/* DZPLAY — mobile-first, RTL, dark by default with a warm light theme. */

@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/plex-arabic-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/plex-arabic-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/fonts/plex-arabic-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("/fonts/plex-arabic-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("/fonts/plex-arabic-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("/fonts/plex-arabic-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #0c0e18;
  --bg-elev: #12152280;
  --surface: #161a29;
  --surface-2: #1e2335;
  --surface-3: #272d43;
  --line: #ffffff14;
  --line-strong: #ffffff24;
  --ink: #eef0f8;
  --ink-2: #b4b9cc;
  --ink-3: #7f86a0;
  --accent: #ff8a5c;
  --accent-2: #ff5f8a;
  --accent-ink: #1a0d08;
  --lilac: #a99cff;
  --ok: #4fd1a5;
  --danger: #ff6b6b;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --bubble-mine: linear-gradient(135deg, #ff8a5c 0%, #ff5f8a 100%);
  --bubble-mine-ink: #fff;
  --bubble-theirs: var(--surface-2);
  --shadow: 0 10px 30px -12px #00000099;
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Plex Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f2ec;
    --bg-elev: #f5f2eccc;
    --surface: #ffffff;
    --surface-2: #efebe4;
    --surface-3: #e4dfd6;
    --line: #1a1c2a14;
    --line-strong: #1a1c2a26;
    --ink: #1a1c2a;
    --ink-2: #4a4e63;
    --ink-3: #868a9c;
    --accent: #ec6a3c;
    --accent-2: #e5466f;
    --lilac: #6b5cff;
    --bubble-theirs: #ffffff;
    --shadow: 0 10px 30px -14px #1a1c2a40;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lilac); }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }

#app { min-height: 100%; }

/* ---------- brand ---------- */
.wordmark { font-weight: 700; letter-spacing: -0.02em; font-size: 20px; direction: ltr; display: inline-flex; align-items: baseline; gap: 2px; }
.wordmark--lg { font-size: 44px; }
.wordmark__dot { width: .28em; height: .28em; border-radius: 50%; background: var(--grad); display: inline-block; box-shadow: 0 0 18px var(--accent); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .wordmark { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- layout ---------- */
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page { flex: 1; padding: calc(16px + var(--safe-t)) 18px calc(var(--nav-h) + var(--safe-b) + 24px); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; min-height: 40px; }
.page-title { font-size: 26px; font-weight: 700; margin: 0; }

/* ---------- bottom navigation ---------- */
.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: var(--bg-elev); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav__inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nav__btn {
  position: relative; border: 0; background: none; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px;
  font-size: 12px; font-weight: 500; transition: color .2s, background .2s;
}
.nav__btn svg { width: 24px; height: 24px; }
.nav__btn[aria-current="page"] { color: var(--ink); background: var(--surface); }
.nav__btn[aria-current="page"] svg { color: var(--accent); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-2); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav__btn .badge { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); }

/* ---------- buttons & inputs ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 14px 20px; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s ease, opacity .2s, box-shadow .2s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px var(--accent-2); }
.btn--ghost { background: var(--surface-2); color: var(--ink); }
.btn--danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn { border: 0; background: var(--surface-2); color: var(--ink); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn--plain { background: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--lilac); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lilac) 18%, transparent); }
.input[dir="ltr"] { text-align: left; }
/* honeypot: hidden in place (an off-screen offset would widen the RTL page) */
.hp { position: absolute !important; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.form-error { color: var(--danger); font-size: 14px; min-height: 22px; margin: 4px 0 10px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.auth__brand { text-align: center; margin-bottom: 26px; }
.auth__tagline { color: var(--ink-2); margin: 6px 0 0; font-size: 17px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px; margin-bottom: 20px; }
.segmented button { border: 0; background: none; padding: 10px; border-radius: 12px; font-weight: 700; color: var(--ink-3); transition: background .2s, color .2s; }
.segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--ink); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
.app-download { margin-top: 14px; text-decoration: none; }
.auth__foot { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 22px; }

/* anti-bot widget */
.antibot {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 8px;
}
.antibot__box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink-3); display: grid; place-items: center; flex: none; transition: all .2s; }
.antibot__box svg { width: 18px; height: 18px; opacity: 0; color: #fff; }
.antibot__text { flex: 1; display: flex; flex-direction: column; }
.antibot__label { font-weight: 500; }
.antibot__hint { font-size: 12px; color: var(--ink-3); }
.antibot[data-state="working"] .antibot__box { border-color: var(--lilac); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.antibot[data-state="done"] .antibot__box { background: var(--ok); border-color: var(--ok); }
.antibot[data-state="done"] .antibot__box svg { opacity: 1; }
.antibot[data-state="error"] { border-color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- home: ideas ---------- */
.btn--sm { padding: 9px 20px; font-size: 15px; border-radius: 14px; }
.idea-composer { position: relative; border-radius: 24px; padding: 14px 14px 10px; margin-bottom: 8px; }
.idea-composer__head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 6px; }
.idea-composer__icon { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; box-shadow: 0 8px 18px -10px var(--accent-2); }
.idea-composer__icon svg { width: 22px; height: 22px; }
.idea-composer__title { margin: 0; font-size: 20px; line-height: 1.3; }
.idea-composer__sub { margin: 0; font-size: 13px; color: var(--ink-3); }
.idea-composer textarea {
  display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent;
  padding: 8px 6px; font-size: 17px; line-height: 1.75; min-height: 84px; transition: min-height .25s ease;
}
.idea-composer.is-active textarea { min-height: 140px; }
.idea-composer textarea::placeholder { color: var(--ink-3); }
.idea-composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 2px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.counter { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; direction: ltr; }
.counter.is-over { color: var(--danger); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-title { font-size: 17px; font-weight: 700; margin: 22px 2px 12px; }
.section-head .section-title { margin: 0; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-status { display: flex; justify-content: center; padding: 18px 0; min-height: 24px; }
.feed-end { text-align: center; color: var(--ink-3); font-size: 13px; margin: 6px 0; }
.feed-sentinel { height: 1px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }

.post-card { position: relative; border-radius: 22px; padding: 12px 14px 6px; }
.post-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.post-card__author { border: 0; background: none; display: flex; align-items: center; gap: 10px; padding: 2px; border-radius: 14px; text-align: start; min-width: 0; }
.post-card__who { display: flex; flex-direction: column; line-height: 1.25; }
.post-card__name { font-weight: 700; direction: ltr; text-align: start; }
.post-card__time { font-size: 12px; color: var(--ink-3); }
.post-card__body { margin: 10px 2px 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16.5px; line-height: 1.85; }
.post-card__body.is-clamped { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__expand { border: 0; background: none; color: var(--lilac); font-weight: 500; padding: 0 2px 6px; font-size: 14px; }
.post-card__actions { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.post-card__spacer { flex: 1; }
.react {
  border: 0; background: none; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 12px; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, transform .15s;
}
.react svg { width: 20px; height: 20px; }
.react:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.react--like[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.react--like[aria-pressed="true"] svg { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.react--dislike[aria-pressed="true"] { color: var(--lilac); background: color-mix(in srgb, var(--lilac) 14%, transparent); }
.react--dislike[aria-pressed="true"] svg { fill: color-mix(in srgb, var(--lilac) 35%, transparent); }
.react:disabled { cursor: default; opacity: .75; }
.react--comment { color: var(--ink-2); }
.react.pop svg { animation: pop .3s ease; }
@keyframes pop { 50% { transform: scale(1.3); } }
.chip { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: var(--surface-3); color: var(--ink); }
.chip--hot { background: var(--accent-2); color: #fff; }

/* owner-only comments */
.sheet__note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3) !important; }
.sheet__note svg { width: 16px; height: 16px; flex: none; color: var(--ok); }
.comment-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comment-list__empty { color: var(--ink-3); text-align: center; padding: 18px 8px; font-size: 14px; }
.comment { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line); }
.comment__main { flex: 1; min-width: 0; }
.comment__head { display: flex; gap: 8px; align-items: baseline; }
.comment__name { font-weight: 700; direction: ltr; font-size: 14px; }
.comment__time { font-size: 12px; color: var(--ink-3); }
.comment__body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; color: var(--ink); }

/* messages: fixed anonymous composer */
.page--with-dock { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 150px); }
.msg-dock {
  position: fixed; inset-inline: 0; margin: 0 auto; width: min(560px, 100%); z-index: 19;
  bottom: calc(var(--nav-h) + var(--safe-b)); padding: 10px 12px 12px; border-radius: 22px 22px 0 0;
  border-bottom: 0 !important;
}
.msg-dock__head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }
.msg-dock__title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.msg-dock__title svg { width: 18px; height: 18px; color: var(--accent); }
.msg-dock__row { display: flex; align-items: flex-end; gap: 8px; }
.msg-dock textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-radius: 22px; padding: 10px 16px; max-height: 120px; min-height: 44px; line-height: 1.5; outline: none; font-size: 16px;
}
.msg-dock textarea:focus { border-color: var(--lilac); }
body.is-typing .nav { display: none; }
body.is-typing .msg-dock { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }
body:has(.page--with-dock) .toasts { bottom: calc(var(--nav-h) + var(--safe-b) + 130px); }
.conv-item.is-new { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 16%, transparent); } }

.msg-stats { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-3); font-size: 12px; margin: -10px 0 18px; text-align: center; }
.msg-stats svg { width: 14px; height: 14px; flex: none; }
.topbar--back { justify-content: flex-start; gap: 12px; }

/* ---------- conversation list ---------- */
.conv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.conv-item {
  width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 12px; text-align: start;
  padding: 12px; border-radius: 18px; transition: background .15s;
}
.conv-item:hover, .conv-item:focus-visible { background: var(--surface); }
.conv-item__body { flex: 1; min-width: 0; }
.conv-item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-item__name { font-weight: 700; direction: ltr; }
.conv-item__time { font-size: 12px; color: var(--ink-3); flex: none; }
.conv-item__bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-item__preview { color: var(--ink-3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.is-unread .conv-item__preview { color: var(--ink); font-weight: 500; }
.conv-item__tag { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 6px; flex: none; }

.avatar {
  width: 50px; height: 50px; border-radius: 50%; flex: none; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffffff30, transparent 60%), var(--grad); color: #fff;
}
.avatar svg { width: 26px; height: 26px; opacity: .95; }
.avatar--sm { width: 38px; height: 38px; }
.avatar--sm svg { width: 20px; height: 20px; }
.avatar--xl { width: 88px; height: 88px; }
.avatar--xl svg { width: 44px; height: 44px; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty svg { width: 96px; height: 96px; color: var(--ink-3); margin-bottom: 10px; }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 20px; }
.empty p { margin: 0 0 20px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; }
.chat__head {
  display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px;
  border-bottom: 1px solid var(--line); background: var(--bg-elev); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.chat__title { flex: 1; min-width: 0; }
.chat__name { font-weight: 700; direction: ltr; display: block; text-align: start; }
.chat__sub { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.chat__sub svg { width: 12px; height: 12px; color: var(--ok); }
.chat__body { flex: 1; overflow-y: auto; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.day-sep { align-self: center; font-size: 12px; color: var(--ink-3); background: var(--surface); border-radius: 10px; padding: 2px 10px; margin: 10px 0 6px; }
.notice { align-self: center; text-align: center; font-size: 12px; color: var(--ink-3); max-width: 300px; margin: 4px 0 12px; display: flex; gap: 6px; align-items: flex-start; }
.notice svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }   /* RTL: own messages sit on the left */
.bubble-row > div { max-width: 82%; display: flex; flex-direction: column; align-items: flex-start; }
.bubble-row.mine > div { align-items: flex-end; }
.bubble {
  max-width: 100%; padding: 9px 13px 6px; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 16px; line-height: 1.6; position: relative; border: 0; text-align: start; color: inherit; font: inherit;
}
.bubble-row.theirs .bubble { background: var(--bubble-theirs); border-start-start-radius: 6px; border: 1px solid var(--line); }
.bubble-row.mine .bubble { background: var(--bubble-mine); color: var(--bubble-mine-ink); border-start-end-radius: 6px; }
.bubble-row + .bubble-row.same { margin-top: -1px; }
.bubble__meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; opacity: .72; margin-top: 2px; direction: ltr; }
.bubble__meta svg { width: 15px; height: 15px; }
.status { display: inline-flex; }
.status--read { opacity: 1; filter: drop-shadow(0 0 3px #ffffffaa); }
.status--read svg { stroke-width: 2.6; }
.bubble-row.failed .bubble { opacity: .65; }
.bubble__failed { color: var(--danger); font-size: 12px; margin-top: 2px; display: flex; gap: 8px; }
.bubble__failed button { border: 0; background: none; color: var(--danger); text-decoration: underline; padding: 0; font-size: 12px; }
.chat__composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--bg-elev); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.chat__composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 22px;
  padding: 10px 16px; max-height: 140px; min-height: 44px; line-height: 1.5; outline: none; font-size: 16px;
}
.chat__composer textarea:focus { border-color: var(--lilac); }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn svg { width: 22px; height: 22px; transform: scaleX(-1); } /* RTL: arrow points left */
.send-btn[disabled] { opacity: .45; }
.closed-bar { padding: 14px 16px calc(14px + var(--safe-b)); text-align: center; color: var(--ink-2); border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; }

/* ---------- profile ---------- */
.id-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 28px 20px 22px; text-align: center;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.id-card::before { content: ""; position: absolute; inset: -40% -20% auto; height: 70%; background: var(--grad); opacity: .14; filter: blur(40px); }
.id-card > * { position: relative; }
.id-card .avatar { margin: 0 auto 12px; }
.id-card__name { font-size: 28px; font-weight: 700; direction: ltr; }
.id-card__hint { color: var(--ink-3); font-size: 13px; margin: 2px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 8px; text-align: center; }
.stat__num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--ink-3); }
.menu { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu__item { width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-align: start; font-weight: 500; }
.menu__item svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.menu__item span { flex: 1; }
.menu__item .chev { width: 18px; height: 18px; transform: scaleX(-1); }
.menu__item--danger, .menu__item--danger svg { color: var(--danger); }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { inset-inline-start: 21px; }
.version { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 18px; }

/* ---------- sheets (bottom modals) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: #00000080; z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(20px + var(--safe-b)); animation: up .25s cubic-bezier(.2,.8,.2,1);
}
.sheet__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.sheet p { color: var(--ink-2); margin: 0 0 14px; }
.sheet .actions { display: grid; gap: 10px; margin-top: 16px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.prose h3 { margin: 18px 0 4px; font-size: 16px; }
.prose p, .prose li { color: var(--ink-2); font-size: 14px; }
.prose ul { padding-inline-start: 20px; margin: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }

/* ---------- toasts & banners ---------- */
.toasts { position: fixed; inset-inline: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 480px; box-shadow: var(--shadow); animation: rise .25s ease; }
.toast--error { background: var(--danger); color: #fff; }
.offline-banner { position: sticky; top: 0; z-index: 30; background: var(--surface-3); color: var(--ink); font-size: 13px; text-align: center; padding: calc(6px + var(--safe-t)) 12px 6px; }

@media (min-width: 700px) {
  .page { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   Liquid Glass — an additive layer over the existing DZPLAY identity.
   Translucent layers, soft ambient light, light edges and depth.
   Rule: readability first. Long lists (post cards) use translucency
   without backdrop blur; only fixed surfaces (nav, docks, sheets,
   headers) blur what scrolls behind them.
   ===================================================================== */
:root {
  --glass-bg: rgba(26, 30, 48, .66);
  --glass-bg-strong: rgba(22, 26, 41, .86);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-shine: rgba(255, 255, 255, .075);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 14px 34px -20px rgba(0, 0, 0, .7);
  --glass-blur: 20px;
  --amb-1: rgba(255, 138, 92, .20);
  --amb-2: rgba(255, 95, 138, .16);
  --amb-3: rgba(169, 156, 255, .18);
}
@media (prefers-color-scheme: light) {
  :root {
    --glass-bg: rgba(255, 255, 255, .62);
    --glass-bg-strong: rgba(255, 255, 255, .86);
    --glass-border: rgba(255, 255, 255, .85);
    --glass-shine: rgba(255, 255, 255, .6);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 0 0 1px rgba(26, 28, 42, .05), 0 14px 30px -20px rgba(26, 28, 42, .35);
    --amb-1: rgba(236, 106, 60, .15);
    --amb-2: rgba(229, 70, 111, .11);
    --amb-3: rgba(107, 92, 255, .13);
  }
}

/* soft, slowly drifting ambient light behind the whole app */
body::before {
  content: ""; position: fixed; inset: -15%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 32% at 82% 8%, var(--amb-1), transparent 70%),
    radial-gradient(40% 34% at 8% 42%, var(--amb-3), transparent 70%),
    radial-gradient(42% 36% at 70% 96%, var(--amb-2), transparent 70%);
  animation: ambient 40s ease-in-out infinite alternate;
}
@keyframes ambient { to { transform: translate3d(-4%, 3%, 0) scale(1.06); } }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
/* light refraction: a soft diagonal sheen along the top edge */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(150deg, var(--glass-shine) 0%, transparent 32%, transparent 72%, color-mix(in srgb, var(--glass-shine) 45%, transparent) 100%);
}
.glass--blur {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass--blur { background: var(--glass-bg-strong); }
}
.glass--lift { transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
.glass--lift:focus-within { box-shadow: var(--glass-shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 18px 40px -22px var(--accent-2); }

/* components upgraded to glass (same shapes, colors and spacing as before) */
.post-card.glass { background: color-mix(in srgb, var(--glass-bg-strong) 92%, transparent); }
.post-card { transition: transform .2s ease; }
.post-card:active { transform: scale(.997); }
.stat.glass, .menu.glass, .id-card.glass, .empty.glass { background: var(--glass-bg); position: relative; }
.empty.glass { border-radius: 22px; padding: 36px 20px; }
.icon-btn.glass { position: relative; }
.btn--ghost { background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.btn--primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 24px -10px var(--accent-2); }

.nav {
  background: var(--glass-bg); border-top: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%); backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-shine);
}
.nav__btn[aria-current="page"] {
  background: var(--glass-bg); box-shadow: inset 0 1px 0 var(--glass-shine), 0 0 0 1px var(--glass-border);
}
.chat__head, .chat__composer {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%); backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
.sheet-backdrop { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); background: rgba(0, 0, 0, .42); }
.sheet {
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border); border-bottom: 0;
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 -20px 50px -30px rgba(0, 0, 0, .6);
}
.sheet--tall { min-height: 55vh; }
.bubble-row.theirs .bubble { background: color-mix(in srgb, var(--glass-bg-strong) 94%, transparent); }

@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

/* inline text button (e.g. "privacy policy" in the sign-up footer) */
.link-btn { border: 0; background: none; padding: 0; color: var(--lilac); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.privacy-notice h2 { margin-bottom: 6px; }
.privacy-notice__lead { margin: 0 0 8px; color: var(--ink-2); }
.privacy-notice .prose { max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
