@font-face { font-family: "AK Rasmee"; src: url("/fonts/ak-rasmee.ttf") format("truetype"); font-display: swap; size-adjust: 125%; }
@font-face { font-family: "MV Waheed"; src: url("/fonts/mv-waheed.otf") format("opentype"); font-display: swap; size-adjust: 120%; }

:root {
  --bg: #f4f1ea;
  --bg-2: #ece7dc;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --ink: #13201d;
  --ink-2: #3a4744;
  --muted: #6d7874;
  --line: #e4ddcf;
  --line-2: #d6cebd;
  --accent: #0c7a70;
  --accent-2: #0a655d;
  --accent-ink: #ffffff;
  --accent-soft: #dfefea;
  --coral: #d9693d;
  --coral-soft: #fbe6dc;
  --ok: #1b9a5a;
  --warn: #c98a12;
  --off: #a3a9a6;
  --shadow: 0 1px 2px rgb(30 25 15 / .05), 0 8px 24px -12px rgb(30 25 15 / .18);
  --shadow-lg: 0 2px 6px rgb(30 25 15 / .06), 0 24px 48px -20px rgb(30 25 15 / .28);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", "MV Waheed", "AK Rasmee", Georgia, serif;
  --font-head: "Inter", "MV Waheed", "AK Rasmee", system-ui, sans-serif;
  --font-thaana: "AK Rasmee", "MV Faseyha", "Faruma", "MV Boli", sans-serif;
  --font-mix: "Inter", "AK Rasmee", "MV Faseyha", "Faruma", system-ui, sans-serif;
  --side-w: 256px;
  --grad: linear-gradient(100deg, #0c7a70 0%, #2a8fc4 48%, #d9693d 100%);
  --glow: color-mix(in srgb, #2a8fc4 22%, transparent);
  --gbox: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1110; --bg-2: #0f1716; --surface: #121a19; --surface-2: #17211f;
    --ink: #e9efed; --ink-2: #c3cecb; --muted: #8b9a95; --line: #22302c; --line-2: #2d3d39;
    --accent: #38d1be; --accent-2: #5fe0cf; --accent-ink: #04201c; --accent-soft: #12302b;
    --coral: #f1956c; --coral-soft: #3a2219; --ok: #3ccf86; --warn: #e8b04a; --off: #5b6763;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 6px rgb(0 0 0 / .3), 0 24px 48px -20px rgb(0 0 0 / .7);
    --grad: linear-gradient(100deg, #46dcc8 0%, #7ab8ff 50%, #ff9d73 100%);
    --glow: color-mix(in srgb, #7ab8ff 18%, transparent);
    --gbox: #18211f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1110; --bg-2: #0f1716; --surface: #121a19; --surface-2: #17211f;
  --ink: #e9efed; --ink-2: #c3cecb; --muted: #8b9a95; --line: #22302c; --line-2: #2d3d39;
  --accent: #38d1be; --accent-2: #5fe0cf; --accent-ink: #04201c; --accent-soft: #12302b;
  --coral: #f1956c; --coral-soft: #3a2219; --ok: #3ccf86; --warn: #e8b04a; --off: #5b6763;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / .3), 0 24px 48px -20px rgb(0 0 0 / .7);
  --grad: linear-gradient(100deg, #46dcc8 0%, #7ab8ff 50%, #ff9d73 100%);
  --glow: color-mix(in srgb, #7ab8ff 18%, transparent);
  --gbox: #18211f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 var(--font-mix); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.thaana, [dir="rtl"], .thaana-field { font-family: var(--font-thaana); }
.thaana { letter-spacing: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 18px;
  border-inline-end: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 4px 8px; }
.mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font: 26px/1 var(--font-thaana); color: #fff; padding-top: 6px;
  background: radial-gradient(120% 120% at 20% 10%, #22b5a3 0%, #0c7a70 55%, #08514a 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .25), 0 6px 16px -6px rgb(12 122 112 / .6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font: 600 20px var(--font-display); letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 14px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a small { color: var(--muted); font-size: 13px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current="page"] svg { color: var(--accent); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.engine { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.engine-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; color: var(--ink-2); }
.engine-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.engine-row .short, .page-title { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.off { background: var(--off); }
.theme-btn { align-self: flex-start; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme]) .theme-btn .i-moon { display: block; }
}

.main { min-width: 0; display: flex; flex-direction: column; }
.view { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 22px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font: 600 34px/1.1 var(--font-display); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.view-head h1 .thaana { font: 22px var(--font-thaana); color: var(--muted); }
.lede { margin: 6px 0 0; color: var(--muted); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 500; cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled, .icon-btn:disabled, .send:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-ink); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.ghost.loading::after { border-color: var(--ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.on { color: var(--coral); background: var(--coral-soft); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.select { position: relative; min-width: 0; max-width: 100%; }
.select::after { content: ""; position: absolute; inset-inline-end: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 40px; padding-block: 0; padding-inline: 14px 38px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 14px; text-overflow: ellipsis;
}

.field {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
  padding: 14px 16px; resize: vertical; line-height: 1.9; transition: border-color .15s, background .15s;
}
.field:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.thaana-field { font-size: 17px; }
.field.bare { border: 0; background: transparent; padding: 0; resize: none; min-height: 180px; font-size: 18px; }
.field.bare:focus { background: transparent; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 32px; height: 19px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(13px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.range { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.range input { accent-color: var(--accent); width: 120px; }
.range output { font-variant-numeric: tabular-nums; width: 34px; color: var(--muted); }

.meta { font-size: 12.5px; color: var(--muted); min-height: 18px; font-variant-numeric: tabular-nums; }
.meta.err { color: var(--coral); }

/* ---------- cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head h2 { margin: 0; font: 600 18px var(--font); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h2 .thaana { font-size: 16px; font-weight: 400; color: var(--muted); }

.output {
  min-height: 140px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft);
  font-size: 19px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere;
}
.output:empty::before { content: attr(data-empty); color: var(--muted); font-size: 16px; }
.output.bare { background: transparent; padding: 0; min-height: 180px; font-size: 18px; }
.output.tall { min-height: 320px; }
.output[dir="auto"], .output[dir="ltr"], .msg .bubble, .field.bare, .suggest button { font-family: var(--font-mix); }
.msg .bubble[dir="rtl"], .suggest button.thaana { font-family: var(--font-thaana); }

.player audio { width: 100%; height: 40px; }

.spoken { border: 1px dashed var(--line-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.spoken-label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; }
.spoken-label .thaana { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; }
.spoken-text { font-size: 17px; line-height: 1.9; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 12px var(--font-thaana); padding: 2px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.chip b { font: 500 10.5px var(--font); color: var(--muted); margin-inline-start: 6px; }

.recorder { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.rec { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--coral); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--coral) 70%, transparent); transition: transform .1s; }
.rec span { width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: border-radius .2s, width .2s, height .2s; }
.rec.on span { border-radius: 4px; width: 16px; height: 16px; }
.rec.on { animation: pulse 1.6s ease-in-out infinite; }
.rec:disabled { background: var(--off); box-shadow: none; cursor: not-allowed; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--coral) 18%, transparent); } }
#wave { width: 100%; height: 44px; }
.timer { font: 600 14px var(--font); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 40px; text-align: end; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 22px; border: 1.5px dashed var(--line-2); border-radius: 14px; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s, color .15s; position: relative; overflow: hidden; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.drop small { font-size: 12px; opacity: .8; }
.drop svg { width: 26px; height: 26px; }
.drop.tall { min-height: 340px; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop img { max-width: 100%; max-height: 420px; border-radius: 10px; object-fit: contain; }

.offline-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--coral-soft); color: var(--ink); font-size: 14px; }
.beta-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.offline-note svg { color: var(--coral); margin-top: 1px; }

/* ---------- chat ---------- */
.view-chat { height: 100vh; height: 100dvh; max-width: 880px; padding-bottom: 16px; gap: 14px; }
.thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 4px 2px 12px; scroll-behavior: smooth; overscroll-behavior: contain; }
.welcome { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 0; }
.welcome-mark { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font: 40px/1 var(--font-thaana); color: #fff; padding-top: 10px; margin-bottom: 8px;
  background: radial-gradient(120% 120% at 20% 10%, #22b5a3 0%, #0c7a70 55%, #08514a 100%); box-shadow: var(--shadow-lg); }
.welcome h2 { margin: 0; font-weight: 400; }
.welcome .big { font-size: 30px; line-height: 1.6; }
.welcome p { margin: 0 0 14px; color: var(--muted); }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 680px; }
.suggest button { text-align: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink-2); line-height: 1.5; transition: border-color .15s, transform .1s, box-shadow .15s; }
.suggest button.thaana { direction: rtl; text-align: right; font-size: 14px; }
.suggest button:hover { border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow); }

.msg { display: flex; gap: 12px; align-items: flex-start; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg .avatar { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; font: 18px/1 var(--font-thaana); padding-top: 4px; color: #fff; background: radial-gradient(120% 120% at 20% 10%, #22b5a3, #0c7a70 55%, #08514a); }
.msg .body { min-width: 0; flex: 1; }
.msg .bubble { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.msg .bubble[dir="rtl"] { font-size: 16px; line-height: 2; }
.msg .bubble p { margin: 0 0 .7em; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 0 0 .7em; padding-inline-start: 1.4em; }
.msg .bubble code { font: 13.5px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 6px; }
.msg .bubble pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: 12px; overflow-x: auto; direction: ltr; }
.msg .bubble pre code { border: 0; padding: 0; background: none; }
.msg .bubble h3 { font-size: 1.05em; margin: .4em 0 .3em; }
.msg.user { justify-content: flex-end; }
.msg.user .body { flex: 0 1 auto; max-width: 82%; }
.msg.user .bubble { background: var(--surface); border: 1px solid var(--line); padding: 10px 16px; border-radius: 18px 18px 6px 18px; box-shadow: var(--shadow); white-space: pre-wrap; }
.msg.user .bubble[dir="rtl"] { border-radius: 18px 18px 18px 6px; }
.msg-tools { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools, .msg.last .msg-tools { opacity: 1; }
.msg-tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.msg-tools button:hover { background: var(--surface-2); color: var(--ink); }
.msg-tools svg { width: 16px; height: 16px; }
.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { position: sticky; bottom: 0; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding-block: 8px; padding-inline: 16px 8px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-lg); transition: border-color .15s; }
.composer-box:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; max-height: 220px; padding: 9px 0; line-height: 1.6; font-size: 16px; font-family: var(--font-mix); }
.composer textarea:focus { outline: none; }
.composer-tools { display: flex; align-items: center; gap: 2px; }
.kbd-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: var(--muted); font: 20px/1 var(--font-thaana); padding-top: 4px; }
.kbd-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.kbd-toggle:hover { background: var(--surface-2); }
.kbd-toggle:has(input:checked) { color: var(--accent); background: var(--accent-soft); }
.kbd-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); }
.send { width: 40px; height: 40px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .08s; }
.send:hover { background: var(--accent-2); }
.send.stop svg { display: none; }
.send.stop::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.fine { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- translate ---------- */
.translate { display: flex; flex-direction: column; gap: 14px; }
.lang-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; max-width: 720px; }
.swap { border: 1px solid var(--line-2); background: var(--surface); }
.tr-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pane { min-height: 260px; }
.out-pane { background: var(--surface-2); }

/* ---------- Gemini-style tool views (voice, translate, read) ---------- */
.g-view { max-width: 820px; padding-top: 40px; gap: 18px; }
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0 4px; }
.hero-title { margin: 0; font: 500 40px/1.35 var(--font); letter-spacing: -.025em; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.hero-title .thaana { font: 30px/1.6 var(--font-thaana); letter-spacing: 0; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 2px; }
.hero-sub { margin: 0; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.center { text-align: center; }

.seg { align-self: center; display: inline-flex; padding: 4px; gap: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 99px; cursor: pointer; font-weight: 500; font-size: 14px; transition: background .15s, color .15s, box-shadow .15s; }
.seg button svg { width: 18px; height: 18px; }
.seg button .thaana { font-size: 13px; opacity: .8; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button[aria-selected="true"] svg { color: var(--accent); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 16px; background: var(--coral-soft); font-size: 14px; }
.notice svg { color: var(--coral); margin-top: 1px; }
.g-pane { display: flex; flex-direction: column; gap: 18px; }

/* the prompt box */
.gbox { position: relative; display: flex; flex-direction: column; gap: 6px; padding-block: 14px 10px; padding-inline: 18px 14px; border-radius: 28px; background: var(--gbox); border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 10px 30px -12px var(--glow); transition: border-color .2s, box-shadow .2s; }
.gbox:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent), 0 14px 36px -14px var(--glow); }
.gbox-input { width: 100%; border: 0; background: transparent; resize: none; padding: 6px 2px; font-size: 17px; line-height: 1.75; min-height: 56px; max-height: 320px; font-family: var(--font-mix); }
.gbox-input.thaana-field, .gbox-input[dir="rtl"] { font-family: var(--font-thaana); font-size: 17px; line-height: 1.9; }
.gbox-input:focus { outline: none; }
.gbox-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-inline-start: -6px; }
.spacer { flex: 1; }
.gbox-tools .send { margin-inline-start: auto; }
.gbox .send { width: 44px; height: 44px; border-radius: 50%; }
.send svg.fill, .send .fill { fill: currentColor; stroke: none; }
.send:disabled { background: var(--line-2); color: var(--muted); }
.send.loading { pointer-events: none; }
.send.loading svg { display: none; }
.send.loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.pill-select { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); max-width: 100%; transition: border-color .15s; }
.pill-select:hover { border-color: var(--line-2); }
.pill-select svg { width: 17px; height: 17px; color: var(--muted); }
.pill-select select { min-height: 0; height: 34px; border: 0; background: transparent; padding: 0; padding-inline-end: 18px; font-size: 13.5px; max-width: 220px; }
.pill-select::after { content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.pill-select select:focus { outline: none; }
.pill-select:focus-within { border-color: var(--accent); }
.pill-select.lg { height: 44px; padding: 0 16px; background: var(--surface); }
.pill-select.lg select { height: 42px; font-size: 15px; font-weight: 500; max-width: none; width: 100%; padding-inline-end: 22px; }
.pill-select.lg { width: 100%; }

.pill-range { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.pill-range svg { width: 17px; height: 17px; color: var(--muted); }
.pill-range input { accent-color: var(--accent); width: 76px; }
.pill-range output { font-variant-numeric: tabular-nums; min-width: 32px; color: var(--muted); }

.pill-toggle { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.pill-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pill-toggle:has(input:checked) { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.pill-toggle:has(input:checked) span::before { content: "✓ "; }
.pill-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.round-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background .15s, transform .2s; }
.round-btn:hover { background: var(--surface-2); color: var(--ink); }
#trSwap:hover svg { transform: rotate(180deg); }
#trSwap svg { transition: transform .3s; }

.spoken { border-top: 1px dashed var(--line); border-radius: 0; padding: 8px 2px 4px; gap: 6px; }
.spoken summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.spoken summary::-webkit-details-marker { display: none; }
.spoken summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-inline-end: 2px; }
.spoken[open] summary::before { transform: rotate(45deg); }
.spoken summary .thaana { font-size: 13px; font-weight: 400; }
.spoken summary em { font-style: normal; margin-inline-start: auto; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.spoken summary em:empty { display: none; }
.spoken[open] { display: flex; flex-direction: column; }
.spoken-text { font-size: 15px; }

.suggest-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggest-chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; font-family: var(--font-mix); }
.suggest-chips button.thaana { font-family: var(--font-thaana); font-size: 13.5px; }
.suggest-chips button:hover { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }

.lang-pills { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }

/* once there are answers, the greeting and examples step aside */
.has-results > .hero, .has-results > .suggest-chips { display: none; }
@media (min-width: 821px) { .has-results > .hero { display: flex; } }

/* answers */
.results { display: flex; flex-direction: column; gap: 14px; }
.resp { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 16px 18px 12px 14px; border-radius: 22px; animation: rise .3s ease-out; }
.resp + .resp { border-top: 1px solid var(--line); border-radius: 0; }
.resp-avatar { width: 32px; height: 32px; display: grid; place-items: center; }
.resp-avatar svg { width: 26px; height: 26px; fill: url(#gSpark); stroke: none; }
.resp.busy .resp-avatar svg { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: rotate(45deg) scale(.85); } }
.resp-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.resp-label { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.resp-label b { color: var(--ink-2); font-weight: 600; }
.resp-text { font-size: 17px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mix); }
.resp-text[dir="rtl"] { font-family: var(--font-thaana); font-size: 17px; line-height: 1.95; }
.resp-text.err { color: var(--coral); font-size: 15px; }
.resp-tools { display: flex; gap: 2px; margin-inline-start: -8px; flex-wrap: wrap; }
.resp-tools button, .resp-tools a { height: 34px; min-width: 34px; padding: 0 9px; border-radius: 99px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; }
.resp-tools button:hover, .resp-tools a:hover { background: var(--surface-2); color: var(--ink); }
.resp-tools svg { width: 17px; height: 17px; }
.resp-tools button:disabled { opacity: .5; }
.resp-note { font-size: 13px; color: var(--muted); border-inline-start: 2px solid var(--line-2); padding-inline-start: 10px; }
.resp-note[dir="rtl"] { font-family: var(--font-thaana); font-size: 14px; }
.resp-img { width: 120px; max-height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.shimmer { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.shimmer i { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, #2a8fc4 25%, var(--surface-2)) 40%, var(--surface-2) 80%); background-size: 300% 100%; animation: sweep 1.4s linear infinite; }
.shimmer i:nth-child(2) { width: 88%; } .shimmer i:nth-child(3) { width: 62%; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* waveform player */
.wplayer { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.wplayer .wp-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .1s; }
.wplayer .wp-btn:active { transform: scale(.94); }
.wplayer .wp-btn svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.wp-bars { flex: 1; height: 36px; display: flex; align-items: center; gap: 2px; cursor: pointer; min-width: 0; overflow: hidden; }
.wp-bars i { flex: 1 1 0; min-width: 0; max-width: 6px; border-radius: 2px; background: var(--line-2); transition: background .1s; }
.wp-bars i.on { background: var(--accent); }
.wp-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* mic orb */
.orb-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 16px 18px; border-radius: 28px; border: 1.5px dashed transparent; transition: border-color .2s, background .2s; }
.orb-stage.over { border-color: var(--accent); background: var(--accent-soft); }
.orb { --level: 0; position: relative; width: 120px; height: 120px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #4fd1c1, #0c7a70 55%, #0a4f6b 100%); box-shadow: 0 14px 40px -12px rgb(12 122 112 / .6); transition: transform .15s; }
.orb:hover { transform: scale(1.03); }
.orb:active { transform: scale(.97); }
.orb svg { width: 40px; height: 40px; stroke-width: 1.8; }
.orb-ring { position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(from 0deg, #22b5a3, #2a8fc4, #e0774a, #22b5a3); opacity: 0; filter: blur(10px); z-index: -1; transition: opacity .2s; transform: scale(calc(1 + var(--level) * .35)); }
.orb .i-stop { display: none; width: 26px; height: 26px; border-radius: 7px; background: #fff; }
.orb.on { background: radial-gradient(circle at 30% 25%, #ff9d73, #d9693d 55%, #9c3d1c 100%); box-shadow: 0 14px 40px -12px rgb(217 105 61 / .7); }
.orb.on .orb-ring { opacity: .85; animation: orbspin 3s linear infinite; }
.orb.on .i-mic { display: none; }
.orb.on .i-stop { display: block; }
.orb.busy { pointer-events: none; }
.orb.busy .orb-ring { opacity: .6; animation: orbspin 1.2s linear infinite; }
.orb:disabled { background: var(--off); box-shadow: none; cursor: not-allowed; }
@keyframes orbspin { to { rotate: 360deg; } }
.orb-stage #wave { width: min(420px, 100%); height: 40px; }
.orb-label { margin: 0; color: var(--ink-2); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.orb-label .timer { min-width: 0; }
.orb-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--ink); }
.chip-btn svg { width: 17px; height: 17px; }
.drop-hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

/* image box */
.drop-box.over { border-color: var(--accent); background: var(--accent-soft); }
.gbox-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 10px 18px; color: var(--muted); cursor: pointer; text-align: center; }
.gbox-empty u { color: var(--accent); }
.gbox-empty small { font-size: 12px; opacity: .85; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.empty-icon svg { width: 26px; height: 26px; }
.attach { position: relative; align-self: flex-start; margin: 4px 0 6px; }
.attach img { display: block; max-height: 220px; max-width: min(100%, 420px); border-radius: 16px; border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }
.attach-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; }
.attach-x svg { width: 15px; height: 15px; stroke-width: 2.2; }
.gbox-tools .meta { min-height: 0; padding: 0 4px; }

@media (max-width: 820px) {
  .g-view { padding-top: 22px; gap: 14px; }
  .hero-title { font-size: 28px; }
  .hero-title .thaana { font-size: 25px; }
  .hero-sub { font-size: 14px; }
  .gbox { border-radius: 24px; padding: 12px 10px 8px 14px; }
  .gbox-input.thaana-field, .gbox-input[dir="rtl"] { font-size: 16px; }
  .pill-select select { max-width: 150px; }
  .orb { width: 104px; height: 104px; }
  .resp { grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 4px 10px 0; }
  .resp-avatar svg { width: 22px; height: 22px; }
  .seg button { padding: 8px 12px; }
  .seg button .thaana { display: none; }
  .wp-bars { gap: 1px; }
  .wplayer { gap: 10px; padding-right: 12px; }
}
@media (max-width: 420px) {
  .pill-range input { width: 56px; }
  .gbox-tools .meta { display: none; }
}

/* ---------- models ---------- */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.model { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.model-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model .kind { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.train { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.model h3 { margin: 0; font: 600 17px var(--font); }
.model p { margin: 0; color: var(--muted); font-size: 13.5px; }
.model code { font: 12px ui-monospace, Consolas, monospace; color: var(--ink-2); overflow-wrap: anywhere; }

.about { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.about p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 70ch; }
.about b { color: var(--ink-2); font-weight: 600; }
.about a { color: var(--ink-2); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); z-index: 50; max-width: calc(100vw - 32px); animation: rise .2s ease-out; }

/* ---------- tab bar (mobile) ---------- */
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .view { padding: 28px 28px 40px; } }
@media (max-width: 960px) {
  .grid2, .tr-panes { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-inline-end: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  /* One top bar for every page: logo · page name · status pill · theme */
  .side { min-height: calc(56px + env(safe-area-inset-top)); }
  .brand { padding: 0; }
  .mark { width: 34px; height: 34px; font-size: 22px; border-radius: 10px; }
  .brand-text { display: none; }
  .page-title { display: block; font: 600 18px/1 var(--font); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .engine-row .long { display: none; }
  .engine-row .short { display: inline; white-space: nowrap; }
  .view-chat .view-head h1 { display: none; }
  .view-chat .view-head { justify-content: flex-end; }
  .view-chat .view-head > div { display: none; }
  .nav { display: none; }
  .side-foot { margin: 0; margin-inline-start: auto; flex-direction: row; align-items: center; gap: 4px; }
  .engine { flex-direction: row; padding: 0 12px; height: 32px; align-items: center; border-radius: 99px; gap: 12px; flex: none; }
  .engine-row { grid-template-columns: 8px auto; gap: 6px; font-size: 12px; white-space: nowrap; }
  .engine-row em { display: none; }
  .view { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); gap: 16px; }
  .view-head h1 { font-size: 28px; }
  .view-chat { height: calc(100dvh - 57px - env(safe-area-inset-top)); padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .view-chat { gap: 10px; padding-top: 14px; }
  .view-chat .view-head { flex-wrap: nowrap; align-items: center; }
  .view-chat .view-head h1 { font-size: 24px; }
  .view-chat .lede { display: none; }
  .view-chat .view-head .btn { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
  .suggest { grid-template-columns: 1fr; }
  .suggest button:nth-child(n+3) { display: none; }
  .welcome .big { font-size: 25px; }
  .card { padding: 16px; border-radius: 16px; }
  .msg.user .body { max-width: 90%; }
  .msg-tools { opacity: 1; }
  .lang-bar { grid-template-columns: 1fr auto 1fr; }
  .drop.tall { min-height: 220px; }
  .output.tall { min-height: 200px; }
  .range input { width: 100px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 500; text-decoration: none; color: var(--muted); border-radius: 12px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .fine { display: none; }
}
@media (max-width: 360px) {
  .engine-row .short { display: none; }
  .engine { gap: 6px; padding: 0 10px; }
}
/* ---------- accounts ---------- */
.booting .shell, .booting .auth { visibility: hidden; }
.signed-out .shell { display: none; }
:root { --wa: #1fa855; --wa-2: #178a45; }

.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(60% 50% at 50% 0%, var(--glow), transparent 70%), var(--bg); }
.auth-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.auth .hero-title { font-size: 34px; }
.auth-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 20px; border-radius: 28px; background: var(--gbox); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 18px 44px -18px var(--glow); }
.auth-card .seg { align-self: stretch; }
.auth-card .seg button { flex: 1; justify-content: center; flex-direction: column; gap: 0; line-height: 1.35; padding: 6px 10px; }
.auth-card .seg button .en { font-size: 10.5px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.auth-field input { width: 100%; height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 16px; transition: border-color .15s, box-shadow .15s, background .15s; }
.auth-field input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }
.pw-eye.on { color: var(--accent); }
.ts-box { display: flex; justify-content: center; min-height: 65px; }
.auth-err { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--coral-soft); color: var(--ink); font-size: 14px; }
.auth-submit { height: 48px; font-size: 15px; border-radius: 14px; }
.auth-submit.loading::after { border-color: var(--accent-ink); border-right-color: transparent; }
.auth-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-note b { color: var(--ink-2); font-weight: 600; }
.auth-foot { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

.btn.wa { background: var(--wa); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--wa) 80%, transparent); text-decoration: none; }
.btn.wa:hover { background: var(--wa-2); }

/* account link in the sidebar (desktop) / credits pill in the top bar (mobile) */
.acct { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.acct:hover, .acct[aria-current="page"] { border-color: var(--line-2); box-shadow: var(--shadow); }
.acct-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, #22b5a3, #2a8fc4 60%, #e0774a); }
.acct-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-who b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-who small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acct-pill { display: none; }
.acct.low .acct-who small, .acct.low .acct-pill { color: var(--coral); }

/* profile */
.profile-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.credit-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.kicker { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.credit-big { display: block; font: 600 44px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter-row b { font-weight: 600; color: var(--ink); }
.meter small { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .3s; }
.card-title { margin: 0; font: 600 16px var(--font); }
.cost-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.cost-list li { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.cost-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.cost-list b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.purchases { display: flex; flex-direction: column; }
.purchase { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.purchase:last-child { border-bottom: 0; }
.purchase b { display: block; font-size: 14px; font-weight: 600; }
.purchase small { font-size: 12.5px; color: var(--muted); }
.pstatus { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; white-space: nowrap; border: 1px solid var(--line); }
.pstatus.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pstatus.wait { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.pstatus.bad { color: var(--coral); background: var(--coral-soft); border-color: color-mix(in srgb, var(--coral) 35%, transparent); }
.muted { margin: 0; color: var(--muted); font-size: 14px; }
.section-title { margin: 10px 0 0; font: 600 20px var(--font-display); }

/* dialogs */
.dlg { width: min(400px, calc(100vw - 32px)); padding: 26px 24px 20px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); text-align: center; }
.dlg::backdrop { background: rgb(10 15 14 / .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg[open] { animation: rise .2s ease-out; }
.dlg-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; display: grid; place-items: center; background: var(--coral-soft); color: var(--coral); }
.dlg-icon svg { width: 28px; height: 28px; }
.dlg-icon.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.dlg-icon.wait { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.dlg h2 { margin: 0 0 8px; font: 600 22px var(--font-display); letter-spacing: -.01em; }
.dlg p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.6; }
.dlg-sub { font-size: 13px; color: var(--muted) !important; }
.dlg-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dlg-actions .btn { width: 100%; min-height: 46px; }
.dlg-x { position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dlg-x:hover { background: var(--surface-2); color: var(--ink); }

/* buy credits */
.dlg.buy { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; text-align: start; padding: 24px 22px 20px; position: relative; }
.buy-step { display: flex; flex-direction: column; gap: 14px; }
.buy-step h2 { margin: 0; padding-inline-end: 36px; }
.buy-step > .dlg-sub { margin: -8px 0 0; }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: start; transition: border-color .15s, background .15s, box-shadow .15s; }
.pack b { font-size: 17px; font-weight: 600; }
.pack span { font-size: 13px; color: var(--muted); }
.pack em { position: absolute; top: 10px; inset-inline-end: 10px; font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); }
.pack:hover { border-color: var(--line-2); }
.pack[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.pack[aria-checked="true"] span { color: var(--ink-2); }
.custom-amt { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.amt-input { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); }
.amt-input:focus-within { border-color: var(--accent); background: var(--surface); }
.amt-input b { font-size: 13px; color: var(--muted); }
.amt-input input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.buy-sum { min-height: 54px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 16px; border-radius: 16px; background: var(--accent-soft); font-size: 14px; color: var(--ink-2); }
.buy-sum b { font: 600 22px var(--font-display); color: var(--ink); margin-inline-start: auto; }
.buy-sum em { flex-basis: 100%; text-align: end; font-style: normal; font-size: 12px; color: var(--accent); }
.buy-sum:empty { visibility: hidden; }
.buy-go { width: 100%; height: 48px; font-size: 15px; border-radius: 14px; }
.buy-back { width: 100%; margin-top: -6px; }
.bank { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.bank div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bank div:last-child { border-bottom: 0; }
.bank dt { font-size: 12.5px; color: var(--muted); }
.bank dd { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; text-align: end; }
.copy { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.copy:hover { background: var(--surface-2); color: var(--ink); }
.copy svg { width: 16px; height: 16px; }
.receipt-drop { display: grid; place-items: center; min-height: 120px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.receipt-drop:hover, .receipt-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.receipt-drop img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.receipt-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; text-align: center; color: var(--ink-2); }
.receipt-empty svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 4px; }
.receipt-empty b { font-weight: 600; font-size: 14.5px; }
.receipt-empty small { font-size: 12.5px; color: var(--muted); }
.buy-result { text-align: center; align-items: stretch; }
.buy-result h2 { padding: 0; }
.buy-result p { margin: 0; }
.buy-reasons { margin: 0; padding: 12px 14px 12px 30px; border-radius: 14px; background: var(--surface-2); text-align: start; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 4px; }
.buy-reasons:empty { display: none; }

@media (max-width: 960px) { .profile-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .engine { display: none; }
  .acct { order: -1; display: flex; padding: 0 12px; height: 32px; border-radius: 99px; gap: 6px; }
  .acct-avatar, .acct-who { display: none; }
  .acct-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .acct-pill svg { width: 17px; height: 17px; color: var(--accent); }
  .auth .hero-title { font-size: 28px; }
  .credit-big { font-size: 38px; }
  .view-head .btn#logoutBtn { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
}


/* ---------- Dhivehi first: Thaana leads, English follows ---------- */
.en { font-family: var(--font); font-size: .74em; font-weight: 400; color: var(--muted); letter-spacing: 0; unicode-bidi: isolate; direction: ltr; }
.en-line { display: block; font-family: var(--font); font-size: 12.5px; font-weight: 400; line-height: 1.5; color: var(--muted); letter-spacing: 0; margin-top: 2px; direction: ltr; text-align: right; }
.dlg .en-line, .hero-sub .en-line, .land-head .en-line, .buy-result .en-line, .toast .en-line, .center .en-line { text-align: center; }
.buy .buy-step:not(.buy-result) .en-line { text-align: right; }
.btn .en, .send .en, .seg .en, .chip-btn .en { color: inherit; opacity: .7; }
.btn.primary .en { opacity: .8; }
h1, h2, h3, .hero-title, .brand-text b, .view-head h1, .dlg h2, .welcome .big, .section-title, .card-title, .land-title, .land-head h2 {
  font-family: var(--font-head);
}
.view-head h1, .section-title, .dlg h2, .card-title { font-weight: 400; }
.view-head h1 { font-size: 38px; letter-spacing: 0; }
.view-head h1 .en { font-size: 15px; }
.view-head h1 .thaana { font: inherit; color: inherit; }
.brand-text b { font: 400 24px/1.2 var(--font-head); letter-spacing: 0; }
.brand-text small { font-size: 12px; }
.hero-title { font-weight: 400; letter-spacing: 0; line-height: 1.6; }
.hero-title .grad { padding: 0 4px; }
.hero-sub { flex-direction: column; gap: 0; }
.hero-sub > span:first-child { font-size: 16px; color: var(--ink-2); }
.nav a { grid-template-columns: 20px 1fr auto; font-size: 15px; }
.nav a small.en { font-size: 11.5px; }
.nav a span { font-weight: 400; }
.seg button { font-size: 15px; font-weight: 400; }
.seg button .en { font-size: 11px; }
.btn { font-weight: 400; font-size: 15px; gap: 6px; }
.btn .en { font-size: 11.5px; }
.lede { font-size: 15px; }
.lede .en { display: block; font-size: 12.5px; }
.welcome .big { font-size: 28px; font-weight: 400; }
.welcome p.en { font-size: 14px; margin-bottom: 14px; }
.card-title { font-size: 19px; display: flex; flex-direction: column; align-items: flex-start; }
.card-title .en { font-size: 12px; }
.section-title { font-size: 24px; display: flex; align-items: baseline; gap: 10px; }
.section-title .en { font-size: 13px; }
.kicker { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; }
.kicker .en { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.meter-row { font-size: 14.5px; }
.meter-row .en, .cost-list .en { font-size: 11.5px; }
.cost-list { font-size: 15px; }
.cost-list li > span { display: flex; flex-direction: column; line-height: 1.4; }
.purchase b { font-weight: 600; }
.dlg h2 { font-size: 26px; line-height: 1.5; }
.dlg h2 .en-line { font-size: 13px; }
.dlg p { font-size: 16px; }
.acct-who small { font-size: 13px; }
.engine-row .long .en { font-size: 10.5px; }
.tabbar a { font-size: 12.5px; gap: 1px; }
.tabbar a .en { font-size: 9.5px; line-height: 1; }
.page-title { font: 400 20px/1.3 var(--font-head) !important; }
.orb-label, .chip-btn, .pill-toggle, .drop-hint { font-size: 14.5px; }
.gbox-empty > span { font-size: 16px; }
.badge .en { font-size: 10px; color: inherit; }
.resp-label, .meta { unicode-bidi: plaintext; }
.toast { font-size: 15px; }
.toast .en-line { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.auth-err .en-line, .buy-reasons .en-line { color: inherit; opacity: .75; }
.about p { max-width: 80ch; font-size: 14px; }
.model h3 { font: 400 19px var(--font-head); }
.model .kind { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; }
/* numbers and Latin inside RTL stay readable */
.credit-big, .price-big, .land-facts b { font-family: "Fraunces", var(--font-head); }

/* buttons: Thaana label with a smaller English line under it */
.btn .lbl { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.3; }
.btn .lbl .en { font-size: 9.5px; opacity: .7; margin-top: 1px; }
.btn:has(.lbl) { padding-block: 5px; }
/* everything clickable reads in MV Waheed (Latin falls back to Inter) */
button, a, summary, select, [role="tab"], .chip-btn, .pill-toggle, .kbd-toggle, .land-links a, .tabbar a, .nav a,
.suggest button, .suggest button.thaana, .suggest-chips button, .suggest-chips button.thaana, .resp-tools button, .resp-tools a {
  font-family: var(--font-head);
}
button .en, a .en, summary .en, .btn .en { font-family: var(--font); }
/* logo letters */
.mark, .welcome-mark, .msg .avatar { font-family: "MV Waheed", var(--font-thaana); }
/* sign-in tabs, submit and field titles */
.auth-field > span, .custom-amt > span, .auth-card .seg button, .auth-submit { font-family: var(--font-head); }
.auth-field > span { font-size: 16px; }
.auth-field > span .en, .custom-amt > span .en { font-family: var(--font); }

/* ---------- landing ---------- */
.auth.landing { display: block; min-height: 100dvh; padding: 0; background: var(--bg); position: relative; overflow-x: hidden; place-items: initial; }
.land-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.landing > :not(.land-bg) { position: relative; z-index: 1; }
.land-nav { position: sticky; top: 0; z-index: 5 !important; display: flex; align-items: center; gap: 18px; max-width: 1180px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 24px 14px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 0 0 22px 22px; }
.land-nav .brand { padding: 0; }
.land-links { display: flex; gap: 4px; margin-inline-start: auto; }
.land-links a { padding: 8px 14px; border-radius: 99px; text-decoration: none; color: var(--ink-2); font-size: 15px; transition: background .15s, color .15s; }
.land-links a:hover { background: var(--surface-2); color: var(--ink); }
.land-links .en { font-size: 11px; }

.land-hero { max-width: 1180px; margin: 0 auto; padding: 56px 24px 72px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; min-height: calc(100dvh - 80px); }
.land-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 14px; color: var(--ink-2); backdrop-filter: blur(8px); }
.land-kicker .en { font-size: 11px; }
.land-title { margin: 20px 0 14px; font: 400 clamp(34px, 4.6vw, 62px)/1.75 var(--font-head); letter-spacing: 0; }
.land-title .grad { padding: .12em .5em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.land-title .grad { background-size: 200% 100%; animation: gradflow 8s ease-in-out infinite alternate; }
@keyframes gradflow { to { background-position: 100% 0; } }
.land-sub { margin: 0; font-size: 19px; color: var(--ink-2); max-width: 34em; line-height: 1.8; }
.land-sub .en-line { font-size: 14.5px; margin-top: 6px; }
.land-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn.lg { min-height: 52px; padding: 0 24px; font-size: 17px; border-radius: 16px; }
.land-facts { list-style: none; margin: 40px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 34px; }
.land-facts li { display: flex; flex-direction: column; gap: 2px; }
.land-facts b { font-size: 34px; font-weight: 500; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-facts span { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.land-facts .en { display: block; font-size: 11.5px; }

.landing .auth-card { width: 100%; max-width: 420px; justify-self: end; background: color-mix(in srgb, var(--gbox) 82%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 30px 60px -24px var(--glow), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent); transition: box-shadow .4s, transform .4s; }
.landing .auth-card.pulse { animation: cardpulse .9s ease-out; }
@keyframes cardpulse { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent), 0 30px 60px -24px var(--glow); transform: translateY(-3px); } }
.auth-card-head { display: flex; flex-direction: column; gap: 0; }
.auth-card-head h2 { margin: 0; font: 400 26px/1.5 var(--font-head); }
.auth-card-head .en { font-size: 12.5px; }
.auth-field > span { font-size: 15px; font-weight: 400; }
.auth-field .en { font-size: 11px; }

.land-section { max-width: 1180px; margin: 0 auto; padding: 72px 24px; }
.land-head { text-align: center; margin-bottom: 36px; }
.land-head h2 { margin: 0; font: 400 clamp(30px, 4vw, 44px)/1.5 var(--font-head); }
.land-head .en { margin: 0; font-size: 14px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feat { --rx: 0deg; --ry: 0deg; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 20px 20px; border-radius: 24px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out, box-shadow .25s, border-color .25s; overflow: hidden; }
.feat:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.feat::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.feat:hover::before { opacity: 1; }
.feat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feat-icon svg { width: 24px; height: 24px; }
.feat h3 { margin: 6px 0 0; font: 400 22px/1.5 var(--font-head); }
.feat h3 .en { font-size: 12px; }
.feat p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.feat-demo { margin-top: auto; height: 156px; flex: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; }
.chat-demo { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); }
.chat-demo .bubble { flex: none; transition: transform .2s; }
.chat-demo .bubble { align-self: flex-start; max-width: 92%; padding: 6px 12px; border-radius: 14px; font-size: 14px; line-height: 1.7; background: var(--surface-2); border: 1px solid var(--line); }
.chat-demo .bubble.ai { align-self: flex-end; background: var(--accent-soft); border-color: transparent; min-height: 34px; min-width: 40px; }
.chat-demo .bubble.ai::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: middle; margin-inline-start: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.wave-demo { flex-direction: row; align-items: center; justify-content: center; gap: 4px; }
.wave-demo i { width: 5px; border-radius: 3px; background: var(--grad); height: 20px; animation: wv 1.1s ease-in-out infinite; }
.wave-demo i:nth-child(odd) { animation-delay: -.3s; } .wave-demo i:nth-child(3n) { animation-delay: -.6s; } .wave-demo i:nth-child(4n) { animation-delay: -.85s; }
@keyframes wv { 0%, 100% { height: 10px; } 50% { height: 58px; } }
.tr-demo { justify-content: center; align-items: stretch; gap: 0; }
.tr-row { display: flex; flex-direction: column; gap: 0; padding: 8px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tr-row small { font-size: 10.5px; color: var(--muted); font-family: var(--font-mix); }
.tr-row span { font-size: 15px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s, transform .35s; }
.tr-row.out { background: var(--accent-soft); border-color: transparent; font-family: var(--font); }
.tr-row.out span { font-weight: 500; }
.tr-row span.fade { opacity: 0; transform: translateY(4px); }
.tr-swap { align-self: center; display: grid; place-items: center; width: 28px; height: 28px; margin: -6px 0; z-index: 1; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--accent); }
.tr-swap svg { width: 15px; height: 15px; }
@keyframes swing { 50% { transform: scaleX(-1); } }
.scan-demo { position: relative; align-items: stretch; justify-content: center; gap: 9px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); overflow: hidden; }
.scan-demo span { height: 9px; border-radius: 5px; background: var(--line-2); }
.scan-demo span:nth-child(2) { width: 80%; } .scan-demo span:nth-child(3) { width: 55%; }
.scan-line { position: absolute; inset-inline: 0; height: 2px; top: 0; background: var(--accent); box-shadow: 0 0 14px 2px var(--accent); animation: scan 2.6s ease-in-out infinite; }
@keyframes scan { 50% { top: calc(100% - 2px); } }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 860px; margin: 0 auto; }
.price { display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border-radius: 26px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.price-big { font-size: 40px; font-weight: 500; line-height: 1.2; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-big small { font: 400 15px var(--font-mix); color: var(--muted); }
.price p { margin: 0; color: var(--ink-2); font-size: 15px; }
.price .btn { align-self: flex-start; margin-top: auto; }
.price-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.price-list li { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.price-list li:last-child { border: 0; }
.price-list .en { font-size: 11px; }
.land-foot { max-width: 1180px; margin: 0 auto; padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }
.land-foot a { color: var(--ink-2); }
html:has(.landing:not([hidden])) { scroll-behavior: smooth; }

@media (max-width: 1000px) {
  .feat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .land-hero { grid-template-columns: 1fr; gap: 36px; padding: 28px 16px 48px; min-height: 0; }
  .landing .auth-card { justify-self: stretch; max-width: none; }
  .land-links { display: none; }
  .land-nav { padding-inline: 16px; }
  .land-nav .btn { margin-inline-start: auto; }
  .land-section { padding: 48px 16px; }
  .price-grid { grid-template-columns: 1fr; }
  .land-sub { font-size: 17px; }
  .land-facts { gap: 14px 24px; margin-top: 30px; }
  .land-facts b { font-size: 28px; }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
  .land-cta .btn { flex: 1; }
}
@media (max-width: 820px) {
  .view-head h1 { font-size: 30px; }
  .welcome .big { font-size: 28px; }
}

/* Thaana fili sit below the baseline: give every tight or clipped box room for them */
.grad { padding-block: .08em .28em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.btn .lbl { line-height: 1.6; }
.btn .lbl .en { line-height: 1.2; margin-top: -2px; }
.auth-card .seg button, .seg button { line-height: 1.6; }
.brand-text b { line-height: 1.55; }
.tr-row span { line-height: 1.95; padding-bottom: 2px; }
.page-title { line-height: 1.7 !important; padding-bottom: 2px; }
.nav a, .tabbar a span, .land-links a, .chip-btn, .pill-toggle, .resp-tools button, .suggest-chips button { line-height: 1.7; }
.pill-select select, select { line-height: 1.7; }
.acct-who small, .kicker, .meter-row, .badge, .pstatus, .engine-row { line-height: 1.7; }
.land-facts span, .feat h3, .card-title, .section-title, .dlg h2, .auth-card-head h2, .view-head h1 { line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
