/* ArabTaxCalc. Arabic-first, RTL. Receipt / ledger visual language. */
/* Flag emoji for Windows Chrome/Edge, which ship no country-flag glyphs. Only regional-indicator code points use it. */
@font-face { font-family: 'Twemoji Country Flags'; unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; src: url('/assets/fonts/TwemojiCountryFlags.woff2') format('woff2'); font-display: swap; }
:root {
  --paper: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e5e7eb;
  --line-strong: #d4d8e1;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --brand-soft: #eef2ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  --gold: #b45309;
  --gold-soft: #fef3c7;
  --tax: #dc2626;
  --tax-soft: #fee2e2;
  --social: #2563eb;
  --social-soft: #dbeafe;
  --net: #059669;
  --good-soft: #d1fae5;
  --focus: #6366f1;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --font: 'Twemoji Country Flags', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --display: 'Twemoji Country Flags', 'Readex Pro', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, table, .receipt, input, .stat b { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.35; color: var(--ink); margin: 0 0 0.5em; font-weight: 600; letter-spacing: 0; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 28px; } }
.skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { inset-inline-start: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.logo svg { width: 34px; height: 34px; }
.logo small { display: block; font-family: var(--font); font-weight: 500; font-size: 0.72rem; color: var(--muted); line-height: 1.2; }
.nav { display: none; margin-inline-start: auto; gap: 4px; align-items: center; }
.nav a, .nav summary { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 0.97rem; cursor: pointer; list-style: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav a:hover, .nav summary:hover, .nav details[open] summary { background: var(--surface); color: var(--ink); }
.nav a[aria-current='page'] { color: var(--brand); background: var(--brand-soft); }
.nav details { position: relative; }
.nav summary::after { content: ''; display: inline-block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-3px); margin-inline-start: 8px; opacity: 0.6; }
.menu { position: absolute; inset-inline-start: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-width: 520px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 10px; }
.menu.cols-2 { grid-template-columns: repeat(2, 1fr); min-width: 420px; }
.menu h4 { grid-column: 1 / -1; font-size: 0.78rem; color: var(--muted); font-family: var(--font); font-weight: 600; margin: 8px 8px 4px; }
.menu h4:first-child { margin-top: 0; }
.menu a { padding: 6px 8px; font-size: 0.93rem; display: flex; gap: 8px; align-items: center; }
.menu .all { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; color: var(--brand); font-weight: 600; }
.site-header .header-cta { display: none; }
.burger { margin-inline-start: auto; background: none; border: 1px solid var(--line-strong); color: var(--ink); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.burger svg { width: 22px; height: 22px; }
@media (min-width: 1024px) {
  .nav { display: flex; }
  .burger { display: none; }
  .site-header .header-cta { display: inline-flex; }
}
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(10, 18, 15, 0.45); display: none; }
.drawer[data-open='true'] { display: block; }
.drawer-panel { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(88vw, 380px); background: var(--surface); padding: 18px 18px 40px; overflow-y: auto; box-shadow: var(--shadow); }
.drawer-panel h4 { font-size: 0.8rem; color: var(--muted); margin: 18px 0 6px; font-family: var(--font); }
.drawer-panel a { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; }
.drawer-close { float: inline-end; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none; transition: transform 0.12s ease, background 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--brand) 88%, black); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 0.92rem; border-radius: 10px; }
label { font-weight: 600; font-size: 0.92rem; color: var(--ink-2); display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input[type='text'], input[type='number'], input[type='search'], select {
  width: 100%; min-height: 50px; padding: 10px 14px; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a958f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position: left 14px center; background-size: 12px 8px; background-repeat: no-repeat; padding-inline-end: 14px; padding-inline-start: 38px; cursor: pointer; }
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent); }
.money-input { position: relative; }
.money-input input { font-size: 1.45rem; font-weight: 600; padding-inline-end: 96px; direction: ltr; text-align: right; font-family: var(--display); }
.money-input .cur { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 0.95rem; pointer-events: none; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 0.93rem; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.hint { color: var(--muted); font-size: 0.86rem; margin-top: 6px; line-height: 1.6; }

/* ---------- breadcrumbs, hero ---------- */
.crumbs { font-size: 0.86rem; color: var(--muted); padding-top: 18px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li:not(:last-child)::after { content: '\2039'; margin-inline-start: 8px; opacity: 0.6; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.page-head { padding: 18px 0 8px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 0.82rem; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.86rem; color: var(--muted); margin-top: 6px; }
.meta-line span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- direct answer (AEO) ---------- */
.answer { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0 8px; box-shadow: var(--shadow); }
.answer strong.label { display: block; font-size: 0.8rem; color: var(--brand); margin-bottom: 4px; letter-spacing: 0; }
.answer p { margin: 0; font-size: 1.06rem; }

/* ---------- calculator + receipt ---------- */
.calc-grid { display: grid; gap: 22px; margin: 22px 0 34px; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .panel { padding: 26px; } }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title h2 { font-size: 1.15rem; margin: 0; }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.receipt { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 22px 22px 30px; box-shadow: var(--shadow); }
.receipt::after { content: ''; position: absolute; inset-inline: -1px; bottom: -12px; height: 12px; background: linear-gradient(-45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x, linear-gradient(45deg, transparent 8px, var(--surface) 0) 0 0 / 16px 12px repeat-x; filter: drop-shadow(0 2px 0 var(--line)); }
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1.5px dashed var(--line-strong); padding-bottom: 12px; margin-bottom: 10px; }
.receipt-head b { font-family: var(--display); font-size: 1.05rem; }
.receipt-head span { color: var(--muted); font-size: 0.85rem; }
.rline { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; font-size: 0.98rem; }
.rline .k { color: var(--ink-2); }
.rline .dots { flex: 1; border-bottom: 1.5px dotted var(--line-strong); transform: translateY(-4px); min-width: 20px; }
.rline .v { font-weight: 600; white-space: nowrap; direction: ltr; }
.rline.minus .v { color: var(--tax); }
.rline.social .v { color: var(--social); }
.rline.gross { font-weight: 600; }
.rline.sub { font-size: 0.88rem; color: var(--muted); padding: 2px 0; }
.rnet { border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rnet .label { font-weight: 700; font-family: var(--display); font-size: 1.05rem; }
.rnet .big { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem); color: var(--net); line-height: 1.1; direction: ltr; }
.rnet .big small { font-size: 0.45em; color: var(--muted); font-weight: 500; margin-inline-start: 6px; }
.rnet .per { color: var(--muted); font-size: 0.9rem; }
.splitbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 16px 0 8px; }
.splitbar i { display: block; height: 100%; }
.splitbar .n { background: var(--net); }
.splitbar .t { background: var(--tax); }
.splitbar .s { background: var(--social); }
.splitbar .o { background: var(--gold); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; background: currentColor; vertical-align: -1px; }
.legend .n::before { background: var(--net); }
.legend .t::before { background: var(--tax); }
.legend .s::before { background: var(--social); }
.legend .o::before { background: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat span { display: block; font-size: 0.78rem; color: var(--muted); }
.stat b { font-family: var(--display); font-size: 1.15rem; direction: ltr; display: inline-block; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.notes { font-size: 0.86rem; color: var(--muted); margin-top: 14px; padding-inline-start: 18px; }
.notes li { margin-bottom: 4px; }

/* ---------- multi-country compare (home) ---------- */
.mc-list { display: grid; gap: 12px; margin-top: 14px; }
.mc-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.mc-item .flag { font-size: 1.6rem; line-height: 1; }
.mc-item .name { font-weight: 600; }
.mc-item .sub { font-size: 0.84rem; color: var(--muted); }
.mc-item .val { text-align: end; font-family: var(--display); font-weight: 700; color: var(--net); direction: ltr; }
.mc-item .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mc-item .bar i { display: block; height: 100%; background: var(--net); border-radius: 999px; }
.mc-item button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.2rem; padding: 4px; }

/* ---------- content ---------- */
.section { padding: 34px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.layout { display: grid; gap: 34px; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8em; padding-top: 0.2em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.toc { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-size: 0.92rem; }
.toc b { display: block; margin-bottom: 8px; font-family: var(--display); }
.toc ol { margin: 0; padding-inline-start: 1.1em; }
.toc li { margin-bottom: 6px; line-height: 1.5; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--brand); }
.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; font-size: 0.93rem; }
.aside-card h3 { font-size: 1rem; }
.aside-card ul { list-style: none; padding: 0; margin: 0; }
.aside-card li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.aside-card li:last-child { border-bottom: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 16px 0 6px; padding: 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.fact dt { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-weight: 600; line-height: 1.55; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 14px 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.82rem; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
  th, td { padding: 9px 10px; }
  table { font-size: 0.9rem; }
  .hide-sm { display: none; }
}
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: left; }
td.num { direction: ltr; unicode-bidi: plaintext; }
td .flag { margin-inline-end: 6px; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.caption { font-size: 0.84rem; color: var(--muted); margin-top: 6px; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.pill.zero { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill.high { background: var(--tax-soft); color: var(--tax); border-color: transparent; }
.pill.conf-high { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill.conf-medium { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.pill.conf-low { background: var(--tax-soft); color: var(--tax); border-color: transparent; }

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); transition: border-color 0.15s ease, transform 0.15s ease; }
.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card .t { font-weight: 700; font-family: var(--display); display: flex; align-items: center; gap: 8px; }
.card .d { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-top: 4px; }
.card .k { margin-top: 10px; font-size: 0.86rem; display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.card .k b { color: var(--net); direction: ltr; }
.card.tool { border-top: 3px solid var(--brand); }

.vs-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 18px 0; }
.vs-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.vs-side .flag { font-size: 2.4rem; line-height: 1.2; }
.vs-side b { display: block; font-family: var(--display); font-size: 1.2rem; }
.vs-side span { color: var(--muted); font-size: 0.88rem; }
.vs-badge { font-family: var(--display); font-weight: 700; color: var(--gold); font-size: 1.1rem; }
.winner { color: var(--net); font-weight: 700; }
.delta-pos { color: var(--net); }
.delta-neg { color: var(--tax); }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--brand); flex-shrink: 0; }
.faq details[open] summary::after { content: '\2212'; }
.faq .a { padding: 0 18px 14px; color: var(--ink-2); }
.faq .a p:last-child { margin: 0; }

.sources { font-size: 0.88rem; }
.sources li { margin-bottom: 6px; }
.sources .tag { font-size: 0.75rem; color: var(--muted); }
.trust { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 16px 0; }
.trust div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.trust b { display: block; font-family: var(--display); font-size: 1.4rem; color: var(--brand); }
.trust span { font-size: 0.88rem; color: var(--muted); }
.notice { background: var(--gold-soft); border: 1px solid color-mix(in oklab, var(--gold) 35%, transparent); color: var(--ink); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.92rem; margin: 14px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 0.92rem; font-weight: 500; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- home ---------- */
.home-hero { padding: 26px 0 8px; }
.home-hero h1 { max-width: 20ch; }
.home-hero .lede { margin-bottom: 0; }
.region-block { margin-bottom: 26px; }
.region-block h3 { font-size: 1rem; color: var(--muted); font-family: var(--font); margin-bottom: 10px; }
.cta-band { background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); padding: 26px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.cta-band h2 { color: inherit; margin: 0; }
.cta-band p { margin: 4px 0 0; opacity: 0.85; }
.cta-band .btn { background: var(--brand-ink); color: var(--brand); }

/* ---------- footer ---------- */
.site-footer { margin-top: 50px; border-top: 1px solid var(--line); background: var(--surface-2); padding: 40px 0 26px; font-size: 0.92rem; }
.foot-grid { display: grid; gap: 26px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.foot-grid h3 { font-size: 0.9rem; font-family: var(--font); color: var(--ink); margin-bottom: 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: 6px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--brand); }
.foot-about { grid-column: 1 / -1; }
@media (min-width: 900px) { .foot-about { grid-column: auto; } }
.foot-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; color: var(--muted); font-size: 0.84rem; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .receipt-actions, .toc, .burger { display: none !important; } body { background: #fff; } }

.byline { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); margin: 4px 0 6px; }
.byline a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.byline a:hover { color: var(--brand); }
.byline .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--display); font-size: 0.95rem; flex-shrink: 0; }
.author-card { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.author-card .avatar { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--display); flex-shrink: 0; }

/* ---------- light indigo look + faded grid ---------- */
main { position: relative; isolation: isolate; }
main::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 640px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, rgba(99, 102, 241, 0.07) 1px, transparent 1px), linear-gradient(to bottom, rgba(99, 102, 241, 0.07) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 35%, transparent 100%); mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 35%, transparent 100%); }
.site-header { background: rgba(255, 255, 255, 0.86); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(99, 102, 241, 0.7); border: 0; }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); }
.eyebrow { background: transparent; color: var(--muted); font-family: var(--mono); font-size: 0.78rem; font-weight: 500; padding: 0; letter-spacing: 0.02em; }
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }
.hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.stat-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 0.9rem; color: var(--ink-2); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.stat-pill b { font-family: var(--mono); font-size: 0.8rem; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 2px 9px; }
.panel-label { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); letter-spacing: 0.04em; }
.live-pill { font-family: var(--mono); font-size: 0.74rem; color: #047857; background: #d1fae5; border-radius: 999px; padding: 3px 10px; display: inline-flex; gap: 6px; align-items: center; }
.live-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }
.home-hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); line-height: 1.2; }
.answer { border-inline-start-color: var(--brand); }
.answer strong.label { color: var(--brand); }
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.card.tool { border-top-color: var(--brand); }
.cta-band { background: var(--grad); }
.cta-band .btn { background: #fff; color: var(--brand); }
.logo svg rect { fill: url(#lg); }
/* mega menu, list style with code badges */
.menu.list { min-width: 340px; grid-template-columns: 1fr; gap: 0; padding: 8px; max-height: 70vh; overflow-y: auto; }
.menu.list.two { min-width: 640px; grid-template-columns: 1fr 1fr; gap: 0 6px; }
.menu.list a { display: grid; grid-template-columns: 36px 1fr; gap: 2px 12px; padding: 9px 10px; border-radius: 10px; align-items: center; }
.menu.list a:hover { background: var(--surface-2); }
.menu.list .code { grid-row: span 2; width: 36px; height: 36px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-family: var(--mono); font-size: 0.72rem; font-weight: 600; display: grid; place-items: center; }
.menu.list .nm { font-weight: 600; color: var(--ink); font-size: 0.95rem; line-height: 1.3; }
.menu.list .ds { color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.menu.list h4 { grid-column: 1 / -1; margin: 10px 10px 4px; }

.sitemap-list { columns: 3 260px; gap: 24px; padding: 0; list-style: none; font-size: 0.9rem; }
.sitemap-list li { break-inside: avoid; padding: 3px 0; }

.chart { margin: 16px 0 6px; }
.chart svg { width: 100%; height: auto; direction: ltr; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.84rem; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

.life-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.life-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.life-card .lc-h { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.life-card b { display: block; font-family: var(--display); font-size: 1.45rem; margin: 4px 0; direction: ltr; text-align: right; }
.life-card p { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 8px; line-height: 1.6; }
.life-card .lc-m { font-size: 0.78rem; color: var(--muted); }
.tr { font-weight: 700; font-size: 0.85rem; }
.tr.up { color: var(--net); } .tr.down { color: var(--tax); } .tr.flat { color: var(--muted); }
.momentum { display: flex; flex-direction: column; gap: 4px; border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; border: 1px solid var(--line); background: var(--surface); }
.momentum b { font-family: var(--display); font-size: 1.1rem; }
.momentum.up { border-inline-start: 4px solid var(--net); } .momentum.down { border-inline-start: 4px solid var(--tax); } .momentum.flat { border-inline-start: 4px solid var(--gold); }

.inv input, .inv select { min-height: 40px; font-size: 0.95rem; padding: 6px 10px; }
.inv td { padding: 6px; }
tr.me td { background: var(--brand-soft); font-weight: 600; }
.zstep { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; background: var(--surface); }
.zstep > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
.zstep > summary::-webkit-details-marker { display: none; }
.zstep > summary .code { font-family: var(--mono); font-size: 0.75rem; background: var(--brand-soft); color: var(--brand-ink); border-radius: 6px; padding: 2px 7px; }
.zstep[open] > summary { border-bottom: 1px solid var(--line); }
.zsum { margin-inline-start: auto; font-family: var(--mono); color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.zbody { padding: 6px 14px 12px; }
.zbar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.zbar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.zbadge { font-size: 0.9rem; font-weight: 700; padding: 8px 12px; border-radius: var(--radius-sm); margin: 6px 0 10px; }
.zbadge.ok { background: var(--good-soft); color: var(--net); }
.zbadge.no { background: var(--gold-soft); color: var(--ink-2); }
@media print { .site-header, .site-footer, .crumbs, .panel, .answer, .section, .byline, .receipt-actions { display: none !important; } .calc-grid { display: block; } }
