/* ==========================================================================
   CWP design system
   Light-first (people read long guides here), fully dark-capable.
   Accent green = "live / go / uptime" — deliberately not the SaaS blue-violet.
   ========================================================================== */

:root {
  /* Neutrals — warm paper, not clinical grey */
  --paper:      #fcfcfa;
  --surface:    #ffffff;
  --surface-2:  #f4f4f0;
  --border:     #e3e3dc;
  --border-2:   #cfcfc5;
  --ink:        #16181c;
  --ink-2:      #454a52;
  --ink-3:      #6e747d;

  /* Accent */
  --accent:      #0b6b4f;
  --accent-2:    #0fa06f;
  --accent-hover:#08543e;
  --accent-soft: #e6f4ee;
  --accent-line: #a9d9c5;
  --on-accent:   #ffffff;

  /* Signals */
  --warn:       #8a5a00;
  --warn-soft:  #fdf3dd;
  --warn-line:  #ecd9a4;
  --danger:     #a02020;
  --danger-soft:#fbeaea;
  --danger-line:#eec2c2;

  /* Header band — a solid brand bar so the chrome never sits white-on-white
     against the paper below it. Verified in check_contrast.py. */
  --header-bg:     #0b6b4f;
  --header-ink:    #ffffff;
  --header-ink-2:  #cfe8dd;
  --header-tld:    #c9eadb;
  --header-line:   #084d39;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --measure: 68ch;
  --radius: 10px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0e1013;
    --surface:    #16191d;
    --surface-2:  #1d2126;
    --border:     #282d33;
    --border-2:   #3a4047;
    --ink:        #eceef1;
    --ink-2:      #b3bac2;
    --ink-3:      #848d97;

    --accent:      #3fd39b;
    --accent-2:    #5ee0ad;
    --accent-hover:#6fe8b8;
    --accent-soft: #12251e;
    --accent-line: #245943;
    --on-accent:   #08130f;

    --header-bg:     #133025;
    --header-ink:    #eceef1;
    --header-ink-2:  #b3c9c1;
    --header-tld:    #3fd39b;
    --header-line:   #0a1d16;

    --warn:       #e8b44a;
    --warn-soft:  #241d0e;
    --warn-line:  #4d3d18;
    --danger:     #f08a8a;
    --danger-soft:#2a1414;
    --danger-line:#572727;

    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --paper: #0e1013; --surface: #16191d; --surface-2: #1d2126;
  --border: #282d33; --border-2: #3a4047;
  --ink: #eceef1; --ink-2: #b3bac2; --ink-3: #848d97;
  --accent: #3fd39b; --accent-2: #5ee0ad; --accent-soft: #12251e; --accent-line: #245943;
  --on-accent: #08130f; --accent-hover: #6fe8b8;
  --header-bg: #133025; --header-ink: #eceef1; --header-ink-2: #b3c9c1;
  --header-tld: #3fd39b; --header-line: #0a1d16;
  --warn: #e8b44a; --warn-soft: #241d0e; --warn-line: #4d3d18;
  --danger: #f08a8a; --danger-soft: #2a1414; --danger-line: #572727;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --paper: #fcfcfa; --surface: #ffffff; --surface-2: #f4f4f0;
  --border: #e3e3dc; --border-2: #cfcfc5;
  --ink: #16181c; --ink-2: #454a52; --ink-3: #6e747d;
  --accent: #0b6b4f; --accent-2: #0fa06f; --accent-soft: #e6f4ee; --accent-line: #a9d9c5;
  --on-accent: #ffffff; --accent-hover: #08543e;
  --header-bg: #0b6b4f; --header-ink: #ffffff; --header-ink-2: #cfe8dd;
  --header-tld: #c9eadb; --header-line: #084d39;
  --warn: #8a5a00; --warn-soft: #fdf3dd; --warn-line: #ecd9a4;
  --danger: #a02020; --danger-soft: #fbeaea; --danger-line: #eec2c2;
  color-scheme: light;
}

/* -------------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 650; overflow-wrap: break-word; word-break: break-word; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -0.033em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.9rem); margin-top: 2.4em; }
h3 { font-size: 1.2rem; margin-top: 2em; }
p  { margin: 0 0 1.15em; }

a { color: var(--accent); text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

strong { font-weight: 650; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--border); margin: 3rem 0; }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .38em;
  word-break: break-word;
}
pre {
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 0 0 1.4em;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin: .35em 0; }
li::marker { color: var(--ink-3); }

/* ------------------------------------------------------------------ layout */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px;
}

/* ------------------------------------------------------------------ tables */

.table-scroll { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 620; white-space: nowrap; color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------- callouts  */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink-3);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .95rem 1.1rem;
  margin: 0 0 1.5em;
  font-size: .95rem;
}
.callout > :last-child { margin-bottom: 0; }
.callout-label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; margin-bottom: .35rem; }
.callout--note   { border-left-color: var(--accent); background: var(--accent-soft); }
.callout--note .callout-label { color: var(--accent); }
.callout--warn   { border-left-color: var(--warn); background: var(--warn-soft); }
.callout--warn .callout-label { color: var(--warn); }
.callout--danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout--danger .callout-label { color: var(--danger); }

/* ------------------------------------------------------------------ pieces */

.eyebrow {
  font-family: var(--mono); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); font-weight: 600; margin: 0 0 .8rem;
}

.lede { font-size: 1.15rem; line-height: 1.6; color: var(--ink-2); }

.answer-first {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0 0 2rem;
  font-size: 1.02rem;
}
.answer-first > :last-child { margin-bottom: 0; }

/* Buttons.
 *
 * Colours come from per-button custom properties, never from a `color:`
 * declaration on a variant class. Variants only reassign the tokens, so adding
 * a variant can never lose a specificity fight with the rules below — which is
 * exactly how the ghost button ended up white-on-white once already.
 *
 * The selectors carry element names so they beat `.nav a` (0,1,1). Contrast for
 * every combination is asserted in check_contrast.py. */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--on-accent);
  --btn-bd: transparent;

  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--btn-bg); font-weight: 600; font-size: .95rem;
  padding: .68rem 1.15rem; border-radius: 8px; border: 1px solid var(--btn-bd);
  text-decoration: none; cursor: pointer; font-family: inherit;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.btn:hover { --btn-bg: var(--accent-hover); transform: translateY(-1px); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--border-2); }
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); --btn-bd: var(--ink-3); }

/* Applied last, with enough specificity to win anywhere a button appears. */
a.btn, button.btn, .nav a.btn, .rail-cta a.btn,
a.btn:hover, button.btn:hover, .nav a.btn:hover { color: var(--btn-fg); }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.2rem; text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.card p { margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.55; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  padding: .18rem .5rem; border-radius: 999px; border: 1px solid var(--border-2);
  color: var(--ink-2); background: var(--surface-2);
}

.meta { font-size: .84rem; color: var(--ink-3); font-family: var(--mono); }

/* ------------------------------------------------------------------ chrome */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  box-shadow: 0 1px 3px rgb(0 0 0 / .18);
}
.site-header .bar { display: flex; align-items: center; gap: 1.4rem; height: 60px; }
.brand { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: var(--header-ink); flex: 0 0 auto; }
.brand-mark {
  font-family: var(--mono); font-weight: 600; font-size: .82rem;
  letter-spacing: .085em; text-transform: uppercase; line-height: 1.1;
}
.brand-tld {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  color: var(--header-tld); text-transform: lowercase; line-height: 1;
}
@media (max-width: 900px) {
  .brand-mark { font-size: 0; letter-spacing: 0; }
  /* Collapse to the initials rather than wrapping three words into the bar. */
  .brand-mark::before { content: 'CWP'; font-size: .95rem; letter-spacing: .1em; }
}
.nav { display: flex; gap: 1.15rem; margin-left: auto; align-items: center; font-size: .92rem; }
.nav a { color: var(--header-ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--header-ink); }
@media (max-width: 760px) {
  .nav { gap: .85rem; font-size: .86rem; overflow-x: auto; }
  .nav .nav-cta { display: none; }
}

/* On the brand band the primary button inverts — an accent-on-accent button
   would be invisible. */
.nav .nav-cta {
  --btn-bg: var(--header-ink); --btn-fg: var(--header-bg); --btn-bd: var(--header-ink);
  background: var(--header-ink); color: var(--header-bg); border-color: var(--header-ink);
}
.nav .nav-cta:hover {
  --btn-bg: var(--header-ink-2); --btn-fg: var(--header-bg); --btn-bd: var(--header-ink-2);
  background: var(--header-ink-2); color: var(--header-bg); border-color: var(--header-ink-2);
}

.theme-toggle {
  background: none; border: 1px solid var(--header-line); color: var(--header-ink-2);
  border-radius: 7px; width: 32px; height: 32px; display: grid; place-items: center;
  cursor: pointer; font-size: .9rem; padding: 0; flex: 0 0 auto;
}
.theme-toggle:hover { border-color: var(--header-ink-2); color: var(--header-ink); }

.site-footer { border-top: 1px solid var(--border); margin-top: 5rem; padding: 2.5rem 0 3.5rem; background: var(--surface); }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: .7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .3rem 0; }
.site-footer a { color: var(--ink-2); text-decoration: none; font-size: .9rem; }
.site-footer a:hover { color: var(--accent); }
.colophon { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--ink-3); }

/* ------------------------------------------------------------- breadcrumbs */

.crumbs { font-size: .84rem; color: var(--ink-3); margin: 0 0 1.2rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs li + li::before { content: '/'; margin-right: .45rem; color: var(--border-2); }

/* ---------------------------------------------------------- doc + sidebar  */

.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; padding: 2.5rem 0 0; }
@media (min-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr) 232px; } }

/* --- article furniture: TL;DR, jump box, read-next, right rail ----------- */

.tldr {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.6rem;
}
.tldr > :last-child { margin-bottom: 0; }
.tldr .callout-label { color: var(--accent); }
.tldr ul { margin-bottom: 0; }

.jumpbox {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.1rem;
  margin: 0 0 2.2rem;
}
.jumpbox-title {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 700; color: var(--ink-3); margin: 0 0 .6rem;
}
.jumpbox ol { margin: 0; padding-left: 1.15rem; }
.jumpbox li { margin: .3rem 0; }
.jumpbox li::marker { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.jumpbox a { text-decoration: none; font-size: .95rem; }
.jumpbox a:hover { text-decoration: underline; text-underline-offset: 3px; }

.read-next { margin: 3rem 0 0; padding-top: 1.6rem; border-top: 2px solid var(--border); }
.read-next-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 700; color: var(--accent); margin: 0 0 .7rem;
}
.read-next a {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.05rem 1.2rem; background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
}
.read-next a:hover { border-color: var(--accent); transform: translateY(-2px); }
.read-next-title { display: block; font-weight: 650; font-size: 1.05rem; margin-bottom: .25rem; }
.read-next-desc { display: block; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }

.rail { align-self: start; font-size: .9rem; display: none; }
@media (min-width: 1000px) { .rail { display: block; position: sticky; top: 84px; } }
.rail-block { margin-bottom: 1.8rem; }
.rail-block h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); margin-bottom: .6rem;
}
.rail-list { list-style: none; padding: 0; margin: 0; }
.rail-list li { margin: 0; border-bottom: 1px solid var(--border); }
.rail-list li:last-child { border-bottom: 0; }
.rail-list a {
  display: block; padding: .5rem 0; color: var(--ink-2);
  text-decoration: none; line-height: 1.4;
}
.rail-list a:hover { color: var(--accent); }
.rail-cta {
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.rail-cta p { margin: 0 0 .5rem; font-size: .89rem; line-height: 1.5; color: var(--ink-2); }
.rail-cta p strong { color: var(--ink); }
.rail-cta .btn { width: 100%; justify-content: center; font-size: .88rem; padding: .55rem 1rem; }

.toc { position: sticky; top: 84px; align-self: start; font-size: .88rem; display: none; }
@media (min-width: 1000px) { .toc { display: block; } }
.toc h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: .6rem; }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: .3rem 0 .3rem .8rem; margin-left: -1px; border-left: 1px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); border-left-color: var(--accent-line); }

/* ---------------------------------------------------------------- the tool */

.tool { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.35rem; margin: 0 0 2rem; }
.tool-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.tool-form input[type='text'], .tool-form select {
  font: inherit; font-size: .95rem; padding: .6rem .75rem;
  border: 1px solid var(--border-2); border-radius: 8px;
  background: var(--paper); color: var(--ink);
}
.tool-form input[type='text'] { flex: 1 1 240px; font-family: var(--mono); font-size: .9rem; }
.tool-form select { flex: 0 0 auto; }

.results { margin-top: 1.25rem; display: grid; gap: .55rem; }
.res {
  display: grid; grid-template-columns: 1fr; gap: .3rem;
  border: 1px solid var(--border); border-radius: 8px; padding: .7rem .85rem; background: var(--paper);
}
@media (min-width: 620px) { .res { grid-template-columns: 190px 1fr auto; align-items: center; gap: .9rem; } }
.res-name { font-weight: 600; font-size: .9rem; }
.res-name small { display: block; font-weight: 400; color: var(--ink-3); font-family: var(--mono); font-size: .75rem; }
.res-data { font-family: var(--mono); font-size: .84rem; color: var(--ink-2); word-break: break-word; }
.res-data div { margin: .1rem 0; }
.res-state { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; }
.res[data-state='ok']      { border-color: var(--accent-line); }
.res[data-state='ok'] .res-state { color: var(--accent); }
.res[data-state='none']    { border-color: var(--warn-line); }
.res[data-state='none'] .res-state { color: var(--warn); }
.res[data-state='error']   { border-color: var(--danger-line); }
.res[data-state='error'] .res-state { color: var(--danger); }
.res[data-state='pending'] .res-state { color: var(--ink-3); }

.verdict { margin-top: 1.1rem; padding: .85rem 1rem; border-radius: 8px; font-size: .93rem; border: 1px solid var(--border); background: var(--surface-2); }
.verdict[data-v='consistent'] { border-color: var(--accent-line); background: var(--accent-soft); }
.verdict[data-v='mixed']      { border-color: var(--warn-line); background: var(--warn-soft); }

/* ------------------------------------------------------------------- misc  */

.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;
}

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { border-bottom: 1px solid var(--border); margin: 0; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain a { display: flex; gap: 1rem; align-items: baseline; padding: .8rem 0; text-decoration: none; color: inherit; }
.list-plain a:hover .lp-title { color: var(--accent); }
.lp-code { font-family: var(--mono); font-size: .8rem; color: var(--ink-3); flex: 0 0 auto; min-width: 3.5rem; }
.lp-title { font-weight: 550; font-size: .97rem; }
.lp-desc { color: var(--ink-3); font-size: .88rem; }

.hero { padding: 4rem 0 2.5rem; }
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 54ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; }

.section { padding: 3rem 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head a { font-size: .89rem; text-decoration: none; }

/* ======================================================================
   Tool UI — shared across every tool
   ====================================================================== */

.opts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 1.25rem; }
.opts-wide { grid-column: 1 / -1; }
.opts fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem 1rem; margin: 0; background: var(--paper);
}
.opts legend {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 700; color: var(--ink-3); padding: 0 .35rem;
}
.opts legend small, .opts label small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }
.opts label { display: block; font-size: .9rem; margin: .45rem 0; color: var(--ink-2); }
.opts label small { display: block; font-size: .78rem; }
.opts input[type="checkbox"] { margin-right: .45rem; accent-color: var(--accent); }
.opts input[type="text"], .opts select, .opts textarea {
  font: inherit; font-size: .88rem; width: 100%; margin-top: .2rem;
  padding: .45rem .6rem; border: 1px solid var(--border-2); border-radius: 7px;
  background: var(--surface); color: var(--ink);
}
.opts textarea, .opts input[type="text"] { font-family: var(--mono); font-size: .82rem; }
.opts input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: .4rem; }

.len { float: right; font-family: var(--mono); font-size: .74rem; color: var(--ink-3); font-weight: 400; }
.len--over { color: var(--danger); font-weight: 600; }

.out { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.out-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  padding: .45rem .5rem .45rem .9rem;
  font-family: var(--mono); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-3);
}
.out pre { margin: 0; border: 0; border-radius: 0; max-height: 460px; }
.btn--sm { padding: .3rem .7rem; font-size: .78rem; }

/* SERP preview */
.preview-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--ink-3); margin: 0 0 .5rem; }
.preview-label small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.serp { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.15rem; background: var(--surface); margin-bottom: 1.5rem; font-family: Arial, sans-serif; }
.serp-url { font-size: .82rem; color: var(--ink-2); margin-bottom: .2rem; }
.serp-title { font-size: 1.25rem; line-height: 1.3; color: #1a0dab; margin-bottom: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .serp-title { color: #8ab4f8; } }
:root[data-theme='dark'] .serp-title { color: #8ab4f8; }
:root[data-theme='light'] .serp-title { color: #1a0dab; }
.serp-desc { font-size: .88rem; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Password generator */
.pw-out { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.pw-value {
  flex: 1; font-family: var(--mono); font-size: 1.05rem; word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem .9rem; min-height: 3rem;
  display: flex; align-items: center;
}
.pw-strength { font-size: .85rem; font-family: var(--mono); margin-bottom: 1.25rem; color: var(--ink-3); }
.pw-strength[data-state='ok'] { color: var(--accent); }
.pw-strength[data-state='warn'] { color: var(--warn); }
.pw-strength[data-state='bad'] { color: var(--danger); }

/* Cron */
.cron-expr { display: flex; gap: .6rem; margin-bottom: .9rem; }
.cron-expr input {
  flex: 1; font-family: var(--mono); font-size: 1.05rem; letter-spacing: .06em;
  padding: .6rem .8rem; border: 1px solid var(--border-2); border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.cron-english { font-size: 1rem; color: var(--ink); margin: 0 0 1.2rem; padding: .7rem .9rem; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: .8rem; padding: .32rem .7rem; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Hosting calculator result */
.hc-result { border: 1px solid var(--border); border-left: 3px solid var(--ink-3); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.25rem; background: var(--surface); }
.hc-result[data-tier='free'], .hc-result[data-tier='static'] { border-left-color: var(--accent); background: var(--accent-soft); }
.hc-result[data-tier='paid'] { border-left-color: var(--warn); background: var(--warn-soft); }
.hc-result[data-tier='vps'] { border-left-color: var(--danger); background: var(--danger-soft); }
.hc-head { font-size: 1.15rem; font-weight: 650; margin: 0 0 .4rem; color: var(--ink); }
.hc-why { margin: 0 0 .8rem; color: var(--ink-2); font-size: .95rem; }
.hc-sub { font-size: .88rem; font-weight: 600; margin: 0 0 .3rem; color: var(--ink); }
.hc-result ul { font-size: .9rem; color: var(--ink-2); margin-bottom: .9rem; }
.hc-note { font-size: .88rem; color: var(--ink-2); margin: 0 0 .7rem; padding-left: .8rem; border-left: 2px solid var(--border-2); }

.verdict[data-v='ok']   { border-color: var(--accent-line); background: var(--accent-soft); }
.verdict[data-v='warn'] { border-color: var(--warn-line); background: var(--warn-soft); }
.verdict[data-v='bad']  { border-color: var(--danger-line); background: var(--danger-soft); }

/* Subdomain picker on /start/ */
.sd-row { display: flex; gap: .6rem; }
.sd-row input {
  flex: 1; font: inherit; font-family: var(--mono); font-size: 1.15rem;
  padding: .75rem .9rem; border: 1px solid var(--border-2); border-radius: 9px;
  background: var(--surface); color: var(--ink);
}
.sd-preview {
  font-family: var(--mono); font-size: 1.25rem; margin: .9rem 0 .3rem;
  color: var(--ink-3); word-break: break-all;
}
.sd-preview[data-state='ok'] { color: var(--accent); }
.sd-preview[data-state='bad'] { color: var(--danger); }
.sd-msg { font-size: .9rem; margin: 0; color: var(--ink-3); min-height: 1.3em; }
.sd-msg[data-state='ok'] { color: var(--accent); }
.sd-msg[data-state='bad'] { color: var(--danger); }

/* Article header art. Transparent PNG/WebP, so no background of its own —
   it reads correctly on both themes without a second asset. */
.header-art { margin: 0 0 2rem; }
.header-art picture { display: block; }
.header-art img {
  display: block; width: 100%; height: auto;
  max-width: 100%; aspect-ratio: 1200 / 670;
}
@media (max-width: 640px) { .header-art { margin-bottom: 1.4rem; } }

/* Small layout utilities.
   These exist so no template needs a style="" attribute: inline styles would
   force `style-src 'unsafe-inline'` in the CSP shipped from public/_headers,
   and there are too few of these to be worth that. */
.mb-1        { margin-bottom: 1rem; }
.mb-2        { margin-bottom: 2rem; }
.pad-block   { padding: 4rem 0; }
.measure     { max-width: 60ch; color: var(--ink-2); }
.measure-wide { max-width: 70ch; }
.fineprint   { font-size: .9rem; color: var(--ink-3); }
.callout-label--accent { color: var(--accent); }
/* A tool with a row in tools.json but no implementation yet. */
.card--pending { opacity: .5; }

/* Outbound recommendation box. Deliberately quieter than the CWP CTA: a paid
   link that shouts is the thing that costs a hosting site its credibility. */
.rec {
  border: 1px solid var(--border); border-left: 3px solid var(--ink-3);
  border-radius: var(--radius); background: var(--surface);
  padding: 1.1rem 1.25rem; margin: 2rem 0;
}
.rec > :last-child { margin-bottom: 0; }
.rec-head { font-weight: 700; margin: 0 0 .5rem; }
.rec-label {
  display: block; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3); margin-bottom: .2rem;
}
.rec-why { color: var(--ink-2); font-size: .95rem; }

/* Auto-injected in-body cross-links (content.py _autolink). Styled the same as
   editorial links so a reader cannot tell which were hand-placed. */
.prose a.xref { color: var(--accent); }

/* Eyebrow labels removed above headings, per request. */
.eyebrow { display: none; }

/* External authority citations (content.py autolink). Subtle outbound mark. */
.prose a.xref-ext::after { content: "\2197"; font-size: .7em; vertical-align: super; opacity: .55; margin-left: 1px; }

/* --------------------------------------------------------------- slide menu */

.hamburger {
  display: inline-grid; gap: 4px; align-content: center;
  width: 34px; height: 34px; padding: 7px 6px; margin-left: .1rem;
  background: none; border: 1px solid var(--header-line); border-radius: 7px;
  cursor: pointer; flex: 0 0 auto;
}
.hamburger span { display: block; height: 2px; border-radius: 2px; background: var(--header-ink); transition: opacity .2s, transform .2s; }
.hamburger:hover { border-color: var(--header-ink-2); }

.drawer-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.45); opacity: 0; transition: opacity .25s ease;
}
body.menu-open .drawer-overlay { opacity: 1; }

.drawer {
  position: fixed; top: 0; left: 0; z-index: 61;
  width: min(320px, 84vw); height: 100%;
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: 2px 0 24px rgba(0,0,0,.18);
  transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
body.menu-open .drawer { transform: translateX(0); }

.drawer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}
.drawer-brand { font-family: var(--mono); font-weight: 600; font-size: .82rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--header-ink); text-decoration: none; }
.drawer-brand span { color: var(--header-tld); text-transform: lowercase; letter-spacing: .12em; margin-left: .3rem; }
.drawer-close { background: none; border: 0; color: var(--header-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }

.drawer-scroll { padding: 1rem 1.1rem 2.5rem; overflow-y: auto; flex: 1; }
.drawer-cta { width: 100%; justify-content: center; margin-bottom: 1.2rem; }

.drawer-group { margin-bottom: 1.3rem; }
.drawer-group ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.drawer-group li { margin: 0; }
.drawer-h { display: block; font-weight: 650; font-size: .95rem; color: var(--ink); text-decoration: none; padding: .35rem 0; }
.drawer-group ul a { display: block; color: var(--ink-2); text-decoration: none; font-size: .9rem; padding: .32rem 0 .32rem .9rem; border-left: 2px solid var(--border); }
.drawer-group ul a:hover, .drawer-h:hover { color: var(--accent); }
.drawer-group ul a:hover { border-left-color: var(--accent-line); }
.drawer-group--flat .drawer-h { border-top: 1px solid var(--border); }

/* Desktop keeps the inline nav; mobile hides the text links and leans on the
   drawer. The hamburger shows at every width, top right. */
@media (max-width: 760px) {
  .nav > a { display: none; }
}

/* Contain the off-canvas drawer so it can never create horizontal scroll on
   mobile (clip keeps position:sticky working, unlike hidden). */
html, body { overflow-x: clip; }
.drawer { visibility: hidden; }
body.menu-open .drawer { visibility: visible; }
