/* ============================================================================
   SEO Dash design system.

   Every colour is a token. The :root block below holds a neutral theme: the
   brand tokens (--accent, --accent-2, --brand-*), a neutral ramp (--n-*), a
   semantic palette (--pos, --neg, --warn, --absent) and the rail. A server's
   own brand.css, served after this file, may set the brand and rail tokens.

   The accent marks identity, the primary action and focus. A genuine decline
   is drawn in --neg, never in the accent, so it reads as a decline whatever
   the brand's colour.
   ========================================================================= */

@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/static/fonts/Barlow-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  /* --- brand: a neutral default; a server's brand.css may set its own ---- */
  --accent:       #1F5FAD;
  --accent-2:     #3A8DDE;
  --brand-dark:   #1F2937;
  --brand-gray:   #4B5563;
  --brand-gray-m: #6B7280;
  --brand-silver: #CBD5E1;

  /* --- neutral ramp ------------------------------------------------------ */
  --n-0: #FFFFFF; --n-25: #FAFBFB; --n-50: #F4F6F6;
  --n-100: #EDEFF0; --n-150: #E5E8E9; --n-200: #DBE0E1;

  /* --- semantic ---------------------------------------------------------- */
  --pos:    #0F7A4F;   /* AA on white */
  --neg:    #C62828;
  --warn:   #A5670A;
  --absent: #9AA0A2;   /* "no data" -- never the ink of a real zero */

  /* --- roles -------------------------------------------------------------- */
  --ground: var(--n-50);  --surface: var(--n-0);
  --ink: var(--brand-dark); --ink-2: var(--brand-gray); --ink-3: var(--brand-gray-m);
  --line: var(--n-150);   --line-2: var(--n-200);

  --rail-bg: #1F2937; --rail-ink: #E5E7EB; --rail-ink-2: #9CA3AF;
  --rail-line: #374151; --rail-hover: #2D3748;

  --font: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

  --rail-w: 232px; --head-h: 60px; --r: 4px;

  /* The faint wash at the foot of the rail: none, unless a brand.css sets one. */
  --chev-wash: none;
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23E5E7EB' d='M1.6,2.2L6,6.6L10.4,2.2Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ------------------------------------------------------------------ shell -- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.app.norail { grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------------------------- rail -- */
.rail {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--rail-bg); color: var(--rail-ink);
  border-right: 1px solid var(--rail-line);
}
/* An optional faint wash at the foot of the rail, drawn at 5% from --chev-wash
   (none unless a brand.css sets one). */
.rail::after {
  content: ""; position: absolute; left: -46px; bottom: -70px;
  width: 300px; height: 640px; pointer-events: none; opacity: .05;
  background: var(--chev-wash) no-repeat center / contain;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; position: relative; z-index: 1; }
/* `fill` is inheritable, so it crosses the <use> boundary into the symbol --
   a `.mark path` selector would not reach inside the shadow tree. */
.brand .mark { width: 13px; height: 28px; flex: none; display: block; fill: var(--accent); }
.brand .name { font-weight: 700; font-size: 13.5px; letter-spacing: .13em; text-transform: uppercase; line-height: 1.1; color: var(--rail-ink); }
.brand .name b { display: block; font-weight: 500; font-size: 9.5px; letter-spacing: .16em; color: var(--rail-ink-2); }
.brand a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 11px; }

.switcher { padding: 0 14px 16px; position: relative; z-index: 1; }
.switcher label {
  display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--rail-ink-2); margin-bottom: 5px;
}
.switcher select {
  width: 100%; font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 26px 7px 9px; border-radius: var(--r); cursor: pointer;
  color: var(--rail-ink); background-color: var(--rail-hover);
  border: 1px solid var(--rail-line); appearance: none;
  background-image: var(--caret); background-repeat: no-repeat;
  background-position: right 8px center; background-size: 9px;
}

.rail-nav { display: flex; flex-direction: column; padding: 4px 0; position: relative; z-index: 1; }
.rail-nav .grouplabel {
  font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rail-ink-2); padding: 14px 18px 6px;
}
.rail-nav a {
  display: flex; align-items: center; gap: 9px; padding: 7px 18px 7px 15px;
  font-size: 13.5px; font-weight: 500; color: var(--rail-ink); text-decoration: none;
  border-left: 3px solid transparent; transition: background-color .12s;
}
.rail-nav a:hover { background: var(--rail-hover); text-decoration: none; }
.rail-nav a.active { background: var(--rail-hover); border-left-color: var(--accent); font-weight: 600; }
.rail-nav a .tally {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px;
  color: var(--rail-ink-2); font-variant-numeric: tabular-nums;
}

.rail-foot { margin-top: auto; padding: 14px 18px 16px; border-top: 1px solid var(--rail-line); position: relative; z-index: 1; }
.rail-foot .who { font-size: 12.5px; font-weight: 600; }
.rail-foot .role { font-size: 10.5px; color: var(--rail-ink-2); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.rail-foot form { margin-top: 9px; }
.rail-foot button {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  background: none; color: var(--rail-ink-2); border: 1px solid var(--rail-line);
  padding: 5px 10px; border-radius: var(--r);
}
.rail-foot button:hover { color: var(--rail-ink); border-color: var(--rail-ink-2); }

/* ---------------------------------------------------------------- content -- */
.main { min-width: 0; display: flex; flex-direction: column; }
.head {
  position: sticky; top: 0; z-index: 30; height: var(--head-h);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.head h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.012em; }
.head .crumb { color: var(--ink-3); font-weight: 500; }
.head .spacer { flex: 1; }
.chip {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
  background: var(--n-50); border: 1px solid var(--line);
  padding: 4px 9px; border-radius: var(--r); white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }

main, .content { padding: 22px 26px 64px; max-width: 1460px; width: 100%; }
.lede { margin: 0 0 2px; font-size: 13px; color: var(--ink-3); max-width: 82ch; }

/* Section rule: label, optional count, hairline to the right edge. */
h2, .section > .sh { margin-top: 30px; }
/* Only a section that opens the page sits tight to the header. A section that
   follows a lede paragraph keeps its full leading, or the two collide. */
main > .section:first-child > .sh { margin-top: 2px; }
.section > .sh { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; flex-wrap: wrap; }
.section > .sh h2 {
  margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.section > .sh .count {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  background: var(--n-100); padding: 1px 6px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.section > .sh .rule { flex: 1; height: 1px; background: var(--line); min-width: 20px; }
/* Every control carries one plain line under it (spec 2026-09-14 §4.3), so .note is a
   global voice, not a section-header ornament. The header rule below stays: it is the
   same size but scoped, and removing it would change nothing except its specificity. */
.note { font-size: 11.5px; color: var(--ink-3); }
.section > .sh .note { font-size: 11.5px; color: var(--ink-3); }

/* -------------------------------------------------------------- scorecard -- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 10px; }
/* A row holding one or two metrics: cap the card width and left-align, so a
   single number does not get stretched across the full content width. */
.cards.few { grid-template-columns: repeat(auto-fit, minmax(184px, 260px)); justify-content: start; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px 13px; min-width: 0;
}
.card .label {
  font-size: 10px; font-weight: 600; letter-spacing: .085em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.card .value {
  font-size: 29px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12;
  margin-top: 3px; font-variant-numeric: tabular-nums;
}
.card .value .unit { font-size: 15px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.card .value.is-absent { color: var(--absent); font-weight: 500; }

.delta { margin-top: 3px; font-size: 11.5px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.delta .n { font-weight: 700; }
.delta.pos .n { color: var(--pos); }
.delta.neg .n { color: var(--neg); }
.delta.flat .n { color: var(--ink-2); }

/* A metric that declares its own polarity, so the arrow can never contradict
   the number (an average position falling from 20.8 to 18.4 is an improvement). */
.polarity {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 0 3px; line-height: 1.5; cursor: help; text-transform: none;
}
/* Absent is not zero: its own ink, and never a delta beside it. */
.na { color: var(--absent); font-variant-numeric: tabular-nums; }
.na[title] { cursor: help; }

/* ------------------------------------------------------------------ table -- */
.tablewrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.tabletools {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--n-25);
}
.tabletools input[type="search"] {
  font: inherit; font-size: 12.5px; padding: 5px 9px; width: 210px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
.tabletools .shown { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tabletools .spacer { flex: 1; }

.cols { position: relative; }
.cols > summary {
  list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 5px 9px;
  background: var(--surface); user-select: none;
}
.cols > summary::-webkit-details-marker { display: none; }
.cols > summary:hover { color: var(--ink); border-color: var(--brand-silver); }
.cols .pop {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 40; min-width: 168px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 8px 22px rgba(31, 41, 55, .13); padding: 7px;
}
.cols .pop label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 6px; border-radius: 3px; cursor: pointer; }
.cols .pop label:hover { background: var(--n-50); }

/* `overflow-x: auto` forces `overflow-y` to compute to auto, which makes this
   element the sticky containing block for the <th>s inside it. So the header
   sticks to THIS box, not the viewport, and `top` must be 0 -- any other value
   just pushes the header down over row 1. Tables long enough to want a sticky
   header get `.tall`, which gives the box a height to scroll within. */
.scroller { overflow-x: auto; }
.scroller.tall { max-height: 460px; overflow: auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); }
th, td { text-align: left; padding: 7px 11px; border-bottom: 1px solid var(--n-100); vertical-align: top; }
thead th {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line-2);
  font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap; padding-top: 9px; padding-bottom: 9px;
}
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--ink); }
thead th[data-sort]::after { content: "\2195"; margin-left: 5px; opacity: .3; font-size: 10px; }
thead th[aria-sort="ascending"]::after  { content: "\2191"; opacity: 1; color: var(--accent); }
thead th[aria-sort="descending"]::after { content: "\2193"; opacity: 1; color: var(--accent); }
tbody tr:hover { background: var(--n-25); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.path { font-family: var(--mono); font-size: 12px; }
td small, .sub { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.trunc { display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.newdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }

/* Table deltas: a glyph and a number, never colour alone. */
.d-in { font-size: 11px; font-weight: 700; margin-left: 5px; font-variant-numeric: tabular-nums; }
.d-in.pos { color: var(--pos); }
.d-in.neg { color: var(--neg); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.pill.green { color: var(--pos);    background: #EAF5F0; border-color: #C4E2D4; }
.pill.amber { color: var(--warn);   background: #FBF3E4; border-color: #EBD9B4; }
.pill.red   { color: var(--neg); background: #FDECEC; border-color: #F5C2C2; }
.pill.gray  { color: var(--ink-3);  background: var(--n-100); border-color: var(--line-2); }

.tags .tag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500;
  background: var(--n-100); border: 1px solid var(--line-2); color: var(--ink-2);
  padding: 1px 4px 1px 7px; border-radius: 3px; margin: 1px 3px 1px 0;
}
.tags .tag button { font: inherit; font-size: 12px; line-height: 1; padding: 0 2px; background: none; border: 0; color: var(--ink-3); cursor: pointer; }
.tags .tag button:hover { color: var(--neg); }

/* ------------------------------------------------------------ empty state -- */
.placeholder {
  border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--n-25);
  padding: 20px; color: var(--ink-3); font-size: 13px; text-align: center;
}
.placeholder strong { display: block; color: var(--ink-2); font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.placeholder code { font-family: var(--mono); font-size: 12px; background: var(--n-100); padding: 1px 5px; border-radius: 3px; color: var(--ink-2); }
.placeholder .ph {
  display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; margin-bottom: 7px;
}
.notice {
  border: 1px solid #F5C2C2; border-left: 3px solid var(--neg); background: #FEF6F6;
  border-radius: var(--r); padding: 11px 14px; font-size: 13px; color: var(--ink-2);
}
.notice b { color: var(--ink); }
.error { color: var(--neg); font-weight: 600; }

/* ----------------------------------------------------------------- charts -- */
.chartgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 10px; }
.chartcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px 9px; min-width: 0; }
.chartcard .ct { display: flex; align-items: baseline; gap: 7px; margin-bottom: 9px; }
.chartcard .ct h3 { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: .085em; text-transform: uppercase; color: var(--ink-3); }
.chartcard .ct .last { margin-left: auto; font-size: 15px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chartcard .cv { position: relative; height: 96px; }
.chartcard .foot { margin-top: 6px; font-size: 10.5px; color: var(--absent); }

/* --------------------------------------------------------------- document -- */
.report-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 24px; font-family: var(--mono); font-size: 12.5px; line-height: 1.62;
  white-space: pre-wrap; overflow-x: auto; color: var(--ink); max-width: 78ch;
}
.report-block.internal { border-left: 3px solid var(--accent); background: #F7F9FD; }
.docbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }

/* ------------------------------------------------------- buttons & forms -- */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 6px 13px; border-radius: var(--r); transition: background-color .12s;
}
button:hover, .btn:hover { background: #184C8A; border-color: #184C8A; text-decoration: none; }
button.secondary {
  background: var(--surface); color: var(--ink-2); border-color: var(--line-2);
}
button.secondary:hover { background: var(--n-50); color: var(--ink); border-color: var(--brand-silver); }
input, select, textarea {
  font: inherit; font-size: 13px; padding: 5px 8px; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
}
form.inline { display: inline; }
label { font-size: 12.5px; }

/* -------------------------------------------------- calendar stacked view -- */
.calrow { padding: 8px 0; border-bottom: 1px solid var(--n-100); }
.calrow:last-child { border-bottom: 0; }
.calrow-l1 { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.calrow-l1 .calrow-seq { font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.calrow-l1 .calrow-title { font-weight: 600; }
.calrow-l1 .calrow-edit { margin-left: auto; }
.calrow-l2 .calfield { margin-right: 14px; }
.calrow-l2 .calfield b { font-weight: 600; color: var(--ink-2); }

details.rowedit > summary {
  list-style: none; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px 8px; display: inline-block;
}
details.rowedit > summary::-webkit-details-marker { display: none; }
details.rowedit > summary:hover { color: var(--ink); border-color: var(--brand-silver); }
details.rowedit form { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; padding: 9px 0 3px; }
details.hidden-pages { margin-top: 26px; }
details.hidden-pages > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 0; }

/* ------------------------------------------------------------------ login -- */
.login { max-width: 340px; margin: 9vh auto; }
.login .lock { height: 30px; margin-bottom: 20px; display: block; }
.login .bar { height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; margin-bottom: 20px; }
.login h1 { font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 14px; }
.login label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.login input { width: 100%; font-size: 14px; padding: 8px 10px; margin-bottom: 13px; }
.login button { width: 100%; padding: 9px; }
.login p { margin: 0; }
code.token { font-family: var(--mono); font-size: 12.5px; background: var(--n-100); padding: 3px 6px; border-radius: 3px; }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .rail::after { display: none; }
  .rail-nav { flex-direction: row; flex-wrap: wrap; padding: 0 12px 12px; }
  .rail-nav .grouplabel { display: none; }
  .rail-nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 6px 10px; }
  .rail-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .rail-nav a .tally { display: none; }
  .rail-foot { margin: 0 0 0 auto; border-top: 0; }
  .switcher { padding: 0 14px 12px; min-width: 190px; }
  main, .content { padding: 18px 16px 48px; }
  .head { padding: 0 16px; }
}

/* ------------------------------------------------------------ automations -- */
.autolist { display: flex; flex-direction: column; gap: 8px; }
.autorow {
  display: grid; grid-template-columns: minmax(200px, 1.5fr) auto minmax(150px, 1fr) minmax(220px, 1.6fr) auto;
  gap: 8px 16px; align-items: center; padding: 11px 14px; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.autorow:hover { border-color: var(--brand-silver); text-decoration: none; }
.autorow-title { font-weight: 600; font-size: 14px; }
.autorow-title .autorow-recipe { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); }
.autorow-how, .autorow-next { font-size: 12px; color: var(--ink-3); }
.autorow-last { font-size: 12.5px; color: var(--ink-2); }
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0 0 6px; }
.seg-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); }
/* Each radio is hidden with the .sr-only clip pattern (still focusable, still reachable
   by assistive tech) and its word sits in a sibling span that carries the padding, so
   the checked/disabled/focus looks come from `input:checked + span` and friends -- no
   :has(), which older Firefox and Safari ignore entirely. position: relative keeps the
   clipped radio inside its own label. */
.seg label { position: relative; display: inline-block; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.seg input + span { display: inline-block; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--brand-dark); color: #fff; }
.seg input:disabled + span { color: var(--absent); cursor: not-allowed; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.runcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.runcard.failed { border-left: 3px solid var(--neg); }
.runcard-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.runcard .changes p { margin: 4px 0; }
.runcard details.report > summary, .runcard .changes details > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.callout { border: 1px solid #C4E2D4; border-left: 3px solid var(--pos); background: #EAF5F0; border-radius: var(--r); padding: 11px 14px; font-size: 13px; color: var(--ink-2); margin: 12px 0 0; }
.recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.recipes label { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.recipes label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.recipes label b { display: block; font-size: 14px; margin-bottom: 3px; }
.recipes label .note { display: block; }
.build fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.build legend { font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.build .group { margin-bottom: 8px; }
.build .group b { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
details.setup > summary, details.confirm > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
details.setup .group { margin: 14px 0; }
details.setup .group > b { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
/* The three Reads groups are fieldsets (a box announces its group) that look exactly like
   the headed blocks they replace: no border, no padding, the legend styled as the old
   heading. */
details.setup fieldset.group, .build fieldset.group { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
details.setup fieldset.group legend, .build fieldset.group legend { padding: 0; margin-bottom: 3px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.build fieldset.group legend b { display: inline; font-size: 12px; margin: 0; }
@media (max-width: 1080px) { .autorow { grid-template-columns: 1fr 1fr; } }
