/* ff-kit design system. Brands override the tokens in their own brand.css. System fonts only: zero font downloads. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --ink: #16151a;
  --muted: #5d5a66;
  --line: #e3e0d8;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --accent-soft: #ece8ff;
  --good: #137a4b;
  --bad: #b3261e;
  --warn: #8a5a00;
  --focus: #1a73e8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 8px 24px rgb(0 0 0 / 6%);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 720px;
  --wrap-wide: 1120px;
  --space: 1rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e13; --surface: #18171f; --surface-2: #22202b; --ink: #f3f1f8; --muted: #a9a5b5; --line: #2e2c38;
    --accent: #9d8bff; --accent-ink: #0f0e13; --accent-soft: #272143; --good: #4cc38a; --bad: #ff8a80; --warn: #f2c14e; --focus: #8ab4f8;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e13; --surface: #18171f; --surface-2: #22202b; --ink: #f3f1f8; --muted: #a9a5b5; --line: #2e2c38;
  --accent: #9d8bff; --accent-ink: #0f0e13; --accent-soft: #272143; --good: #4cc38a; --bad: #ff8a80; --warn: #f2c14e; --focus: #8ab4f8;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.55 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.wrap-wide { width: 100%; max-width: var(--wrap-wide); margin-inline: auto; padding-inline: 16px; }
.main { flex: 1; padding-block: 1.25rem 3rem; }
main:focus { outline: none; }
.narrow { max-width: 560px; margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, 1rem); }
.stack > * { margin-bottom: 0; }
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lede { font-size: 1.15rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; color: var(--accent); margin-bottom: .5rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { top: 8px; }

/* header / footer */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 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-inner { display: flex; align-items: center; gap: .75rem; min-height: 58px; max-width: var(--wrap-wide); }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; min-height: 44px; margin-right: auto; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 1.05rem; white-space: nowrap; }
.site-nav { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 650; padding: .55rem .6rem; border-radius: 999px; white-space: nowrap; font-size: .95rem; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
@media (max-width: 600px) {
  .site-header { position: static; }
  .site-header-inner { flex-wrap: wrap; gap: 0 .5rem; padding-top: 4px; }
  .brand-name { font-size: 1rem; }
  .site-nav { order: 3; width: 100%; margin: 0 -8px; padding-bottom: 4px; }
  .site-nav a { padding: .45rem .6rem; font-size: .95rem; min-height: 44px; }
}
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); flex: none; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; margin-top: auto; background: var(--surface-2); font-size: .95rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: 1rem; }
.footer-nav a, .footer-nav .linklike { color: var(--muted); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-small { color: var(--muted); font-size: .85rem; margin: 0; }
.cross-promo { margin-bottom: 1.25rem; }
.cross-promo-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.cross-promo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.cross-promo-list a { display: inline-flex; min-height: 40px; align-items: center; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--surface); font-weight: 600; font-size: .9rem; }
.site-banner { background: var(--accent); color: var(--accent-ink); font-weight: 650; padding: .5rem 0; font-size: .95rem; }

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.5rem); box-shadow: var(--shadow); }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.btn { --b: var(--surface); --i: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.25rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--b); color: var(--i); font-weight: 750; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; transition: transform .08s ease, background .15s ease, border-color .15s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { --b: var(--accent); --i: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { --b: transparent; }
.btn-small { min-height: 40px; padding: .4rem .9rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.1rem; padding: .9rem 1.6rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.choice { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 56px; padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; text-align: left; cursor: pointer; font-size: 1.02rem; transition: border-color .15s, background .15s, transform .08s; touch-action: manipulation; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice:active { transform: scale(.99); }
.choice[aria-pressed="true"], .choice.is-picked { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-key { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: .85rem; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 700; text-decoration: none; border: 1px solid var(--line); min-height: 28px; }
a.pill { min-height: 40px; padding-inline: .9rem; }
.pill-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.notice { padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.notice-error { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.notice-success { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.field { display: grid; gap: .35rem; font-weight: 650; }
.field > span { font-size: .92rem; }
.field-inline { display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; font-size: .9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: .65rem .85rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 450; font-size: 1rem; }
.field-inline input, .field-inline select, .cluster input, .cluster select { width: auto; min-height: 40px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid transparent; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem 1rem; }
legend { font-weight: 700; padding: 0 .3rem; }
.counter { font-size: .8rem; color: var(--muted); text-align: right; }

/* result bars */
.bars { display: grid; gap: .6rem; }
.bar { position: relative; border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; min-height: 52px; display: flex; align-items: center; border: 1px solid var(--line); }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: color-mix(in srgb, var(--accent) 22%, transparent); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bar.is-mine .bar-fill, .bar.is-lead .bar-fill { background: color-mix(in srgb, var(--accent) 42%, transparent); }
.bar-label, .bar-value { position: relative; padding: .6rem .9rem; font-weight: 700; }
.bar-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bar-value { font-variant-numeric: tabular-nums; }
.bar.is-mine { border-color: var(--accent); }
.bar-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-left: .4rem; }
@media (prefers-reduced-motion: no-preference) { html.js .bars.is-animating .bar-fill { width: 0; } }

.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .1rem; }
.stat-n { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .85rem; font-weight: 600; }
.big-number { font-size: clamp(3.5rem, 2rem + 9vw, 6.5rem); font-weight: 900; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }

.tile-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.tile { display: block; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-title { font-weight: 750; font-size: 1.05rem; display: block; margin-bottom: .2rem; }
.tile-meta { color: var(--muted); font-size: .85rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2rem 0 .75rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; font-size: .9rem; white-space: nowrap; }

.prose { max-width: 68ch; }
.prose h2 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: .35rem 0; }

.error-page { text-align: center; padding: 3rem 0; }
.error-page .cluster { justify-content: center; }

/* ads: never shown unless an ad is actually requested */
/* Ad layout standard: every format reserves its space (label 24px + creative) so nothing shifts when an ad loads.
   Sites place slots only between sections, below results or in the desktop rail, never inside the core interaction. */
.adslot { --ad-h: 280px; --ad-h-d: 280px; margin: 1.75rem auto; text-align: center; width: 100%; box-sizing: border-box; max-width: 100%; overflow: hidden; min-height: calc(var(--ad-h) + 24px); clear: both; }
.adslot-label { display: block; height: 18px; line-height: 18px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.adslot--horizontal { --ad-h: 100px; --ad-h-d: 90px; }
.adslot--rectangle { --ad-h: 250px; --ad-h-d: 250px; max-width: 336px; }
.adslot--fluid { --ad-h: 200px; --ad-h-d: 200px; }
.adslot--rail { --ad-h: 600px; --ad-h-d: 600px; width: 300px; margin: 0; display: none; }
@media (min-width: 1100px) { .adslot { min-height: calc(var(--ad-h-d) + 24px); } .adslot--rail { display: block; position: sticky; top: 88px; } }
.adslot--preview .adslot-box { display: flex; align-items: center; justify-content: center; min-height: var(--ad-h); border: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: 10px; color: var(--muted); font-size: .8rem; padding: .5rem; background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--muted) 7%, transparent) 10px 20px); }
@media (min-width: 1100px) { .adslot--preview .adslot-box { min-height: var(--ad-h-d); } }
/* Optional page grid with a desktop ad rail: <div class="with-rail"><div>content</div>${ad(ctx,'x-rail',{format:'rail'})}</div> */
.with-rail { display: block; }
@media (min-width: 1100px) { .with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; } }

/* Tip jar */
.tip-prompt { margin: 1.5rem auto; max-width: 560px; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.tip-prompt-text { margin: 0; flex: 1 1 260px; font-size: .95rem; }
.tip-prompt-actions { margin: 0; display: flex; align-items: center; gap: .9rem; }
.tip-prompt-dismiss { color: var(--muted); min-height: 44px; }
.tip-page .tip-block { margin-top: 1.5rem; }
.tip-page .tip-note { color: var(--muted); font-size: .95rem; }
.tip-page .tip-gate, .tip-page .tip-widget { margin-top: 1.5rem; }
.tip-panel { margin-top: 1rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.tip-panel iframe { display: block; width: 100%; height: 640px; border: 0; }

/* share sheet + toast + consent */
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; }
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: min(100%, 520px); max-width: 100%; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -10px 40px rgb(0 0 0 / 25%); }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 20px; } }
dialog.sheet::backdrop { background: rgb(0 0 0 / 45%); }
.sheet-inner { padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); display: grid; gap: 1rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.sheet-grid .btn { flex-direction: column; min-height: 72px; border-radius: 14px; font-size: .85rem; padding: .5rem; }
.toast-region { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: grid; gap: .5rem; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); animation: ff-toast .25s ease; text-align: center; }
@keyframes ff-toast { from { opacity: 0; transform: translateY(8px); } }
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70; max-width: 560px; margin-inline: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: 0 10px 40px rgb(0 0 0 / 25%); display: grid; gap: .75rem; }
.consent p { margin: 0; font-size: .95rem; }
.consent .cluster .btn { flex: 1 1 140px; }

/* admin */
.admin-shell { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .admin-shell { grid-template-columns: 200px 1fr; } }
.admin-nav { display: flex; flex-wrap: wrap; gap: .25rem; align-content: start; }
@media (min-width: 900px) { .admin-nav { flex-direction: column; position: sticky; top: 76px; } }
.admin-nav a { padding: .5rem .75rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 650; min-height: 40px; display: flex; align-items: center; }
.admin-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.admin-body { min-width: 0; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .7rem; color: var(--muted); gap: 4px; }
.spark-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.social-imgs { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }
.social-imgs img { border-radius: 8px; border: 1px solid var(--line); width: auto; max-height: 180px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
/* optional header extras (site.headerCta, site.mobileMenu) */
.header-cta { min-height: 44px; padding: .5rem 1rem; font-size: .9rem; white-space: nowrap; }
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; display: grid; gap: .25rem; padding: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.nav-menu-panel a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; padding: .6rem .7rem; border-radius: 8px; min-height: 44px; display: flex; align-items: center; }
.nav-menu-panel a:not(.btn):hover, .nav-menu-panel a[aria-current="page"] { background: var(--surface-2); }
@media (max-width: 760px) {
  .has-menu .site-nav, .has-menu .header-cta { display: none; }
  .has-menu .nav-menu { display: block; }
  .has-menu .site-header-inner { flex-wrap: nowrap; }
}

@media print { .site-header, .site-footer, .adslot, .tip-prompt, .consent, .share-row { display: none !important; } }

/* theme toggle shows the current theme: sun in light, moon in dark */
.theme-toggle .ti-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ti-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .ti-sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .ti-moon { display: block; } }
/* K-91: kit.js wires the toggle; with scripting off it would do nothing, so it is not shown */
@media (scripting: none) { [data-theme-toggle] { display: none; } }
/* optional header note (site.headerNote / opts.headerNote), wide screens only */
.header-note { margin: 0; font-size: .72rem; line-height: 1.35; color: var(--muted); border-left: 1px solid var(--line, currentColor); padding-left: .9rem; }
@media (max-width: 999px) { .header-note { display: none; } }

/* ---------- CrumbJar family chrome (kit/family.js). Quiet by design: the product keeps its own look. ---------- */
/* CrumbJar top bar: name at the far left, then a traditional dropdown per section. Phones get one Menu button. */
.cj-bar { background: var(--cj-bar-bg, #28251f); color: var(--cj-bar-ink, #f6f2e9); font-size: .875rem; line-height: 1.2; position: relative; z-index: 35; }
.cj-bar-inner { display: flex; align-items: center; gap: .25rem; min-height: 44px; padding: 0 max(1rem, env(safe-area-inset-left)); }
.cj-bar a { color: inherit; }
.cj-logo { font-weight: 800; letter-spacing: .01em; text-decoration: none; padding: .45rem .5rem .45rem 0; margin-right: .5rem; white-space: nowrap; }
.cj-logo:hover { text-decoration: underline; }
.cj-nav { display: flex; align-items: center; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.cj-nav-top { position: relative; }
.cj-nav-link, .cj-dd > summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .7rem; border-radius: 6px; text-decoration: none; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.cj-dd > summary { list-style: none; }
.cj-dd > summary::-webkit-details-marker, .cj-mobile > summary::-webkit-details-marker { display: none; }
.cj-dd > summary::after { content: ""; width: .38em; height: .38em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .8; }
.cj-dd[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.cj-nav-link:hover, .cj-dd > summary:hover, .cj-dd[open] > summary, .cj-mobile > summary:hover, .cj-mobile[open] > summary { background: color-mix(in srgb, currentColor 13%, transparent); }
.cj-nav-top.is-here > .cj-nav-link, .cj-nav-top.is-here > .cj-dd > summary { box-shadow: inset 0 -3px 0 var(--cj-bar-mark, currentColor); border-radius: 6px 6px 0 0; }
.cj-nav-link:focus-visible, .cj-dd > summary:focus-visible, .cj-logo:focus-visible, .cj-mobile > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.cj-dd-panel, .cj-mobile-panel { background: var(--cj-menu-bg, #fff); color: var(--cj-menu-ink, #28251f); border: 1px solid var(--cj-menu-line, #d8d2c4); border-radius: 8px; box-shadow: 0 10px 28px rgb(0 0 0 / .18); }
.cj-dd-panel { position: absolute; left: 0; top: calc(100% + 2px); min-width: 16rem; max-width: 22rem; list-style: none; margin: 0; padding: .35rem; }
.cj-dd-panel a, .cj-nav-list a { display: block; padding: .5rem .65rem; border-radius: 4px; text-decoration: none; min-height: 44px; }
.cj-dd-panel a:hover, .cj-dd-panel a:focus-visible, .cj-nav-list a:hover, .cj-nav-list a:focus-visible, .cj-nav-home:hover, .cj-nav-home:focus-visible { background: var(--cj-menu-hover, #f3efe6); }
.cj-dd-panel a[aria-current], .cj-nav-list a[aria-current] { background: var(--cj-menu-hover, #f3efe6); box-shadow: inset 3px 0 0 var(--accent, #7a4a14); }
.cj-nav-name { display: block; font-weight: 700; }
.cj-nav-desc { display: block; margin-top: .1rem; color: var(--cj-menu-muted, #5c574c); font-size: .8125rem; font-weight: 400; }
.cj-mobile { display: none; margin-left: auto; position: static; }
.cj-mobile > summary { list-style: none; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 .7rem; border-radius: 6px; font-weight: 700; cursor: pointer; }
.cj-burger { position: relative; width: 16px; height: 2px; background: currentColor; border-radius: 1px; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; }
.cj-mobile-panel { position: absolute; left: .5rem; right: .5rem; top: calc(100% + 2px); max-height: min(78vh, 40rem); overflow-y: auto; overscroll-behavior: contain; padding: .4rem; }
.cj-nav-home { display: flex; align-items: center; min-height: 44px; padding: .5rem .65rem; border-radius: 4px; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--cj-menu-line, #e7e1d4); margin-bottom: .25rem; }
.cj-nav-home::after { content: "\2192"; margin-left: .4rem; }
.cj-nav-head { margin: .6rem .65rem .15rem; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cj-menu-muted, #5c574c); }
.cj-nav-list { list-style: none; margin: 0; padding: 0; }
@media (max-width: 719px) {
  .cj-nav { display: none; }
  .cj-mobile { display: block; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.cj-dd-panel, .cj-mobile-panel) { --cj-menu-bg: #1f1d19; --cj-menu-ink: #f1ece2; --cj-menu-line: #3a362f; --cj-menu-hover: #2c2923; --cj-menu-muted: #b5ad9e; } }
:root[data-theme="dark"] :is(.cj-dd-panel, .cj-mobile-panel) { --cj-menu-bg: #1f1d19; --cj-menu-ink: #f1ece2; --cj-menu-line: #3a362f; --cj-menu-hover: #2c2923; --cj-menu-muted: #b5ad9e; }

.brand:has(.cj-endorse) { flex-wrap: wrap; row-gap: 0; }
.brand .cj-endorse { display: block; flex-basis: 100%; order: 9; font: 500 .6875rem/1.1 system-ui, sans-serif; letter-spacing: .02em; opacity: .75; margin-top: .1rem; white-space: nowrap; }
.cj-modes { border-bottom: 1px solid var(--line, #ddd); background: var(--surface, transparent); }
.cj-modes-inner { display: flex; align-items: center; gap: .25rem 1rem; overflow-x: auto; min-height: 44px; scrollbar-width: thin; }
.cj-modes-product { font-weight: 700; margin-right: .25rem; white-space: nowrap; }
.cj-modes a { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: .6rem .15rem; text-decoration: none; color: var(--muted, inherit); border-bottom: 2px solid transparent; }
.cj-modes a[aria-current="page"] { color: var(--ink, inherit); border-bottom-color: var(--accent, currentColor); font-weight: 600; }
.cj-modes a:hover, .cj-modes a:focus-visible { color: var(--ink, inherit); text-decoration: underline; }
.cj-footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; font-size: .875rem; margin: 1rem 0 .5rem; }
.cj-footer-made { font-weight: 700; }
/* Three adaptable templates. Hooks only: products keep their own widths until the visual redesign. */
.tpl-reading { --cj-measure: 44rem; }
.tpl-standard { --cj-measure: 60rem; }
.tpl-wide { --cj-measure: 76rem; }
/* Content with conservative ad rails; rails appear only at 1100px+ and keep their reserved width. */
.cj-layout { display: block; }
.cj-content { min-width: 0; }
.cj-rail { display: none; }
@media (min-width: 1100px) {
  .cj-layout.has-right { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
  .cj-layout.has-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 2rem; align-items: start; }
  .cj-layout.has-left.has-right { grid-template-columns: 300px minmax(0, 1fr) 300px; }
  .cj-rail { display: block; }
}
@media (prefers-reduced-motion: reduce) { .cj-dd > summary::after { transition: none; } }

/* CrumbJar badge (K-33): a small yellow sticky note at the left of every family product's header, one click back to
   the CrumbJar front page. It replaces the full-width CrumbJar top bar. The 44px link area wraps a smaller note. */
.cj-badge { flex: none; display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-right: .15rem; text-decoration: none; }
.cj-badge-note { display: inline-block; font: 800 .8125rem/1 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: -.01em; color: #1d1a22; background: #ffd84d; padding: .42rem .55rem .36rem; transform: rotate(-3deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: transform .15s ease; white-space: nowrap; }
.cj-badge:hover .cj-badge-note, .cj-badge:focus-visible .cj-badge-note { transform: rotate(0) scale(1.05); }
.cj-badge:focus-visible { outline: 3px solid var(--accent, #1d1a22); outline-offset: 2px; border-radius: 4px; }
.cj-badge-short { display: none; }
/* Phones: a compact "CJ" note so the product's own name, theme toggle and menu still fit on one row. */
@media (max-width: 520px) {
  .site-header-inner:has(.cj-badge) { gap: .4rem; }
  .cj-badge { min-width: 44px; margin-right: 0; }
  .cj-badge-full { display: none; }
  .cj-badge-short { display: inline; }
  .cj-badge-note { font-size: .8rem; padding: .38rem .4rem .32rem; }
}
@media (prefers-reduced-motion: reduce) { .cj-badge-note { transition: none; } }

/* K-58: every control that stands alone is at least 44px tall to tap (WCAG 2.5.5). A link-button that can sit inside a
   sentence (.linklike) keeps its line height: its tap area is padded out and the padding taken back with a negative
   margin. Inline links in running text are left as text, as WCAG allows. */
a.pill { min-height: 44px; }
.section-head { align-items: center; }
.section-head a, .cj-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.linklike { display: inline-block; padding-block: 11px; margin-block: -11px; line-height: 22px; }
.footer-nav .linklike { margin-block: 0; padding-block: 0; }
.btn-small, .seg a, .seg button { min-height: 44px; }

/* K-77: the 18+ caution card shown instead of a difficult topic. Links are buttons (48px), stacked on a phone. */
.caution-card { border-left: 4px solid var(--accent, #c58b00); max-width: 40rem; }
.caution-card .caution-title { margin: 0; font-size: 1.15rem; }
.caution-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 480px) { .caution-actions .btn { flex: 1 1 100%; } }
.report-hide { display: inline; }
/* K-77: the one sign-in in every header (44px tap target). */
.header-signin { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .6rem; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.header-signin:hover, .header-signin:focus-visible { text-decoration: underline; }
/* 7 Oct pm (run to 1000): short nav and footer words ("Help", "Terms") were under 44px wide where a section removed the
   side padding; every header and footer link is at least 44 x 44, text centred. */
.site-nav a, .footer-nav a, .footer-nav .linklike, .cj-footer a { min-width: 44px; justify-content: center; }
/* K-83 (auditor walk): the kit's Report button measured 40-41px wide. */
.report-hide button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* 8 Oct 2026 (night audit, Mood walk): "Create one" / "Sign in" under the account forms were 67x19 and 42x19 px. */
.auth-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
