:root{--kufi:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2280%22%20height%3D%2280%22%20viewBox%3D%220%200%2080%2080%22%3E%3Cpath%20d%3D%22M17%20-19h6v13h-6zM41%20-19h6v13h-6zM65%20-19h6v13h-6zM9%20-11h6v13h-6zM33%20-11h6v13h-6zM49%20-11h6v13h-6zM73%20-11h6v13h-6zM1%20-3h6v13h-6zM25%20-3h6v13h-6zM41%20-3h6v13h-6zM57%20-3h6v13h-6zM9%205h6v13h-6zM33%205h6v13h-6zM49%205h6v13h-6zM73%205h6v13h-6zM17%2013h6v13h-6zM41%2013h6v13h-6zM65%2013h6v13h-6zM1%2021h6v13h-6zM25%2021h6v13h-6zM57%2021h6v13h-6zM9%2029h6v13h-6zM33%2029h6v13h-6zM49%2029h6v13h-6zM73%2029h6v13h-6zM1%2037h6v13h-6zM17%2037h6v13h-6zM41%2037h6v13h-6zM65%2037h6v13h-6zM9%2045h6v13h-6zM33%2045h6v13h-6zM49%2045h6v13h-6zM73%2045h6v13h-6zM1%2053h6v13h-6zM25%2053h6v13h-6zM57%2053h6v13h-6zM17%2061h6v13h-6zM41%2061h6v13h-6zM65%2061h6v13h-6zM9%2069h6v13h-6zM33%2069h6v13h-6zM49%2069h6v13h-6zM73%2069h6v13h-6zM1%2077h6v13h-6zM25%2077h6v13h-6zM41%2077h6v13h-6zM57%2077h6v13h-6z%22%2F%3E%3C%2Fsvg%3E");--arch:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20132%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M0%20132V52C0%2027%2029%2013%2050%200C71%2013%20100%2027%20100%2052V132Z%22%2F%3E%3C%2Fsvg%3E");--ease-out:cubic-bezier(.16, 1, .3, 1);--ease-in-out:cubic-bezier(.65, 0, .35, 1);--bg:#fbf9f3;--surface:#ffffff;--surface-2:#f3eee2;--surface-3:#e8e0cf;--ink:#1c1915;--ink-2:#48423a;--muted:#6e665a;--line:#e4ddcd;--line-strong:#978d78;--accent:#26221b;--accent-strong:#0f0d0a;--accent-soft:#efe9da;--on-accent:#fbf9f3;--gold:#a67c1e;--gold-ink:#6f5210;--gold-soft:#f6ecd0;--gold-btn:#d9aa42;--gold-btn-h:#e4b955;--on-gold:#241803;--good:#1f6b33;--good-soft:#e2efdf;--warn:#8a5a00;--warn-soft:#f9e9c4;--bad:#a8281f;--bad-soft:#f6dfd9;--sand-a:#f8dfad;--sand-b:#f3d598;--brick:#fdebc0;--mist:#fffaf0;--foot-a:#1c1915;--foot-ink:#f5f0e4;--foot-ink-2:#bdb3a0;--scrim:rgba(28, 25, 21, .55);--grain:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.85%22%20numOctaves%3D%223%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url(%23n)%22%20opacity%3D%220.16%22%2F%3E%3C%2Fsvg%3E")}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--bg:#131210;--surface:#1b1a17;--surface-2:#25231f;--surface-3:#322f29;--ink:#f1ece0;--ink-2:#c9c2b3;--muted:#9a9282;--line:#2e2b26;--line-strong:#6e695c;--accent:#efe8d6;--accent-strong:#ffffff;--accent-soft:#2f2c25;--on-accent:#1b1a17;--gold:#d2a646;--gold-ink:#e6c477;--gold-soft:#2b2412;--gold-btn:#dcae45;--gold-btn-h:#e6bb58;--on-gold:#241803;--good:#6fca83;--good-soft:#17301e;--warn:#e6b04a;--warn-soft:#33270d;--bad:#ef7b72;--bad-soft:#3a1916;--sand-a:#f1d7a2;--sand-b:#e6c686;--brick:#f8e3b6;--mist:#f6ecd4;--foot-a:#0c0b0a;--foot-ink:#f1ece0;--foot-ink-2:#9a9282;--scrim:rgba(0, 0, 0, .66);--grain:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.85%22%20numOctaves%3D%223%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url(%23n)%22%20opacity%3D%220.06%22%2F%3E%3C%2Fsvg%3E");color-scheme:dark}}
:root[data-theme="dark"]{--bg:#131210;--surface:#1b1a17;--surface-2:#25231f;--surface-3:#322f29;--ink:#f1ece0;--ink-2:#c9c2b3;--muted:#9a9282;--line:#2e2b26;--line-strong:#6e695c;--accent:#efe8d6;--accent-strong:#ffffff;--accent-soft:#2f2c25;--on-accent:#1b1a17;--gold:#d2a646;--gold-ink:#e6c477;--gold-soft:#2b2412;--gold-btn:#dcae45;--gold-btn-h:#e6bb58;--on-gold:#241803;--good:#6fca83;--good-soft:#17301e;--warn:#e6b04a;--warn-soft:#33270d;--bad:#ef7b72;--bad-soft:#3a1916;--sand-a:#f1d7a2;--sand-b:#e6c686;--brick:#f8e3b6;--mist:#f6ecd4;--foot-a:#0c0b0a;--foot-ink:#f1ece0;--foot-ink-2:#9a9282;--scrim:rgba(0, 0, 0, .66);--grain:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%22180%22%3E%3Cfilter%20id%3D%22n%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.85%22%20numOctaves%3D%223%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url(%23n)%22%20opacity%3D%220.06%22%2F%3E%3C%2Fsvg%3E");color-scheme:dark}
:root[data-theme="light"]{color-scheme:light}
body{background:var(--bg);color:var(--ink)}
/* ---------- base ---------- */
:root {
  direction: rtl;
  --f-display: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
  --f-body: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --r: 3px;
  --wrap: 1040px;
  --tabbar-h: 66px;
  --shadow: 0 10px 28px rgba(28, 25, 21, .12);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grain) var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16.5px; line-height: 1.85; text-rendering: optimizeLegibility; font-feature-settings: "kern", "liga", "calt"; }
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-underline-offset: 3px; }
input, textarea { caret-color: var(--gold-ink); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-weight: 600; line-height: 1.45; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.9rem, 5vw, 2.5rem); line-height: 1.4; }
h2 { font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0 0 1em; padding-inline-start: 1.3em; }
li { margin-bottom: .3em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
h2.h3 { font-family: var(--f-body); font-size: 1.05rem; font-weight: 600; }
.path h2.h3 { font-size: 1.12rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--r); z-index: 200; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }
button { font-family: inherit; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.ic { flex: none; vertical-align: middle; }
.hide-sm { display: none !important; }
@media (min-width: 560px) { .hide-sm { display: inline-flex !important; } }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.4px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { position: relative; isolation: isolate; overflow: hidden; font: inherit; font-size: 1rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--r); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); color: var(--on-accent); }
/* gold: the one key action on a page, with a pressed edge underneath like a stamped seal */
.btn.gold { background: var(--gold-btn); color: var(--on-gold); box-shadow: inset 0 -2px 0 rgba(36, 24, 3, .16); }
.btn.gold:hover { background: var(--gold-btn-h); color: var(--on-gold); }
/* line: ink fills in from the start edge (the right) on hover */
.btn.line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.line::before, .btn.danger-line::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink); transform: scaleX(0); transform-origin: right; }
.btn.line:not([disabled]):hover { color: var(--bg); }
.btn.line:not([disabled]):hover::before, .btn.danger-line:not([disabled]):hover::before { transform: scaleX(1); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.92); color: #fff; }
.btn.danger-line { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger-line::before { background: var(--bad); }
.btn.danger-line:not([disabled]):hover { color: var(--bg); }
.btn.sm { min-height: 38px; padding: 0 15px; font-size: .92rem; gap: 8px; }
.btn.lg { min-height: 56px; padding: 0 28px; font-size: 1.06rem; gap: 12px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 20px; height: 20px; }
.btn.sm .ic { width: 18px; height: 18px; }
.btn .trail { width: 18px; height: 18px; }

/* ---------- header / nav ---------- */
.demobar { background: #2a2310; color: #f3e3b3; font-size: .86rem; line-height: 1.5; }
.demobar .wrap { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding-block: 7px; }
.dm-t { flex: 1 1 260px; }
.dm-t b { color: #f0c25c; }
.dm-sw { display: inline-flex; background: rgba(255,255,255,.1); border-radius: var(--r); padding: 2px; }
.dm-sw button { font: inherit; font-size: .82rem; border: 0; background: transparent; color: #f3e3b3; padding: 3px 12px; border-radius: var(--r); cursor: pointer; }
.dm-sw button.on { background: #f0c25c; color: #2a1c00; font-weight: 600; }
.dm-reset { font: inherit; font-size: .8rem; background: none; border: 0; color: #f3e3b3; text-decoration: underline; cursor: pointer; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: transparent; border-bottom: 1px solid transparent; }
:root[data-scrolled] .top { background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; line-height: 1.1; display: block; }
.brand small { display: block; font-size: .7rem; color: var(--muted); line-height: 1.3; white-space: nowrap; }
.brand b { white-space: nowrap; }
@media (max-width: 520px) { .brand small { display: none; } .brand svg { width: 32px; height: 32px; } .top .wrap { gap: 8px; } }
.tnav { display: none; gap: 2px; margin-inline-start: 10px; }
.tnav a { position: relative; color: var(--ink-2); text-decoration: none; padding: 7px 14px; font-size: .95rem; white-space: nowrap; }
.tnav a:hover { color: var(--ink); }
.tnav a::after { content: ""; position: absolute; inset-inline: 14px; bottom: 1px; height: 2px; background: var(--ink); transform: scaleX(0); }
.tnav a:hover:not(.on)::after { transform: scaleX(1); background: var(--line-strong); }
.tnav a.on { color: var(--ink); font-weight: 600; }
.tnav a.on::after { transform: scaleX(1); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.dotbadge { font-style: normal; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; margin-inline-start: 6px; }
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line); border-radius: var(--r); padding: 3px 10px 3px 6px; cursor: pointer; color: var(--ink); }
.acct-btn:hover { background: var(--surface-2); }
.acct-n { display: none; font-size: .92rem; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 720px) { .acct-n { display: inline; } }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu-h { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.5; }
.menu-h b { display: block; }
.menu-h small { color: var(--muted); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: var(--r); background: none; border: 0; font: inherit; font-size: .95rem; color: var(--ink); text-decoration: none; cursor: pointer; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--ink); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-family: var(--f-display); font-weight: 700; flex: none; }

.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 35; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; color: var(--muted); text-decoration: none; font-size: .72rem; line-height: 1.3; min-height: var(--tabbar-h); justify-content: center; }
.tabbar a.on { color: var(--accent-strong); font-weight: 600; }
.tabbar .tb-ic::after { content: ""; position: absolute; inset-inline: 22%; bottom: -6px; height: 2px; background: var(--gold); transform: scaleX(0); }
.tabbar a.on .tb-ic::after { transform: scaleX(1); }
.tb-ic { position: relative; display: inline-grid; }
.tb-ic .dotbadge { position: absolute; top: -6px; inset-inline-start: 14px; margin: 0; min-width: 17px; height: 17px; font-size: .64rem; }
@media (min-width: 900px) { .tnav { display: flex; } .tabbar { display: none; } }
@media (max-width: 899px) { main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); } }

.foot { position: relative; isolation: isolate; background: var(--foot-a); color: var(--foot-ink); padding-block: 28px 30px; margin-top: 24px; }
/* the poster's brickwork, barely there */
.foot::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--foot-ink); opacity: .045; -webkit-mask: var(--kufi) center top / 80px 80px; mask: var(--kufi) center top / 80px 80px; }
/* after .foot, or its padding-block wins and the last footer line sits under the fixed tab bar */
@media (max-width: 899px) { .foot { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 26px); } }
.foot .fine { font-size: .82rem; color: var(--foot-ink-2); margin: 0 0 8px; line-height: 1.8; }
.foot a { color: var(--foot-ink); }

/* ---------- layout ---------- */
.page { max-width: var(--wrap); margin-inline: auto; padding: 18px 16px 36px; }
@media (min-width: 720px) { .page { padding-inline: 24px; padding-top: 28px; } }
.page.narrow { max-width: 640px; }
.page-head { margin-bottom: 18px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.crumb:hover { color: var(--accent-strong); }
.ph-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.ph-main { min-width: 0; flex: 1 1 260px; }
.ph-sub { color: var(--ink-2); margin: 4px 0 0; font-size: .96rem; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
@media (min-width: 980px) { .cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } .cols .sticky { position: sticky; top: 82px; } }
.cols3 { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "a" "c" "b"; }
.cols3 > * { min-width: 0; }
.cols3 > .a { grid-area: a; } .cols3 > .b { grid-area: b; } .cols3 > .c { grid-area: c; }
.cols3 > .a:empty { display: none; }
/* nothing in the first block: do not leave its row (and half the chat's height) empty above the details */
.cols3:has(> .a:empty) { grid-template-areas: "c" "b"; }
@media (min-width: 980px) { .cols3:has(> .a:empty) { grid-template-areas: "b c"; } }
@media (min-width: 980px) { .cols3 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "a c" "b c"; align-items: start; } .cols3 > .c { position: sticky; top: 82px; } }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack > * { min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.sp { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; min-width: 0; }
.card .att { max-width: 100%; border-radius: var(--r); }
.card > h2, .card > h3 { margin-bottom: 10px; }
.card.flat { background: var(--bg); }
.card.accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card.gold { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.sec-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.sec-t h2 { font-size: 1.4rem; }

/* ---------- badges, notices, empty ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 11px; border-radius: var(--r); font-size: .8rem; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.b-good { background: var(--good-soft); color: var(--good); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.b-gold { background: var(--gold-soft); color: var(--gold-ink); }
.b-mute { background: var(--surface-3); color: var(--ink-2); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: .94rem; line-height: 1.75; border: 1px solid transparent; }
.notice .ic { margin-top: 4px; }
.notice b { display: block; }
.notice > div { min-width: 0; }
.n-info { background: var(--accent-soft); color: var(--ink); }
.n-info .ic { color: var(--accent-strong); }
.n-warn { background: var(--warn-soft); } .n-warn .ic { color: var(--warn); }
.n-good { background: var(--good-soft); } .n-good .ic { color: var(--good); }
.n-bad { background: var(--bad-soft); } .n-bad .ic { color: var(--bad); }
.n-gold { background: var(--gold-soft); } .n-gold .ic { color: var(--gold-ink); }
.empty { text-align: center; padding: 40px 18px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.empty h3, .empty h2.h3 { margin: 10px 0 4px; }
.empty p { color: var(--ink-2); margin: 0 auto 14px; max-width: 34rem; }
.empty-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r); background: var(--gold-soft); color: var(--gold-ink); }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.field > legend { float: none; width: 100%; padding: 0; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: .96rem; margin-bottom: 6px; }
.req { color: var(--bad); margin-inline-start: 3px; }
.hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; line-height: 1.7; }
.err { font-size: .88rem; color: var(--bad); margin: 6px 0 0; font-weight: 500; }
input[type="text"], input[type="tel"], input[type="email"], input[type="url"], input[type="date"], input[type="password"], input[type="number"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; min-height: 46px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); line-height: 1.6; appearance: none; -webkit-appearance: none; }
textarea { min-height: 92px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23889' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-inline-start: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--bad); }
.ltr-in { direction: ltr; text-align: left; }
.ltr-in::placeholder { text-align: left; }
.two { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.opts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.opts.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); line-height: 1.65; font-size: .95rem; min-height: 46px; }
/* a single checkbox sits in a .field, whose label rule is more specific than .opt: keep the box beside its sentence */
.field > label.opt { display: flex; font-weight: 400; font-size: .95rem; margin-bottom: 0; }
.opt:hover { border-color: var(--accent); }
.opt input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 50%; margin: 3px 0 0; flex: none; background: var(--surface); display: grid; place-items: center; }
.opt input[type="checkbox"] { border-radius: var(--r); }
.opt input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .12s; }
.opt input[type="checkbox"]::after { border-radius: 3px; }
.opt input:checked { border-color: var(--accent); }
.opt input:checked::after { transform: scale(1); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.opt:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.opt small { display: block; color: var(--muted); font-size: .82rem; }
.opt b { display: block; font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); border-radius: var(--r); padding: 4px; }
.seg button { font: inherit; font-size: .9rem; border: 0; background: transparent; color: var(--ink-2); padding: 5px 14px; border-radius: var(--r); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg i { font-style: normal; font-size: .72rem; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; }
.filepick { display: inline-flex; }
.picked { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.picked li { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 0; }
.picked img { width: 40px; height: 40px; border-radius: var(--r); object-fit: cover; }
.pk-ic { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--r); }
.pk-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; direction: ltr; text-align: end; }
.stars { display: inline-flex; gap: 2px; color: var(--line-strong); }
.stars .on { color: var(--gold-btn); }
.stars .on svg { fill: currentColor; }
.stars.edit button { background: none; border: 0; padding: 2px; color: var(--line-strong); cursor: pointer; }
.stars.edit button.on { color: var(--gold-btn); }
.stars.edit button.on svg { fill: currentColor; }

.steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 22px; }
.steps li { flex: 1 1 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; font-size: .78rem; color: var(--muted); }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-3); color: var(--ink-2); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 14px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--surface-3); }
.steps li:last-child::after { display: none; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on .dot { background: var(--accent); color: var(--on-accent); }
.steps li.done .dot { background: var(--accent-soft); color: var(--accent-strong); }
.steps li.done::after { background: var(--accent); }
.steps .lbl { line-height: 1.4; }
@media (max-width: 560px) { .steps li:not(.on) .lbl { display: none; } }

/* ---------- lists ---------- */
.list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.list > * { min-width: 0; }
.rc { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
a.rc:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); color: var(--ink); box-shadow: inset -3px 0 0 var(--gold); }
.rc.unread { border-color: var(--accent); }
.rc-ic { width: 46px; height: 46px; border-radius: var(--r); background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; flex: none; }
.rc-main { flex: 1; min-width: 0; line-height: 1.6; }
.rc-main b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.rc-main span { display: block; font-size: .86rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.rc-side small { color: var(--muted); font-size: .76rem; }
/* phones: the badge column squeezed titles, names and refs into ellipses - move it under the text */
@media (max-width: 560px) {
  .rc:has(> .rc-side) { flex-wrap: wrap; row-gap: 8px; }
  .rc-side { flex-basis: 100%; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .rc-ic ~ .rc-side { padding-inline-start: 60px; }
  .rc-main span { white-space: normal; }
  .rc-main .ref { white-space: nowrap; }
}
.dl { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: .94rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tbl table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 480px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: var(--surface-2); font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.tbl tr:last-child td { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .88rem; padding: 3px 13px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- home ---------- */
/* The poster's artwork. Colour as a JPEG, outline as a small alpha mask: a tenth of the weight of one transparent PNG. */
.art { display: block; pointer-events: none; background-repeat: no-repeat; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.art-shrine { aspect-ratio: 1299 / 802; background-image: url(assets/shrine.jpg); background-size: 100% 100%; -webkit-mask-image: url(assets/shrine-mask.png); mask-image: url(assets/shrine-mask.png); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.art-graves { background-image: url(assets/graves.jpg); background-size: cover; background-position: center top; -webkit-mask-image: url(assets/graves-mask.png); mask-image: url(assets/graves-mask.png); -webkit-mask-size: cover; mask-size: cover; -webkit-mask-position: center top; mask-position: center top; }
/* the arched window: the poster in small, cut to the iwan's own arch, a gold hairline standing off it */
.arch-frame { position: relative; }
.arch-win { position: relative; aspect-ratio: 100 / 132; overflow: hidden; background: linear-gradient(180deg, var(--sand-a), var(--sand-b)); -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat; }
.arch-rim { position: absolute; inset: -13px; width: calc(100% + 26px); height: calc(100% + 26px); fill: none; stroke: var(--gold); stroke-width: 1.2px; overflow: visible; }
.arch-bricks { position: absolute; inset: 0; background: var(--brick); opacity: .85; -webkit-mask: var(--kufi) center top / 64px 64px; mask: var(--kufi) center top / 64px 64px; }
.arch-win .art-shrine { position: absolute; width: 176%; inset-inline-start: -38%; bottom: 21%; }
.arch-mist { position: absolute; inset-inline: 0; bottom: 16%; height: 30%; background: linear-gradient(180deg, transparent, var(--mist) 78%); }
.arch-win .art-graves { position: absolute; inset-inline: 0; bottom: 0; height: 31%; }

.hm-hero { padding-block: clamp(26px, 6vw, 84px) clamp(34px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.hm-grid { display: grid; gap: clamp(36px, 6vw, 76px); align-items: center; grid-template-columns: minmax(0, 1fr); }
.hm-over { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: .9rem; color: var(--gold-ink); }
.hm-over::before { content: ""; width: 34px; height: 1px; background: var(--gold); }
.hm-copy h1 { font-size: clamp(2.5rem, 9vw, 4.7rem); line-height: 1.3; }
.hm-copy h1 > span, .hm-copy h1 > em { display: block; }
.hm-copy h1 em { font-style: normal; color: var(--gold-ink); }
.hm-copy .lede { max-width: 35rem; margin: 18px 0 0; font-size: clamp(1.02rem, 2.2vw, 1.18rem); line-height: 2; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hm-copy .cta-row { align-items: center; gap: 12px 24px; margin-top: 26px; }
.hm-link { display: inline-flex; align-items: center; gap: 4px; min-height: 46px; color: var(--ink); font-weight: 600; text-underline-offset: 5px; }
.hm-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(28px, 5vw, 46px) 0 0; padding-top: 18px; position: relative; }
.hm-facts::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--line-strong); transform-origin: right; }
.hm-facts > div { padding-inline-end: 14px; }
.hm-facts > div + div { padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.hm-facts dt { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.45rem, 4.4vw, 2.1rem); line-height: 1.35; }
.hm-facts dd { margin: 2px 0 0; font-size: .86rem; line-height: 1.65; color: var(--muted); }
.hm-arch { margin: 0 auto; width: min(82%, 400px); }
.hm-arch figcaption { margin-top: 26px; text-align: center; font-size: .84rem; color: var(--muted); }
@media (min-width: 920px) { .hm-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } .hm-arch { width: min(100%, 430px); } }

/* sections: generous rhythm, one numbered title per section (counters skip a section that is not there) */
.hm-sec { padding-top: clamp(64px, 10vw, 128px); }
.hm { counter-reset: sec; }
.hm-t { position: relative; display: flex; align-items: baseline; gap: 16px; font-size: clamp(1.85rem, 5vw, 2.75rem); padding-bottom: 14px; margin-bottom: clamp(20px, 3vw, 32px); }
.hm-t::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); content: counter(sec, decimal-leading-zero) / ""; font-family: var(--f-body); font-size: .9rem; font-weight: 600; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
/* transform-origin right = the start edge: the app is right-to-left only */
.hm-t::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: right; }
.hm-sub { margin: -8px 0 20px; max-width: 24rem; color: var(--ink-2); font-size: 1.05rem; }
.hm-note { font-size: .9rem; color: var(--muted); margin: 18px 0 0; }
/* title column beside the content on wide screens; the title stays in view while the content scrolls */
.hm-split { display: grid; gap: 0 64px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) {
  .hm-split { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; }
  .hm-split > .hm-head { position: sticky; top: 96px; }
}

/* 01 three ways in: the family card leads, the other two follow */
.hm-ways { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .hm-ways { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .hm-ways .feat { grid-row: span 2; } }
.feat { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 340px; padding: clamp(26px, 4vw, 44px); background: var(--accent); color: var(--on-accent); border-radius: var(--r); text-decoration: none; }
/* the poster's brickwork, fading out toward the end edge */
.feat::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--on-accent); opacity: .07;
  -webkit-mask-image: var(--kufi), linear-gradient(to left, transparent 30%, #000 90%); mask-image: var(--kufi), linear-gradient(to left, transparent 30%, #000 90%);
  -webkit-mask-size: 80px 80px, 100% 100%; mask-size: 80px 80px, 100% 100%; -webkit-mask-composite: source-in; mask-composite: intersect; }
.feat:hover { color: var(--on-accent); }
.feat-ic { color: var(--gold-btn); margin-bottom: 6px; }
.feat h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 4.6vw, 2.8rem); line-height: 1.35; }
.feat p { max-width: 30rem; margin: 0; font-size: 1.04rem; color: color-mix(in srgb, var(--on-accent) 80%, var(--accent)); }
.feat .btn { margin-top: auto; }
.feat:hover .btn.gold { background: var(--gold-btn-h); }
.alt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-content: center; padding: clamp(20px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.alt:hover { border-color: var(--ink); color: var(--ink); }
.alt-ic { color: var(--gold-ink); padding-top: 6px; }
.alt-tx b { display: block; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.7rem); line-height: 1.45; }
.alt-tx > span { display: block; color: var(--ink-2); font-size: .96rem; }
.alt .go { grid-column: 2; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* 02 how it works: a timeline of arches joined by one line */
.hm-steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(26px, 4vw, 40px); view-timeline-name: --steps; }
.hm-steps::before { content: ""; position: absolute; inset-inline-start: 21px; top: 34px; bottom: 34px; width: 2px; background: var(--line); }
.hm-steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 20px; align-items: start; margin: 0; view-timeline-name: --step; }
.hm-steps .n { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 58px; background: var(--line-strong); -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat; }
.hm-steps .n::before { content: ""; position: absolute; inset: 1.5px; background: var(--bg); -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat; }
.hm-steps .n i { position: relative; padding-top: 12px; font-style: normal; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; line-height: 1; color: var(--gold-ink); }
.hm-steps b { display: block; padding-top: 8px; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.7rem); line-height: 1.45; }
.hm-steps .d { display: block; max-width: 34rem; color: var(--ink-2); font-size: .98rem; }

/* 03 packages: their own band, read from the catalog */
.hm-band { margin-top: clamp(64px, 10vw, 128px); padding-block: clamp(52px, 8vw, 104px); background: var(--surface-2); border-block: 1px solid var(--line); }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.plan { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 28px 24px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.plan::before { content: ""; position: absolute; inset-inline: -1px; top: -1px; height: 3px; background: var(--gold); border-radius: var(--r) var(--r) 0 0; transform-origin: right; }
.plan.sk { min-height: 300px; background: linear-gradient(90deg, var(--surface), var(--surface-3), var(--surface)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
.plan.sk::before { display: none; }
.plan h3 { font-size: 1.02rem; font-weight: 600; color: var(--ink-2); }
.plan-pr { font-family: var(--f-display); font-weight: 700; font-size: clamp(3rem, 7vw, 3.9rem); line-height: 1.15; margin: 6px 0 0; }
.plan-d { color: var(--ink-2); font-size: .95rem; margin: 4px 0 16px; }
.plan ul { list-style: none; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: .92rem; }
.plan li { position: relative; padding-inline-start: 22px; margin-bottom: .35em; color: var(--ink-2); }
.plan li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 11px; height: 6px; border-left: 2.2px solid var(--gold); border-bottom: 2.2px solid var(--gold); transform: rotate(-45deg); }

/* 04 commitments */
.hm-promises { display: grid; gap: 34px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.promise { position: relative; padding-top: 24px; color: var(--gold-ink); }
.promise::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 1px; background: var(--line-strong); transform-origin: right; }
.promise h3 { margin: 12px 0 6px; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.65rem); color: var(--ink); }
.promise p { margin: 0; color: var(--ink-2); font-size: .97rem; }

/* 05 questions: the questions beside their title on wide screens, the tracking box under the title */
.hm-faq { display: grid; gap: 0 64px; grid-template-columns: minmax(0, 1fr); }
.hm-aside { display: contents; }
.hm-faq > .faq { order: 2; }
.hm-track { order: 3; margin-top: 24px; }
.hm-track h3 { font-size: 1.05rem; margin-bottom: 4px; }
.hm-track p { margin-bottom: 12px; }
@media (min-width: 920px) {
  .hm-faq { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; }
  .hm-aside { display: block; position: sticky; top: 96px; }
  .hm-faq > .faq { order: 0; }
}

/* closing: the hero's invitation once more, inside a gold arch */
.hm-close { position: relative; isolation: isolate; overflow: hidden; margin-top: clamp(64px, 10vw, 128px); padding-block: clamp(120px, 15vw, 190px) clamp(76px, 11vw, 144px); text-align: center; background: var(--surface-2); border-top: 1px solid var(--line); }
/* wide enough that the words sit inside its curve; nearly full width on a phone */
.close-arch { --aw: clamp(min(94vw, 440px), 58vw, 680px); position: absolute; z-index: -1; left: 50%; top: clamp(28px, 4vw, 48px); width: var(--aw); height: calc(var(--aw) * 1.32); margin-left: calc(var(--aw) / -2); fill: none; stroke: var(--gold); stroke-width: .24; opacity: .75; overflow: visible; }
.hm-close h2 { max-width: 10.5em; margin-inline: auto; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.4; }
.hm-close p { max-width: 32rem; margin: 14px auto 0; color: var(--ink-2); font-size: 1.05rem; }
.hm-close .cta-row { justify-content: center; align-items: center; gap: 12px 26px; margin-top: 30px; }
/* the band meets the footer: no strip of paper between them */
main:has(.hm-close) + .foot { margin-top: 0; }
@media (max-width: 899px) { .hm-close { margin-bottom: calc(-1 * (var(--tabbar-h) + env(safe-area-inset-bottom, 0px))); } }

/* guest pages: entry cards and the short "how it works" list */
.path { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); height: 100%; }
a.path:hover { border-color: var(--accent); color: var(--ink); }
.path .rc-ic { width: 50px; height: 50px; margin-bottom: 6px; }
.path h3 { font-size: 1.12rem; }
.path p { color: var(--ink-2); font-size: .94rem; margin: 0; }
.path .go { margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--accent-strong); display: inline-flex; align-items: center; gap: 4px; }
.how { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: h; padding: 0; list-style: none; margin: 0; }
.how li { margin: 0; padding: 16px 16px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); position: relative; }
.how li::before { counter-increment: h; content: counter(h); position: absolute; inset-block-start: 14px; inset-inline-end: 16px; font-family: var(--f-display); font-weight: 700; color: var(--muted); }
.how + .notice { margin-top: 12px; }
.how b { display: block; margin-bottom: 4px; }
.how span { color: var(--ink-2); font-size: .92rem; }

/* ---------- auth ---------- */
.authcard { max-width: 460px; margin: 10px auto 0; padding: 26px 24px 22px; border-radius: var(--r); border-color: var(--line-strong); }
.authcard h1 { font-size: 1.6rem; margin-bottom: 4px; }
.authcard .sub { color: var(--ink-2); margin-bottom: 20px; }
.authcard .alt { text-align: center; margin: 14px 0 0; font-size: .94rem; color: var(--ink-2); }
.authcard .auth-method { display: flex; margin: -6px 0 18px; }
.authcard .auth-method button { flex: 1; }
.authcard .captcha { margin-top: 12px; min-height: 65px; }
.quick { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }

/* ---------- grave ---------- */
.gh { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.gh .nm { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 4.6vw, 2.3rem); line-height: 1.4; }
.ref { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--muted); direction: ltr; unicode-bidi: isolate; display: inline-block; }
.cand { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--surface); display: grid; gap: 10px; }
.cand.proposed { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.cand.confirmed { border-color: var(--good); }
.cand.rejected, .cand.withdrawn { opacity: .65; }
.cand .cand-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cand .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.photos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.photos .ph { padding: 0; border: 0; background: var(--surface-2); border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; display: block; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos.lead > .ph:first-child { grid-column: 1 / -1; }
.img-ph { display: block; width: 100%; height: 100%; min-height: 60px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.img-fail { display: grid; place-items: center; width: 100%; height: 100%; min-height: 60px; color: var(--muted); background: var(--surface-2); }
.lightbox { text-align: center; }
.lightbox img { max-width: 100%; max-height: 70vh; border-radius: var(--r); }
.lb-nav { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.clarity { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--bg); margin: 6px 0 4px; }
.clarity .row { flex-wrap: nowrap; gap: 14px; }
.clarity .grade { width: 50px; height: 50px; border-radius: var(--r); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; background: var(--surface-3); color: var(--ink-2); flex: none; direction: ltr; }
.clarity[data-g="A"] .grade { background: var(--good-soft); color: var(--good); }
.clarity[data-g="B"] .grade { background: var(--accent-soft); color: var(--accent-strong); }
.clarity[data-g="C"] .grade { background: var(--warn-soft); color: var(--warn); }
.clarity[data-g="D"] .grade { background: var(--bad-soft); color: var(--bad); }
.clarity .bars { display: flex; gap: 5px; margin-top: 8px; }
.clarity .bars i { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-3); }
.clarity[data-g="A"] .bars i { background: var(--good); }
.clarity[data-g="B"] .bars i:nth-child(-n+3) { background: var(--accent); }
.clarity[data-g="C"] .bars i:nth-child(-n+2) { background: var(--gold); }
.clarity[data-g="D"] .bars i:nth-child(1) { background: var(--bad); }
.clarity .t { font-weight: 600; margin: 0; line-height: 1.55; }
.clarity .sub { font-size: .9rem; color: var(--ink-2); margin: 10px 0 0; }
.clarity ul { margin: 6px 0 0; padding-inline-start: 1.2em; font-size: .9rem; color: var(--ink-2); }
.nav-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; flex-wrap: wrap; }
.nav-row .btn { min-width: 120px; }
.consents { display: grid; gap: 10px; margin: 16px 0 6px; }
.helpbox { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 4px 14px; margin: 0 0 18px; font-size: .9rem; }
.helpbox summary { cursor: pointer; padding: 8px 0; color: var(--accent-strong); font-weight: 600; }
.sum { display: grid; gap: 12px; margin-bottom: 16px; }
.sum section { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--bg); }
.sum h3 { font-size: .98rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* ---------- orders ---------- */
.pkgs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.pk { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: start; font: inherit; color: inherit; }
.pk:hover { border-color: var(--accent); }
.pk.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.pk .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pk .pr { font-family: var(--f-display); font-size: 2rem; font-weight: 700; line-height: 1.2; direction: ltr; text-align: start; }
.pk ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: .9rem; }
.pk li { position: relative; padding-inline-start: 20px; margin-bottom: .3em; color: var(--ink-2); }
.pk li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .62em; width: 11px; height: 6px; border-left: 2.4px solid var(--accent); border-bottom: 2.4px solid var(--accent); transform: rotate(-45deg); }
.pk .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; }
.pk.on .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.units { display: grid; gap: 8px; }
.unit { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.unit.on { border-color: var(--accent); background: var(--accent-soft); }
.unit.off { opacity: .55; }
.unit .u-main { flex: 1; min-width: 0; line-height: 1.5; }
.unit .u-main b { display: block; font-weight: 600; }
.unit .u-main small { color: var(--muted); }
@media (max-width: 440px) { .unit { flex-wrap: wrap; row-gap: 8px; } .unit .u-main { flex: 1 1 100%; } .unit .u-pr { margin-inline-start: auto; } }
.unit .u-pr { font-weight: 700; direction: ltr; white-space: nowrap; }
.unit .u-inc { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: .82rem; font-weight: 600; color: var(--accent-strong); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.qty button { width: 36px; height: 36px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .15s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(-20px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }
.pricebox { position: sticky; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)); z-index: 20; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); margin-top: 18px; }
@media (min-width: 900px) { .pricebox { bottom: 12px; } }
.pricebox .tot { flex: 1; min-width: 0; line-height: 1.4; }
.pricebox .tot small { display: block; color: var(--muted); }
.pricebox .tot b { font-family: var(--f-display); font-size: 1.6rem; direction: ltr; display: inline-block; }
.lines { list-style: none; padding: 0; margin: 0 0 8px; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; margin: 0; border-bottom: 1px dashed var(--line); }
.lines li:last-child { border-bottom: 0; }
.lines .v { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines.total li { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; padding-top: 10px; }
.tokenbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border: 1px dashed var(--gold); border-radius: var(--r); background: var(--gold-soft); }
.tokenbox code { flex: 1 1 240px; min-width: 0; direction: ltr; text-align: start; font-size: .82rem; word-break: break-all; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.chat-log:focus-visible { outline-offset: -3px; }
.chat-log { height: min(58vh, 540px); min-height: 280px; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--bg) 70%, var(--surface)); overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 20rem; padding: 12px; }
.chat-empty p { margin: 8px 0 0; font-size: .92rem; }
.msg { max-width: 84%; padding: 8px 12px 5px; border-radius: var(--r); font-size: .96rem; line-height: 1.7; overflow-wrap: anywhere; position: relative; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg .who { display: block; font-size: .74rem; font-weight: 700; color: var(--accent-strong); margin-bottom: 1px; }
.msg.me { align-self: flex-start; background: var(--accent); color: var(--on-accent); border-start-start-radius: 0; }
.msg.them { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-start-end-radius: 0; }
.msg .meta { display: flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: .72rem; color: var(--muted); margin-top: 2px; direction: ltr; }
.msg.me .meta { color: color-mix(in srgb, var(--on-accent) 92%, transparent); }
.msg .meta .ic.read { color: var(--on-accent); }
.msg .meta .ic.two { margin-inline-start: -8px; }
.msg.pending { opacity: .7; }
.msg.failed { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
.msg.sys { align-self: center; max-width: 94%; display: flex; gap: 8px; align-items: flex-start; text-align: start; background: var(--surface-2); color: var(--ink-2); border-radius: var(--r); padding: 6px 12px; font-size: .86rem; line-height: 1.65; }
.msg.sys .ic { margin-top: 4px; }
.msg .att { display: block; max-width: 240px; width: 100%; border-radius: var(--r); margin-bottom: 4px; }
.msg .photos { grid-template-columns: minmax(0, 220px); margin-bottom: 4px; }
.daysep { text-align: center; margin: 6px 0 2px; }
.daysep span { font-size: .74rem; background: var(--surface-3); color: var(--ink-2); padding: 1px 12px; border-radius: var(--r); }
.composer { border-top: 1px solid var(--line); padding: 8px 10px 10px; background: var(--surface); }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; border-radius: var(--r); padding: 9px 16px; overflow-y: auto; }
.composer .send { width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: var(--r); flex: none; }
.composer .send .ic { transform: scaleX(-1); }
.composer .filepick .btn { min-height: 44px; width: 44px; padding: 0; border-radius: var(--r); }
.composer-file { display: flex; align-items: center; gap: 8px; font-size: .84rem; background: var(--accent-soft); padding: 4px 6px 4px 12px; border-radius: var(--r); margin-bottom: 8px; width: fit-content; max-width: 100%; }
.composer-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }

/* ---------- certificate ---------- */
.cert { max-width: 720px; margin: 0 auto; padding: 34px 28px 28px; border: 3px double var(--gold); border-radius: var(--r); background: var(--surface); text-align: center; position: relative; }
.cert::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--gold); border-radius: var(--r); pointer-events: none; opacity: .5; }
.cert .mk svg { width: 54px; height: 54px; }
.cert .bn { font-family: var(--f-display); font-size: 1rem; color: var(--gold-ink); margin: 4px 0 2px; }
.cert h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 6px 0 14px; }
.cert .for { font-family: var(--f-display); font-size: clamp(1.3rem, 3.6vw, 1.8rem); font-weight: 700; color: var(--accent-strong); margin: 4px 0 10px; line-height: 1.5; }
.cert .what { max-width: 30rem; margin: 0 auto 12px; color: var(--ink-2); }
.cert .meta { display: flex; flex-wrap: wrap; gap: 6px 26px; justify-content: center; font-size: .88rem; color: var(--muted); margin-top: 14px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.cert .fine { font-size: .76rem; color: var(--muted); margin: 14px 0 0; }

/* ---------- overlays ---------- */
.toasts { position: fixed; inset-inline: 0; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; padding-inline: 14px; }
@media (min-width: 900px) { .toasts { bottom: 22px; } }
.toast { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: .94rem; box-shadow: var(--shadow); max-width: 100%; }
.t-bad { background: var(--bad); color: #fff; }
.t-good .ic { color: #7ee2a0; }
.modal-back { position: fixed; inset: 0; z-index: 100; background: var(--scrim); display: grid; place-items: center; padding: 14px; overflow-y: auto; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 28px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: 0 24px 60px rgba(0,0,0,.35); overflow: hidden; }
.modal.wide { width: min(900px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 1.1rem; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--line); background: var(--surface); }

@media print {
  /* paper is always light, whatever theme the screen uses */
  :root { --bg: #fff !important; --surface: #fff !important; --surface-2: #f3f3f3 !important; --ink: #111 !important; --ink-2: #333 !important; --muted: #555 !important; --line: #ccc !important; --line-strong: #999 !important; --accent: #26221b !important; --accent-strong: #0f0d0a !important; --accent-soft: #efe9da !important; --gold: #a67c1e !important; --gold-ink: #6f5210 !important; }
  .top, .tabbar, .foot, .demobar, .no-print, .toasts, .offline { display: none !important; }
  /* a certificate opened in a dialog prints alone */
  body.noscroll #main { display: none !important; }
  body.noscroll .modal-back { position: static; background: none; padding: 0; display: block; overflow: visible; }
  body.noscroll .modal { box-shadow: none; max-height: none; width: auto; overflow: visible; }
  body.noscroll .modal-h, body.noscroll .modal-f { display: none; }
  body.noscroll { overflow: visible; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .cert { border-color: #b47d12; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .btn, .spin, .img-ph, .plan.sk { transition: none; animation: none; } html { scroll-behavior: auto; } }

/* ---------- faq ---------- */
.faq { display: grid; }
.faq details { border-bottom: 1px solid var(--line); padding-inline: 4px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; display: inline-grid; place-items: center; width: 1em; height: 1em; font-size: 1.5rem; font-weight: 400; color: var(--gold-ink); line-height: 1; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); font-size: .96rem; max-width: 46rem; }

.offline { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--warn-soft); color: var(--ink); font-size: .88rem; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.offline .ic { color: var(--warn); }
.announce { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--gold-soft); color: var(--ink); font-size: .92rem; padding: 4px 12px 4px 16px; border-bottom: 1px solid var(--line); line-height: 1.6; }
.announce .ic { color: var(--gold-ink); }
.announce .iconbtn { width: 32px; height: 32px; }

/* ================================================================
   Motion for the «الورق» design: ink on paper.
   Lines draw in from the start edge (the right: the app is right-to-left only, so transform-origin: right),
   words settle a few pixels into place, gold arrives last. Long calm ease-outs (--ease-out), nothing loops:
   this is a service for the bereaved, so the page never fidgets.
   Everything here sits inside prefers-reduced-motion: no-preference. With reduced motion every state change
   still happens, at once. Scroll reveals also need html.motion, which src/lib/motion.js sets only when it can
   observe; without it nothing is ever hidden.
   ================================================================ */

@media (prefers-reduced-motion: no-preference) {

  /* ---------- the shell ---------- */
  .top { transition: background-color .35s ease, border-color .35s ease, -webkit-backdrop-filter .35s ease, backdrop-filter .35s ease; }
  .tnav a { transition: color .2s ease; }
  .tnav a::after { transition: transform .45s var(--ease-out), background-color .2s ease; }
  .tabbar a { transition: color .2s ease; }
  .tabbar .tb-ic::after { transition: transform .45s var(--ease-out); }
  .tabbar a.on .tb-ic { animation: lift .5s var(--ease-out); }
  /* the mark's gold wave is drawn once, when the app opens */
  .brand .mk-wave { animation: stroke 1.4s var(--ease-in-out) .25s backwards; }
  .dotbadge { animation: pop .4s var(--ease-out); }

  /* a page arrives (every route remounts its page) */
  .page { animation: page-in .55s var(--ease-out) backwards; }

  /* ---------- controls ---------- */
  .btn { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .18s var(--ease-out); }
  .btn:active:not([disabled]):not([aria-disabled="true"]) { transform: scale(.975); }
  .iconbtn, .linkbtn, .chip, .seg button, .menu a, .menu button { transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
  input, select, textarea { transition: border-color .2s ease, box-shadow .25s ease; }
  .opt { transition: border-color .2s ease, background-color .2s ease; }
  a.rc { transition: border-color .2s ease, background-color .2s ease, box-shadow .3s var(--ease-out); }
  a.path { transition: border-color .2s ease, transform .4s var(--ease-out); }
  a.path:hover { transform: translateY(-2px); }
  .photos .ph img { transition: transform .6s var(--ease-out); }
  .photos .ph:hover img { transform: scale(1.035); }
  /* arrows lean the way they point: forward is left, back is right */
  .go .ic, .hm-link .ic, .btn .trail { transition: transform .4s var(--ease-out); }
  a:hover .go .ic, a:focus-visible .go .ic, .hm-link:hover .ic, .btn:hover .trail, .feat:hover .trail, .feat:focus-visible .trail { transform: translateX(-4px); }
  /* line buttons ink in from the start edge */
  .btn.line::before, .btn.danger-line::before { transition: transform .45s var(--ease-out); }
  .crumb .ic { transition: transform .4s var(--ease-out); }
  .crumb:hover .ic { transform: translateX(3px); }

  /* progress */
  .steps .dot { transition: background-color .3s ease, color .3s ease; }
  .steps li.on .dot { animation: pop .5s var(--ease-out) .15s backwards; }
  .steps li.done::after { transform-origin: right; animation: draw .8s var(--ease-out) backwards; }

  /* overlays */
  .menu { transform-origin: top left; animation: menu-in .22s var(--ease-out); }
  .modal-back { animation: fade .25s ease-out; }
  .modal { animation: modal-in .4s var(--ease-out); }
  .toast { animation: toast-in .45s var(--ease-out); }
  .msg, .daysep { animation: msg-in .4s var(--ease-out) backwards; }

  /* the theme switch is a cross-fade (src/lib/motion.js softly()) */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; animation-timing-function: var(--ease-in-out); }

  /* ---------- home: the hero writes itself in ---------- */
  .hm-over { animation: settle .7s var(--ease-out) backwards; }
  .hm-over::before { transform-origin: right; animation: draw .9s var(--ease-out) .05s backwards; }
  .hm-copy h1 > span { animation: line-up .95s var(--ease-out) .06s backwards; }
  .hm-copy h1 > em { animation: line-up .95s var(--ease-out) .2s backwards; }
  .hm-copy .lede { animation: settle .9s var(--ease-out) .34s backwards; }
  .hm-copy .cta-row { animation: settle .9s var(--ease-out) .44s backwards; }
  .hm-facts::before { animation: draw 1.1s var(--ease-out) .52s backwards; }
  .hm-facts > div { animation: settle .9s var(--ease-out) backwards; }
  .hm-facts > div:nth-child(1) { animation-delay: .6s; }
  .hm-facts > div:nth-child(2) { animation-delay: .68s; }
  .hm-facts > div:nth-child(3) { animation-delay: .76s; }

  /* the window: the gold rim rises up both sides to the apex, the sand comes up, the shrine rises,
     the valley settles in front of it, the caption last */
  .hm-arch .arch-rim { animation: rim 1.6s var(--ease-in-out) .1s backwards; }
  .arch-win { animation: win-in 1.1s var(--ease-out) .05s backwards; }
  .arch-bricks { animation: fade 1.6s ease .25s backwards; }
  .arch-win .art-shrine { animation: shrine-in 1.6s var(--ease-out) .28s backwards; }
  .arch-mist { animation: fade 1.4s ease .5s backwards; }
  .arch-win .art-graves { animation: graves-in 1.3s var(--ease-out) .45s backwards; }
  .hm-arch figcaption { animation: settle .9s var(--ease-out) .95s backwards; }

  /* ---------- home: sections settle in as they reach the screen ---------- */
  .motion [data-reveal] { transition: opacity .9s var(--ease-out), translate .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  .motion [data-reveal]:not([data-in]) { opacity: 0; translate: 0 22px; }
  /* titles: the number and words settle, then the ink rule draws under them */
  .motion .hm-t::after { transition: transform 1.2s var(--ease-out) .2s; }
  .motion .hm-t:not([data-in])::after { transform: scaleX(0); }
  /* how it works: each step's rule draws in turn */

  /* ---------- home: the features ---------- */
  /* icons are drawn in ink when their card arrives */
  .motion [data-reveal] .ic-draw > * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.5s var(--ease-in-out); transition-delay: calc(var(--i, 0) * 90ms + .3s); }
  .motion [data-in] .ic-draw > * { stroke-dashoffset: 0; }
  /* the ways in lift a little under the pointer (the reveal and the lift share one transition list) */
  .feat, .alt { transition: transform .45s var(--ease-out), border-color .2s ease; }
  .motion .feat[data-reveal], .motion .alt[data-reveal] {
    transition: opacity .9s var(--ease-out), translate .9s var(--ease-out), transform .45s var(--ease-out), border-color .2s ease;
    transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0s, 0s;
  }
  .feat:hover, .alt:hover { transform: translateY(-3px); }
  .feat .btn { transition: background-color .2s ease; }

  /* how it works: the gold line runs down the steps and each arch lights as it is reached.
     Here on arrival; where the browser can, it follows the scroll instead (below). */
  .motion .hm-steps[data-reveal]:not([data-in]) { opacity: 1; translate: none; }
  .motion .hm-steps::after { content: ""; position: absolute; inset-inline-start: 21px; top: 34px; bottom: 34px; width: 2px; background: var(--gold); transform-origin: top; transition: transform 1.8s var(--ease-in-out) .2s; }
  .motion .hm-steps:not([data-in])::after { transform: scaleY(0); }
  .motion .hm-steps .n, .motion .hm-steps .n::before, .motion .hm-steps .n i { transition: background-color .5s ease, color .5s ease; transition-delay: calc(var(--i, 0) * 380ms + .4s); }
  .motion .hm-steps li[data-in] .n { background-color: var(--gold); }
  .motion .hm-steps li[data-in] .n::before { background-color: var(--gold-btn); }
  .motion .hm-steps li[data-in] .n i { color: var(--on-gold); }

  /* packages: the gold top edge draws, then each tick is set down in turn */
  .motion .plan::before { transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms + .25s); }
  .motion .plan:not([data-in])::before { transform: scaleX(0); }
  .motion .plan li::before { transition: transform .5s var(--ease-out), opacity .3s ease; transition-delay: calc(var(--i, 0) * 90ms + var(--k, 0) * 90ms + .5s); }
  .motion .plan:not([data-in]) li::before { transform: rotate(-45deg) scale(0); opacity: 0; }

  /* commitments: each rule draws, its icon is drawn after it */
  .motion .promise::before { transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 120ms + .1s); }
  .motion .promise:not([data-in])::before { transform: scaleX(0); }

  /* closing: the double arch is drawn around the last words, from the start edge over the apex */
  .motion .close-arch[data-reveal]:not([data-in]) { opacity: .75; translate: none; }
  .motion .close-arch path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.6s var(--ease-in-out) .1s; }
  .motion .close-arch path + path { transition-delay: .45s; }
  .motion .close-arch[data-in] path { stroke-dashoffset: 0; }
  .faq summary::after { transition: transform .4s var(--ease-out); }
}

/* the shrine sinks behind the valley as the hero scrolls away, for depth (browsers with scroll-driven animations) */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .arch-win .art-shrine {
      animation-name: shrine-in, sink; animation-duration: 1.6s, auto; animation-timing-function: var(--ease-out), linear;
      animation-delay: .28s, 0s; animation-fill-mode: backwards, both; animation-timeline: auto, scroll(root); animation-range: normal, 0 90vh;
    }
    .arch-win .art-graves {
      animation-name: graves-in, surface; animation-duration: 1.3s, auto; animation-timing-function: var(--ease-out), linear;
      animation-delay: .45s, 0s; animation-fill-mode: backwards, both; animation-timeline: auto, scroll(root); animation-range: normal, 0 90vh;
    }
    /* how it works follows the scroll: the line fills as the steps pass the middle of the screen, each arch lights as its step does */
    .motion .hm-steps::after { transition: none; animation-name: fill-y; animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both;
      /* the fill reaches the point crossing 55% of the screen (offsets measured against the arches, which sit 34px inside the list) */
      animation-timeline: --steps; animation-range: cover calc(45vh + 80px) cover calc(100% - 55vh + 12px); }
    .motion .hm-steps .n, .motion .hm-steps .n::before, .motion .hm-steps .n i { transition: none; animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both;
      animation-timeline: --step; animation-range: cover calc(45vh + 18px) cover calc(45vh + 58px); }
    .motion .hm-steps .n { animation-name: light-outer; }
    .motion .hm-steps .n::before { animation-name: light-inner; }
    .motion .hm-steps .n i { animation-name: light-num; }
    /* on the home page a gold hairline under the header tracks how far down the page you are */
    :root:has(.hm) .top::after {
      content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--gold); transform-origin: right;
      animation-name: progress; animation-duration: auto; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: scroll(root);
    }
  }
}

/* answers open and close smoothly where the browser can size to auto */
@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    details::details-content { block-size: 0; overflow: clip; overflow-clip-margin: 6px; transition: block-size .45s var(--ease-out), content-visibility .45s allow-discrete; }
    details[open]::details-content { block-size: auto; }
  }
}

/* paper never hides anything */
@media print {
  .motion [data-reveal] { opacity: 1 !important; translate: none !important; }
  .hm-t::after, .plan::before, .promise::before { transform: none !important; }
  .plan li::before { transform: rotate(-45deg) !important; opacity: 1 !important; }
  .ic-draw > *, .close-arch path { stroke-dashoffset: 0 !important; }
}

@keyframes page-in { from { opacity: 0; translate: 0 10px; } }
@keyframes settle { from { opacity: 0; translate: 0 14px; } }
/* a line rises out of its own baseline; the clip opens wide at the end so no vowel mark is ever cut */
@keyframes line-up { from { opacity: 0; translate: 0 .35em; clip-path: inset(0 0 100% 0); } to { clip-path: inset(-40% -8% -40% -8%); } }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; scale: .7; } }
@keyframes lift { 40% { translate: 0 -3px; } }
@keyframes stroke { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes rim { from { clip-path: inset(100% -8px -8px -8px); } to { clip-path: inset(-8px); } }
@keyframes win-in { from { opacity: 0; scale: .965; } }
@keyframes shrine-in { from { opacity: 0; translate: 0 9%; } }
@keyframes graves-in { from { opacity: 0; translate: 0 18%; } }
@keyframes sink { to { transform: translateY(12%); } }
@keyframes surface { to { transform: translateY(-4%); } }
@keyframes fill-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes light-outer { from { background-color: var(--line-strong); } to { background-color: var(--gold); } }
@keyframes light-inner { from { background-color: var(--bg); } to { background-color: var(--gold-btn); } }
@keyframes light-num { from { color: var(--gold-ink); } to { color: var(--on-gold); } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes menu-in { from { opacity: 0; translate: 0 -6px; scale: .98; } }
@keyframes modal-in { from { opacity: 0; translate: 0 16px; scale: .98; } }
@keyframes toast-in { from { opacity: 0; translate: 0 14px; } }
@keyframes msg-in { from { opacity: 0; translate: 0 6px; } }

/* ================================================================
   Staff console (src/pages/staff/*). Every class starts with st- so it cannot clash with the customer pages.
   Logical properties only (RTL).
   ================================================================ */

/* ---------- helpers ---------- */
.st-gap { margin: 8px 0 12px; }
.st-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-phone { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.st-chat { scroll-margin-top: 80px; }
.st-jump { display: inline-flex; }
@media (min-width: 980px) { .st-jump { display: none !important; } }
.st-media { display: block; width: 100%; max-width: 440px; border-radius: var(--r); background: #000; }
audio.st-media { background: none; max-width: 360px; }
.st-names { display: flex; flex-wrap: wrap; gap: 6px; }
.st-name { padding: 0 12px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-strong); font-size: .9rem; line-height: 1.8; }
.st-pre + .st-pre { margin-top: 6px; }

/* ---------- toolbar: search + horizontally scrollable tabs ---------- */
.st-toolbar { display: grid; gap: 10px; }
.st-search { position: relative; }
.st-search > .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.st-search input { padding-inline-start: 42px; padding-inline-end: 46px; }
.st-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.st-clear { position: absolute; inset-inline-end: 3px; top: 3px; }
.st-busy { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; }
.st-tabs { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs .seg { flex-wrap: nowrap; }
.st-tabs .seg button { white-space: nowrap; }
@media (min-width: 720px) {
  .st-tabs { margin-inline: 0; padding-inline: 0; overflow: visible; }
  .st-tabs .seg { flex-wrap: wrap; }
}

/* ---------- inbox ---------- */
.st-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .st-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.st-stat { display: flex; flex-direction: column; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); line-height: 1.4; }
.st-stat b { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.st-stat span { font-size: .84rem; color: var(--ink-2); }
.st-stat.hot { border-color: var(--bad); }
.st-stat.hot b { color: var(--bad); }
.st-stat.warm { border-color: var(--gold); }
.st-stat.warm b { color: var(--gold-ink); }
.st-badges { gap: 4px; justify-content: flex-end; }
.st-more { text-align: center; }
.st-count { text-align: center; margin: 0; }

/* ---------- registry hints and search results ---------- */
.st-matches { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.st-match { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); line-height: 1.65; }
.st-match-h { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: center; justify-content: space-between; }
.st-entry-foot { margin-top: 6px; gap: 6px 12px; }
.st-score { display: inline-flex; align-items: center; gap: 8px; }
.st-score b { font-size: .78rem; font-weight: 600; color: var(--ink-2); direction: ltr; min-width: 2.7em; text-align: end; }
.st-track { display: inline-block; width: 72px; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.st-track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* ---------- candidates, notes ---------- */
.st-cnote { margin: 0; padding: 6px 12px; border-radius: var(--r); background: var(--warn-soft); }
.st-notes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.st-notes li { margin: 0; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); }
.st-notes p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.st-note-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.st-details { margin: 4px 0 12px; border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 2px 14px; font-size: .92rem; }
.st-details summary { cursor: pointer; padding: 8px 0; color: var(--accent-strong); font-weight: 600; }
.st-details ul { margin: 2px 0 8px; }

/* ---------- public queue ---------- */
.st-pub { padding: 16px; }
.st-pub-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .st-pub-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.st-pub-guest { padding: 10px 14px; border: 1px dashed var(--gold); border-radius: var(--r); background: var(--gold-soft); min-width: 0; }
.st-pub-guest p { margin: 4px 0 0; overflow-wrap: anywhere; }
.st-pub-name { display: block; font-family: var(--f-display); font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
.st-pub-real { display: grid; gap: 2px; align-content: start; line-height: 1.6; min-width: 0; overflow-wrap: anywhere; }
.st-flags { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 8px 12px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .9rem; }
.st-pub-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-check { margin: 4px 0 0; padding-inline-start: 1.2em; }
.st-check li { margin-bottom: .15em; }

/* ---------- registry ---------- */
.st-code { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; word-break: break-all; overflow-wrap: anywhere; }
.st-raw .hint { overflow-wrap: anywhere; }
.st-raw textarea { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6; min-height: 150px; white-space: pre; overflow-x: auto; }
.st-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-sources li { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.st-src-n { display: grid; min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }

/* ---------- settings ---------- */
.st-prices { display: grid; gap: 12px; margin-top: 10px; }
.st-prow { display: grid; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.st-prow.off { opacity: .78; }
.st-prow-main { grid-column: 1 / -1; line-height: 1.6; min-width: 0; }
.st-prow .field { margin-bottom: 0; }
.st-prow-gap { display: block; }
.st-prow-err { grid-column: 1 / -1; margin: 0; }
.st-act { display: inline-flex; gap: 10px; align-items: center; min-height: 46px; font-size: .92rem; }
@media (min-width: 900px) {
  .st-prow { grid-template-columns: minmax(0, 1.7fr) minmax(0, 8.5rem) minmax(0, 8.5rem) auto auto; }
  .st-prow-main { grid-column: auto; align-self: center; }
}
.st-role { display: block; }
.st-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-members li { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.st-mem-n { flex: 1 1 180px; min-width: 0; display: grid; line-height: 1.5; }
.st-mem-n small { overflow-wrap: anywhere; }
.st-mem-acts { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.st-log { list-style: none; margin: 0; padding: 0; }
.st-log li { margin: 0; padding: 10px 2px; border-bottom: 1px dashed var(--line-strong); line-height: 1.6; }
.st-log li:last-child { border-bottom: 0; }
.st-log-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; align-items: baseline; }
