/* Labtrace. An instrument, not a magazine.
   No web fonts: zero external requests, and a strict CSP stays possible. */

:root {
  --bg: #0b0d10;
  --bg-elev: #0f1217;
  --bg-row: #101319;
  --line: #191e26;
  --line-hi: #262e3a;
  --fg: #c9d2dd;
  --fg-dim: #78849a;
  --fg-mute: #4a5464;
  --accent: #45c7e8;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --row-pad: 11px 16px;
  --chrome-h: 44px;
  --ticker-h: 128px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Fine grain over the whole surface. Sits under everything, costs one element. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: repeating-linear-gradient(
    0deg, #fff 0 1px, transparent 1px 2px
  );
  mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- chrome */

.chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--chrome-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px;
  background: rgba(11, 13, 16, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #e6edf6;
}
.brand span { color: var(--fg-mute); }

.domains { display: flex; gap: 2px; margin-right: auto; }

.domains a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.domains a:hover { color: var(--fg-dim); border-color: var(--line); text-decoration: none; }
.domains a.on {
  color: var(--d-accent, var(--fg));
  border-color: color-mix(in srgb, var(--d-accent, var(--fg)) 34%, transparent);
  background: color-mix(in srgb, var(--d-accent, var(--fg)) 8%, transparent);
}

.live {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
}
.live b { font-weight: 500; color: var(--fg-dim); }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55);
  animation: pulse 2.4s ease-out infinite;
}
.dot.off { background: var(--fg-mute); animation: none; box-shadow: none; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

.demo {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: #f0b429;
  border: 1px solid rgba(240, 180, 41, 0.4);
  background: rgba(240, 180, 41, 0.07);
  padding: 2px 7px;
  border-radius: 2px;
}

/* -------------------------------------------------------------- counters */

.counters {
  position: sticky;
  top: var(--chrome-h);
  z-index: 39;
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  padding: 7px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.counters b {
  font-weight: 500;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.counters .c { white-space: nowrap; }

/* ------------------------------------------------------------------ feed */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: calc(var(--ticker-h) + 24px);
}

.feed { position: relative; }

.ev {
  --accent: #45c7e8;
  position: relative;
  display: grid;
  grid-template-columns: 3px 1fr 118px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.16s;
}
.ev:hover { background: var(--bg-row); }

.rail {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  transition: background 0.5s, box-shadow 0.5s;
}

.body { padding: var(--row-pad); min-width: 0; }

/* Every piece of metadata is monospaced. It is the cheapest and most effective
   instrument signal there is. */
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  margin-bottom: 5px;
}

.eid {
  color: var(--accent);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.sep { color: #232a34; }
.dom {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: color-mix(in srgb, var(--accent) 74%, var(--fg-mute));
}

.gap {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid;
}
.gap.overblown { color: #f0803c; border-color: rgba(240, 128, 60, 0.38); background: rgba(240, 128, 60, 0.08); }
.gap.underread { color: #58d6a8; border-color: rgba(88, 214, 168, 0.34); background: rgba(88, 214, 168, 0.07); }

.title {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: -0.005em;
  color: #dfe7f1;
}
.ev:hover .title { color: #fff; }

.sub {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.sol { color: var(--fg-dim); }
.sol.weak { color: #b8763a; }
.sol.strong { color: #6f9e7e; }

.num { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.rise { color: #58d6a8; }

.spark { display: block; opacity: 0.75; }

/* heat column */

.heat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: var(--row-pad);
  border-left: 1px solid var(--line);
}

.hnum {
  font-family: var(--mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--accent) calc(var(--h) * 1%), var(--fg-mute));
  text-shadow: 0 0 calc(var(--h) * 0.18px) color-mix(in srgb, var(--accent) 55%, transparent);
  line-height: 1;
}

.hlabel {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--fg-mute);
}

.hbar {
  width: 86px; height: 3px;
  background: #171c24;
  border-radius: 1px;
  overflow: hidden;
}
.hbar i {
  display: block;
  height: 100%;
  width: calc(var(--h) * 1%);
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: width 0.55s cubic-bezier(.22,.8,.3,1);
}

/* The arrival state. It carries the whole feeling of the feed, so it gets the
   effort: a bright rail, a wash, then a slow decay back to rest over 30s. */
.ev.is-new { animation: arrive 0.42s cubic-bezier(.16,1,.3,1); }
.ev.is-new .rail {
  background: var(--accent);
  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--accent) 70%, transparent);
}
.ev.is-new::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 13%, transparent) 0%,
    transparent 46%);
  animation: fadeout 30s linear forwards;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }

/* A row that just gained a source flashes without moving. This is what keeps
   the page alive while the feed itself stays deliberately calm. */
.ev.is-bumped .hbar i { box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 90%, transparent); }
.ev.is-bumped .hnum { animation: bump 0.75s ease-out; }
@keyframes bump {
  0%   { transform: scale(1); }
  22%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------------- ticker */

.ticker {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  height: var(--ticker-h);
  background: rgba(9, 11, 14, 0.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-hi);
  display: flex;
  flex-direction: column;
}

.tbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.tbar .worker { margin-left: auto; text-transform: none; letter-spacing: 0.04em; }
.tbar .worker.on { color: #58d6a8; }

.tlines {
  flex: 1;
  overflow: hidden;
  padding: 4px 14px 6px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tl {
  display: flex;
  gap: 10px;
  white-space: nowrap;
  color: var(--fg-mute);
  animation: tin 0.2s ease-out;
}
@keyframes tin { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.tl .t { color: #39414f; font-variant-numeric: tabular-nums; }
.tl .st { width: 62px; flex: none; letter-spacing: 0.06em; }
.tl .tg { color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; }
.tl .dt { margin-left: auto; color: #4a5464; flex: none; }

.tl[data-stage="fetch"]   .st { color: #5b8fd6; }
.tl[data-stage="parse"]   .st { color: #7b8ba3; }
.tl[data-stage="embed"]   .st { color: #a06fd6; }
.tl[data-stage="cluster"] .st { color: #45c7e8; }
.tl[data-stage="score"]   .st { color: #58d6a8; }
.tl[data-stage="resolve"] .st { color: #c98f5a; }
.tl[data-stage="dedup"]   .st { color: #b8763a; }
.tl[data-stage="queue"]   .st { color: #4a5464; }
.tl[data-stage="worker"]  .st { color: #d6a13f; }
.tl[data-stage="idle"]    .st { color: #39414f; }
.tl[data-err="1"] .tg { color: #d6674f; }

/* ------------------------------------------------------------ event page */

.ev-page { padding: 26px 16px 0; }
.ev-page .title { font-size: 22px; line-height: 1.28; margin-bottom: 10px; }
.ev-page .abstract { color: var(--fg-dim); max-width: 74ch; margin: 0 0 20px; }

.panel { border: 1px solid var(--line); border-radius: 3px; margin-bottom: 16px; }
.panel h3 {
  margin: 0;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.panel .rows { padding: 2px 0; }

.srow {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 6px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(25, 30, 38, 0.6);
}
.srow:last-child { border-bottom: 0; }
.srow .sname { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }
.srow .shead { color: var(--fg); min-width: 0; }
.srow .sw { font-family: var(--mono); font-size: 11px; color: var(--fg-mute); }
.srow.syndicated .shead { color: var(--fg-mute); text-decoration: line-through; }
.srow .tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  padding: 1px 4px; border-radius: 2px; margin-left: 6px;
}
.tag.p { color: #58d6a8; border: 1px solid rgba(88, 214, 168, 0.3); }
.tag.s { color: var(--fg-mute); border: 1px solid var(--line-hi); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; }
.kv dt { color: var(--fg-mute); }
.kv dd { margin: 0; color: var(--fg-dim); }

.back {
  font-family: var(--mono); font-size: 11px; color: var(--fg-mute);
  letter-spacing: 0.08em; display: inline-block; margin-bottom: 16px;
}

.empty {
  padding: 60px 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-mute);
}

@media (max-width: 720px) {
  .ev { grid-template-columns: 3px 1fr 84px; }
  .hbar { width: 60px; }
  .domains { overflow-x: auto; }
  :root { --ticker-h: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =================================================================
   Reading vs instruments.

   Both variants are in the markup; the mode only decides which one is
   displayed. Toggling is therefore instant and costs no JavaScript work and no
   re-render. The chrome, the density, the ticker and the animations are
   identical in both: only the jargon changes.
   ================================================================= */

body.mode-reading .i-only { display: none !important; }
body.mode-instruments .r-only { display: none !important; }


.modesw button {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  transition: color 0.14s, background 0.14s;
}
.modesw button:hover { color: var(--fg-dim); }
body.mode-reading .modesw button[data-mode="reading"],
body.mode-instruments .modesw button[data-mode="instruments"] {
  color: #cfe9f4;
  background: rgba(69, 199, 232, 0.12);
}

.howto-open {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  background: transparent;
  border: 0;
  border-bottom: 1px dotted var(--line-hi);
  padding: 1px 0;
  cursor: pointer;
}
.howto-open:hover { color: var(--fg-dim); }

/* The plain sentence under the title. Dim, one line on wide screens, so the
   scannable density of the feed survives. */
.gloss {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-mute);
  max-width: 96ch;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ev:hover .gloss { color: var(--fg-dim); }

.sol.mid { color: #7f93b5; }
.when { cursor: help; }

.paper {
  color: color-mix(in srgb, var(--accent) 78%, var(--fg-dim));
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 40%, transparent);
}
.paper:hover { text-decoration: none; color: var(--accent); }

/* ---------------------------------------------------- ticker refinements */

/* Lines dissolve as they rise. A mask is composited on the GPU: no JavaScript,
   no per frame cost, and it scrolls for free. */
.tlines {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 100%);
}

/* Arrival: a short background wash on the single new line, gone in 400ms.
   One animation on one element, so no permanent glow and no christmas tree. */
.tl {
  animation: tin 0.2s ease-out, tglow 0.4s ease-out;
  border-radius: 2px;
  padding: 0 4px;
  margin: 0 -4px;
}
@keyframes tglow {
  0%   { background: rgba(120, 200, 235, 0.16); }
  100% { background: transparent; }
}

/* ------------------------------------------------------------ how to read */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 8, 10, 0.82);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  padding: 40px 16px calc(var(--ticker-h) + 40px);
  animation: fadein 0.16s ease-out;
}
.sheet[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.sheet-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  padding: 26px 30px 30px;
  position: relative;
}
.sheet-box h2 {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #dfe7f1;
}
.sheet-box h3 {
  margin: 22px 0 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.sheet-box p { margin: 0 0 10px; color: var(--fg-dim); line-height: 1.62; font-size: 13.5px; }
.sheet-box b { color: var(--fg); font-weight: 500; }
.sheet-box .ex {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
  border: 1px solid;
  margin-right: 6px;
}
.sheet-box .ex.overblown { color: #f0803c; border-color: rgba(240, 128, 60, 0.38); }
.sheet-box .ex.underread { color: #58d6a8; border-color: rgba(88, 214, 168, 0.34); }
.sheet-foot { margin-top: 22px !important; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px !important; }

.sheet-close {
  position: absolute;
  top: 12px; right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 3px 9px;
  cursor: pointer;
}
.sheet-close:hover { color: var(--fg); border-color: var(--line-hi); }

@media (max-width: 900px) {
  .counters .c:nth-child(n+3) { display: none; }
}

/* Reliability of an outlet, shown as a bar rather than a raw weight. The number
   itself stays one click away in instruments mode. */
.rel-bar {
  display: inline-block;
  width: 54px; height: 3px;
  background: #171c24;
  border-radius: 1px;
  overflow: hidden;
  vertical-align: middle;
  cursor: help;
}
.rel-bar i {
  display: block; height: 100%;
  width: calc(var(--w) * 1%);
  border-radius: 1px;
}
.rel-bar.hi  i { background: #58d6a8; }
.rel-bar.mid i { background: #7f93b5; }
.rel-bar.lo  i { background: #b8763a; }
.syn {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em;
  color: #b8763a; border: 1px solid rgba(184, 118, 58, 0.34);
  border-radius: 2px; padding: 0 4px; margin-left: 6px;
}
.lede {
  font-size: 15px; line-height: 1.55; color: var(--fg);
  max-width: 74ch; margin: 0 0 14px;
}

/* =================================================================
   Responsive.

   The header carries brand, six domains, a demo badge, a help button, the mode
   switch and the live indicator. That does not fit a phone, so it degrades in
   stages rather than overflowing.
   ================================================================= */

.chrome { flex-wrap: wrap; height: auto; min-height: var(--chrome-h); row-gap: 0; }

/* min-width:0 is what actually lets a flex child scroll instead of pushing its
   siblings off screen. Without it, overflow-x on .domains does nothing. */
.domains {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.domains::-webkit-scrollbar { display: none; }
.domains a { flex: none; }

.counters { overflow-x: auto; scrollbar-width: none; }
.counters::-webkit-scrollbar { display: none; }

@media (max-width: 1024px) {
  .chrome { gap: 14px; padding: 0 12px; }
  .counters { gap: 0 18px; }
}

@media (max-width: 880px) {
  /* The help button becomes a mark. The panel it opens is unchanged. */
  .howto-open { border: 1px solid var(--line); border-radius: 2px; padding: 2px 7px; }
  .howto-open::before { content: "?"; }
  .howto-open { font-size: 0; }
  .howto-open::before { font-size: 11px; }
  .live b { display: none; }
  .modesw button { padding: 3px 7px; }
}

@media (max-width: 700px) {
  :root { --row-pad: 10px 12px; --ticker-h: 108px; }

  /* The two row structure is defined once in the 900px block above. Nothing
     here may reorder the header, or the layout stops being deterministic. */
  .demo { font-size: 9px; padding: 1px 5px; }

  .counters { top: auto; position: static; }
  .counters .c:nth-child(n+3) { display: none; }

  .ev { grid-template-columns: 3px 1fr 62px; }
  .hbar { display: none; }
  .hnum { font-size: 15px; }
  .spark { display: none; }
  .title { font-size: 14.5px; }
  .gloss { font-size: 12.5px; -webkit-line-clamp: 3; }

  /* The coverage list stacks: outlet, then headline, then reliability. */
  .srow {
    grid-template-columns: 1fr auto;
    grid-template-areas: "name rel" "head head";
    gap: 4px 10px;
    padding: 9px 12px;
  }
  .srow .sname { grid-area: name; }
  .srow .shead { grid-area: head; font-size: 12.5px; }
  .srow .sw { grid-area: rel; }

  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; }
  .ev-page { padding: 18px 12px 0; }
  .ev-page .title { font-size: 19px; }
  .sheet-box { padding: 22px 18px 24px; }
}

@media (max-width: 460px) {
  .brand span { display: none; }
  .modesw button[data-mode="instruments"]::after { content: "inst"; }
  .modesw button[data-mode="instruments"] { font-size: 0; }
  .modesw button[data-mode="instruments"]::after { font-size: 10px; }
  .mrow { gap: 7px; }
  .gap { font-size: 9px; padding: 1px 4px; }
}

/* =================================================================
   Deterministic header.

   Letting flex-wrap decide what falls to the second row produced a different
   layout at every width: domains on row two here, the mode switch on row two
   there. A zero height flex item with flex-basis 100% forces the break at a
   chosen point instead, so the structure is identical from 900px down to 320px.

   Row 1  brand ................ demo  ?  live
   Row 2  domains (scrolling) ........ reading | instruments
   ================================================================= */

@media (max-width: 900px) {
  .chrome {
    align-items: center;
    padding: 7px 12px;
    row-gap: 7px;
    column-gap: 12px;
  }

  .brand    { order: 1; margin-right: auto; }
  .demo     { order: 2; }
  .howto-open { order: 3; }
  .live     { order: 4; }

  /* The forced break. Everything after it lands on row two, always. */
  .chrome::after {
    content: "";
    order: 5;
    flex: 0 0 100%;
    height: 0;
  }

  .domains  { order: 6; flex: 1 1 auto; min-width: 0; margin-right: 0; }
  .modesw   { order: 7; flex: none; }

  .counters { position: static; }
}

/* The badge used to break mid-phrase into a two line box. It now keeps its
   words together and takes its own line when it has to. */
.gap { white-space: nowrap; }
.mrow > span { white-space: nowrap; }
.mrow { flex-wrap: wrap; row-gap: 4px; }

@media (max-width: 700px) {
  /* Separators become noise once the line wraps: a trailing slash at the end of
     a row reads as a mistake. Spacing carries the separation instead. */
  .sub .sep { display: none; }
  .sub { gap: 6px 11px; }
  .mrow .sep { display: none; }
  .mrow { gap: 4px 9px; }
}

/* ------------------------------------------------------------- maintenance

   The holding page reuses this stylesheet rather than carrying its own inline
   styles: script-src and style-src stay honest, and the page still looks like
   the site instead of a default browser error. */

.maint-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.maint {
  max-width: 460px;
  border: 1px solid var(--line-hi);
  background: var(--bg-elev);
  padding: 28px 30px 30px;
}

.maint .brand { display: inline-block; margin-bottom: 22px; }

.maint h1 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 10px;
}

.maint p { margin: 0 0 12px; color: var(--fg-dim); }

.maint-note {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg-mute);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-bottom: 0;
}
