/* Lion Hiba · Ask — design system.
   Built for readers aged 50+: large type, big targets, high contrast, nothing hidden behind gestures. */

:root {
  --ink: #0B1F44;
  --ink-2: #26375C;
  --muted: #465370;
  --navy: #00338D;
  --navy-deep: #0A2560;
  --navy-ink: #061A40;
  --gold: #EBB700;
  --gold-deep: #A87E00;
  --gold-soft: #FFF3C7;
  --gold-line: #EBCF6E;
  --paper: #FBF7EE;
  --paper-2: #F3EBD8;
  --card: #FFFFFF;
  --line: #E4D8BE;
  --wa: #25D366;
  --wa-ink: #04311A;
  --wa-edge: #169A4C;
  --danger: #B42318;
  --ok: #1D7A3F;

  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 28px;
  --shadow-1: 0 1px 0 rgba(11, 31, 68, .05), 0 2px 10px rgba(11, 31, 68, .06);
  --shadow-2: 0 2px 0 rgba(11, 31, 68, .04), 0 18px 40px -14px rgba(11, 31, 68, .28);
  --tap: 3.4rem;
  --topbar: 4.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Literata", Georgia, "Times New Roman", serif;
  --scale: 1;

  color-scheme: light;
}
html[lang="ar"] {
  --font-body: "IBM Plex Sans Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-head: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif;
}
html[data-size="l"] { --scale: 1.15; }
html[data-size="xl"] { --scale: 1.3; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(112.5% * var(--scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .12 0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--navy); text-underline-offset: .18em; }
p { margin: 0 0 .7em; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; }
.skip:focus { top: 12px; }
.flip-rtl { display: inline-block; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: clamp(16px, 4.5vw, 40px); }

/* ---------- icons (Phosphor subset) ---------- */
.ph { font-size: 1.5em; line-height: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; min-height: var(--topbar); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; margin-inline-end: auto; min-width: 0; }
.brand img { width: 46px; height: 46px; flex: none; }
.brand b { display: block; font-family: var(--font-head); font-size: 1.2rem; line-height: 1.1; white-space: nowrap; }
.brand small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
html[lang="ar"] .brand small { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.tool {
  min-height: 3rem; min-width: 3rem; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--card);
  color: var(--navy-deep); font-weight: 700; font-size: .95rem; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.tool:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.tool .ph { font-size: 1.35rem; }
.tool[lang="ar"] { font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; font-size: 1.05rem; }
.tool[lang="en"] { font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--tap); padding: 0 24px;
  border-radius: 18px; border: 2px solid transparent;
  font-weight: 700; font-size: 1.1rem; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn .ph { font-size: 1.65rem; }
.btn:active { transform: translateY(2px); }
.btn-wa { background: var(--wa); color: var(--wa-ink); box-shadow: 0 5px 0 var(--wa-edge), 0 16px 26px -14px rgba(10, 110, 55, .7); }
.btn-wa:active { box-shadow: 0 2px 0 var(--wa-edge); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 5px 0 var(--navy-ink), 0 16px 26px -14px rgba(0, 30, 90, .7); }
.btn-primary:active { box-shadow: 0 2px 0 var(--navy-ink); }
.btn-gold { background: var(--gold); color: var(--navy-ink); box-shadow: 0 5px 0 var(--gold-deep); }
.btn-gold:active { box-shadow: 0 2px 0 var(--gold-deep); }
.btn-ghost { background: var(--card); color: var(--navy-deep); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.btn-block { width: 100%; }
.btn small { display: block; font-weight: 600; font-size: .8rem; opacity: .85; }
.btn .stack { display: flex; flex-direction: column; align-items: flex-start; text-align: start; }

/* ---------- home hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(235, 183, 0, .22), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(0, 51, 141, .9), transparent 70%),
    linear-gradient(160deg, #0B2D72 0%, var(--navy-deep) 55%, #071B47 100%);
  border-radius: 0 0 36px 36px;
  padding-block: 26px 92px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(235, 183, 0, .35);
}
.hero::before { width: 520px; height: 520px; inset-inline-end: -220px; top: -250px; }
.hero::after { width: 360px; height: 360px; inset-inline-end: -140px; top: -170px; border-color: rgba(235, 183, 0, .18); border-width: 14px; }
.hero .wrap { position: relative; z-index: 1; }
.greet { display: inline-flex; align-items: center; gap: 10px; color: var(--gold); font-weight: 700; font-size: .92rem; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ar"] .greet { letter-spacing: 0; text-transform: none; font-size: 1rem; }
.greet .ph { font-size: 1.3rem; }
.hero h1 {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.05rem, 1.35rem + 3vw, 3.5rem); line-height: 1.1;
  margin: .3em 0 .35em; text-wrap: balance; letter-spacing: -.012em;
}
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead { color: #DCE5F6; font-size: 1.12rem; max-width: 36ch; margin: 0; }
.hero-actions { display: none; }

.askcard {
  position: relative; z-index: 2;
  margin-top: -64px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-2); padding: 16px;
}
.askcard > label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; padding: 2px 6px 10px; color: var(--navy-deep); }
.askcard > label .ph { color: var(--gold-deep); }
.askrow { display: flex; gap: 10px; align-items: stretch; }
.askrow textarea {
  flex: 1; min-width: 0; min-height: 4.2rem; max-height: 11rem; resize: none;
  padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; background: var(--paper);
  font: inherit; font-size: 1.1rem; color: var(--ink); line-height: 1.45;
}
.askrow textarea::placeholder { color: #6B7690; }
.askrow textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px var(--gold-soft); }
.askcard .btn-wa { margin-top: 12px; }

.act {
  flex: none; width: 4.1rem; min-height: 4.2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 18px; cursor: pointer; font-weight: 700; font-size: .72rem; line-height: 1.1;
  transition: transform .15s var(--ease), background .2s;
}
.act .ph { font-size: 1.8rem; }
.act:active { transform: scale(.96); }
.act.mic { background: var(--gold-soft); color: var(--navy-deep); border: 2px solid var(--gold-line); }
.act.send { background: var(--navy); color: #fff; }
.act.send:disabled { background: #9AA6C2; cursor: not-allowed; }
.act.mic.rec { background: var(--danger); color: #fff; border-color: var(--danger); animation: rec 1.4s var(--ease) infinite; }
.recnote { display: flex; align-items: center; gap: 10px; margin: 10px 4px 0; font-weight: 700; color: var(--danger); }
.recnote .bar { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }

/* ---------- sections ---------- */
.section { padding-block: 44px 6px; }
.section-head { margin-bottom: 18px; }
.section h2 { font-family: var(--font-head); font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.2rem); line-height: 1.2; margin: 0; }
.section h2::before { content: ""; display: block; width: 46px; height: 5px; border-radius: 3px; background: var(--gold); margin-bottom: 12px; }
.section .hint { color: var(--muted); margin: .35em 0 0; font-size: 1.02rem; }
.row-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }

/* ---------- topic doors ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.6rem), 1fr)); gap: 12px; }
.door {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 9.2rem; padding: 16px 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); text-align: start; cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--gold-line); }
.door:active { transform: translateY(0); }
.disc {
  width: 3.1rem; height: 3.1rem; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #FFE68F 0%, var(--gold) 55%, #C99A00 100%);
  color: var(--navy-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12), 0 3px 8px -3px rgba(168, 126, 0, .6);
}
.disc .ph { font-size: 1.65rem; }
.disc.navy { background: radial-gradient(circle at 32% 28%, #2A5BC0 0%, var(--navy) 55%, var(--navy-deep) 100%); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.door b { font-family: var(--font-head); font-size: 1.14rem; line-height: 1.22; }
.door span { color: var(--muted); font-size: .9rem; line-height: 1.35; }

/* ---------- create tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 14px; min-height: 5.4rem; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
  text-align: start; cursor: pointer; transition: transform .22s var(--ease), box-shadow .22s, border-color .22s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--gold-line); }
.tile b { display: block; font-family: var(--font-head); font-size: 1.12rem; line-height: 1.25; }
.tile span { display: block; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.tile .chev { margin-inline-start: auto; color: var(--navy); font-size: 1.4rem; }

/* ---------- news ---------- */
.fresh { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--ok); background: #E6F4EA; border: 1px solid #BFE3CB; padding: 6px 12px; border-radius: 999px; }
.fresh .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: live 2.2s infinite; }
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 14px; }
.news-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.news-card .pic { aspect-ratio: 16 / 9; background: var(--paper-2) center / cover no-repeat; max-width: 100%; }
.news-card .in { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.news-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.news-card h3 { font-family: var(--font-head); font-size: 1.14rem; line-height: 1.3; margin: 0; }
.news-card p { color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.news-empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); }

.chipbtn {
  min-height: 3rem; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--paper);
  color: var(--navy-deep); font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.chipbtn:hover { background: var(--gold-soft); border-color: var(--gold-line); }
.chipbtn .ph { font-size: 1.3rem; }
.chipbtn.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- trust strip ---------- */
.trust { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.trust div { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.trust .ph { color: var(--navy); font-size: 1.8rem; flex: none; }
.trust b { display: block; }
.trust span { color: var(--muted); font-size: .92rem; }

/* ---------- topic (narrowing) view ---------- */
.subhead { padding-block: 18px 6px; }
.back { margin-bottom: 14px; }
.topic-title { display: flex; align-items: center; gap: 14px; }
.topic-title h1 { font-family: var(--font-head); font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); line-height: 1.15; margin: 0; }
.topic-title .disc { width: 3.8rem; height: 3.8rem; }
.topic-title .disc .ph { font-size: 2rem; }
.topic-lead { color: var(--muted); font-size: 1.08rem; margin: 12px 0 0; }
.subjects { display: grid; gap: 12px; margin-top: 22px; }
.subject {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 4.4rem; padding: 12px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 1.08rem; font-weight: 700; line-height: 1.35; color: var(--ink); text-align: start; cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s var(--ease);
}
.subject:hover { border-color: var(--gold-line); background: #FFFDF6; }
.subject:active { transform: scale(.99); }
.subject .num { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--navy); font-weight: 700; }
.subject .chev { margin-inline-start: auto; color: var(--navy); font-size: 1.35rem; flex: none; }
.subject.other { border-style: dashed; background: transparent; }
.subject.other .num { background: var(--gold-soft); }

/* ---------- chat ---------- */
.chatbar { position: sticky; top: var(--topbar); z-index: 30; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.chatbar .wrap { display: flex; align-items: center; gap: 10px; min-height: 4rem; }
.chatbar h1 { font-family: var(--font-head); font-size: 1.15rem; line-height: 1.2; margin: 0 auto 0 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .chatbar h1 { margin: 0 0 0 auto; }
.chatbar .btn { min-height: 3rem; padding: 0 14px; font-size: 1rem; border-radius: 14px; }
.chatbar .btn .ph { font-size: 1.4rem; }

.chat-layout { display: block; }
.chat-side { display: none; }
.chat-main { display: flex; flex-direction: column; min-height: calc(100dvh - var(--topbar) - 4rem); }
.log { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-block: 20px 12px; }
.msg { max-width: min(100%, 46rem); animation: rise .32s var(--ease) both; }
.msg.user { align-self: flex-end; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 22px 22px 6px 22px; font-size: 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
[dir="rtl"] .msg.user { border-radius: 22px 22px 22px 6px; }
.msg.bot { align-self: stretch; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 10px; }
.avatar { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--card); border: 2px solid var(--gold); display: grid; place-items: center; overflow: hidden; }
.avatar img { width: 82%; height: 82%; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 6px 22px 22px 22px; padding: 14px 18px; box-shadow: var(--shadow-1); font-size: 1.08rem; overflow-wrap: anywhere; }
[dir="rtl"] .bubble { border-radius: 22px 6px 22px 22px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: .2em 0 .8em; padding-inline-start: 1.4em; }
.bubble li { margin: .25em 0; }
.bubble strong { color: var(--navy-deep); }
.bubble h3 { font-family: var(--font-head); font-size: 1.15rem; margin: .4em 0 .3em; }
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sources > span { width: 100%; font-size: .85rem; font-weight: 700; color: var(--muted); }
.source { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 700; text-decoration: none; }
.source .ph { font-size: 1.15rem; color: var(--gold-deep); }
a.source:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choices { display: grid; gap: 10px; margin-top: 12px; }
.choices .subject { min-height: 3.8rem; }
.media { margin-top: 12px; display: grid; gap: 10px; }
.media img { width: 100%; max-width: 540px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper-2); }
.media audio { width: 100%; max-width: 540px; }
.typing .bubble { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 700; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: hop 1.1s var(--ease) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.err .bubble { border-color: #F2C4BE; background: #FFF6F5; }

.composer { position: sticky; bottom: 0; z-index: 20; padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 72%, rgba(251, 247, 238, 0)); }
.composer .inner { display: flex; gap: 8px; align-items: stretch; background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 8px; box-shadow: var(--shadow-2); }
.composer .inner:focus-within { border-color: var(--navy); box-shadow: 0 0 0 4px var(--gold-soft), var(--shadow-2); }
.composer textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; font: inherit; font-size: 1.1rem; line-height: 1.45; color: var(--ink); padding: 12px 10px; min-height: 3.6rem; max-height: 10rem; }
.composer textarea:focus { outline: none; }
.composer .act { width: 3.7rem; min-height: 3.6rem; }
.starter { display: grid; gap: 12px; margin-top: 8px; }

/* ---------- mobile dock ---------- */
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 35; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .3s var(--ease); }
.dock.show { transform: none; }
.dock .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dock .btn { min-height: 3.4rem; padding: 0 10px; font-size: 1.02rem; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(6, 26, 64, .55); display: grid; align-items: end; animation: fade .2s ease both; }
.sheet { background: var(--card); border-radius: 28px 28px 0 0; padding: 22px clamp(16px, 5vw, 28px) calc(24px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; animation: up .3s var(--ease) both; }
.sheet .grab { width: 54px; height: 6px; border-radius: 3px; background: var(--line); margin: -6px auto 14px; }
.sheet h2 { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.2; margin: 0 0 .35em; }
.sheet .note { color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 16px 0 18px; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 1.06rem; }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--gold); color: var(--navy-ink); display: grid; place-items: center; font-weight: 700; }
.sheet .btns { display: grid; gap: 12px; }
.qr { display: grid; justify-items: center; gap: 8px; margin: 6px 0 16px; }
.qr canvas, .qr img, .qr svg { width: 220px; height: 220px; background: #fff; padding: 12px; border-radius: 18px; border: 1px solid var(--line); }
.number { font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; }
.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 18px; }
.sizes button { min-height: 5.2rem; border-radius: 18px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 700; color: var(--navy-deep); display: grid; place-items: center; gap: 2px; }
.sizes button[aria-pressed="true"] { border-color: var(--navy); background: var(--gold-soft); box-shadow: 0 0 0 3px var(--gold-soft); }
.sizes .a1 { font-size: 1.2rem; } .sizes .a2 { font-size: 1.5rem; } .sizes .a3 { font-size: 1.85rem; }
.sizes small { font-size: .78rem; font-weight: 600; color: var(--muted); }

/* ---------- footer ---------- */
.foot { margin-top: 48px; padding-block: 32px calc(110px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.foot .wrap { display: grid; gap: 14px; }
.foot a { color: var(--navy-deep); font-weight: 700; }
.foot .books { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- motion ---------- */
.reveal > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-7px); opacity: 1; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(29, 122, 63, .55); } 70% { box-shadow: 0 0 0 9px rgba(29, 122, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 122, 63, 0); } }
@keyframes rec { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .55); } 70% { box-shadow: 0 0 0 14px rgba(180, 35, 24, 0); } 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0); } }
@keyframes blink { 50% { opacity: .2; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- tablet ---------- */
@media (min-width: 720px) {
  .hero { padding-block: 40px 100px; border-radius: 0 0 48px 48px; }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .backdrop { place-items: center; }
  .sheet { width: min(560px, calc(100% - 48px)); border-radius: 28px; }
  .sheet .grab { display: none; }
  .dock .wrap { max-width: 640px; }
}

/* ---------- laptop ---------- */
@media (min-width: 1024px) {
  :root { --topbar: 4.75rem; }
  .brand img { width: 52px; height: 52px; }
  .hero { padding-block: 64px 72px; border-radius: 0 0 56px 56px; }
  .hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
  .askcard { margin-top: 0; padding: 20px; }
  .askcard .btn-wa { display: none; }
  .dock { display: none; }
  .foot { padding-bottom: 40px; }
  .doors { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 16px; }
  .door { min-height: 10rem; padding: 20px; }
  .chat-layout { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 36px; }
  .chat-side { display: block; position: sticky; top: calc(var(--topbar) + 4rem + 20px); align-self: start; max-height: calc(100dvh - var(--topbar) - 6rem); overflow: auto; padding-block: 20px; }
  .chat-side h2 { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 10px; }
  .side-list { display: grid; gap: 6px; margin-bottom: 22px; }
  .side-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 3rem; padding: 6px 10px; border-radius: 12px; border: 2px solid transparent; background: transparent; text-align: start; font-weight: 700; cursor: pointer; color: var(--ink); }
  .side-list button:hover { background: var(--card); border-color: var(--line); }
  .side-list button[aria-current="true"] { background: var(--card); border-color: var(--gold-line); }
  .side-list .ph { color: var(--gold-deep); font-size: 1.4rem; }
  .side-call { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
  .side-call p { margin: 0; color: var(--muted); font-size: .95rem; }
}
@media (min-width: 1280px) {
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- refinements (mobile first, then up) ---------- */
.tool-label, .hide-xs { display: none; }
.askrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.askrow textarea { grid-column: 1 / -1; }
.askrow .act { width: auto; min-height: 3.5rem; flex-direction: row; gap: 10px; font-size: 1.05rem; }
.askrow .act .ph { font-size: 1.6rem; }
.recnote { flex-wrap: wrap; }
.recnote .rectime { font-variant-numeric: tabular-nums; margin-inline-start: auto; }
.recnote.warn { color: var(--ink-2); }
.recnote.warn .bar { display: none; }
.composer .recnote { margin: 0 6px 8px; }
.trust p { margin: 0; }
.subject.on { border-color: var(--navy); background: var(--gold-soft); }
.subject:disabled { opacity: .55; cursor: default; }
.subject.on:disabled { opacity: 1; }
.subject .desc { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.list-title { font-weight: 700; color: var(--muted); font-size: .9rem; margin: 14px 0 0; }
blockquote.excerpt { width: 100%; margin: 6px 0 0; padding: 10px 14px; border-inline-start: 4px solid var(--gold); background: var(--paper); border-radius: 10px; color: var(--ink-2); font-size: .95rem; }
.msg { scroll-margin-top: calc(var(--topbar) + 5rem); }
.chipbtn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.news-card .pic { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--paper-2); }
.news-card.skel { min-height: 13rem; background: linear-gradient(90deg, var(--paper-2) 0%, #fff 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.topic-call { margin-top: 28px; }
.chatbar .btn-ghost { padding: 0 12px; }
.qr svg { display: block; }
.sheet h2:focus { outline: none; }
.quick { display: none; }
.hero-actions { align-items: center; }
@media (min-width: 720px) {
  .quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
  .quick > span { width: 100%; font-size: .85rem; font-weight: 700; color: var(--muted); }
  .quick .chipbtn { min-height: 2.8rem; font-weight: 600; text-align: start; line-height: 1.3; padding-block: 6px; }
}
/* Headings receive focus after navigation for screen readers; they are not controls, so no ring. */
[data-focus]:focus, main:focus { outline: none; }
@media (min-width: 560px) {
  .tool-label, .hide-xs { display: inline; }
}
@media (min-width: 720px) {
  .askrow { grid-template-columns: minmax(0, 1fr) auto auto; }
  .askrow textarea { grid-column: auto; }
  .askrow .act { width: 4.7rem; min-height: 4.4rem; flex-direction: column; gap: 2px; font-size: .78rem; }
  .askrow .act .ph { font-size: 1.8rem; }
  .topic-call { max-width: 480px; }
}

/* ---------- layout fixes after the first phone review ---------- */
/* The ask card now overlaps the hero's lower edge instead of covering the intro text. */
.hero { overflow: visible; padding-block: 26px 0; }
.hero::before, .hero::after { content: none; }
.hero-deco { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 0; }
.hero-deco::before, .hero-deco::after { content: ""; position: absolute; border-radius: 50%; border: 2px solid rgba(235, 183, 0, .35); }
.hero-deco::before { width: 520px; height: 520px; inset-inline-end: -220px; top: -250px; }
.hero-deco::after { width: 360px; height: 360px; inset-inline-end: -140px; top: -170px; border-color: rgba(235, 183, 0, .18); border-width: 14px; }
.askcard { margin-top: 24px; margin-bottom: -76px; }
.hero + .section { padding-top: calc(44px + 76px); }
/* Two topic columns on phones; one column only when the largest text is chosen on a small screen. */
.doors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.door { padding: 14px; min-height: 8.6rem; }
@media (max-width: 479px) {
  html[data-size="xl"] .doors { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
  .hero { padding-block: 40px 0; }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  html[data-size="xl"] .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .hero { padding-block: 64px 72px; }
  .askcard { margin: 0; }
  .hero + .section { padding-top: 44px; }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .door { min-height: 10rem; padding: 20px; }
}
@media (min-width: 1280px) {
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html[data-size="xl"] .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
