/* Smart Finance - site styles. Apple-style design: system font, glass header, spring motion, light + dark, RTL first.
   No external fonts or libraries (CSP: everything is served from this origin). Motion uses transform/opacity only. */

:root {
  color-scheme: light dark;
  /* brand: a calmer green than before; --brand carries white text (>= 5:1), --brand-strong is for text on light surfaces */
  --brand: #0a7a56; --brand-hi: #0d6e4f; --brand-strong: #07654a; --brand-ink: #fff; --brand-soft: rgba(10, 122, 86, .10); --brand-soft-hi: rgba(10, 122, 86, .17);
  --bg: #f5f5f7; --surface: #fff; --surface-2: #f2f2f5; --tx: #1d1d1f; --tx2: #424245; --mut: #636366;
  --line: rgba(0, 0, 0, .09); --line-strong: rgba(0, 0, 0, .5);
  --warn-bg: #fff4e3; --warn-bd: #f0c58a; --warn-tx: #6e3500; --err: #bf2018; --err-soft: rgba(191, 32, 24, .09); --ok: #0f7a38; --ok-soft: rgba(15, 122, 56, .10);
  --focus: #0a5bd1;
  --glass: rgba(251, 251, 253, .74); --scrim: rgba(0, 0, 0, .34);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .045);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .04), 0 14px 38px rgba(0, 0, 0, .09);
  --r-s: 12px; --r-m: 20px; --r-l: 30px;
  /* springs sampled from a damped oscillator (damping 1.0 = no overshoot; use --spring-bounce only after a flick-like gesture) */
  --spring: cubic-bezier(.2, .9, .25, 1);
  --spring-bounce: cubic-bezier(.2, 1.2, .3, 1);
  --t-spring: .56s; --t-fast: .33s; --t-bounce: .5s;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0237, 0.0815, 0.158, 0.2428, 0.3291, 0.4125, 0.4904, 0.5615, 0.6252, 0.6814, 0.7306, 0.7731, 0.8097, 0.8409, 0.8674, 0.8898, 0.9086, 0.9244, 0.9375, 0.9485, 0.9576, 0.9652, 0.9714, 0.9766, 0.9809, 0.9844, 0.9872, 0.9896, 0.9915, 0.9931, 0.9944, 0.9954, 0.9963, 0.997, 0.9976, 1);
    --spring-bounce: linear(0, 0.0203, 0.0731, 0.1474, 0.2346, 0.3279, 0.4219, 0.513, 0.5982, 0.676, 0.7453, 0.8057, 0.8573, 0.9005, 0.9359, 0.9642, 0.9863, 1.0029, 1.0149, 1.0231, 1.0282, 1.0308, 1.0315, 1.0309, 1.0292, 1.0268, 1.024, 1.0211, 1.0181, 1.0153, 1.0126, 1.0101, 1.008, 1.0061, 1.0044, 1.0031, 1);
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3ecf97; --brand-hi: #5ddcab; --brand-strong: #6fe0b4; --brand-ink: #05281c; --brand-soft: rgba(62, 207, 151, .14); --brand-soft-hi: rgba(62, 207, 151, .22);
    --bg: #000; --surface: #1c1c1e; --surface-2: #2a2a2d; --tx: #f5f5f7; --tx2: #d2d2d7; --mut: #a1a1a6;
    --line: rgba(255, 255, 255, .13); --line-strong: rgba(255, 255, 255, .34);
    --warn-bg: #33250f; --warn-bd: #6b4d1c; --warn-tx: #ffd9a0; --err: #ff7a70; --err-soft: rgba(255, 122, 112, .14); --ok: #55d98a; --ok-soft: rgba(85, 217, 138, .14);
    --focus: #6cb4ff;
    --glass: rgba(28, 28, 30, .72); --scrim: rgba(0, 0, 0, .55);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; accent-color: var(--brand); }
/* no system tap highlight (the blue rectangle Android browsers draw over a tapped link): every control has its own pressed state instead */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, input, select, textarea { touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font: 1.0625rem/1.7 system-ui, -apple-system, "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
::selection { background: var(--brand-soft-hi); }
img, svg { max-width: 100%; }
.hidden { display: none !important; }

/* accessibility basics */
.skip { position: absolute; inset-inline-end: 12px; top: -64px; background: var(--surface); color: var(--tx); padding: 10px 18px; border-radius: 0 0 14px 14px; font-weight: 700; z-index: 30; text-decoration: underline; box-shadow: var(--shadow-2); transition: top .25s var(--spring); }
.skip:focus { top: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 28px); }
body[data-page="/admin"] .wrap { max-width: 1240px; }
/* reading pages (documents, forms): one comfortable column; the header, the home page and the admin area keep the full width */
body:not([data-page="/"]):not([data-page="/admin"]) main.wrap { max-width: 820px; }

/* ---------- header: translucent glass, content scrolls under it ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--line); view-transition-name: site-header; transition: box-shadow .4s var(--spring); }
.top.scrolled { box-shadow: 0 1px 0 var(--line), 0 10px 30px rgba(0, 0, 0, .06); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; padding-block: 10px; }
.brand { color: var(--tx); text-decoration: none; font-weight: 750; font-size: 1.1rem; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 10px; border-radius: 12px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, var(--brand-hi), var(--brand)); color: var(--brand-ink); font-weight: 800; box-shadow: 0 2px 8px rgba(10, 122, 86, .35); transition: transform var(--t-bounce) var(--spring-bounce); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); }
nav { display: flex; gap: 2px; font-size: .92rem; }
nav a { color: var(--tx2); text-decoration: none; padding: 7px 11px; border-radius: 999px; white-space: nowrap; font-weight: 500; transition: background-color .25s ease, color .25s ease, transform var(--t-fast) var(--spring); }
nav a:hover { background: var(--brand-soft); color: var(--tx); }
nav a:active { transform: scale(.95); transition-duration: .08s; }
nav a[aria-current=page] { background: var(--brand-soft-hi); color: var(--brand-strong); font-weight: 700; }
@media (max-width: 860px) {
  nav { order: 3; flex: 1 0 100%; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 4vw, 28px)); padding-inline: clamp(16px, 4vw, 28px); padding-bottom: 4px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
  nav::-webkit-scrollbar { display: none; }
  nav a { scroll-snap-align: center; padding: 9px 14px; }
}

/* ---------- typography ---------- */
main { padding-block: clamp(24px, 5vw, 44px) 56px; }
h1, h2, h3 { text-wrap: balance; color: var(--tx); }
h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.1rem); line-height: 1.1; letter-spacing: -.028em; font-weight: 760; margin: .15em 0 .45em; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); line-height: 1.25; letter-spacing: -.016em; font-weight: 700; margin: 2.1em 0 .5em; scroll-margin-top: 92px; }
h3 { font-size: 1.12rem; line-height: 1.35; letter-spacing: -.008em; font-weight: 680; margin: 1.4em 0 .35em; }
p, li { color: var(--tx); text-wrap: pretty; }
body[data-page="/"] main > :is(p, ul, ol, h2, h3) { max-width: 70ch; }
li { margin-block: .25em; }
.mut { color: var(--mut); font-size: .93rem; }
.lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.55; color: var(--tx2); letter-spacing: -.004em; }
main a:not(.btn) { color: var(--brand-strong); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-thickness .2s; }
main a:not(.btn):hover { text-decoration-thickness: 2px; }
code { background: var(--surface-2); padding: 2px 7px; border-radius: 7px; direction: ltr; unicode-bidi: embed; font-size: .9em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-s); direction: ltr; text-align: left; overflow: auto; font-size: .85rem; margin: .6em 0 0; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px 22px; box-shadow: var(--shadow-1); }
.card h3, .card h2 { margin: 1.5em 0 .5em; font-size: 1.1rem; letter-spacing: -.008em; }
.card > :first-child, .card h3:first-child, .card h2:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 20px 0; }
.grid > .card { transition: transform var(--t-spring) var(--spring), box-shadow var(--t-spring) var(--spring); }
@media (hover: hover) { .grid > .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); } }
.ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px; }
.ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(40px, 7vw, 84px) clamp(20px, 6vw, 64px); text-align: center; box-shadow: var(--shadow-2); }
.hero::before { content: ""; position: absolute; inset: -30% -15% auto; height: 100%; z-index: -1; background: radial-gradient(55% 60% at 50% 20%, rgba(10, 122, 86, .22), transparent 72%); }
@media (prefers-color-scheme: dark) { .hero::before { background: radial-gradient(55% 60% at 50% 20%, rgba(62, 207, 151, .2), transparent 72%); } }
.hero h1 { font-size: clamp(2.5rem, 1.4rem + 5.4vw, 4.4rem); letter-spacing: -.034em; line-height: 1.04; margin-bottom: .3em; }
.hero p { max-width: 640px; margin-inline: auto; }
.hero .notice { max-width: 640px; margin: 1.6em auto 0; }

.notice { background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-tx); border-radius: 16px; padding: 13px 18px; margin: 16px 0; }
.notice p, .notice li { color: inherit; }

/* ---------- buttons: feedback on press (instant), spring on release ---------- */
.btn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 24px; border: 0; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 650; letter-spacing: -.005em; line-height: 1.2; cursor: pointer; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-spring) var(--spring), background-color .22s ease, box-shadow .3s ease, color .22s ease; }
.btn:hover { background: var(--brand-hi); }
.btn:active { transform: scale(.96); transition-duration: .09s, .09s, .09s, .09s; }
.btn.alt { background: var(--brand-soft); color: var(--brand-strong); }
.btn.alt:hover { background: var(--brand-soft-hi); }
.btn.danger { background: var(--err); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #2b0a07; } }
.btn.danger:hover { filter: brightness(1.08); background: var(--err); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
p > .btn + .btn, p > .btn + button { margin-inline-start: 8px; }
.hero .btn { min-height: 52px; padding-inline: 30px; font-size: 1.05rem; }

/* ---------- forms ---------- */
form.f label { display: block; margin-top: 16px; font-weight: 620; font-size: .96rem; }
form.f label:first-child { margin-top: 0; }
input:not([type=checkbox]):not([type=radio]), textarea, select { display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 11px 15px; font: inherit; color: var(--tx); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  transition: border-color .2s ease, box-shadow .4s var(--spring), outline-offset .3s var(--spring); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:not([type=checkbox]):not([type=radio]):hover, textarea:hover, select:hover { border-color: var(--mut); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--mut); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
form.f label:has(> input[type=checkbox]), label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.hp { position: absolute; inset-inline-end: -9999px; height: 0; overflow: hidden; }
p[role=status]:not(:empty), p[role=alert]:not(:empty) { padding: 11px 16px; border-radius: 14px; background: var(--surface-2); animation: rise .5s var(--spring) both; }
p.ok:not(:empty) { background: var(--ok-soft); }
p.err:not(:empty) { background: var(--err-soft); }
.ok { color: var(--ok); } .err { color: var(--err); }

/* ---------- tables ---------- */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--shadow-1); margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); color: var(--mut); font-size: .8rem; font-weight: 700; letter-spacing: .02em; position: sticky; top: 0; white-space: nowrap; }
tbody tr { transition: background-color .2s ease; }
tbody tr:hover { background: var(--brand-soft); }
tbody tr:last-child td { border-bottom: 0; }
td .btn { min-height: 36px; padding: 6px 16px; font-size: .9rem; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { display: block; padding: 5px 0; border: 0; }
  table.stack td::before { content: attr(data-label); display: block; font-size: .76rem; font-weight: 700; color: var(--mut); letter-spacing: .02em; }
}

/* ---------- on-page contents (built by ui.js on long documents) ---------- */
.toc { margin: 18px 0 8px; padding: 0; overflow: hidden; }
.toc summary { cursor: pointer; padding: 14px 20px; font-weight: 650; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 9px; height: 9px; border-inline-end: 2px solid var(--mut); border-bottom: 2px solid var(--mut); transform: rotate(45deg); transition: transform var(--t-fast) var(--spring); margin-top: -4px; }
.toc[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.toc ol { margin: 0; padding: 4px 20px 16px; padding-inline-start: 42px; columns: 2 260px; column-gap: 28px; }
.toc li { margin-block: .15em; break-inside: avoid; }

/* ---------- admin: segmented tabs with a sliding indicator, KPI tiles ---------- */
.tabs { position: relative; display: flex; gap: 2px; padding: 4px; margin: 14px 0 24px; background: var(--surface-2); border-radius: 999px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .btn, .tabs .btn.alt { flex: 0 0 auto; position: relative; z-index: 1; min-height: 38px; padding: 6px 16px; font-size: .92rem; font-weight: 620; white-space: nowrap; background: transparent; color: var(--tx2); }
.tabs .btn:hover, .tabs .btn.alt:hover { background: transparent; color: var(--tx); }
.tabs .btn[aria-selected=true] { color: var(--brand-strong); background: var(--surface); box-shadow: var(--shadow-1); }
.tabs.has-ind .btn[aria-selected=true] { background: transparent; box-shadow: none; }
.tabs.has-ind::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--w, 0px); transform: translateX(var(--x, 0px)); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); opacity: var(--ready, 0);
  transition: transform var(--t-spring) var(--spring), width var(--t-spring) var(--spring), opacity .2s; }
.tabs.no-anim::before { transition: none !important; }
.tab:not(.hidden) { animation: rise .5s var(--spring) both; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 6px 0 18px; }
.kpi .card { padding: 18px 20px; color: var(--mut); font-size: .88rem; font-weight: 550; }
.kpi .card b { display: block; font-size: 2.1rem; line-height: 1.1; letter-spacing: -.02em; color: var(--tx); font-variant-numeric: tabular-nums; margin-bottom: 6px; font-weight: 750; }
#login, #verify { max-width: 440px; margin: 28px auto; padding: 26px 26px; }
#who { color: var(--mut); }

/* ---------- dialogs (replace the browser's confirm / prompt) ---------- */
dialog.sf { border: 0; padding: 0; margin: auto; width: min(92vw, 420px); max-height: 88vh; overflow: auto; color: var(--tx); background: var(--surface); border-radius: 26px; box-shadow: 0 30px 90px rgba(0, 0, 0, .38), 0 0 0 1px var(--line);
  opacity: 0; transform: translateY(18px) scale(.95);
  transition: opacity .22s ease, transform var(--t-bounce) var(--spring-bounce), overlay var(--t-bounce) allow-discrete, display var(--t-bounce) allow-discrete; }
dialog.sf[open] { opacity: 1; transform: none; }
@starting-style { dialog.sf[open] { opacity: 0; transform: translateY(18px) scale(.95); } }
dialog.sf::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%); opacity: 0; transition: opacity .3s ease, overlay .3s allow-discrete, display .3s allow-discrete; }
dialog.sf[open]::backdrop { opacity: 1; }
@starting-style { dialog.sf[open]::backdrop { opacity: 0; } }
.sf-body { padding: 26px 26px 6px; }
.sf-body h3 { margin: 0 0 .4em; font-size: 1.25rem; letter-spacing: -.014em; }
.sf-body p { margin: 0; color: var(--tx2); white-space: pre-line; }
.sf-body input { margin-top: 14px !important; }
.sf-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 20px 26px 26px; }
.sf-actions .btn { flex: 1 1 0; }
@media (min-width: 480px) { .sf-actions .btn { flex: 0 0 auto; min-width: 110px; } }

/* ---------- footer ---------- */
.foot { background: var(--surface); border-top: 1px solid var(--line); color: var(--mut); padding-block: 28px; font-size: .9rem; margin-top: 24px; }
.foot p { margin: .4rem 0; color: var(--mut); }
.foot a { color: var(--tx2); text-underline-offset: 3px; }
.foot a:hover { color: var(--brand-strong); }
.foot .foot-id { font-size: .84rem; line-height: 1.75; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.foot-links a { text-decoration: none; padding: 4px 10px; border-radius: 999px; transition: background-color .2s; }
.foot-links a:hover { background: var(--brand-soft); }
.foot-links a:active { background: var(--brand-soft-hi); }
.brand:active { opacity: .72; }
main a:not(.btn):active { opacity: .6; }
.toc summary:active { background: var(--brand-soft); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.hero > *, main > h1 { animation: rise var(--t-spring) var(--spring) both; }
.hero > :nth-child(2) { animation-delay: 60ms; } .hero > :nth-child(3) { animation-delay: 120ms; } .hero > :nth-child(4) { animation-delay: 180ms; }
@supports (animation-timeline: view()) {
  /* below the fold: content eases in as it scrolls into view (CSS only; browsers without it simply show the content) */
  .grid > .card, main > h2 { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .2s ease both vt-out; }
::view-transition-new(root) { animation: var(--t-spring) var(--spring) both vt-in; }
::view-transition-group(site-header) { animation-duration: 0s; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- user preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .14s !important; animation-delay: 0s !important; transition-duration: .14s !important; animation-timeline: auto !important; animation-range: normal !important; scroll-behavior: auto !important; }
  .hero > *, main > h1, .grid > .card, main > h2, .tab:not(.hidden), p[role=status]:not(:empty), p[role=alert]:not(:empty) { animation-name: fade; }
  .btn:active, nav a:active { transform: none; }
  .grid > .card:hover, .brand:hover .logo { transform: none; }
  dialog.sf, dialog.sf[open] { transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: .14s linear both fade; }
  .tabs.has-ind::before { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  dialog.sf::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--scrim); }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .45); --mut: var(--tx2); }
  .card, .tw, dialog.sf, .top { border-color: var(--line-strong); }
  .btn.alt { box-shadow: inset 0 0 0 2px var(--brand-strong); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) { :root { --line: rgba(255, 255, 255, .6); } }
@media (forced-colors: active) {
  .btn, .card, .tw, dialog.sf { border: 1px solid CanvasText; }
  .btn[aria-selected=true] { outline: 2px solid Highlight; }
  .tabs.has-ind::before { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero { border-radius: 24px; }
  .grid { gap: 12px; }
  .btn { min-height: 48px; }
}
@media print {
  .top, .foot, .toc, .skip, .tabs { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; display: block; }
  .card, .tw, .hero { box-shadow: none; border-color: #999; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  main a:not(.btn)::after { content: " (" attr(href) ")"; font-size: .85em; }
}
