/* أسماء ومعاني — design tokens and components (see design.md) */
:root {
  --ink: #1B2F4B; --ink-2: #24406A; --ink-3: #2F5283;
  --paper: #FBF7EE; --vellum: #FFFDF8; --line: #E7DFCC; --line-2: #D9CDB2;
  --garnet: #8C3A46; --garnet-2: #74303A;
  --gold: #B08A3E; --gold-2: #96742F; --gold-soft: #E9D9AE; --gold-wash: #F6EED9;
  --sage: #E8F0EA;
  --boy: #2D64A8; --boy-wash: #EAF1FA; --girl: #B34A70; --girl-wash: #FBEDF2; --unisex: #6A5A9C; --uni-wash: #F0EDF8;
  --text: #23262B; --muted: #5D6470;
  --r-panel: 14px; --r-card: 12px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(27,47,75,.06), 0 6px 18px rgba(27,47,75,.06);
  --sh-2: 0 18px 50px rgba(27,47,75,.12);
  --f-disp: "Amiri", "Noto Sans Tifinagh", "Noto Naskh Arabic", "Times New Roman", serif;
  --f-quran: "Amiri Quran", "Amiri", serif;
  --f-body: "IBM Plex Sans Arabic", "Noto Sans Tifinagh", "Segoe UI", Tahoma, system-ui, sans-serif;
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.9; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink-3); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--garnet); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.35; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4.4vw, 39px); font-weight: 700; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 10px; }
.center { text-align: center; justify-content: center; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }

/* ---------- top bar ---------- */
.topbar { background: var(--vellum); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--gold), var(--garnet) 50%, var(--gold)); }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.seal-mark { position: relative; width: 42px; height: 42px; flex: none; }
.seal-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal-mark b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--f-disp); font-size: 25px; font-weight: 700; line-height: 1; padding-bottom: 6px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt strong { font-family: var(--f-disp); font-size: 25px; font-weight: 700; }
.brand-txt small { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.mainnav { display: flex; gap: 2px; margin-inline-start: auto; flex-wrap: wrap; align-items: center; }
.mainnav a { text-decoration: none; color: var(--text); font-size: 14.5px; font-weight: 500; padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.mainnav a:hover { background: var(--gold-wash); color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--garnet); box-shadow: inset 0 -2px 0 var(--garnet); border-radius: 0; }
.mainnav .nav-cta { background: var(--ink); color: #fff; border-radius: var(--r-pill); padding: 7px 16px; margin-inline-start: 6px; }
.mainnav .nav-cta:hover { background: var(--garnet); color: #fff; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; color: var(--ink); cursor: pointer; }
.nav-toggle .ic { width: 22px; height: 22px; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .mainnav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--vellum); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; box-shadow: var(--sh-1); }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 11px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .mainnav .nav-cta { margin: 10px 0 0; text-align: center; border-radius: var(--r-pill); border: 0; }
  .topbar-in { position: relative; }
}

/* ---------- hero (home) ---------- */
.hero { position: relative; color: #fff; background: radial-gradient(1200px 400px at 50% -10%, rgba(176,138,62,.25), transparent 60%), linear-gradient(180deg, rgba(27,47,75,.93), rgba(27,47,75,.97)), url('/img/hero-qalam.webp') center/cover; padding: 54px 0 34px; overflow: visible; }
.hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px); opacity: .35; }
.hero-in { text-align: center; }
.hero .kicker { color: var(--gold-soft); }
.hero h1 { color: #fff; font-family: var(--f-disp); font-size: clamp(34px, 6vw, 58px); line-height: 1.3; margin-bottom: 12px; }
.hero h1 span { color: var(--gold-soft); font-size: .62em; font-family: var(--f-body); font-weight: 600; }
.hero-sub { max-width: 720px; margin: 0 auto 26px; color: #DCE3EC; font-size: 17px; }
.hero-try { margin: 14px 0 26px; color: #C9D3E0; font-size: 14.5px; }
.hero-try a { color: #fff; }
.kicker { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; color: var(--garnet); margin: 0 0 6px; }

/* ---------- search ---------- */
.search { position: relative; display: flex; max-width: 720px; margin: 0 auto 8px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 5px; box-shadow: var(--sh-1); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 17px; padding: 10px 18px; color: var(--text); border-radius: var(--r-pill); }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px var(--gold-soft), var(--sh-1); }
.search button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--garnet); color: #fff; font: inherit; font-weight: 600; padding: 10px 22px; border-radius: var(--r-pill); cursor: pointer; transition: background .15s; }
.search button:hover { background: var(--garnet-2); }
.search-big { padding: 7px; }
.search-big input { font-size: 19px; padding: 14px 22px; }
.search-big button { padding: 12px 28px; font-size: 17px; }
.suggest { position: absolute; inset-inline: 10px; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-2); z-index: 40; text-align: start; color: var(--text); }
.suggest li a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.suggest li a b { font-family: var(--f-disp); font-size: 20px; color: var(--ink); }
.suggest li a small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; align-self: center; }
.suggest li[aria-selected="true"] a, .suggest li a:hover { background: var(--gold-wash); }
.suggest .sg-new a { color: var(--garnet); font-weight: 600; }

/* ---------- alphabet ---------- */
.alpha { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; max-width: 760px; margin: 0 auto; }
.alpha a { display: grid; place-items: center; aspect-ratio: 1; font-family: var(--f-disp); font-size: 22px; font-weight: 700; text-decoration: none; color: #fff; border: 1px solid rgba(233,217,174,.35); border-radius: 8px; background: rgba(255,255,255,.04); transition: background .15s, transform .15s; line-height: 1; }
.alpha a:hover { background: var(--gold); color: var(--ink); transform: translateY(-1px); }
.alpha-compact { max-width: none; margin-bottom: 28px; }
.alpha-compact a { color: var(--ink); border-color: var(--line); background: var(--vellum); font-size: 20px; }
.alpha-compact a[aria-current="page"] { background: var(--garnet); color: #fff; border-color: var(--garnet); }
@media (max-width: 640px) { .alpha { grid-template-columns: repeat(7, 1fr); } }

/* ---------- section titles, ornament ---------- */
.sec-title { font-size: clamp(22px, 3vw, 27px); margin: 0 0 22px; position: relative; padding-bottom: 12px; }
.sec-title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 56px; height: 3px; border-radius: 3px; background: var(--garnet); }
.sec-title.center::after { inset-inline-start: 50%; transform: translateX(50%); }
.sec-title small { font-size: 15px; color: var(--muted); font-weight: 500; }
.boy-t { color: var(--boy); } .girl-t { color: var(--girl); } .uni-t { color: var(--unisex); }
.boy-t::after { background: var(--boy); } .girl-t::after { background: var(--girl); } .uni-t::after { background: var(--unisex); }
.ornament { display: flex; align-items: center; gap: 14px; margin: 46px auto; max-width: 420px; color: var(--gold); }
.ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.ornament svg { width: 22px; height: 22px; fill: var(--gold); }

/* ---------- tools row ---------- */
.home-tools { margin-top: -1px; padding: 30px 0 10px; }
.tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tool { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 14px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); transition: transform .15s, border-color .15s; }
.tool:hover { transform: translateY(-2px); border-color: var(--gold-soft); color: var(--text); }
.tool-ic { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--gold-wash); color: var(--garnet); border: 1px solid var(--gold-soft); }
.tool-ic .ic { width: 26px; height: 26px; }
.tool strong { color: var(--ink); font-size: 16px; }
.tool small { color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 980px) { .tools { grid-template-columns: repeat(2, 1fr); } .tool:last-child { grid-column: 1 / -1; } }

/* ---------- top lists ---------- */
.top-lists { padding: 40px 0 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.list-panel { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 0 0 18px; box-shadow: var(--sh-1); overflow: hidden; text-align: center; }
.list-panel h3 { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 12px; color: #fff; font-size: 18px; }
.list-panel.boy h3 { background: var(--boy); } .list-panel.girl h3 { background: var(--girl); }
.list-panel h3 .gdot { background: #fff; }
.list-panel ol { list-style: none; counter-reset: n; margin: 0 0 16px; padding: 0; text-align: start; }
.list-panel li { counter-increment: n; border-bottom: 1px solid var(--line); }
.list-panel li a { display: grid; grid-template-columns: 34px auto 1fr; align-items: baseline; gap: 10px; padding: 10px 18px; text-decoration: none; color: var(--text); }
.list-panel li a::before { content: counter(n); color: var(--muted); font-size: 14px; text-align: center; }
.list-panel li a b { font-family: var(--f-disp); font-size: 22px; color: var(--ink); }
.list-panel li a small { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-panel li a:hover { background: var(--gold-wash); }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; border-radius: var(--r-pill); padding: 10px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, border-color .15s, color .15s; line-height: 1.4; }
.btn:active { transform: scale(.98); }
.btn-gold { background: var(--gold); color: #fff; } .btn-gold:hover { background: var(--gold-2); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; } .btn-ink:hover { background: var(--garnet); color: #fff; }
.btn-pill { background: transparent; color: var(--ink); border-color: var(--line-2); padding: 7px 18px; font-size: 14px; }
.btn-pill:hover { border-color: var(--garnet); color: var(--garnet); }
.btn-pill .ic { transform: none; }
.btn-ghost { background: rgba(255,255,255,.7); color: var(--ink); border-color: var(--line-2); font-size: 14px; padding: 8px 16px; }
.btn-ghost:hover { border-color: var(--gold); background: #fff; color: var(--garnet); }
.btn-ghost-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-lg { padding: 13px 30px; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--vellum); color: var(--ink); text-decoration: none; font-size: 15px; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--gold); background: var(--gold-wash); color: var(--ink); }
.chip.boy { border-color: #C9D9EE; background: var(--boy-wash); color: var(--boy); }
.chip.girl { border-color: #EFC9D6; background: var(--girl-wash); color: var(--girl); }
.chip.unisex { border-color: #D7D0EA; background: var(--uni-wash); color: var(--unisex); }
.chip-new { border-style: dashed; color: var(--muted); }
.more-hubs { margin-top: 22px; }

/* ---------- category cards ---------- */
.cats { padding: 44px 0 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--sh-1); display: flex; flex-direction: column; }
.cat-img img { aspect-ratio: 3/2; object-fit: cover; width: 100%; transition: transform .3s; }
.cat-img { overflow: hidden; display: block; }
.cat:hover .cat-img img { transform: scale(1.03); }
.cat-b { padding: 14px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.cat-b h3 { font-size: 18px; margin-bottom: 4px; }
.cat-b h3 a { color: var(--ink); text-decoration: none; }
.cat-b p { color: var(--muted); font-size: 14px; margin-bottom: 8px; line-height: 1.7; }
.cat-b ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.cat-b li a { font-family: var(--f-disp); font-size: 19px; text-decoration: none; }
.cat-b li a::before { content: "◆"; color: var(--gold); font-size: 9px; margin-inline-end: 6px; vertical-align: middle; }
.cat-b .btn { margin-top: auto; align-self: flex-start; }
@media (max-width: 980px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } }

/* ---------- name cards grid ---------- */
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ncard { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 14px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); transition: transform .15s, border-color .15s; border-top: 3px solid var(--unisex); }
.ncard.boy { border-top-color: var(--boy); } .ncard.girl { border-top-color: var(--girl); }
.ncard:hover { transform: translateY(-2px); border-color: var(--gold-soft); color: var(--text); }
.ncard-top { display: flex; justify-content: space-between; align-items: center; }
.ncard-name { font-family: var(--f-disp); font-size: 27px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.ncard-latin { font-size: 13px; color: var(--muted); text-align: end; font-weight: 500; letter-spacing: .03em; }
.ncard-meaning { font-size: 14px; line-height: 1.7; color: var(--text); margin: 4px 0 6px; }
.ncard-meta { font-size: 12.5px; color: var(--muted); margin-top: auto; }
.ncard-meta .q { color: var(--gold-2); font-weight: 600; }
.gdot { width: 10px; height: 10px; border-radius: 50%; background: var(--unisex); display: inline-block; flex: none; }
.boy .gdot { background: var(--boy); } .girl .gdot { background: var(--girl); }
.ncard .add-cmp { position: absolute; inset-inline-end: 10px; bottom: 10px; font: inherit; font-size: 12px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--r-pill); padding: 2px 10px; cursor: pointer; color: var(--ink); }
.ncard .add-cmp[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--vellum); border: 1px dashed var(--line-2); border-radius: var(--r-card); }

/* ---------- band header (inner pages) ---------- */
.band { position: relative; background: linear-gradient(180deg, var(--ink), var(--ink-2)); color: #fff; padding: 26px 0 34px; overflow: hidden; }
.band-img { background: linear-gradient(90deg, rgba(27,47,75,.98) 35%, rgba(27,47,75,.78)), var(--band-img) center/cover; }
.band::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px); opacity: .3; }
.band h1 { color: #fff; max-width: 860px; }
.band .kicker { color: var(--gold-soft); }
.band-intro { color: #DCE3EC; max-width: 780px; font-size: 17px; margin: 0; }
.band-count { margin: 14px 0 0; display: inline-flex; gap: 8px; align-items: center; color: var(--gold-soft); font-weight: 600; font-size: 14.5px; }
.letter-glyph { font-family: var(--f-disp); color: var(--gold-soft); font-size: 1.3em; margin-inline-start: 8px; }
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: #B9C4D3; }
.crumbs li + li::before { content: "‹"; margin-inline-end: 6px; color: var(--gold-soft); }
.crumbs a { color: #DCE3EC; text-decoration: none; } .crumbs a:hover { color: #fff; text-decoration: underline; }
.page-body { padding-top: 34px; padding-bottom: 50px; }
.group { margin-bottom: 40px; }
.prose { max-width: 820px; margin: 36px 0; font-size: 17px; }
.prose p { color: var(--text); }
.lead { font-size: 17.5px; max-width: 860px; }
.notice { padding: 14px 18px; border-radius: var(--r-card); background: var(--gold-wash); border: 1px solid var(--gold-soft); max-width: 720px; margin: 18px auto; }
.notice.err { background: var(--girl-wash); border-color: #EFC9D6; color: var(--garnet); }
.more { margin-top: 10px; font-size: 15px; }
.more a { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- name record ---------- */
.record-wrap { padding-top: 22px; padding-bottom: 50px; }
.record-wrap .crumbs ol { color: var(--muted); }
.record-wrap .crumbs a { color: var(--ink-3); }
.record-wrap .crumbs li + li::before { color: var(--gold); }
.record { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--sh-2); overflow: hidden; }
.record-hero { position: relative; text-align: center; padding: 34px 20px 26px; background: radial-gradient(600px 200px at 50% 0, var(--gold-wash), transparent 70%), var(--vellum); border-bottom: 1px solid var(--line); }
.record-hero::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold-soft); border-radius: 10px; pointer-events: none; }
.record-hero.boy { box-shadow: inset 0 4px 0 var(--boy); } .record-hero.girl { box-shadow: inset 0 4px 0 var(--girl); } .record-hero.unisex { box-shadow: inset 0 4px 0 var(--unisex); }
.record-name { font-family: var(--f-disp); font-size: clamp(56px, 11vw, 92px); line-height: 1.55; margin: 0; color: var(--ink); font-weight: 700; }
.record-plain { color: var(--muted); font-size: 16px; margin: 0 0 8px; }
.record-short { font-size: 19px; color: var(--text); max-width: 640px; margin: 0 auto 14px; font-weight: 500; }
.seals { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.gbadge, .obadge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; border: 1px solid var(--line-2); background: #fff; }
.gbadge i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.gbadge.boy { color: var(--boy); background: var(--boy-wash); border-color: #C9D9EE; }
.gbadge.girl { color: var(--girl); background: var(--girl-wash); border-color: #EFC9D6; }
.gbadge.unisex { color: var(--unisex); background: var(--uni-wash); border-color: #D7D0EA; }
.obadge { color: var(--ink); } .obadge.q { color: var(--gold-2); background: var(--gold-wash); border-color: var(--gold-soft); }
.record-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; position: relative; }
.toc { display: flex; gap: 4px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper); scrollbar-width: thin; }
.toc a { flex: none; font-size: 14px; text-decoration: none; color: var(--ink); padding: 5px 12px; border-radius: var(--r-pill); }
.toc a:hover { background: var(--gold-wash); }
.rsec { padding: 26px clamp(18px, 4vw, 44px); border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.rsec:last-of-type { border-bottom: 0; }
.rsec h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(20px, 2.6vw, 24px); margin-bottom: 14px; }
.num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--garnet); color: #fff; font-size: 16px; font-weight: 700; flex: none; box-shadow: 0 0 0 3px var(--vellum), 0 0 0 4px var(--gold-soft); }
.rsec p { max-width: 74ch; font-size: 17px; }
.rsec h3 { font-size: 18px; margin-top: 18px; color: var(--garnet); }
.idlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.idlist > div { padding: 12px 16px; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); background: #fff; }
.idlist > div.wide { grid-column: 1 / -1; }
.idlist dt { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.idlist dd { margin: 0; font-size: 16px; color: var(--ink); line-height: 1.7; }
.idlist dd.disp { font-family: var(--f-disp); font-size: 26px; line-height: 1.5; }
.latin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.latin-row b { font-size: 19px; letter-spacing: .03em; }
.latin-row span { font-size: 14px; padding: 1px 10px; border: 1px solid var(--line-2); border-radius: var(--r-pill); color: var(--muted); }
@media (max-width: 760px) { .idlist { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .idlist { grid-template-columns: 1fr; } }
.myths { display: grid; gap: 14px; }
.myth { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.myth > div { padding: 14px 16px; }
.myth span { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.myth p { margin: 0; font-size: 16px; }
.myth-wrong { background: #FAF3F3; } .myth-wrong span { color: var(--garnet); } .myth-wrong p { color: #6B4A4F; text-decoration: line-through; text-decoration-color: rgba(140,58,70,.35); }
.myth-right { background: #F2F7F3; border-inline-start: 1px solid var(--line); } .myth-right span { color: #2F6B45; }
@media (max-width: 640px) { .myth { grid-template-columns: 1fr; } .myth-right { border-inline-start: 0; border-top: 1px solid var(--line); } }
.qstatus { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line-2); font-weight: 600; font-size: 15px; }
.qstatus.lafz { background: var(--gold-wash); border-color: var(--gold-soft); color: var(--gold-2); }
.verses { display: grid; gap: 12px; margin: 14px 0 16px; }
.verse { margin: 0; background: linear-gradient(180deg, #FFFDF6, var(--gold-wash)); border: 1px solid var(--gold-soft); border-radius: var(--r-card); padding: 18px 20px 12px; position: relative; }
.verse blockquote { margin: 0; font-family: var(--f-quran); font-size: clamp(21px, 2.6vw, 25px); line-height: 2.25; color: #1E2A3A; text-align: center; }
.verse figcaption { text-align: center; margin-top: 6px; }
.surah-badge { display: inline-block; font-size: 13.5px; color: var(--garnet); font-weight: 600; padding: 2px 12px; border: 1px solid var(--gold-soft); border-radius: var(--r-pill); background: #fff; }
.passport { max-width: 520px; background: linear-gradient(135deg, #24406A, #1B2F4B); color: #fff; border-radius: 12px; padding: 16px 18px 12px; margin: 4px 0 20px; font-family: var(--f-body); box-shadow: var(--sh-1); }
.pp-head { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; color: var(--gold-soft); margin-bottom: 10px; }
.pp-rows { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.pp-rows small { display: block; font-size: 10.5px; color: #AFC0D6; letter-spacing: .04em; }
.pp-rows b { font-size: 20px; letter-spacing: .08em; }
.pp-rows span { font-size: 14px; }
.pp-mrz { margin-top: 12px; font-family: "Courier New", monospace; font-size: 13px; letter-spacing: .12em; color: #DCE3EC; overflow: hidden; white-space: nowrap; border-top: 1px dashed rgba(255,255,255,.25); padding-top: 8px; }
@media (max-width: 520px) { .pp-rows { grid-template-columns: 1fr 1fr; } .pp-rows > div:first-child { grid-column: 1 / -1; } }
.regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.regions > div { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; }
.regions h3 { margin-top: 0; font-size: 16px; }
.regions p { font-size: 15px; margin: 0; }
@media (max-width: 860px) { .regions { grid-template-columns: 1fr; } }
.nick { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.nick li { font-family: var(--f-disp); font-size: 22px; padding: 4px 18px; border-radius: var(--r-pill); background: var(--gold-wash); border: 1px solid var(--gold-soft); color: var(--ink); }
.note { font-size: 14px !important; color: var(--muted); }
.sibs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sibs h3 { margin-top: 0; }
.sibs .chip { font-family: var(--f-disp); font-size: 20px; padding: 4px 18px; }
@media (max-width: 640px) { .sibs { grid-template-columns: 1fr; } }
.record-foot { padding: 16px clamp(18px, 4vw, 44px); background: var(--paper); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.record-foot p { margin: 0 0 4px; }
.rev { font-size: 13px; }
.related, .search-again, .hub-links { margin: 40px 0; }
.search-again .search { margin: 0; }

/* ---------- certificate CTA ---------- */
.cert-cta { display: grid; grid-template-columns: 280px 1fr; gap: 0; margin: 40px 0; background: var(--vellum); border: 1px solid var(--gold-soft); border-radius: var(--r-panel); overflow: hidden; box-shadow: var(--sh-1); }
.cert-cta img { width: 100%; height: 100%; object-fit: cover; min-height: 200px; }
.cert-cta > div { padding: 24px 28px; background: radial-gradient(400px 160px at 100% 0, var(--gold-wash), transparent 70%); }
.cert-cta h2 { font-size: clamp(20px, 2.6vw, 25px); }
.cert-cta p { color: var(--muted); }
@media (max-width: 700px) { .cert-cta { grid-template-columns: 1fr; } .cert-cta img { max-height: 200px; } }

/* ---------- FAQ ---------- */
.faq { margin: 40px 0; max-width: 900px; }
.faq details { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--garnet); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq-a { padding: 0 18px 16px; color: var(--text); }

/* ---------- hub, letters, pairs ---------- */
.alpha-big { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.alpha-big a { display: flex; flex-direction: column; align-items: center; padding: 14px 6px 10px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); transition: transform .15s, border-color .15s; }
.alpha-big a:hover { transform: translateY(-2px); border-color: var(--gold-soft); }
.alpha-big b { font-family: var(--f-disp); font-size: 38px; color: var(--garnet); line-height: 1.3; }
.alpha-big span { font-size: 14px; color: var(--ink); }
.alpha-big small { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .alpha-big { grid-template-columns: repeat(4, 1fr); } }
.pager { display: flex; justify-content: space-between; margin-top: 30px; }
.pager a { text-decoration: none; font-weight: 600; }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pair { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); border-inline-start: 4px solid var(--unisex); }
.pair.boy { border-inline-start-color: var(--boy); } .pair.girl { border-inline-start-color: var(--girl); }
.pair-main { font-family: var(--f-disp); font-size: 26px; font-weight: 700; text-decoration: none; color: var(--ink); min-width: 92px; }
.pair .chip { font-size: 14px; padding: 3px 12px; }

/* ---------- comparisons ---------- */
.cmp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cmp-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); transition: transform .15s, border-color .15s; }
.cmp-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); color: var(--text); }
.cmp-names { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cmp-names b { font-family: var(--f-disp); font-size: 26px; color: var(--ink); }
.cmp-names i { font-style: normal; color: var(--gold-2); font-size: 14px; }
.cmp-card strong { font-size: 15px; color: var(--ink-3); }
.cmp-card small { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.cmp-home { padding: 40px 0 10px; }
.cmp-home > p.center { margin-top: 22px; display: flex; }
.cmp-heads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.cmp-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 12px; background: var(--vellum); border: 1px solid var(--line); border-top: 4px solid var(--unisex); border-radius: var(--r-card); text-decoration: none; color: var(--text); box-shadow: var(--sh-1); }
.cmp-head.boy { border-top-color: var(--boy); } .cmp-head.girl { border-top-color: var(--girl); }
.cmp-head .disp { font-family: var(--f-disp); font-size: clamp(30px, 5vw, 44px); font-weight: 700; color: var(--ink); line-height: 1.5; }
.cmp-head small { color: var(--muted); font-size: 14px; line-height: 1.6; }
@media (max-width: 640px) { .cmp-heads { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); background: #fff; margin: 10px 0 24px; }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 15px; }
.cmp-table th, .cmp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; line-height: 1.7; }
.cmp-table thead th { background: var(--ink); color: #fff; font-weight: 600; position: sticky; top: 0; }
.cmp-table thead th a { color: #fff; font-family: var(--f-disp); font-size: 21px; }
.cmp-table tbody th { background: var(--paper); color: var(--garnet); font-weight: 600; width: 150px; }
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: 0; }
.verdict { background: var(--vellum); border: 1px solid var(--gold-soft); border-radius: var(--r-panel); padding: 22px 26px; max-width: none; }
.verdict .sec-title { display: flex; gap: 10px; align-items: center; }

/* ---------- guides ---------- */
.guide .rsec { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 16px; }
.toc-guide { flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 20px; background: var(--vellum); }
.dots { margin: 0 0 1em; padding-inline-start: 1.3em; }
.dots li { margin-bottom: 6px; }
.dots li::marker { color: var(--gold); }
.dots.small { font-size: 14px; color: var(--muted); }

/* ---------- harmony lab ---------- */
.lab-home { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; align-items: center; margin: 46px 0; padding: 30px; background: var(--sage); border-radius: var(--r-panel); border: 1px solid #D5E3D9; }
.lab-intro h2 { font-size: clamp(22px, 3vw, 28px); }
.lab-intro p { color: var(--muted); }
@media (max-width: 860px) { .lab-home { grid-template-columns: 1fr; padding: 20px; } }
.lab-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lab-form .btn { grid-column: 1 / -1; justify-self: start; }
.f { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.f label, .f legend { font-size: 14px; font-weight: 600; color: var(--ink); padding: 0; }
.f small { color: var(--muted); font-weight: 400; }
.f input, .f select, .fletter select { font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s; }
.f input:focus, .f select:focus, .fletter select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.f input[aria-invalid="true"] { border-color: var(--garnet); }
.seg { flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg legend { width: 100%; margin-bottom: 5px; }
.seg label, .fgroup label { position: relative; cursor: pointer; }
.seg input, .fgroup input, .cards-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .fgroup label span { display: inline-block; padding: 8px 18px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: #fff; font-size: 15px; transition: background .15s, border-color .15s, color .15s; }
.seg input:checked + span, .fgroup input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span, .fgroup input:focus-visible + span, .cards-radio input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .lab-form { grid-template-columns: 1fr; } }
.lab { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
.lab-card { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; box-shadow: var(--sh-1); }
.lab-result { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; box-shadow: var(--sh-1); min-height: 320px; }
.lab-empty { display: grid; place-items: center; text-align: center; color: var(--muted); min-height: 270px; }
.lab-empty .ic { width: 46px; height: 46px; color: var(--gold); }
@media (max-width: 900px) { .lab { grid-template-columns: 1fr; } }
.res-top { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.gauge { --p: 0; width: 128px; height: 128px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--gc, var(--gold)) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.gauge::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--vellum); }
.gauge b { position: relative; font-size: 32px; color: var(--ink); line-height: 1; }
.gauge b small { font-size: 16px; }
.res-verdict h3 { margin: 0 0 4px; font-size: 22px; }
.res-verdict p { margin: 0; color: var(--muted); font-size: 15px; }
.res-full { font-family: var(--f-disp); font-size: clamp(28px, 4vw, 38px); text-align: center; color: var(--ink); padding: 12px; margin: 10px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.6; }
.res-issues { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.res-issues li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 15px; line-height: 1.7; }
.res-issues li .ic { margin-top: 5px; }
.res-issues .good { background: #F2F7F3; color: #2F5A3D; }
.res-issues .warn { background: #FBF4E6; color: #6F5420; }
.res-issues .bad { background: #FAF1F2; color: var(--garnet-2); }
.latin-card { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 16px; }
.latin-card h4 { margin: 0; padding: 8px 14px; background: var(--ink); color: #fff; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.latin-card table { width: 100%; border-collapse: collapse; }
.latin-card th, .latin-card td { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 15px; text-align: start; }
.latin-card td { font-weight: 600; letter-spacing: .03em; color: var(--ink); }
.latin-card th { color: var(--muted); font-weight: 500; width: 120px; background: var(--paper); }
.latin-card tr:last-child th, .latin-card tr:last-child td { border-bottom: 0; }
.res-sibs { margin-bottom: 16px; }
.res-sibs h4 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.res-actions .btn { font-size: 14px; padding: 8px 14px; }
.btn-wa { background: #1F7A4D; color: #fff; } .btn-wa:hover { background: #17633E; color: #fff; }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: var(--r-pill); opacity: 0; transition: opacity .2s, transform .2s; z-index: 60; pointer-events: none; font-size: 15px; }
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ---------- finder ---------- */
.finder { display: grid; gap: 14px; background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px; box-shadow: var(--sh-1); margin-bottom: 18px; }
.fgroup { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fgroup legend, .fletter label { font-weight: 700; font-size: 14px; color: var(--garnet); width: 100%; margin-bottom: 4px; }
.fgroup label span { padding: 6px 14px; font-size: 14px; }
.fletter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fletter select { max-width: 260px; }
.finder-count { color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }
.compare-tray { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-pill); margin-top: 18px; box-shadow: var(--sh-2); }
.compare-tray span { font-family: var(--f-disp); font-size: 20px; padding-inline: 8px; }
.compare-out { margin-top: 24px; }

/* ---------- order form ---------- */
.order { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.order-form { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 24px; box-shadow: var(--sh-1); }
.form-h { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 18px 0 12px; }
.form-h:first-of-type { margin-top: 0; }
.form-h .num { width: 28px; height: 28px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.cards-radio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-radio label { position: relative; cursor: pointer; }
.cards-radio span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-card); background: #fff; transition: border-color .15s, box-shadow .15s; }
.cards-radio b { color: var(--ink); font-size: 15px; }
.cards-radio small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.cards-radio input:checked + span { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); background: var(--gold-wash); }
.st-diwani, .st-thuluth, .st-andalusi { font-family: var(--f-disp); font-size: 19px !important; }
@media (max-width: 760px) { .cards-radio, .cards-4 { grid-template-columns: 1fr 1fr; } }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.order-form { position: relative; }
.form-err { color: var(--garnet); background: var(--girl-wash); border: 1px solid #EFC9D6; border-radius: 10px; padding: 10px 14px; }
.order-form .btn-lg { margin-top: 20px; }
.order-preview { position: sticky; top: 90px; }
@media (max-width: 900px) { .order { grid-template-columns: 1fr; } .order-preview { position: static; } }
.mini-cert { background: #FFFDF6; padding: 12px; border-radius: 6px; box-shadow: var(--sh-2); margin-bottom: 14px; }
.order-done { background: var(--vellum); border: 1px solid var(--gold-soft); border-radius: var(--r-panel); padding: 26px; box-shadow: var(--sh-1); max-width: 760px; margin: 0 auto; }
.ref-badge { display: inline-block; font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--garnet); padding: 6px 18px; border: 2px dashed var(--gold); border-radius: 10px; background: var(--gold-wash); direction: ltr; }
.sum { width: 100%; border-collapse: collapse; margin: 16px 0; }
.sum th, .sum td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; font-size: 15px; }
.sum th { color: var(--muted); width: 180px; font-weight: 500; }

/* ---------- certificate (print + preview) ---------- */
.cert-frame { border: 2px solid var(--gold); outline: 1px solid var(--garnet); outline-offset: -8px; padding: 30px 26px; text-align: center; background: radial-gradient(circle at 50% 30%, #FFFDF6, #FBF4E1); position: relative; }
.cert-star svg { width: 30px; height: 30px; fill: var(--gold); margin: 0 auto 6px; display: block; }
.cert-kicker { font-size: 13px; letter-spacing: .14em; color: var(--garnet); font-weight: 700; margin: 0 0 4px; }
.cert-name { font-family: var(--f-disp); font-size: 54px; line-height: 1.5; color: var(--ink); margin: 0; font-weight: 700; }
.cert-full { font-family: var(--f-disp); font-size: 24px; color: var(--ink); margin: 0 0 4px; }
.cert-latin { font-size: 15px; letter-spacing: .14em; color: var(--muted); margin: 0 0 12px; text-transform: uppercase; }
.cert-meaning { font-size: 17px; color: var(--text); max-width: 460px; margin: 0 auto 12px; }
.cert-verse { font-family: var(--f-disp); font-size: 17px; color: var(--garnet); margin: 10px 0 8px; }
.cert-foot { font-size: 11px; color: var(--muted); margin: 10px 0 0; }
.mini-cert .cert-name { font-size: 40px; }
.certificate { display: none; }

/* ---------- generating state ---------- */
.gen { margin: 26px auto; max-width: 640px; }
.gen-card { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 28px; text-align: center; box-shadow: var(--sh-2); }
.quill { width: 260px; height: 40px; margin: 0 auto 10px; display: block; }
.quill path { fill: none; stroke: var(--garnet); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: write 2.4s ease-in-out infinite; }
@keyframes write { 0% { stroke-dashoffset: 420; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.gen-title { font-size: 19px; font-weight: 600; color: var(--ink); }
.gen-steps { list-style: none; padding: 0; margin: 14px 0 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.gen-steps li { font-size: 14px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); color: var(--muted); transition: all .3s; }
.gen-steps li.on { background: var(--gold-wash); border-color: var(--gold-soft); color: var(--ink); font-weight: 600; }
.gen-steps li.done { background: var(--ink); color: #fff; border-color: var(--ink); }
.gen-err { color: var(--garnet); margin-top: 14px; }

/* ---------- trust, recent ---------- */
.trust { text-align: center; margin: 20px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 900px; margin: 0 auto 16px; }
.trust-grid div { background: var(--vellum); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 10px; }
.trust-grid b { display: block; font-family: var(--f-disp); font-size: 34px; color: var(--garnet); line-height: 1.3; }
.trust-grid span { font-size: 14px; color: var(--muted); }
.trust-src { color: var(--muted); font-size: 15px; }
@media (max-width: 640px) { .trust-grid { grid-template-columns: 1fr 1fr; } }
.recent { margin: 40px 0; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #C9D3E0; margin-top: 30px; padding: 44px 0 0; font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; }
.foot h2 { color: var(--gold-soft); font-size: 15px; margin-bottom: 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: 6px; }
.foot a { color: #DCE3EC; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.brand-light { color: #fff; margin-bottom: 12px; }
.brand-light small { color: #AFC0D6; }
.foot-brand p { line-height: 1.8; }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 16px; padding-bottom: 20px; font-size: 13px; color: #9FB0C6; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

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

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .topbar, .foot, .toc, .record-actions, .cert-cta, .search-again, .related, .faq, .ornament, .tools, .hub-links, .compare-tray, .band::after, .skip { display: none !important; }
  body.print-cert main { display: none !important; }
  body.print-cert .certificate { display: flex !important; align-items: center; justify-content: center; min-height: 260mm; }
  body.print-cert .certificate .cert-frame { width: 100%; padding: 30mm 18mm; }
  body.print-cert .certificate .cert-name { font-size: 80px; }
  .record { box-shadow: none; border: 0; }
  .rsec { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

@media (max-width: 700px) {
  .hero { background: radial-gradient(800px 300px at 50% -10%, rgba(176,138,62,.25), transparent 60%), linear-gradient(180deg, rgba(27,47,75,.93), rgba(27,47,75,.97)), url('/img/hero-qalam-sm.webp') center/cover; }
}
