/* =========================================================
   Theme Palette guide
   Chrome is deliberately cool + neutral so that the only
   saturated things on the page are the palette swatches.
   ========================================================= */

:root {
  --ink:        #14161a;
  --ink-2:      #3d4450;
  --ink-3:      #6b7280;
  --paper:      #f7f8fa;
  --paper-2:    #ffffff;
  --paper-3:    #eef0f4;
  --rule:       #dcdfe5;
  --rule-2:     #c6cad3;
  --accent:     #2347ce;
  --accent-ink: #ffffff;
  --accent-wash:#e8ecfb;

  --pass:       #0e7a5f;
  --pass-wash:  #e2f1ec;
  --fail:       #c0362c;
  --fail-wash:  #fbe9e7;
  --warn:       #b26b00;
  --warn-wash:  #fbf0dc;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --rail-w: 21rem;
  --step: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
  --shadow: 0 1px 2px rgba(20,22,26,.06), 0 8px 24px -12px rgba(20,22,26,.18);
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #e8eaee;
    --ink-2:      #b3b9c4;
    --ink-3:      #858c99;
    --paper:      #101216;
    --paper-2:    #171a20;
    --paper-3:    #1e222a;
    --rule:       #282c34;
    --rule-2:     #3a4049;
    --accent:     #8ba4ff;
    --accent-ink: #0d1017;
    --accent-wash:#1a2138;
    --pass:       #4fc9a4;
    --pass-wash:  #12281f;
    --fail:       #ff8a7d;
    --fail-wash:  #2c1512;
    --warn:       #e0a54a;
    --warn-wash:  #2a1f0d;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px -14px rgba(0,0,0,.8);
  }
}

:root[data-theme="dark"] {
  --ink:#e8eaee; --ink-2:#b3b9c4; --ink-3:#858c99;
  --paper:#101216; --paper-2:#171a20; --paper-3:#1e222a;
  --rule:#282c34; --rule-2:#3a4049;
  --accent:#8ba4ff; --accent-ink:#0d1017; --accent-wash:#1a2138;
  --pass:#4fc9a4; --pass-wash:#12281f;
  --fail:#ff8a7d; --fail-wash:#2c1512;
  --warn:#e0a54a; --warn-wash:#2a1f0d;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px -14px rgba(0,0,0,.8);
}
:root[data-theme="light"] {
  --ink:#14161a; --ink-2:#3d4450; --ink-3:#6b7280;
  --paper:#f7f8fa; --paper-2:#ffffff; --paper-3:#eef0f4;
  --rule:#dcdfe5; --rule-2:#c6cad3;
  --accent:#2347ce; --accent-ink:#ffffff; --accent-wash:#e8ecfb;
  --pass:#0e7a5f; --pass-wash:#e2f1ec;
  --fail:#c0362c; --fail-wash:#fbe9e7;
  --warn:#b26b00; --warn-wash:#fbf0dc;
  --shadow: 0 1px 2px rgba(20,22,26,.06), 0 8px 24px -12px rgba(20,22,26,.18);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:where(a, button, select, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; font: 600 .85rem/1 var(--sans);
}
.skip:focus { left: .5rem; top: .5rem; }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: .08em .34em;
}

/* ---------- eyebrow: the recurring mono label ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .5rem;
}

/* ============ TOP BAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-in {
  max-width: 96rem; margin: 0 auto;
  padding: .7rem clamp(1rem, 3vw, 2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.wordmark {
  display: flex; align-items: center; gap: .6rem;
  font: 650 .95rem/1 var(--sans); letter-spacing: -.01em;
}
.wordmark .mark {
  width: 1.1rem; height: 1.1rem; border-radius: 2px; flex: none;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, transparent 50% 100%),
    repeating-linear-gradient(45deg, var(--rule-2) 0 3px, var(--paper-2) 3px 6px);
  border: 1px solid var(--rule-2);
}
.wordmark-sub {
  font: 400 .75rem/1 var(--mono); color: var(--ink-3);
  padding-left: .6rem; border-left: 1px solid var(--rule);
}
@media (max-width: 640px) { .wordmark-sub { display: none; } }

.topbar-tools { display: flex; align-items: center; gap: .5rem; }
.lang-seg .seg-btn { padding: .45rem .55rem; letter-spacing: .06em; }

.ghost-btn {
  font: 500 .78rem/1 var(--mono);
  letter-spacing: .04em;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  padding: .45rem .7rem;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.ghost-btn.wide { width: 100%; text-align: center; }

/* ============ SHELL ============ */
.shell {
  max-width: 96rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: start;
}
@media (max-width: 1080px) { .shell { grid-template-columns: minmax(0,1fr); } }

/* ============ PALETTE RAIL ============ */
.rail {
  position: sticky;
  top: 3.6rem;
  max-height: calc(100dvh - 4.6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 0 2rem;
}
.rail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.rail-title { font: 650 1.1rem/1.2 var(--sans); letter-spacing: -.015em; margin: 0; }
.rail-toggle { display: none; }
.rail-note {
  font-size: .8125rem; line-height: 1.5; color: var(--ink-3);
  margin: .6rem 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule);
}

.pal-group { margin-bottom: 1.1rem; }
.pal-group > h3 {
  font-family: var(--mono); font-size: .625rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 .4rem; padding-bottom: .3rem; border-bottom: 1px dashed var(--rule);
}

.chip {
  display: grid;
  grid-template-columns: 1.75rem minmax(0,1fr);
  align-items: center;
  gap: .55rem;
  padding: .3rem .35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.chip:hover, .chip:focus-within { background: var(--paper-2); border-color: var(--rule); }
.chip.is-lit { background: var(--accent-wash); border-color: var(--accent); }

.chip-swatch {
  position: relative;
  width: 1.75rem; height: 1.75rem;
  border-radius: 4px;
  border: 1px solid var(--rule-2);
  padding: 0; cursor: pointer;
  overflow: hidden;
  background-image:
    linear-gradient(45deg, var(--rule) 25%, transparent 25% 75%, var(--rule) 75%),
    linear-gradient(45deg, var(--rule) 25%, transparent 25% 75%, var(--rule) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}
.chip-swatch.is-alpha { cursor: default; }
.chip-swatch i { position: absolute; inset: 0; display: block; }
.chip-swatch input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  border: 0; padding: 0; cursor: pointer;
}

.chip-meta { min-width: 0; }
.chip-name {
  display: block;
  font: 500 .75rem/1.25 var(--mono);
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-val {
  display: block; width: 100%;
  font: 400 .6875rem/1.3 var(--mono);
  color: var(--ink-3);
  background: none; border: 0; padding: 0;
  text-transform: lowercase;
}
.chip-val:focus { outline: none; color: var(--ink); }
:root[data-lang="sr"] .chip.is-default .chip-name::after { content: "početna"; }
.chip.is-default .chip-name::after {
  content: "starter";
  margin-left: .4rem;
  font-size: .5625rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn);
  border: 1px solid currentColor; border-radius: 2px;
  padding: 0 .22em; vertical-align: 1px;
}

.rail-foot {
  display: flex; flex-direction: column; gap: .5rem;
  padding-top: 1rem; border-top: 1px solid var(--rule);
}
.preset-label {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
.preset {
  font: 400 .8125rem/1 var(--sans);
  color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  padding: .5rem; width: 100%;
}

/* ============ MAIN / TYPE SCALE ============ */
main { padding: 1.5rem 0 4rem; min-width: 0; }

.hero { padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.hero h1 {
  font: 700 clamp(2rem, 1.3rem + 3.2vw, 3.6rem)/1.06 var(--sans);
  letter-spacing: -.035em;
  text-wrap: balance;
  margin: 0 0 1rem;
}
.lede {
  font-size: clamp(1rem, .96rem + .25vw, 1.15rem);
  color: var(--ink-2);
  max-width: 62ch; margin: 0;
}
.lede em { color: var(--ink); font-style: italic; }

.tally {
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  margin-top: 2rem; padding: 1.25rem 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.tally-item { display: flex; flex-direction: column; gap: .15rem; }
.tally-num {
  font: 700 clamp(2rem, 1.5rem + 2vw, 3rem)/1 var(--mono);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.tally-item.accent .tally-num { color: var(--accent); }
.tally-cap { font-size: .8125rem; color: var(--ink-3); max-width: 24ch; }
.tally-arrow { color: var(--rule-2); }

.block { padding: clamp(2.5rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--rule); }
.block-head { margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.block-head h2 {
  font: 650 clamp(1.4rem, 1.15rem + 1.1vw, 2rem)/1.15 var(--sans);
  letter-spacing: -.025em; text-wrap: balance; margin: 0 0 .6rem;
}
.block-lede { color: var(--ink-2); max-width: 68ch; margin: 0; }
.block-lede em { color: var(--ink); }

.caption {
  font-size: .8125rem; color: var(--ink-3);
  max-width: 62ch; margin: 1rem 0 0;
}

/* ============ PREVIEW ============ */
.preview-frame {
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-2);
}
.preview-chrome {
  display: flex; align-items: center; gap: .4rem;
  padding: .55rem .8rem;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
}
.preview-chrome > span {
  width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--rule-2);
}
.preview-url {
  margin: 0 0 0 .6rem;
  font: 400 .6875rem/1 var(--mono); color: var(--ink-3);
}

/* The mock site: an isolated colour world driven by --p-* vars */
.site {
  --p-primary:#A9542F; --p-secondary:#2E2A25; --p-accent:#9C5A22;
  --p-background:#FBF8F3; --p-background_alt:#F3EDE3; --p-background_inverse:#211C17;
  --p-title:#2B2622; --p-subtitle:#6F6456; --p-text:#403A33;
  --p-text_on_primary:#FBF8F3; --p-text_on_secondary:#F3EDE3; --p-text_on_inverse:#F3EDE3;
  --p-overlay:rgba(33,28,23,.45); --p-overlay_alt:rgba(33,28,23,.8);
  --p-border:#E4DBCB; --p-border_alt:#C9BBA3;

  font-family: var(--sans);
  container-type: inline-size;
}
.site [data-uses] { transition: background-color .22s ease, color .22s ease, border-color .22s ease; }

/* highlight mode */
.site.is-highlighting [data-uses] { opacity: .32; }
.site.is-highlighting [data-uses].is-hit {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 2px;
}

.s-nav {
  background: var(--p-background_alt);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 1.25rem;
  flex-wrap: wrap;
}
.s-logo { color: var(--p-text); font: 650 .95rem/1 var(--sans); letter-spacing: .18em; }
.s-links { display: flex; align-items: center; gap: 1rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.s-links li { color: var(--p-text); font-size: .8rem; }
.s-links .is-hover { color: var(--p-accent); position: relative; font-weight: 600; }
.hovertag {
  font: 400 .55rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--p-accent); opacity: .7; margin-left: .3rem; font-style: normal;
}
.s-cta {
  background: var(--p-primary); color: var(--p-text_on_primary);
  padding: .4rem .8rem; border-radius: 3px; font-size: .75rem; font-weight: 600;
}

.s-hero { position: relative; min-height: 15rem; display: flex; align-items: flex-end; }
.s-photo {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 18% 12%, #d9c7a8 0%, transparent 55%),
    radial-gradient(90% 80% at 88% 78%, #6a4b34 0%, transparent 60%),
    linear-gradient(158deg, #8f7a5e 0%, #43362a 58%, #241c15 100%);
}
.s-photo-b {
  background:
    radial-gradient(100% 80% at 70% 20%, #c9a97e 0%, transparent 60%),
    linear-gradient(200deg, #7d6544 0%, #2e2519 100%);
}
.s-photo-c {
  background:
    radial-gradient(90% 90% at 25% 80%, #9a8f76 0%, transparent 55%),
    linear-gradient(120deg, #55483a 0%, #1d1811 100%);
}
.s-scrim { position: absolute; inset: 0; background: var(--p-overlay); }
.s-hero-copy { position: relative; padding: 1.5rem 1.25rem; }
.s-kicker {
  color: var(--p-text_on_inverse);
  font: 500 .625rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  margin: 0 0 .5rem;
}
.s-hero-copy h3 {
  color: var(--p-text_on_inverse);
  font: 600 clamp(1.25rem, 3cqi, 1.9rem)/1.1 var(--sans);
  letter-spacing: -.02em; margin: 0 0 1rem; text-wrap: balance;
}
.s-btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.s-btn { padding: .5rem .9rem; border-radius: 3px; font-size: .78rem; font-weight: 600; border: 1px solid; }
.s-btn-1 { background: var(--p-primary); color: var(--p-text_on_primary); border-color: var(--p-primary); }
.s-btn-2 { background: var(--p-secondary); color: var(--p-text_on_secondary); border-color: var(--p-secondary); }

.s-sec { padding: 1.5rem 1.25rem; }
.s-default { background: var(--p-background); }
.s-inverse { background: var(--p-background_inverse); }
.s-sub {
  font: 500 .625rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  margin: 0 0 .45rem;
}
.s-default .s-sub { color: var(--p-subtitle); }
.s-inverse .s-sub { color: var(--p-text_on_inverse); }
.s-sec h4 {
  font: 600 clamp(1.05rem, 2.4cqi, 1.4rem)/1.15 var(--sans);
  letter-spacing: -.02em; margin: 0 0 .5rem;
}
.s-default h4 { color: var(--p-title); }
.s-inverse h4 { color: var(--p-text_on_inverse); }
.s-body { font-size: .82rem; margin: 0; max-width: 54ch; }
.s-default .s-body { color: var(--p-text); }
.s-inverse .s-body { color: var(--p-text_on_inverse); }
.s-rule { border: 0; border-top: 1px solid var(--p-border); margin: 1rem 0 .7rem; }
.s-fine { font-size: .72rem; color: var(--p-text); margin: 0; opacity: .85; }

.s-gallery {
  background: var(--p-background);
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  padding: 0 1.25rem 1.5rem;
}
.s-tile { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 3px; }
.s-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--p-overlay_alt);
  padding: .45rem .6rem;
}
.s-caption span { color: var(--p-text_on_inverse); font-size: .7rem; font-weight: 500; }

/* ============ REFERENCE / CODE ============ */
.ref-demo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
@media (max-width: 860px) { .ref-demo { grid-template-columns: minmax(0,1fr); } }

.code-card { border: 1px solid var(--rule-2); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .7rem; background: var(--paper-3); border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.code-title { font: 400 .6875rem/1 var(--mono); color: var(--ink-3); }
.seg { display: flex; border: 1px solid var(--rule-2); border-radius: 4px; overflow: hidden; }
.seg-btn {
  font: 500 .6875rem/1 var(--mono); color: var(--ink-3);
  background: var(--paper-2); border: 0; padding: .35rem .55rem; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--rule-2); }
.seg-btn.is-on { background: var(--accent); color: var(--accent-ink); }

pre.code {
  margin: 0; padding: .9rem;
  font: 400 .78rem/1.75 var(--mono);
  color: var(--ink-2);
  overflow-x: auto;
  tab-size: 2;
}
.c-key { color: var(--ink); }
.c-ref { color: var(--accent); font-weight: 600; }
.c-lit { color: var(--warn); }
.c-bad { color: var(--fail); font-weight: 600; text-decoration: underline wavy currentColor; text-underline-offset: 3px; }
.c-cmt { color: var(--ink-3); font-style: italic; }
.c-swatch {
  display: inline-block; width: .7em; height: .7em; border-radius: 2px;
  border: 1px solid var(--rule-2); margin-left: .45em; vertical-align: -1px;
}

.code-hint {
  margin: 0; padding: .5rem .9rem;
  border-top: 1px solid var(--rule); background: var(--paper-3);
  font-size: .78rem; color: var(--ink-3);
}
.code-hint code { background: none; border: 0; padding: 0; color: var(--accent); }

/* line-level link between a reference and its declaration */
.c-line { display: inline-block; width: 100%; border-radius: 3px; transition: background-color .12s; }
.c-line.is-linked {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.c-was { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---- one place vs everywhere ---- */
.fork { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.fork-card {
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2); padding: 1rem;
  display: flex; flex-direction: column; gap: .55rem;
}
.fork-q {
  margin: 0; font: 500 .625rem/1 var(--mono);
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.fork-q em { color: var(--accent); font-style: normal; font-weight: 700; }
.fork-card h3 { margin: 0; font: 650 1rem/1.25 var(--sans); letter-spacing: -.015em; }
.fork-p { margin: 0; font-size: .84rem; color: var(--ink-2); }
.fork-do {
  margin: .15rem 0 0; font-size: .84rem; font-weight: 600; color: var(--ink);
  display: flex; gap: .45rem; align-items: baseline;
}
.fork-tick { color: var(--accent); font-family: var(--mono); }
.fork-card pre.code {
  background: var(--paper-3); border: 1px solid var(--rule);
  border-radius: 4px; padding: .6rem .7rem; font-size: .74rem; line-height: 1.6;
}

.anti {
  margin-top: 1rem;
  border: 1px solid var(--rule-2); border-left: 3px solid var(--warn);
  border-radius: var(--radius); background: var(--paper-2); overflow: hidden;
}
.anti-tag {
  margin: 0; padding: .5rem .9rem;
  background: var(--warn-wash); color: var(--warn);
  font: 600 .625rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.anti-body { padding: .9rem; display: flex; flex-direction: column; gap: .7rem; }
.anti-body > p { margin: 0; font-size: .875rem; color: var(--ink-2); max-width: 74ch; }
.anti-body pre.code {
  background: var(--paper-3); border: 1px solid var(--rule);
  border-radius: 4px; padding: .6rem .7rem; font-size: .74rem;
}
.anti-cost { color: var(--ink) !important; }
.anti-cost strong { color: var(--warn); }

.ref-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.ref-points li {
  font-size: .875rem; color: var(--ink-2); line-height: 1.55;
  padding-left: .9rem; border-left: 2px solid var(--rule-2);
}
.ref-points strong { color: var(--ink); display: block; font-weight: 600; }

/* ============ STEPS ============ */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; counter-reset: none; }
.steps > li {
  display: grid; grid-template-columns: 2.5rem minmax(0,1fr); gap: 1rem;
  padding: 1.25rem 0; border-top: 1px dashed var(--rule);
}
.steps > li:first-child { border-top: 0; }
.step-n {
  font: 700 1.25rem/1 var(--mono); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps h3 { font: 650 1.05rem/1.25 var(--sans); letter-spacing: -.015em; margin: 0 0 .35rem; }
.steps p { margin: 0; color: var(--ink-2); font-size: .9rem; max-width: 66ch; }

/* ============ VS CARDS ============ */
.vs { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.vs-card {
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2); padding: 1rem; display: flex; flex-direction: column; gap: .7rem;
}
.vs-card header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.vs-card h3 { font: 650 .98rem/1.2 var(--sans); margin: 0; letter-spacing: -.01em; }
.vs-card p { margin: 0; font-size: .84rem; color: var(--ink-2); }
.vs-card pre.code { background: var(--paper-3); border-radius: 4px; border: 1px solid var(--rule); }
.vs-card.is-bad  { border-left: 3px solid var(--fail); }
.vs-card.is-good { border-left: 3px solid var(--pass); }

.tag {
  font: 600 .5875rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  padding: .25rem .4rem; border-radius: 2px;
}
.tag-bad  { background: var(--fail-wash); color: var(--fail); }
.tag-good { background: var(--pass-wash); color: var(--pass); }

.rule-callout {
  margin-top: 1rem; padding: .9rem 1rem;
  background: var(--accent-wash); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.rule-callout p { margin: 0; font-size: .875rem; color: var(--ink); max-width: 74ch; }

/* ============ PAIRS + COLLISIONS ============ */
.pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: .75rem; }
.pair {
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2); overflow: hidden;
  display: flex; flex-direction: column;
}
.pair-demo {
  padding: 1rem .9rem; min-height: 4.6rem;
  display: flex; flex-direction: column; justify-content: center; gap: .2rem;
  transition: background-color .22s ease;
}
.pair-demo b { font: 600 .95rem/1.2 var(--sans); }
.pair-demo span { font-size: .74rem; }
.pair-meta {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem .7rem; border-top: 1px solid var(--rule); flex-wrap: wrap;
}
.pair-names { font: 400 .6875rem/1.4 var(--mono); color: var(--ink-3); }
.pair-names b { color: var(--ink-2); font-weight: 500; }
.verdict {
  font: 600 .6875rem/1 var(--mono); letter-spacing: .04em;
  padding: .28rem .45rem; border-radius: 3px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.verdict.ok   { background: var(--pass-wash); color: var(--pass); }
.verdict.bad  { background: var(--fail-wash); color: var(--fail); }
.verdict.warn { background: var(--warn-wash); color: var(--warn); }

.collisions { display: flex; flex-direction: column; gap: .5rem; }
.coll {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center; gap: .9rem;
  padding: .7rem .9rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2);
}
.coll-pair { display: flex; align-items: center; }
.coll-pair i {
  width: 1.5rem; height: 1.5rem; border: 1px solid var(--rule-2); border-radius: 3px; display: block;
}
.coll-pair i + i { margin-left: -.55rem; }
.coll-copy strong { display: block; font: 600 .875rem/1.3 var(--sans); }
.coll-copy span { font-size: .78rem; color: var(--ink-3); }
.coll.is-bad { border-color: var(--fail); background: var(--fail-wash); }

/* ============ TYPOS ============ */
.typo-demo { display: flex; flex-direction: column; gap: .6rem; }
.typo-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: .75rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius);
  background: var(--paper-2); padding: .5rem .7rem;
}
@media (max-width: 640px) { .typo-row { grid-template-columns: minmax(0,1fr); } }
.typo-row pre.code { padding: 0; background: none; border: 0; }
.typo-verdict { font: 500 .6875rem/1 var(--mono); }
.typo-verdict.ok { color: var(--pass); }
.typo-verdict.bad { color: var(--fail); }
.typo-swatch {
  width: 1.6rem; height: 1.6rem; border-radius: 3px; border: 1px solid var(--rule-2);
  display: grid; place-items: center;
  font: 600 .75rem/1 var(--mono); color: var(--ink-3);
}
.typo-swatch.is-void {
  background: repeating-linear-gradient(45deg, var(--paper-3) 0 4px, var(--paper-2) 4px 8px);
  border-style: dashed;
}
.typo-note { margin: .3rem 0 0; font-size: .84rem; color: var(--ink-2); max-width: 70ch; }

/* ============ SLOTS TABLE ============ */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule-2); border-radius: var(--radius); }
table.slots { width: 100%; border-collapse: collapse; background: var(--paper-2); font-size: .84rem; }
table.slots th, table.slots td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.slots thead th {
  font: 500 .625rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); background: var(--paper-3); position: sticky; top: 0;
}
table.slots tbody tr:last-child td { border-bottom: 0; }
table.slots .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--ink-3); white-space: nowrap; }
table.slots td.name { font-family: var(--mono); font-size: .78rem; color: var(--ink); white-space: nowrap; }
table.slots td.role { color: var(--ink-2); min-width: 22rem; }
.tbl-swatch { width: 1.4rem; height: 1.4rem; border-radius: 3px; border: 1px solid var(--rule-2); display: block; }
tr.is-unused td { opacity: .62; }
tr.is-unused .num::after { content: " ·"; }

/* ============ CHECKS ============ */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.checks li {
  display: grid; grid-template-columns: 1.4rem minmax(0,1fr);
  gap: .7rem; align-items: start;
  padding: .65rem .8rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--paper-2);
  font-size: .875rem;
}
.checks .box {
  width: 1.4rem; height: 1.4rem; border-radius: 3px;
  display: grid; place-items: center;
  font: 700 .8rem/1 var(--mono);
}
.checks .box.ok   { background: var(--pass-wash); color: var(--pass); }
.checks .box.bad  { background: var(--fail-wash); color: var(--fail); }
.checks .box.info { background: var(--paper-3); color: var(--ink-3); }
.checks strong { display: block; font-weight: 600; color: var(--ink); }
.checks span { color: var(--ink-3); font-size: .82rem; }
.checks li.is-bad { border-color: var(--fail); }

/* ============ FOOT ============ */
.foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.foot p { margin: 0; font-size: .8125rem; color: var(--ink-3); max-width: 70ch; }

.foot-credit {
  display: flex; align-items: center; gap: .55rem;
  margin-top: 1.1rem !important;
  padding-top: .95rem;
  border-top: 1px dashed var(--rule);
  font: 500 .8125rem/1.4 var(--mono);
  letter-spacing: .02em;
  color: var(--ink-2) !important;
}
.foot-credit .mark {
  width: .95rem; height: .95rem; flex: none; border-radius: 2px;
  background:
    linear-gradient(135deg, var(--accent) 0 50%, transparent 50% 100%),
    repeating-linear-gradient(45deg, var(--rule-2) 0 3px, var(--paper-2) 3px 6px);
  border: 1px solid var(--rule-2);
}
.foot-credit strong { color: var(--ink); font-weight: 700; letter-spacing: .06em; }

/* ============ MOBILE RAIL ============ */
.rail-scrim { position: fixed; inset: 0; background: rgba(10,12,16,.45); z-index: 45; border: 0; }

@media (max-width: 1080px) {
  .rail {
    position: fixed; z-index: 50;
    left: 0; right: 0; bottom: 0; top: auto;
    max-height: 76dvh;
    background: var(--paper-2);
    border-top: 1px solid var(--rule-2);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -8px 30px -12px rgba(0,0,0,.35);
    padding: .9rem 1rem 1.2rem;
    transform: translateY(calc(100% - 3.6rem));
    transition: transform .25s ease;
  }
  .rail.is-open { transform: translateY(0); }
  .rail-toggle {
    display: inline-block;
    font: 500 .75rem/1 var(--mono); letter-spacing: .06em;
    color: var(--accent-ink); background: var(--accent);
    border: 0; border-radius: 4px; padding: .45rem .7rem; cursor: pointer;
  }
  .rail-note, .rail-body, .rail-foot { display: none; }
  .rail.is-open .rail-note,
  .rail.is-open .rail-body,
  .rail.is-open .rail-foot { display: block; }
  .rail.is-open .rail-foot { display: flex; }
  .rail-body { max-height: 46dvh; overflow-y: auto; }
  main { padding-bottom: 6rem; }
}
