/* ═══════════════════════════════════════════════════════════════════════
   MiniCalc — design system
   Two themes (dark/light) × two variants (sleek/glassy).
   Class chain: .mc.mc-{dark|light}.mc-{sleek|glassy}.
   Accent is a JS-driven CSS var.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --accent: #5eead4;
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-ui:      "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

.mc-dark {
  --bg:        #08090b;
  --bg-soft:   #0e1014;
  --surface:   #111317;
  --surface-2: #15181e;
  --border:    rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --text:      #f1f1f3;
  --text-soft: rgba(241,241,243,.62);
  --text-mute: rgba(241,241,243,.38);
  --shadow:    0 30px 60px -30px rgba(0,0,0,.7);
  --glass-blur: 0px;
}

.mc-light {
  --bg:        #f5f4f0;
  --bg-soft:   #efeee8;
  --surface:   #ffffff;
  --surface-2: #faf9f5;
  --border:    rgba(10,11,13,.07);
  --border-strong: rgba(10,11,13,.14);
  --text:      #0f1115;
  --text-soft: rgba(15,17,21,.62);
  --text-mute: rgba(15,17,21,.42);
  --shadow:    0 20px 50px -30px rgba(0,0,0,.25);
  --glass-blur: 0px;
}

.mc-glassy.mc-dark {
  --bg:        #04060c;
  --surface:   rgba(22,25,34,.5);
  --surface-2: rgba(28,32,42,.55);
  --border:    rgba(255,255,255,.12);
  --border-strong: rgba(255,255,255,.22);
  --glass-blur: 18px;
}
.mc-glassy.mc-light {
  --bg:        #f4eee6;
  --surface:   rgba(255,255,255,.55);
  --surface-2: rgba(255,255,255,.7);
  --border:    rgba(10,11,13,.1);
  --glass-blur: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mc {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: clip;
}

/* Sleek background — soft radial accent glows */
.mc-sleek.mc-dark::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1200px 800px at 80% -10%, color-mix(in oklab, var(--accent) 20%, transparent), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, color-mix(in oklab, var(--accent) 8%, transparent), transparent 70%);
  opacity: .55;
}
.mc-sleek.mc-light::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1100px 700px at 90% -10%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(800px 600px at -10% 40%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 70%);
  opacity: .8;
}

/* Aurora behind the glassy variant */
.aurora {
  position: fixed; inset: -10%; pointer-events: none; z-index: 0;
  filter: blur(80px) saturate(140%);
  background:
    radial-gradient(40% 40% at 20% 30%, color-mix(in oklab, var(--accent) 90%, transparent), transparent 70%),
    radial-gradient(35% 35% at 80% 20%, #a78bfa, transparent 70%),
    radial-gradient(45% 45% at 70% 80%, #60a5fa, transparent 70%),
    radial-gradient(30% 30% at 30% 80%, #fb7185, transparent 70%);
  opacity: .55;
  animation: aurora 24s ease-in-out infinite alternate;
}
.mc-light .aurora { opacity: .35; }
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -3%, 0) scale(.98); }
}

.feat-section, .cat-section, .foot { position: relative; z-index: 1; }
/* Hero sits above the sections below so the search dropdown (which extends
   downward from the hero) can render over the featured/catalog grids. */
.hero { position: relative; z-index: 5; }
.nav { position: relative; z-index: 30; }
.modal { position: relative; z-index: 100; }

/* ───────── Nav ───────── */
.nav {
  max-width: 1240px; margin: 0 auto;
  padding: 22px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 28px; height: 28px; display: block; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px; letter-spacing: -.01em;
}
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--text-soft); text-decoration: none;
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: color-mix(in oklab, var(--text) 6%, transparent); }
.nav-toggle {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(var(--glass-blur));
}
.nav-toggle svg { width: 16px; height: 16px; }
.nav-toggle:hover { border-color: var(--border-strong); }

/* Style preferences popover (variant + accent) — opens from nav button */
.prefs-wrap { position: relative; display: inline-flex; }
.prefs-pop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 260px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(calc(var(--glass-blur) + 6px));
  z-index: 40;
  animation: popIn .18s cubic-bezier(.2,.7,.3,1);
}
.prefs-section + .prefs-section { margin-top: 14px; }
.prefs-lbl {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-mute); margin-bottom: 8px;
}
.prefs-variants {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 3px;
}
.prefs-variant {
  appearance: none; cursor: pointer;
  background: transparent; border: 0;
  color: var(--text-soft); font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 10px; border-radius: 7px;
  transition: background .15s, color .15s;
}
.prefs-variant:hover { color: var(--text); }
.prefs-variant.on {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.prefs-accents {
  display: flex; gap: 8px;
}
.prefs-swatch {
  appearance: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch);
  transition: transform .15s, border-color .15s;
}
.prefs-swatch:hover { transform: scale(1.1); }
.prefs-swatch.on {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--swatch);
}

/* ───────── Hero ───────── */
.hero {
  max-width: 1100px; margin: 0 auto;
  padding: 50px 32px 30px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px;
  backdrop-filter: blur(var(--glass-blur));
  margin-bottom: 22px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 0%, transparent); }
}

.hero-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.hero-h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  background: linear-gradient(180deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--text)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 560px; margin: 0 auto 32px;
  font-size: 17px; line-height: 1.55; color: var(--text-soft);
  text-wrap: pretty;
}

/* ───────── Search ───────── */
.search {
  position: relative; max-width: 620px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(var(--glass-blur));
  transition: border-color .2s, box-shadow .2s, transform .2s;
  box-shadow: var(--shadow);
  /* The pills below + featured cards further down both use backdrop-filter,
     which creates stacking contexts. Without an explicit z-index here, the
     dropdown (z-index: 10 inside this element) stacks below them by
     document order. Lift the whole search component above siblings. */
  z-index: 20;
}
.search-focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent),
    var(--shadow);
  transform: translateY(-1px);
}
.search-ic { width: 18px; height: 18px; color: var(--text-mute); flex-shrink: 0; }
.search-input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit; font-size: 16px;
  padding: 12px 0;
}
.search-input::placeholder { color: var(--text-mute); }
.search-kbd {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-mute);
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 6px; padding: 4px 7px;
  margin-right: 6px;
}
.search-pop {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(calc(var(--glass-blur) + 6px));
  text-align: left;
  z-index: 10;
  animation: popIn .18s cubic-bezier(.2,.7,.3,1);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  background: transparent; border: 0; color: inherit;
  border-radius: 12px; cursor: pointer; text-align: left;
  font-family: inherit; font-size: inherit;
  transition: background .12s;
}
.search-row-hi { background: color-mix(in oklab, var(--accent) 14%, transparent); }
.search-glyph {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  flex-shrink: 0;
}
.search-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.search-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.search-blurb { font-size: 12.5px; color: var(--text-soft); }
.search-cat {
  font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .08em;
}
.search-empty {
  padding: 22px 16px; text-align: center; color: var(--text-soft); font-size: 14px;
}

/* Category-tone glyph chips */
[data-tone="Finance"]    { background: color-mix(in oklab, #5eead4 24%, var(--surface-2)); color: #5eead4; }
[data-tone="Health"]     { background: color-mix(in oklab, #fb7185 22%, var(--surface-2)); color: #fb7185; }
[data-tone="Math"]       { background: color-mix(in oklab, #a78bfa 24%, var(--surface-2)); color: #a78bfa; }
[data-tone="Everyday"]   { background: color-mix(in oklab, #fbbf24 24%, var(--surface-2)); color: #fbbf24; }
[data-tone="Conversion"] { background: color-mix(in oklab, #60a5fa 24%, var(--surface-2)); color: #60a5fa; }

/* ───────── Hero pills ───────── */
.hero-pills {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px;
}
.hero-pills-lbl {
  font-size: 12px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
  margin-right: 4px;
}
.pill {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500;
  backdrop-filter: blur(var(--glass-blur));
  transition: transform .15s, background .15s, border-color .15s;
}
.pill:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.pill-glyph {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
}

/* ───────── Section header ───────── */
.section-hd {
  max-width: 1240px; margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px;
}
.section-h {
  font-family: var(--font-display);
  font-weight: 600; font-size: 32px; letter-spacing: -.02em;
  margin: 0;
}
.section-sub { color: var(--text-soft); font-size: 14px; }
.section-sub em { font-style: normal; color: var(--accent); font-weight: 600; }

/* ───────── Featured cards ───────── */
.feat-section { padding: 70px 0 30px; }
.feat-grid {
  max-width: 1240px; margin: 0 auto;
  padding: 0 32px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 900px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feat-grid { grid-template-columns: 1fr; } }

.feat {
  position: relative;
  appearance: none; text-align: left; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px 24px 24px;
  color: var(--text); font: inherit;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "glyph . cat"
    "meta meta meta"
    ". . go";
  gap: 22px 14px;
  min-height: 200px;
  backdrop-filter: blur(var(--glass-blur));
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.7,.3,1),
              border-color .2s, background .2s;
  animation: rise .5s both cubic-bezier(.2,.7,.3,1);
  animation-delay: calc(var(--i) * 60ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feat::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(80% 100% at 50% 110%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 60%);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.feat:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.feat:hover::after { opacity: 1; }
.feat-glyph {
  grid-area: glyph;
  width: 56px; height: 56px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
}
.feat-meta { grid-area: meta; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feat-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 24px; letter-spacing: -.015em; line-height: 1.1;
}
.feat-blurb { color: var(--text-soft); font-size: 14.5px; line-height: 1.5; }
.feat-cat {
  grid-area: cat; align-self: start; justify-self: end;
  font-size: 11px; font-weight: 600; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .1em;
}
.feat-hot {
  position: absolute; top: 18px; right: 18px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  padding: 4px 8px; border-radius: 6px;
}
.feat:has(.feat-hot) .feat-cat { visibility: hidden; }
.feat-go {
  grid-area: go; align-self: end; justify-self: end;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--accent);
  transition: transform .2s, background .2s;
}
.feat-go svg { width: 16px; height: 16px; }
.feat:hover .feat-go {
  background: var(--accent);
  color: #0a0b0d;
  transform: translateX(4px);
}

/* ───────── Catalog grid ───────── */
.cat-section { padding: 60px 0 80px; }
.cat-rail {
  max-width: 1240px; margin: 0 auto;
  padding: 0 32px 22px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cat-pill {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font: inherit; font-size: 13px; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.cat-pill:hover { color: var(--text); border-color: var(--border-strong); }
.cat-pill-on {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.cat-pill-on .cat-count { color: var(--bg); opacity: .55; }
.cat-count {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-mute);
}

.grid {
  max-width: 1240px; margin: 0 auto;
  padding: 0 32px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .grid { grid-template-columns: 1fr; } }

.tile {
  position: relative;
  appearance: none; cursor: pointer; text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(var(--glass-blur));
  transition: transform .2s cubic-bezier(.2,.7,.3,1),
              border-color .15s, background .15s;
  animation: rise .4s both cubic-bezier(.2,.7,.3,1);
  animation-delay: calc(var(--i, 0) * 25ms);
}
.tile:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.tile-glyph {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.tile-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 17px; letter-spacing: -.01em;
}
.tile-blurb { color: var(--text-soft); font-size: 12.5px; line-height: 1.45; flex: 1; }
.tile-flag {
  position: absolute; top: 14px; right: 14px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mute);
  border: 1px solid var(--border); padding: 3px 6px; border-radius: 5px;
}
.tile-flag-on {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text-soft); font-size: 14px;
}

/* ───────── Modal ───────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklab, #000 65%, transparent);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
  padding: 40px 20px 20px;
}
@media (min-width: 700px) { .modal { align-items: center; padding: 40px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%; max-width: 540px; max-height: calc(100vh - 80px);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideUp .3s cubic-bezier(.2,.7,.3,1);
}
.mc-glassy .modal-card {
  background: color-mix(in oklab, var(--bg) 92%, var(--accent) 8%);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.modal-hd {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-glyph {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  flex-shrink: 0;
}
.modal-meta { flex: 1; min-width: 0; }
.modal-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 22px; letter-spacing: -.015em; line-height: 1.1;
}
.modal-blurb { font-size: 13px; color: var(--text-soft); margin-top: 3px; }
.modal-cat { color: var(--accent); font-weight: 600; }
.modal-x {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); width: 32px; height: 32px; border-radius: 9px;
  cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: var(--surface-2); border-color: var(--border-strong); }
.modal-body { padding: 22px 22px 26px; overflow-y: auto; }

.soon {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.soon-glyph {
  width: 60px; height: 60px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
}
.soon-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.soon-blurb { color: var(--text-soft); font-size: 14px; max-width: 360px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════════
   Calculator widget styles (cw-*) — used inside the modal
   ═══════════════════════════════════════════════════════════════════════ */
.cw-stack { display: flex; flex-direction: column; gap: 16px; }
.cw-row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.cw-field { display: flex; flex-direction: column; gap: 6px; }
.cw-field-lbl {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-mute);
}
.cw-field-shell {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  transition: border-color .15s, background .15s;
}
.cw-field-shell:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}
.cw-affix { color: var(--text-mute); font-family: var(--font-mono); font-size: 14px; }
.cw-input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit;
  font-family: var(--font-mono); font-size: 16px; font-weight: 500;
  padding: 12px 4px;
}

.tabular { font-variant-numeric: tabular-nums; }
.display-num {
  font-family: var(--font-display);
  font-feature-settings: "tnum";
  font-weight: 600;
}

.cw-slider { display: flex; flex-direction: column; gap: 8px; }
.cw-slider-hd { display: flex; justify-content: space-between; align-items: baseline; }
.cw-slider-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text); }
.cw-range {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: 0; margin: 4px 0;
}
.cw-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 6px rgba(0,0,0,.3);
  cursor: pointer;
}
.cw-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}

.cw-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cw-chip {
  appearance: none; cursor: pointer;
  padding: 7px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-soft); font: inherit; font-size: 13px; font-weight: 500;
  font-family: var(--font-mono);
  transition: all .15s;
}
.cw-chip:hover { color: var(--text); border-color: var(--border-strong); }
.cw-chip-on {
  background: var(--accent); color: #0a0b0d;
  border-color: var(--accent);
}

.cw-stepper {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.cw-stepper-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cw-stepper-ctrl button {
  appearance: none; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cw-stepper-ctrl button:hover { background: var(--accent); color: #0a0b0d; border-color: var(--accent); }
.cw-stepper-ctrl span { font-size: 22px; font-weight: 600; min-width: 1.5em; text-align: center; }

.cw-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  justify-content: center;
}
.cw-mini-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-mute);
}
.cw-mini-val { font-size: 18px; font-weight: 600; color: var(--text); font-family: var(--font-display); }

.cw-seg {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 3px; gap: 3px;
}
.cw-seg-3 { grid-template-columns: repeat(3, 1fr); }
.cw-seg-4 { grid-template-columns: repeat(4, 1fr); }
.cw-seg-btn {
  appearance: none; cursor: pointer;
  background: transparent; border: 0;
  color: var(--text-soft); font: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.cw-seg-btn:hover { color: var(--text); }
.cw-seg-on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.cw-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.cw-result-accent {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 16%, var(--surface-2)),
    var(--surface-2) 70%);
  border-color: color-mix(in oklab, var(--accent) 28%, var(--border));
}
.cw-result-lbl {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-mute);
}
.cw-result-val { font-size: 38px; line-height: 1.05; letter-spacing: -.02em; }
.cw-result-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.cw-bar { display: flex; flex-direction: column; gap: 6px; }
.cw-bar-track {
  position: relative; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2);
}
.cw-bar-track > span {
  position: absolute; inset: 0; opacity: .9;
}
.cw-bar-pin {
  position: absolute; top: -3px; width: 4px; height: 16px;
  border-radius: 2px; transform: translateX(-50%);
  box-shadow: 0 0 0 3px var(--bg);
}
.cw-bar-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-mute);
}
.cw-bar-ticks span { flex: 1; text-align: center; }

.cw-spark {
  width: 100%; height: 80px; display: block;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px;
}

.cw-convert {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 10px; align-items: stretch;
}
.cw-convert-side {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.cw-select {
  appearance: none;
  background: transparent; border: 0; outline: 0; color: var(--text-soft);
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 0; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='rgba(150,150,150,.7)' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat; background-position: right center;
  padding-right: 16px;
}
.mc-light .cw-select option, .mc-dark .cw-select option {
  background: var(--surface); color: var(--text);
}
.cw-bigin, .cw-bigout {
  background: transparent; border: 0; outline: 0;
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600; letter-spacing: -.015em;
  color: var(--text); padding: 0;
}
.cw-bigin { width: 100%; }
.cw-swap {
  appearance: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  align-self: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--accent); font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .25s, background .15s;
}
.cw-swap:hover { transform: rotate(180deg); background: var(--accent); color: #0a0b0d; }

/* ───────── Footer ───────── */
.foot {
  max-width: 1240px; margin: 0 auto;
  padding: 40px 32px 60px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.foot-meta { color: var(--text-mute); font-size: 13px; }

@media (max-width: 600px) {
  .nav { padding: 18px 20px; }
  .hero { padding: 30px 20px 20px; }
  .section-hd { padding: 0 20px; }
  .feat-grid, .grid, .cat-rail { padding-left: 20px; padding-right: 20px; }
  .foot { padding: 30px 20px 50px; flex-direction: column; gap: 16px; align-items: flex-start; }
  .feat { min-height: 0; padding: 22px 20px; }
  .feat-name { font-size: 20px; }
  .section-h { font-size: 24px; }
  .cw-row-two { grid-template-columns: 1fr; }
  .cw-convert { grid-template-columns: 1fr; }
  .cw-swap { transform: rotate(90deg); justify-self: center; }
  .cw-swap:hover { transform: rotate(270deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hidden utility */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════
   Embeddable widget pages (/embed/*.html)
   Minimal chrome — just the calculator + a tiny attribution link back.
   Designed to live inside an <iframe> on third-party sites.
   ═══════════════════════════════════════════════════════════════════════ */
body.embed {
  background: var(--bg, #08090b);
  color: var(--text, #f1f1f3);
  --bg:        #08090b;
  --surface:   #111317;
  --surface-2: #15181e;
  --border:    rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);
  --text:      #f1f1f3;
  --text-soft: rgba(241,241,243,.62);
  --text-mute: rgba(241,241,243,.4);
  font-family: var(--font-ui);
  padding: 0; margin: 0;
}
body.embed.light {
  --bg: #ffffff; --surface: #fafaf9; --surface-2: #f4f4f5;
  --border: rgba(10,11,13,.08); --border-strong: rgba(10,11,13,.16);
  --text: #18181b; --text-soft: rgba(15,17,21,.62); --text-mute: rgba(15,17,21,.42);
}
.embed-wrap {
  max-width: 480px; margin: 0 auto;
  padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.embed-hd {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.embed-glyph {
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.embed-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; letter-spacing: -0.015em;
  margin: 0; flex: 1;
}
.embed-footer {
  text-align: center; font-size: 11px; color: var(--text-mute);
  text-decoration: none; padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.embed-footer:hover { color: var(--accent); }
.embed-footer b { color: var(--text-soft); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   Legacy /calculators/*.html compatibility
   ───────────────────────────────────────────────────────────────────────
   The 22 pre-redesign calculator pages still ship as direct-URL entry
   points (for SEO and deep links). This block gives their pre-existing
   class names a presentable look in the new design tokens, without
   conflicting with the SPA homepage classes above.

   The pages render in mc-dark mc-sleek by default — they don't load the
   SPA's theme JS, so we apply the theme tokens to <body> here.
   =========================================================================== */

body:not(:has(#mc-root)) {
  background: var(--bg, #08090b);
  color: var(--text, #f1f1f3);
  --bg:        #08090b;
  --bg-soft:   #0e1014;
  --surface:   #111317;
  --surface-2: #15181e;
  --border:    rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --text:      #f1f1f3;
  --text-soft: rgba(241,241,243,.62);
  --text-mute: rgba(241,241,243,.38);
  --shadow:    0 30px 60px -30px rgba(0,0,0,.7);
  --glass-blur: 0px;
  font-family: var(--font-ui);
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(10px);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 60px;
}
.container-wide {
  width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem;
}

.brand__mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #0a0b0d; font-family: var(--font-display);
  font-size: 14px; font-weight: 800;
}

.theme-toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { border-color: var(--border-strong); }

.breadcrumb {
  padding: 1.25rem 0 0.5rem;
  font-size: 13px; color: var(--text-mute);
}
.breadcrumb a { color: var(--text-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb__sep { margin: 0 0.5rem; color: var(--text-mute); }

.calc-head { padding: 0.5rem 0 1.75rem; }
.calc-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.025em;
  margin: 0 0 0.5rem; line-height: 1.1;
}
.lede {
  font-size: 16px; color: var(--text-soft);
  line-height: 1.55; max-width: 60ch; margin: 0;
}

.calc-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem; align-items: start;
}
@media (max-width: 880px) { .calc-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.5rem;
}
.panel--inputs h2, .panel--results h2 {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute);
  margin: 0 0 1rem;
}

.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 0.375rem; color: var(--text);
}
.field__hint {
  display: block; font-size: 12px; color: var(--text-mute);
  margin-top: 0.375rem;
}

.input-wrap {
  display: flex; align-items: stretch;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.input-wrap:focus-within { border-color: var(--accent); background: var(--surface); }
.input-wrap__prefix, .input-wrap__suffix {
  display: inline-flex; align-items: center; padding: 0 0.75rem;
  color: var(--text-mute); font-family: var(--font-mono); font-size: 14px;
}
.input, .select {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0;
  color: var(--text); font: inherit;
  font-family: var(--font-mono); font-size: 16px; font-weight: 500;
  padding: 0.75rem;
}
.select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.select:focus { border-color: var(--accent); }

.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.slider-row { display: flex; align-items: center; gap: 0.75rem; }
.slider-row .input { width: 100px; flex: 0 0 auto; }

input[type="range"] {
  flex: 1; appearance: none;
  height: 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  outline: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  cursor: pointer;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.headline-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute);
  margin: 0 0 0.25rem;
}
.headline--accent { color: var(--accent); }

.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem 1.5rem; margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px;
}
.kv__label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute); margin: 0 0 0.25rem;
}
.kv__value {
  font-size: 18px; font-weight: 600;
  font-family: var(--font-display);
  margin: 0;
}

.chart-wrap { position: relative; margin: 1.5rem 0 1rem; }
.chart-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 12px; color: var(--text-soft); margin-top: 0.5rem;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  padding-top: 1rem; margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.625rem 1rem;
  border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--sm { padding: 0.375rem 0.625rem; font-size: 13px; border-radius: 8px; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #0a0b0d; }
.btn--primary:hover { background: var(--accent); opacity: .9; color: #0a0b0d; }

/* Legacy pills (radio button groups) */
.pills {
  display: inline-flex;
  background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px;
  border: 1px solid var(--border);
}
.pills input {
  position: absolute; width: 1px; height: 1px; opacity: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); margin: -1px;
}
.pills label {
  margin: 0; padding: 0.4rem 0.75rem;
  font-size: 13px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  color: var(--text-soft);
  transition: background .15s, color .15s;
}
.pills input:checked + label {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.explain {
  padding: 2.5rem 0; margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.explain h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 24px; letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}
.explain h2:first-child { margin-top: 0; }
.prose {
  font-size: 16px; line-height: 1.6;
  color: var(--text); max-width: 68ch;
}
.prose p { margin: 0 0 1em; color: var(--text-soft); }
.prose ul { color: var(--text-soft); padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); font-style: italic; }
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

.formula {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-display);
  font-style: italic; font-size: 18px;
  text-align: center;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px; margin: 1rem 0;
}
table.schedule {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
table.schedule th, table.schedule td {
  padding: 0.625rem 1rem; text-align: right;
  border-bottom: 1px solid var(--border);
}
table.schedule th:first-child, table.schedule td:first-child { text-align: left; }
table.schedule thead th {
  background: var(--surface-2); position: sticky; top: 0;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-mute); font-weight: 600;
  font-family: var(--font-ui);
}
table.schedule tbody tr:nth-child(odd) td {
  background: color-mix(in oklab, var(--surface-2) 50%, transparent);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 18px; color: var(--text-mute); }
.faq details[open] summary::after { content: "−"; }
.faq details > *:not(summary) { margin-top: 0.75rem; color: var(--text-soft); }

.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg);
  padding: 0.625rem 1rem;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  z-index: 100;
  transition: opacity .15s, transform .15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.site-footer {
  margin-top: 5rem; padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft); font-size: 14px;
}
.site-footer__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.site-footer h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); margin: 0 0 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--text-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer__bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; font-size: 13px;
}

/* Legacy navigation links */
body:not(:has(#mc-root)) .nav {
  display: flex; align-items: center; gap: 0.25rem;
  max-width: none; margin: 0; padding: 0;
}
body:not(:has(#mc-root)) .nav a {
  padding: 0.5rem 0.75rem; border-radius: 6px;
  color: var(--text-soft); text-decoration: none;
  font-weight: 500; font-size: 14px;
  transition: color .15s, background .15s;
}
body:not(:async(#mc-root)) .nav a:hover {
  color: var(--text); background: var(--surface-2);
}

/* Legacy brand mark — the new SPA's .brand class doesn't conflict because
   legacy pages use .brand__mark (BEM) and .brand span> structure. */
body:not(:has(#mc-root)) .brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  color: var(--text); text-decoration: none;
}

/* Utility shorthands used by legacy pages */
.muted { color: var(--text-soft); }
.faint { color: var(--text-mute); }
.mono { font-family: var(--font-mono); }
.tab { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.flash { animation: pulseBg 600ms ease-out; border-radius: 8px; }
@keyframes pulseBg {
  0% { background: color-mix(in oklab, var(--accent) 24%, transparent); }
  100% { background: transparent; }
}
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  font-size: 12px; font-weight: 600;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
}

/* Light theme overrides for the legacy layer */
body:not(:has(#mc-root)).legacy-light {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --border: rgba(10,11,13,.07);
  --border-strong: rgba(10,11,13,.14);
  --text: #0f1115;
  --text-soft: rgba(15,17,21,.62);
  --text-mute: rgba(15,17,21,.42);
}
