/* مستورد — calm sage: a green-grey ground, ink, one green accent, one sans
   (IBM Plex Sans Arabic) for reading and clicking. Radix Colors (MIT) sage/green scales. */
:root {
  --paper: #fbfdfc;
  --card: #ffffff;
  --field: #eef1f0;
  --side: #f4f6f5;
  --ink: #1a211e;
  --muted: #5f6563;
  --line: #e3e7e5;
  --line-strong: #d0d5d3;
  --navy: #1a211e;
  --navy-2: #218358;
  --on-navy: #fbfdfc;
  --on-navy-muted: #adb5b2;
  --gold: #218358;
  --gold-soft: #e6f6eb;
  --eg-red: #218358;
  --accent: #218358;
  --accent-ink: #ffffff;
  --focus: #30a46c;
  --ok: #218358;
  --cond: #a35800;
  --bad: #ce2c31;
  --ask: #0d74ce;
  --unk: #5f6563;
  --user: #eef1f0;
  --shadow: 0 1px 2px rgba(26, 33, 30, .05), 0 4px 14px -8px rgba(26, 33, 30, .12);
  --display: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --prose: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101211; --card: #171918; --field: #202221; --side: #141615; --ink: #eceeed; --muted: #adb5b2;
    --line: #2b2f2d; --line-strong: #3c423f; --navy: #eceeed; --navy-2: #3dd68c; --on-navy: #101211; --on-navy-muted: #3c423f;
    --gold: #3dd68c; --gold-soft: #132d21; --eg-red: #3dd68c; --accent: #3dd68c; --accent-ink: #0e1512; --focus: #3dd68c;
    --ok: #3dd68c; --cond: #ffca16; --bad: #ff9592; --ask: #70b8ff; --unk: #adb5b2; --user: #202221;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101211; --card: #171918; --field: #202221; --side: #141615; --ink: #eceeed; --muted: #adb5b2;
  --line: #2b2f2d; --line-strong: #3c423f; --navy: #eceeed; --navy-2: #3dd68c; --on-navy: #101211; --on-navy-muted: #3c423f;
  --gold: #3dd68c; --gold-soft: #132d21; --eg-red: #3dd68c; --accent: #3dd68c; --accent-ink: #0e1512; --focus: #3dd68c;
  --ok: #3dd68c; --cond: #ffca16; --bad: #ff9592; --ask: #70b8ff; --unk: #adb5b2; --user: #202221;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px -10px rgba(0, 0, 0, .55); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.75 "IBM Plex Sans Arabic", system-ui, sans-serif; min-height: 100vh; }
button { font: inherit; cursor: pointer; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.6; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.only-mobile { display: none !important; }

/* ── the flag and the app bar ── */
.flagband { display: grid; grid-template-rows: repeat(3, 3px); }
.flagband i:nth-child(1) { background: var(--eg-red); }
.flagband i:nth-child(2) { background: #ffffff; }
.flagband i:nth-child(3) { background: #000000; }
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: var(--card); color: var(--ink); box-shadow: inset 0 -1px 0 var(--line), 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.logo-tile { display: inline-flex; align-items: center; border-radius: 10px; }
.logo { display: block; height: 48px; width: auto; }
.sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-tile { background: #ffffff; padding: 3px 8px; } }
:root[data-theme="dark"] .logo-tile { background: #ffffff; padding: 3px 8px; }
.appbar-actions { display: flex; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: none; }
.appbar .icon-btn { color: var(--ink); border-color: var(--line); }
.appbar .icon-btn:hover { background: var(--field); }
.badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--eg-red); color: #fff; font: 700 11px/18px "IBM Plex Sans Arabic", sans-serif; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ── layout ── */
.shell { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 71px); }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; background: var(--side); border-inline-end: 1px solid var(--line); }
.side-head { display: flex; gap: 8px; }
.side-title { margin: 8px 4px 0; font: 700 12.5px/1.5 var(--display); color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.history li.muted { font-size: 13px; padding: 6px 8px; }
.history .item { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.history .item:hover, .history .item.current { background: var(--field); }
.history .item.current { box-shadow: inset -3px 0 0 var(--gold); }
.history .open { flex: 1; min-width: 0; text-align: right; background: none; border: 0; padding: 7px 10px; }
.history .open .t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.history .open .d { display: block; font-size: 11.5px; color: var(--muted); }
.history .del { background: none; border: 0; color: var(--muted); padding: 4px 8px; opacity: 0; }
.history .item:hover .del, .history .item.current .del, .history .del:focus-visible { opacity: 1; }
.history .del:hover { color: var(--bad); }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.kb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.kb div { display: flex; flex-direction: column; }
.kb b { font: 500 16px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.kb span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; max-width: 900px; width: 100%; margin: 0 auto; padding: 0 24px 14px; }
main { flex: 1; padding: 22px 0; display: flex; flex-direction: column; gap: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 16px; font-weight: 700; border: 1px solid var(--line-strong); background: var(--card); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.wide { flex: 1; justify-content: flex-start; }

.banner { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--cond); color: var(--cond); background: var(--card); font-size: 14px; }

/* ── empty state ── */
.hero { padding: 18px 0 6px; }
.eyebrow { margin: 0 0 4px; color: var(--gold); font: 700 13px/1.5 var(--display); letter-spacing: .02em; }
.hero h2 { margin: 0 0 6px; font: 700 clamp(26px, 4vw, 34px)/1.3 var(--display); text-wrap: balance; }
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feature { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.feature:hover { border-color: var(--gold); transform: translateY(-1px); }
.feature svg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; color: var(--gold); background: var(--gold-soft); margin-bottom: 6px; }
.feature b { font: 700 15px/1.4 var(--display); }
.feature span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.chips-title { margin: 6px 0 0; font: 700 14px/1.5 var(--display); color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chip { text-align: right; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14.5px; }
.chip:hover { border-color: var(--navy-2); }

/* ── messages ── */
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-start; max-width: 80%; white-space: pre-wrap; padding: 10px 16px; border-radius: 14px; border-start-start-radius: 4px; background: var(--user); }
.msg.bot { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.decl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--field); border-bottom: 1px solid var(--line); font: 700 14px/1.4 var(--display); }
.decl-head > span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; vertical-align: middle; background: var(--gold); transform: rotate(45deg); }
.decl-date { font: 500 12px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-bottom: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-inline-end: 1px solid var(--line); min-width: 0; }
.fact:last-child { border-inline-end: 0; }
.fact > b { font: 700 12px/1.4 var(--display); color: var(--muted); }
.fact small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.code-val, .cpc-val { font: 500 17px/1.4 var(--mono); direction: ltr; text-align: right; unicode-bidi: isolate; letter-spacing: .03em; font-variant-numeric: tabular-nums; }

.verdict { display: inline-block; width: fit-content; font: 700 15px/1.2 var(--display); border: 2px solid currentColor; border-radius: 6px; padding: 5px 12px; transform: rotate(-2deg); }
.verdict[data-v="allowed"] { color: var(--ok); }
.verdict[data-v="conditional"] { color: var(--cond); }
.verdict[data-v="prohibited"] { color: var(--bad); }
.verdict[data-v="needs_info"] { color: var(--ask); }
.verdict[data-v="unknown"] { color: var(--unk); }

.field { display: grid; grid-template-columns: 110px 1fr; border-bottom: 1px solid var(--line); }
.field > b { font: 700 12px/1.6 var(--display); color: var(--muted); padding: 12px 16px; border-inline-end: 1px solid var(--line); }
.field > div { padding: 12px 16px; min-width: 0; }
.msg .body p { margin: 0 0 8px; }
.msg .body p:last-child { margin-bottom: 0; }
.msg .body ul { margin: 4px 0 8px; padding-inline-start: 20px; }
.msg .body strong { font-weight: 700; }
.sources ul { margin: 0; padding-inline-start: 18px; font-size: 13px; }
.sources a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.sources a:hover { text-decoration-color: currentColor; }
.sources .unofficial { color: var(--cond); }
.msg.error { border-color: var(--bad); }
.msg.error .body { color: var(--bad); }

.steps { list-style: none; margin: 0; padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.steps li::before { content: "◦ "; }
.steps li.live::before { content: "● "; color: var(--gold); }
.steps:empty { display: none; }
.aside { font-size: 13px; color: var(--muted); border-inline-start: 2px solid var(--line); padding-inline-start: 8px; margin: 8px 16px; }

/* ── importer tools ── */
.tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-size: 13.5px; font-weight: 600; }
.tool svg { width: 17px; height: 17px; color: var(--gold); }
.tool:hover, .tool[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.panel { padding: 16px; background: var(--field); border-bottom: 1px solid var(--line); }
.panel h4 { margin: 0 0 10px; font: 700 15px/1.4 var(--display); }
.panel .note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-row input, .form-row select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 150px; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.t th, table.t td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font: 700 12px/1.5 var(--display); color: var(--muted); background: var(--field); }
table.t td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; text-align: left; white-space: nowrap; }
table.t tr.total td { font-weight: 700; background: var(--gold-soft); }
table.t tr.best td { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.plan-step { margin: 0 0 12px; }
.plan-step h5 { margin: 0 0 6px; font: 700 14px/1.4 var(--display); display: flex; align-items: center; gap: 8px; }
.plan-step h5 i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--on-navy); font: 700 12px/1 "IBM Plex Sans Arabic", sans-serif; }
.plan-step ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-step li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.plan-step li.warn { border-color: var(--bad); color: var(--bad); }
.plan-step input { margin-top: 5px; accent-color: var(--ok); }
.plan-step li a { color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; margin-top: 10px; }

.actions { display: flex; gap: 6px; align-items: center; padding: 10px 16px; }
.fb { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; }
.fb[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }

/* ── followed lines ── */
.drawer { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; font: 700 16px/1.4 var(--display); }
.followed { border-top: 1px solid var(--line); padding: 10px 0; }
.followed:first-child { border-top: 0; }
.followed header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.followed .code-val { font-size: 15px; }
.followed ul { margin: 6px 0 0; padding-inline-start: 18px; font-size: 13.5px; }
.followed .unfollow { background: none; border: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; }

/* ── the composer ── */
.composer { position: sticky; bottom: 0; padding: 10px 0 6px; background: linear-gradient(to top, var(--paper) 70%, transparent); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.composer-row:focus-within { border-color: var(--focus); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; min-height: 42px; max-height: 180px; padding: 8px 6px; }
.attach { color: var(--muted); border-radius: 10px; }
.attach:hover { background: var(--field); color: var(--ink); }
.send { height: 42px; border-radius: 12px; }
.send svg { width: 18px; height: 18px; }
.send:disabled { opacity: .5; cursor: wait; }
.attach-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); width: fit-content; max-width: 100%; }
.attach-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.attach-preview .name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.attach-preview button { background: none; border: 0; color: var(--muted); }
.legal { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* ── phones ── */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; inset-inline-start: 0; height: 100vh; width: min(86vw, 320px); z-index: 40; transform: translateX(105%); transition: transform .2s ease; border-inline-end: 0; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .scrim[hidden] { display: none; }
  .only-mobile { display: inline-grid !important; }
  .main { padding: 0 16px 12px; }
  .appbar { padding: 6px 12px; }
  .sub { display: none; }
  .logo { height: 40px; }
  h1 { font-size: 17px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .chips { grid-template-columns: 1fr; }
  .msg.user { max-width: 92%; }
  .field { grid-template-columns: 1fr; }
  .field > b { border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 5px 14px; }
  .field > div { padding: 10px 14px; }
  .fact { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .fact:last-child { border-bottom: 0; }
  .send span { display: none; }
  body { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .side, .feature { transition: none; } }

/* print only the plan being printed */
@media print {
  body.printing > *:not(.shell), body.printing .side, body.printing .composer, body.printing .legal, body.printing .banner, body.printing .drawer { display: none !important; }
  body.printing .msg:not(.print-target), body.printing .empty { display: none !important; }
  body.printing .print-target > *:not(.decl-head):not(.facts):not(.panel) { display: none !important; }
  body.printing .panel-actions { display: none !important; }
}

.more-sources { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--focus); font-size: 13px; text-decoration: underline; }

/* ── the calm layer: quieter chrome, serif reading, soft pills ── */
.flagband { display: none; }
.appbar { background: var(--paper); box-shadow: none; padding: 10px 20px; }
.sub { border-inline-start-color: var(--line-strong); }
.appbar .icon-btn { border-color: transparent; color: var(--muted); }
.appbar .icon-btn:hover { background: var(--field); color: var(--ink); }
.side { border-inline-end: 0; }
.history .item.current { box-shadow: none; background: var(--line); }
.side-title { font: 600 12px/1.5 "IBM Plex Sans Arabic", sans-serif; }

.hero { text-align: center; padding: 48px 0 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font: 600 13px/1.5 "IBM Plex Sans Arabic", sans-serif; letter-spacing: 0; }
.eyebrow::before { content: none; }
.hero h2 { font: 500 clamp(30px, 4.6vw, 40px)/1.35 var(--display); margin-bottom: 8px; }
.hero p { margin-inline: auto; font-size: 15.5px; }
.feature { box-shadow: none; border-radius: 12px; background: transparent; padding: 14px; }
.feature:hover { border-color: var(--line-strong); background: var(--card); transform: none; }
.feature svg { background: none; padding: 0; width: 24px; height: 24px; color: var(--accent); }
.feature b { font: 600 14.5px/1.4 "IBM Plex Sans Arabic", sans-serif; }
.chips-title { text-align: center; font: 600 13px/1.5 "IBM Plex Sans Arabic", sans-serif; }
.chip { border-radius: 12px; background: transparent; color: var(--ink); }
.chip:hover { border-color: var(--line-strong); background: var(--card); }

.msg.user { border-radius: 18px; padding: 10px 18px; }
.msg.bot { box-shadow: none; border-radius: 14px; }
.msg .body { font-family: var(--prose); font-size: 17px; line-height: 1.9; }
.decl-head { background: transparent; font: 600 13px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }
.decl-head > span::before { content: none; }
.verdict { transform: none; border: 0; border-radius: 999px; padding: 5px 14px; font: 700 14px/1.2 "IBM Plex Sans Arabic", sans-serif; background: color-mix(in srgb, currentColor 13%, transparent); }
.fact > b, .field > b { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 600; }
.tool svg { color: var(--accent); }
.tool:hover, .tool[aria-pressed="true"] { border-color: var(--accent); background: var(--gold-soft); }
.panel h4, .drawer-head h2 { font-family: var(--display); font-weight: 600; }
table.t th { font-family: "IBM Plex Sans Arabic", sans-serif; }
.plan-step h5 { font-family: "IBM Plex Sans Arabic", sans-serif; }
.plan-step h5 i { background: var(--accent); color: var(--accent-ink); }

.composer-row { border-radius: 20px; border-color: var(--line-strong); padding: 10px; box-shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 10px 28px -14px rgba(20, 20, 19, .22); }
.composer-row:focus-within { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(20, 20, 19, .05), 0 12px 32px -14px rgba(20, 20, 19, .3); }
.send { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.send span { display: none; }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--accent) 88%, #000); }
.legal { text-align: center; }

/* Answers read like claude.ai: prose on the page, the declaration facts as a
   quiet strip above it, no card around the whole thing. */
.msg.bot { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.msg.bot .decl-head { padding: 0 0 6px; border-bottom: 0; }
.msg.bot .facts { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 8px; }
.msg.bot .field { border-bottom: 0; grid-template-columns: 1fr; }
.msg.bot .field > b { border-inline-end: 0; padding: 10px 0 2px; }
.msg.bot .field > div { padding: 2px 0 8px; }
.msg.bot .steps { border-bottom: 0; padding: 4px 0; }
.msg.bot .steps li.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; animation: breathe 1.4s ease-in-out infinite; }
.msg.bot .tools { border: 0; padding: 8px 0; }
.msg.bot .panel { border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 8px; }
.msg.bot .actions { padding: 4px 0; }
.msg.bot .aside { margin: 8px 0; }
.fb { border-color: transparent; color: var(--muted); }
.fb:hover { background: var(--field); color: var(--ink); }
@keyframes breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .msg.bot .steps li.live::before { animation: none; } }
.new-chat { background: transparent; border-color: transparent; font-weight: 600; padding: 8px 10px; }
.new-chat:hover { background: var(--field); }
.new-chat i { font-style: normal; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; line-height: 1; }

/* ── stop, retry, edit ── */
.send .i-stop { display: none; }
.send.stopping { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.send.stopping .i-send { display: none; }
.send.stopping .i-stop { display: block; }
.act { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); }
.act:hover { background: var(--field); color: var(--ink); }
.act svg { width: 17px; height: 17px; }
.msg.user { position: relative; }
.msg.user .u-text { white-space: pre-wrap; }
.msg.user .edit { position: absolute; top: 50%; inset-inline-end: -40px; transform: translateY(-50%); opacity: 0; transition: opacity .15s; }
.msg.user:hover .edit, .msg.user .edit:focus-visible { opacity: 1; }
@media (hover: none) { .msg.user .edit { opacity: 1; position: static; transform: none; margin-top: 4px; } }
form.editing .composer-row { border-color: var(--accent); }

/* ── numbered sources ── */
.sources ol { margin: 0; padding-inline-start: 22px; font-size: 13px; }
.sources ol li { margin-bottom: 2px; }
.sources ol li::marker { color: var(--accent); font-weight: 700; }
.ref { line-height: 0; }
.ref button, .ref-inline { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-inline-start: 3px; padding: 0 4px; border: 0; border-radius: 6px; background: var(--gold-soft); color: var(--accent); font: 700 11px/1 "IBM Plex Sans Arabic", sans-serif; vertical-align: super; }
.ref button:hover, .ref button:focus-visible, .ref-inline:hover { background: var(--accent); color: var(--accent-ink); }
.ref-inline { vertical-align: baseline; height: 20px; margin-inline-start: 6px; font-size: 11.5px; font-weight: 600; }
.ref-pop { position: fixed; z-index: 60; max-height: 50vh; overflow: auto; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .35); font-size: 13.5px; line-height: 1.75; }
.ref-pop b { display: block; margin-bottom: 6px; font-size: 13px; }
.ref-pop p { margin: 0 0 6px; font-family: var(--prose); font-size: 15px; white-space: pre-line; }
.ref-pop a { color: var(--accent); font-size: 12.5px; }

/* ── follow-up suggestions ── */
.followups { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 2px; }
.followup { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-size: 13.5px; }
.followup:hover { border-color: var(--accent); color: var(--accent); }


/* ── the mark: the shield-and-container icon from the brand logo ── */
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.wordmark .mark { width: 40px; height: 40px; object-fit: contain; }
.wordmark > span { display: flex; flex-direction: column; line-height: 1.15; }
.wordmark b { font: 700 21px/1.1 var(--display); letter-spacing: 0; }
.wordmark small { font: 500 11.5px/1.3 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }
.hero .eyebrow::before { content: none; }
.hero-mark { width: 72px; height: 72px; object-fit: contain; margin-bottom: 8px; }
.decl-head > span::before { content: none; }

/* ── tariff suggestions over the composer ── */
.composer { position: sticky; }
.suggest { list-style: none; margin: 0 0 8px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .35); max-height: 300px; overflow-y: auto; }
.suggest li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--field); }
.suggest .code-val { font-size: 13.5px; color: var(--accent); }
.suggest .s-desc { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .s-duty { font: 600 12px/1 var(--mono); color: var(--muted); }
@media (max-width: 900px) { .suggest li { grid-template-columns: 1fr auto; } .suggest .code-val { grid-column: 1 / -1; } }

/* ── motion: quick, small, and all of it off for reduced-motion ── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 35%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.msg { animation: fade .2s ease-out both; }
.msg.user { animation-duration: .22s; }
.hero-mark { animation: fade .3s ease-out both; }
.hero h2, .hero p { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.hero h2 { animation-delay: .06s; }
.hero p { animation-delay: .12s; }
.feature, .chip { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; transition: border-color .15s, background .15s, transform .15s; }
.feature:nth-child(1) { animation-delay: .16s; } .feature:nth-child(2) { animation-delay: .21s; }
.feature:nth-child(3) { animation-delay: .26s; } .feature:nth-child(4) { animation-delay: .31s; }
.chip:nth-child(1) { animation-delay: .34s; } .chip:nth-child(2) { animation-delay: .37s; } .chip:nth-child(3) { animation-delay: .40s; }
.chip:nth-child(4) { animation-delay: .43s; } .chip:nth-child(5) { animation-delay: .46s; } .chip:nth-child(6) { animation-delay: .49s; }
.feature:hover, .chip:hover { transform: translateY(-2px); }
.feature:hover svg { transform: scale(1.12) rotate(-4deg); }
.feature svg { transition: transform .2s; }

/* the answer being written */
.caret { display: inline-block; width: 2px; height: 1.05em; margin-inline-start: 2px; vertical-align: -.15em; background: var(--accent); opacity: .7; }
.msg.bot .steps li { animation: rise .25s ease-out both; }
.msg.bot .steps li.live { color: var(--muted); }
.msg.bot .steps li.live::before { -webkit-text-fill-color: var(--accent); }
.msg.bot.landed .facts, .msg.bot.landed .sources, .msg.bot.landed .tools { animation: fade .35s ease-out both; }
.msg.bot.landed .fact { animation: none; }
.msg.bot.landed .fact:nth-child(2) { animation-delay: .05s; } .msg.bot.landed .fact:nth-child(3) { animation-delay: .1s; }
.msg.bot.landed .verdict { animation: fade .25s ease-out both; }
.ref button { animation: pop .3s ease-out both; transition: background .15s, color .15s, transform .15s; }
.ref button:hover { transform: translateY(-1px) scale(1.08); }
.followup { animation: pop .3s cubic-bezier(.2, .8, .2, 1.2) both; transition: border-color .15s, color .15s, transform .15s; }
.followup:nth-child(2) { animation-delay: .06s; } .followup:nth-child(3) { animation-delay: .12s; } .followup:nth-child(4) { animation-delay: .18s; }
.followup:hover { transform: translateY(-2px); }
.panel:not([hidden]) { animation: rise .25s ease-out both; }
.suggest:not([hidden]) { animation: pop .16s ease-out both; transform-origin: bottom center; }
.ref-pop:not([hidden]) { animation: pop .14s ease-out both; }
.history .item { animation: fade .25s ease-out both; transition: background .15s; }

/* controls respond to the hand */
.btn, .tool, .icon-btn, .act, .fb, .followup, .chip, .feature, .send { transition: transform .12s, background .15s, border-color .15s, color .15s; }
.btn:active, .tool:active, .icon-btn:active, .act:active, .fb:active, .followup:active, .chip:active, .feature:active, .send:active { transform: scale(.96); }
.send:not(:disabled):hover { transform: translateY(-1px); }
.send.stopping { animation: ring 1.4s ease-out infinite; }
.new-chat i { transition: transform .25s; }
.new-chat:hover i { transform: rotate(90deg); }
.theme-toggle svg { transition: transform .4s; }
.theme-toggle:hover svg { transform: rotate(40deg); }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .msg.bot .steps li.live { color: var(--muted); background: none; }
}

/* the preview line while the answer is written, and a replayed answer */
.msg.bot.previewing .facts { animation: pop .25s ease-out both; border-style: dashed; }
.msg.bot.previewing .f-code b { color: var(--accent); }
.msg.bot.previewing .code-val { opacity: .85; }
.decl-head .cached { margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }

/* ── the globe behind the hero ── */
.empty { position: relative; isolation: isolate; }
.hero-canvas { position: absolute; top: -30px; inset-inline-start: 0; width: 100%; height: 420px; z-index: -1; pointer-events: none; opacity: .28; transition: opacity 1.2s ease; -webkit-mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, #000 50%, transparent 78%); mask-image: radial-gradient(ellipse 55% 60% at 50% 50%, #000 50%, transparent 78%); }
/* wide screens: the words on the start side, the globe beside them */
@media (min-width: 1000px) {
  .hero { text-align: start; min-height: 360px; padding: 40px 0 20px; max-width: 54%; display: flex; flex-direction: column; justify-content: center; }
  .hero p { margin-inline: 0; }
  .hero-canvas { inset-inline-start: auto; inset-inline-end: -24px; top: -10px; width: 50%; height: 400px; opacity: 1; }
}
.hero, .features, .chips-title, .chips { position: relative; }
.hero h2 .w { display: inline-block; }

/* GSAP drives the entrances when it loads; the CSS keyframes step aside */
.gsap .msg, .gsap .hero-mark, .gsap .hero h2, .gsap .hero p, .gsap .feature, .gsap .chip,
.gsap .msg.bot.landed .fact, .gsap .msg.bot.landed .verdict, .gsap .followup, .gsap .ref button { animation: none; }
.gsap .feature:hover, .gsap .chip:hover { transform: none; }

/* a light that follows the pointer across a feature card */
.feature { overflow: hidden; }
.feature::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); }
.feature:hover::before { opacity: 1; }
.feature { position: relative; backdrop-filter: blur(6px); background: color-mix(in srgb, var(--paper) 55%, transparent); }
.chip { backdrop-filter: blur(6px); background: color-mix(in srgb, var(--paper) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .hero-canvas { display: none; } }

/* ── ambient light: three soft glows drifting behind the whole app ── */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .20; will-change: transform; }
.aurora i:nth-child(1) { background: var(--accent); top: -18vmax; inset-inline-end: -10vmax; animation: drift1 38s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: #1fae9b; bottom: -22vmax; inset-inline-start: 10vmax; animation: drift2 46s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: color-mix(in srgb, var(--accent) 50%, #f2b24c); top: 30vh; inset-inline-start: -16vmax; width: 30vmax; height: 30vmax; opacity: .14; animation: drift3 52s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-22vw, 18vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(18vw, -20vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(30vw, 10vh) scale(1.2); } }
:root[data-theme="light"] .aurora i { opacity: .13; }
.appbar, .shell { position: relative; z-index: 1; }
.appbar { position: sticky; background: color-mix(in srgb, var(--paper) 78%, transparent); backdrop-filter: blur(14px); }
.side { background: color-mix(in srgb, var(--side) 88%, transparent); backdrop-filter: blur(10px); }
.composer { background: linear-gradient(to top, var(--paper) 55%, transparent); }
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none; } }

/* ── the sidebar, redone: search, day groups, a knowledge card, collapsible ── */
.side { gap: 12px; padding: 14px 12px; }
.side-head { align-items: center; gap: 6px; }
.new-chat { gap: 10px; padding: 9px 10px; border-radius: 12px; }
.new-chat kbd { margin-inline-start: auto; font: 500 10.5px/1 var(--mono); color: var(--muted); padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 6px; opacity: 0; transition: opacity .15s; }
.new-chat:hover kbd { opacity: 1; }
.collapse-side { width: 36px; height: 36px; color: var(--muted); border-radius: 10px; }
.collapse-side:hover { background: var(--field); color: var(--ink); }
.side-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--field) 80%, transparent); border: 1px solid transparent; transition: border-color .15s, background .15s; }
.side-search:focus-within { border-color: var(--line-strong); background: var(--card); }
.side-search svg { width: 16px; height: 16px; color: var(--muted); }
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; }
.side-search input::placeholder { color: var(--muted); }
.history-wrap { flex: 1; min-height: 0; overflow-y: auto; margin-inline: -4px; padding-inline: 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.history { overflow: visible; gap: 1px; }
.history .group { margin: 12px 8px 4px; font: 600 11.5px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); letter-spacing: .02em; }
.history .group:first-child { margin-top: 2px; }
.history .item { position: relative; border-radius: 10px; transition: background .15s; }
.history .item .open { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; }
.history .item .open .t { flex: 1; min-width: 0; font-size: 13.5px; }
.history .item .open .d { flex: none; font-size: 11px; opacity: .8; }
.history .item:hover .open .d, .history .item.current .open .d { display: none; }
.history .item.current { background: var(--field); box-shadow: none; }
.history .item.current::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.history .del { border-radius: 8px; }
.history .del:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.history .empty-note { padding: 18px 10px; text-align: center; font-size: 13px; }
.side-foot { border-top: 0; padding-top: 0; }
.kb-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.kb-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 7px transparent; } }
.kb { margin-bottom: 6px; }
.kb b { font-size: 15px; color: var(--ink); }
.sources-note summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; }
.sources-note summary::-webkit-details-marker { display: none; }
.sources-note summary::after { content: " ▾"; }
.sources-note[open] summary::after { content: " ▴"; }
.sources-note p { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }

/* collapsed on wide screens: the chat takes the room; the menu button brings it back */
@media (min-width: 901px) {
  .shell { transition: grid-template-columns .3s cubic-bezier(.2, .7, .2, 1); }
  .shell.collapsed { grid-template-columns: 0 1fr; }
  .shell.collapsed .side { opacity: 0; pointer-events: none; overflow: hidden; padding-inline: 0; width: 0; min-width: 0; border: 0; }
  .side { transition: opacity .2s; }
  body.side-collapsed #open-side { display: inline-grid !important; }
}
@media (max-width: 900px) { .collapse-side { display: none; } .new-chat kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ── the options of a clarifying question, as buttons ── */
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; }
.choice { max-width: 100%; text-align: start; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--accent); background: var(--gold-soft); color: var(--ink); font-size: 14px; line-height: 1.5; transition: transform .12s, background .15s; }
.choice:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-1px); }
.choice:active { transform: scale(.97); }

.act.simpler { width: auto; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; }
.act.simpler:hover { background: var(--gold-soft); color: var(--accent); }

/* ════ shadcn/ui look + Magic UI motion, without React ════ */

/* Magic UI «Animated Gradient Text» — the hero title */
.grad-text, .grad-text .w {
  background: linear-gradient(90deg, var(--ink) 0%, var(--accent) 25%, #1fae9b 50%, var(--accent) 75%, var(--ink) 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: grad-flow 8s linear infinite;
}
@keyframes grad-flow { to { background-position: 300% 0; } }

/* Magic UI «Dot Pattern» — a soft grid of dots behind the hero, faded at the edges */
.dot-pattern { position: absolute; inset: -20px 0 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--muted) 45%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  animation: dots-in 1.2s ease-out both; }
@keyframes dots-in { from { opacity: 0; } }

/* Magic UI «Border Beam» — a light travelling round the composer and a hovered feature card */
@property --beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.composer-row, .feature { position: relative; }
.composer-row::after, .feature::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--beam), transparent 0 70%, var(--accent) 80%, #1fae9b 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam 5s linear infinite; opacity: .9;
}
.feature::after { opacity: 0; transition: opacity .3s; }
.feature:hover::after { opacity: 1; }
.composer-row:focus-within::after { animation-duration: 2.2s; }
@keyframes beam { to { --beam: 360deg; } }

/* Magic UI «Shimmer Button» — the send button and the new-inquiry plus */
.send, .new-chat i { position: relative; overflow: hidden; }
.send::after, .new-chat i::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%) -150% 0 / 250% 100% no-repeat;
  animation: shimmer-sweep 3.2s ease-in-out infinite;
}
@keyframes shimmer-sweep { 0%, 55% { background-position: -150% 0; } 100% { background-position: 150% 0; } }

/* Magic UI «Marquee» — example questions drift by; hover to stop */
.marquee { display: block; overflow: hidden; padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; flex-wrap: wrap; gap: 8px; width: auto; animation: none; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee .chip { flex: none; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* shadcn «Command» — Ctrl/⌘ K palette */
.cmdk-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); }
.cmdk { width: min(620px, 100%); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55); overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.cmdk-input svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk-input input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 15.5px; }
.cmdk kbd, .cmdk-foot kbd { font: 500 11px/1 var(--mono); color: var(--muted); padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 6px; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk-group { padding: 10px 10px 4px; font: 600 11.5px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }
.cmdk-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.cmdk-item small { flex: none; color: var(--muted); font: 500 11.5px/1 var(--mono); }
.cmdk-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item[aria-selected="true"], .cmdk-item:hover { background: var(--field); }
.cmdk-item[aria-selected="true"] { box-shadow: inset -3px 0 0 var(--accent); }
.cmdk-empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 13.5px; }
.cmdk-foot { display: flex; gap: 16px; justify-content: flex-end; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cmdk-foot span { display: inline-flex; gap: 4px; align-items: center; }

/* shadcn «Sonner» — toasts */
.toasts { position: fixed; z-index: 90; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 13.5px; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .45); opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .2, 1.2); }
.toast.in { opacity: 1; transform: none; }
.toast-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); }
.toast.error .toast-dot { background: var(--bad); }

/* shadcn «Tooltip» — for icon-only buttons */
[data-tip] { position: relative; }
[data-tip]::before { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; z-index: 70; transform: translate(-50%, -4px); padding: 5px 9px; border-radius: 7px; background: var(--ink); color: var(--paper); font: 500 12px/1.3 "IBM Plex Sans Arabic", sans-serif; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; }
[data-tip]:hover::before, [data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }
.act[data-tip]::before { top: auto; bottom: calc(100% + 8px); }

@media (prefers-reduced-motion: reduce) {
  .grad-text, .grad-text .w { animation: none; background-position: 0 0; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .composer-row::after, .feature::after, .send::after, .new-chat i::after { animation: none; }
}

/* ════ the answer as shadcn blocks: Alert, Card, Steps, Badge ════ */
.msg.bot .body { font-size: 16px; line-height: 1.8; display: flex; flex-direction: column; gap: 12px; }
.msg.bot .body > p { margin: 0; }
.ans-alert { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 16px; background: var(--card); }
.ans-alert p { margin: 0; }
.ans-alert-title { font: 700 12.5px/1.4 "IBM Plex Sans Arabic", sans-serif; letter-spacing: .02em; margin-bottom: 4px; }
.ans-summary { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); font-size: 17px; font-weight: 500; }
.ans-summary .ans-alert-title { color: var(--accent); }
.ans-warn { border-color: color-mix(in srgb, var(--cond) 55%, transparent); background: color-mix(in srgb, var(--cond) 9%, var(--card)); }
.ans-warn .ans-alert-title { color: var(--cond); }
.ans-next { display: flex; gap: 12px; align-items: flex-start; border-color: color-mix(in srgb, #1fae9b 55%, transparent); background: color-mix(in srgb, #1fae9b 9%, var(--card)); }
.ans-next .ans-alert-title { color: #13806f; }
:root[data-theme="dark"] .ans-next .ans-alert-title { color: #4fd1bd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ans-next .ans-alert-title { color: #4fd1bd; } }
.ans-next-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #1fae9b; color: #fff; font-weight: 700; }
.ans-section { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); }
.ans-section h4 { margin: 0 0 8px; font: 700 13px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); letter-spacing: .02em; }
.ans-section > p { margin: 0 0 6px; }
.ans-items, .ans-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ans-items li, .ans-steps li { display: flex; gap: 10px; align-items: flex-start; }
.ans-items li b, .ans-steps li b { display: block; font: 600 14.5px/1.55 "IBM Plex Sans Arabic", sans-serif; color: var(--ink); }
.ans-items li span, .ans-steps li span { display: block; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.ans-items li span.solo, .ans-steps li span.solo { color: var(--ink); }
.ans-items .dot { flex: none; width: 7px; height: 7px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
.ans-steps { position: relative; }
.ans-steps li { position: relative; }
.ans-steps .n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 12px/1 "IBM Plex Sans Arabic", sans-serif; font-style: normal; z-index: 1; }
.ans-steps li:not(:last-child)::after { content: ""; position: absolute; top: 26px; bottom: -12px; inset-inline-start: 11px; width: 2px; background: var(--line-strong); }
.ans-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ans-badge { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--field); font: 700 15px/1.3 var(--mono); color: var(--ink); }
.ans-badge small { font: 500 12px/1.3 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }
.ans-badges + .ans-muted p { display: none; }
.ans-muted { color: var(--muted); font-size: 14px; }
.ans-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 14.5px; color: var(--muted); }
.ans-line > span { font: 700 12.5px/1.4 "IBM Plex Sans Arabic", sans-serif; color: var(--muted); }
.ans-line p { margin: 0; color: var(--ink); }
.gsap .msg.bot.landed .ans-alert, .gsap .msg.bot.landed .ans-section { animation: none; }
.msg.bot.landed .ans-alert, .msg.bot.landed .ans-section { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }

/* ════ light theme: solid chrome, stronger ink ════ */
:root:not([data-theme="dark"]) { --muted: #5d5b54; --line: #dedace; --line-strong: #c9c4b4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --muted: #a6a39a; --line: #3d3d3a; --line-strong: #4a4945; } }
:root[data-theme="light"] .appbar, :root:not([data-theme]) .appbar { background: color-mix(in srgb, var(--paper) 96%, transparent); box-shadow: 0 1px 0 var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .appbar { background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: none; } }
:root[data-theme="dark"] .appbar { background: color-mix(in srgb, var(--paper) 92%, transparent); box-shadow: none; }
:root[data-theme="light"] .aurora i { opacity: .08; }
:root[data-theme="light"] .feature, :root[data-theme="light"] .chip { background: var(--card); box-shadow: 0 1px 2px rgba(20, 20, 19, .05); }
:root[data-theme="light"] .dot-pattern { background-image: radial-gradient(color-mix(in srgb, var(--muted) 30%, transparent) 1px, transparent 1.2px); }
.appbar { z-index: 30; }

.guide-link { display: block; margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.guide-link:hover { text-decoration: underline; }
a.tool { text-decoration: none; }

/* a draft being checked: kept on screen, dimmed, until the checked answer replaces it */
.msg.bot .body.revising { opacity: .45; transition: opacity .2s; }

/* ── still page (2026-10-09): the Magic UI effects are off — aurora glows, dot
   pattern, border beam, shimmer sweep, flowing gradient title, pointer light,
   drifting marquee. They read as «AI-made» and kept the screen moving. ── */
.aurora, .dot-pattern, .hero-canvas { display: none !important; }
.composer-row::after, .feature::after, .send::after, .new-chat i::after, .feature::before { content: none !important; animation: none !important; }
.grad-text, .grad-text .w { background: none !important; color: var(--ink) !important; -webkit-text-fill-color: currentColor; animation: none !important; }
.marquee { -webkit-mask-image: none; mask-image: none; }
.feature { transform: none !important; }
.feature:hover { border-color: var(--line-strong); }
.feature, .chip, .hero h2, .hero p, .msg.bot .steps li { animation: none !important; }
