/* news — a transit map of your reading.
   Categories are lines with their own color; stories are stations on them.
   A filled station is unread, a hollow one is read. */

@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #F1F2F6;
  --sheet: #FFFFFF;
  --ink: #1A1F36;
  --ink-2: #4A5070;
  --muted: #6E7391;
  --rule: #DADDE8;
  --cobalt: #3346C8;
  --cobalt-soft: #E4E7FB;
  --danger: #C2283B;
  --ok: #1E8A5A;
  --star: #E5A50A;
  --sel: #FFF4CC;
  --mast: #1A1F36;
  --mast-ink: #F1F2F6;

  --ui: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --read: "Newsreader", "Iowan Old Style", Georgia, serif;

  --line: #9AA0B2;
  --line-ink: #5E6475;
  color-scheme: light;
}

/* Line palette: vivid track color, plus a darker variant for text on paper. */
.line-0 { --line: #3346C8; --line-ink: #2A3AA8; }
.line-1 { --line: #0F8F80; --line-ink: #0B6E62; }
.line-2 { --line: #E5A50A; --line-ink: #8A6100; }
.line-3 { --line: #C8327E; --line-ink: #A3256A; }
.line-4 { --line: #3E9A3C; --line-ink: #2E7A2D; }
.line-5 { --line: #EC6A1E; --line-ink: #B04A0E; }
.line-6 { --line: #7B52D4; --line-ink: #6040B0; }
.line-7 { --line: #D23A3A; --line-ink: #A82B2B; }
.line-8 { --line: #1F93D8; --line-ink: #136FA6; }
.line-9 { --line: #9A6B3F; --line-ink: #7A522C; }
.line-10 { --line: #7FAF1B; --line-ink: #557A0C; }
.line-11 { --line: #E0607E; --line-ink: #B8405D; }
.line-none { --line: #9AA0B2; --line-ink: #5E6475; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12152A;
    --sheet: #1A1E38;
    --ink: #E8EAF4;
    --ink-2: #B9BDD3;
    --muted: #8D92B0;
    --rule: #2B3052;
    --cobalt: #8C9BFF;
    --cobalt-soft: #262C55;
    --danger: #FF7A85;
    --ok: #5FD39B;
    --sel: #2A2D1E;
    --mast: #0C0F20;
    color-scheme: dark;
  }
  .line-0 { --line: #6F80FF; }
  .line-1 { --line: #2CC2AE; }
  .line-2 { --line: #F2BE3A; }
  .line-3 { --line: #F062A8; }
  .line-4 { --line: #6CC86A; }
  .line-5 { --line: #FF8C4A; }
  .line-6 { --line: #A887FF; }
  .line-7 { --line: #FF6B6B; }
  .line-8 { --line: #4DB6F5; }
  .line-9 { --line: #CB9665; }
  .line-10 { --line: #A6D63D; }
  .line-11 { --line: #FF8FA8; }
  .line-none { --line: #7C82A0; }
  [class*="line-"] { --line-ink: var(--line); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--ui);
  font-optical-sizing: auto;
}
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:not(:hover) { text-decoration: none; }
h1, h2, h3 { font-family: var(--ui); line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.break { overflow-wrap: anywhere; }
kbd {
  font: 600 0.8rem var(--ui);
  display: inline-block; min-width: 1.6em; text-align: center;
  padding: 1px 6px; border-radius: 6px;
  background: var(--sheet); border: 1px solid var(--rule); border-bottom-width: 2px;
}
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--sheet); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ── Masthead ─────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; padding-top: env(safe-area-inset-top);
  min-height: 56px;
  background: var(--mast); color: var(--mast-ink);
}
.mark { display: flex; align-items: center; gap: 8px; color: var(--mast-ink); }
.mark svg { width: 30px; height: 30px; }
.mark-track { stroke: #F2BE3A; stroke-width: 4; stroke-linecap: round; }
.mark-stop { fill: #F2BE3A; stroke: var(--mast); stroke-width: 2; }
.mark-stop.hollow { fill: var(--mast); stroke: #F2BE3A; stroke-width: 3; }
.mark span { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.04em; }
.views, .tools { display: flex; align-items: center; gap: 2px; }
.views { flex: 1; }
.views a, .tools a {
  color: color-mix(in srgb, var(--mast-ink) 70%, transparent);
  padding: 6px 12px; border-radius: 999px; font-weight: 550; white-space: nowrap;
}
.views a:hover, .tools a:hover { color: var(--mast-ink); text-decoration: none; }
.views a[aria-current], .tools a[aria-current] { color: var(--mast); background: var(--mast-ink); }
.pill {
  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #F2BE3A; color: #1A1F36;
}
.keys-btn {
  width: 30px; height: 30px; margin-left: 6px; border-radius: 50%; cursor: pointer;
  font: 700 0.9rem var(--ui); color: var(--mast-ink);
  background: transparent; border: 1.5px solid color-mix(in srgb, var(--mast-ink) 40%, transparent);
}
@media (hover: none) { .keys-btn { display: none; } }

.flash {
  margin: 16px auto 0; max-width: 720px; width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px;
  background: var(--cobalt-soft); color: var(--ink); font-weight: 500;
  animation: flash-in 0.35s ease-out;
}
@keyframes flash-in { from { transform: translateY(-6px); opacity: 0; } }

/* ── Shell: line map + content ────────────────────────────── */
.shell {
  display: grid; grid-template-columns: 240px minmax(0, 720px);
  justify-content: center; gap: 40px;
  padding: 24px 20px 64px;
}
.shell:not(:has(.map)) { grid-template-columns: minmax(0, 720px); }
main { min-width: 0; }

.map {
  position: sticky; top: 80px; align-self: start;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.stop {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  padding: 6px 10px 6px 4px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500;
}
.stop:hover { background: var(--sheet); text-decoration: none; color: var(--ink); }
.stop .seg {
  height: 8px; border-radius: 4px; background: var(--line);
  position: relative;
}
.stop .seg::after {
  content: ""; position: absolute; right: -4px; top: 50%; translate: 0 -50%;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--line);
}
.stop-all .seg { background: linear-gradient(90deg, #3346C8 0 25%, #0F8F80 25% 50%, #E5A50A 50% 75%, #C8327E 75%); }
.stop-all .seg::after { border-color: var(--ink); }
.stop .n { font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.stop.on { background: var(--sheet); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--line); }
.stop.on .seg::after { background: var(--line); }
.stop-all.on { box-shadow: inset 3px 0 0 var(--ink); }
.stop-all.on .seg::after { background: var(--ink); }
.stop.plain { cursor: default; }
.stop.plain:hover { background: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 0 48px; }
  .map {
    position: static; flex-direction: row; overflow-x: auto; max-height: none;
    gap: 6px; padding: 12px 16px; scrollbar-width: none;
    border-bottom: 1px solid var(--rule);
  }
  .map::-webkit-scrollbar { display: none; }
  .stop { grid-template-columns: 18px auto auto; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; white-space: nowrap; background: var(--sheet); border: 1px solid var(--rule); }
  .stop .seg { height: 6px; }
  .stop .seg::after { width: 10px; height: 10px; border-width: 2.5px; }
  .stop.on { box-shadow: none; border-color: var(--line); }
  .stop.plain { display: none; }
  main { padding: 16px 16px 0; }
  .masthead { gap: 8px; padding: 0 12px; }
  .views a, .tools a { padding: 6px 9px; }
  .mark span { display: none; }
}
@media (max-width: 560px) {
  .tools a[href="/devices"], .keys-btn { display: none; }
  .views { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .views::-webkit-scrollbar { display: none; }
}
body { overflow-x: clip; }

/* ── Buttons & fields ─────────────────────────────────────── */
.btn {
  font: 600 0.92rem var(--ui); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--sheet); border: 1.5px solid var(--rule);
  white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 0.85rem; }
.btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; animation: nudge 0.3s; }
@keyframes nudge { 30% { translate: -3px 0; } 60% { translate: 3px 0; } }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input:not([type]) {
  font: 400 1rem var(--ui); color: var(--ink);
  background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 9px 12px; width: 100%; min-height: 42px;
}
input:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px var(--cobalt-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--cobalt); margin: 0; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-within .btn { outline: 3px solid var(--cobalt); outline-offset: 2px; }

/* ── List ─────────────────────────────────────────────────── */
.list-head { margin-bottom: 4px; }
.source-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  padding-bottom: 16px; margin-bottom: 8px; border-bottom: 4px solid var(--line);
}
.source-head h1 { margin: 6px 0 2px; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; display: flex; align-items: center; gap: 12px; }
.source-head h1 .seg { width: 28px; height: 10px; border-radius: 5px; background: var(--line); flex: none; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--line); color: #fff; font-size: 0.8rem; font-weight: 700;
}
.badge:hover { text-decoration: none; filter: brightness(1.1); }
.line-2 .badge, .line-10 .badge { color: #1A1F36; }
.list-tools { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 0.9rem; }

.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 12px;
  padding-right: 4px; border-radius: 14px;
  transition: background-color 0.12s;
}
.row:hover { background: color-mix(in srgb, var(--sheet) 70%, transparent); }

/* Swipe a row to toggle read: a band in the line color wipes in from the
   side the finger starts on and gains a check once the swipe will commit. */
.row { position: relative; touch-action: pan-y pinch-zoom; }
.row::after {
  content: attr(data-swipe-label);
  position: absolute; top: 4px; bottom: 4px; z-index: 2;
  width: var(--swipe-w, 0px); max-width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  overflow: hidden; white-space: nowrap;
  background: var(--line); color: #fff; font-weight: 700; font-size: 0.95rem;
  pointer-events: none; opacity: 0;
}
.row.swiping::after { opacity: 1; }
.row.swipe-right::after { left: 0; border-radius: 0 14px 14px 0; justify-content: flex-end; }
.row.swipe-left::after { right: 0; border-radius: 14px 0 0 14px; justify-content: flex-start; flex-direction: row-reverse; }
.row.swipe-ready::after { font-size: 1rem; }
.row.swipe-ready::before {
  content: ""; position: absolute; top: 50%; z-index: 3; translate: 0 -50%;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 6px var(--line); pointer-events: none;
}
.row.swipe-right.swipe-ready::before { left: 14px; }
.row.swipe-left.swipe-ready::before { right: 14px; }
.row.swipe-done::after { transition: width 0.2s ease-out, opacity 0.2s 0.1s; }
.line-2.row::after, .line-10.row::after { color: #1A1F36; }
.row.sel { background: var(--sel); }

/* The track: a continuous vertical line in the category color. Consecutive
   stories from the same line join up; a color change is a transfer. */
.track { position: relative; display: block; }
.track::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; translate: -50% 0;
  background: var(--line);
}
.row:first-child .track::before { top: 24px; border-radius: 3px 3px 0 0; }
.row:last-of-type .track::before { bottom: calc(100% - 30px); }
.station {
  position: absolute; left: 50%; top: 18px; translate: -50% 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--line); border: 3px solid var(--paper);
  box-shadow: 0 0 0 2.5px var(--line);
  transition: background-color 0.2s;
}
.row.read .station { background: var(--paper); }
.row.sel .station { border-color: var(--sel); }
.row.read.sel .station { background: var(--sel); }

.row-main { display: block; padding: 14px 0; color: inherit; min-width: 0; }
.row-main:hover { text-decoration: none; }
.row .title { font-size: 1.12rem; font-weight: 680; margin: 0 0 4px; overflow-wrap: anywhere; }
.row-main:hover .title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--line); text-underline-offset: 3px; }
.row.read .title { font-weight: 450; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 0.84rem; color: var(--muted); }
.meta .src { color: var(--line-ink); font-weight: 650; }
.summary {
  margin-top: 6px; font-family: var(--read); font-size: 1rem; line-height: 1.5; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row.read .summary { display: none; }
.actions { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.act {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: none; border-radius: 50%; cursor: pointer; color: var(--muted);
}
.act:hover { background: var(--sheet); color: var(--ink); }
.act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.act-read[aria-pressed="true"] { color: var(--ok); }
.act-star[aria-pressed="true"] { color: var(--star); }
.act-star[aria-pressed="true"] svg { fill: currentColor; }
.more { display: flex; margin: 20px auto; }

.empty { text-align: center; color: var(--muted); padding: 56px 16px; font-size: 1.05rem; }
.empty svg { width: 160px; display: block; margin: 0 auto 16px; }
.empty-track { stroke: var(--rule); stroke-width: 6; stroke-linecap: round; }
.empty circle { fill: var(--paper); stroke: var(--rule); stroke-width: 4; }
.empty p { max-width: 42ch; margin: 0 auto; }

/* ── Reader ───────────────────────────────────────────────── */
.reader-nav { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.92rem; margin-bottom: 20px; }
.reader-nav span { display: flex; gap: 18px; }
.reader-head { padding-bottom: 20px; border-bottom: 4px solid var(--line); }
.reader-head h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem); font-weight: 780; letter-spacing: -0.025em; line-height: 1.08;
  margin: 12px 0 12px; text-wrap: balance;
}
.byline { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 0.92rem; }
.byline .src { color: var(--line-ink); font-weight: 700; }
.byline .author { color: var(--ink-2); font-weight: 600; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.reader-actions .act-star[aria-pressed="true"] { background: var(--star); border-color: var(--star); color: #1A1F36; }
.reader-actions .act-read[aria-pressed="true"] { color: var(--ink-2); }

.content {
  font-family: var(--read); font-size: 1.2rem; line-height: 1.68; color: var(--ink);
  max-width: 66ch; margin-top: 28px; overflow-wrap: break-word;
}
.content p, .content ul, .content ol, .content blockquote, .content figure, .content pre { margin: 0 0 1.05em; }
.content h2, .content h3, .content h4 { font-family: var(--ui); margin: 1.6em 0 0.5em; font-size: 1.3rem; }
.content a { color: var(--line-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--line) 50%, transparent); }
.content img, .content video, .content picture { max-width: 100%; height: auto; border-radius: 10px; }
.content figcaption { font: 0.85rem/1.4 var(--ui); color: var(--muted); margin-top: 6px; }
.content blockquote { padding-left: 1em; border-left: 4px solid var(--line); color: var(--ink-2); font-style: italic; }
.content pre { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); padding: 14px; border-radius: 10px; font-size: 0.85rem; line-height: 1.5; }
.content code { font-size: 0.88em; }
.content table { display: block; overflow-x: auto; border-collapse: collapse; font: 0.9rem var(--ui); }
.content td, .content th { border: 1px solid var(--rule); padding: 4px 8px; }
.original { margin-top: 36px; }

/* Swipe between stories (touch only). The article follows the finger; the
   hint on the side it reveals names the destination. */
.reader { touch-action: pan-y pinch-zoom; }
.reader.dragging { transition: none; }
.reader.settling { transition: transform 0.22s ease-out, opacity 0.22s ease-out; }
.reader.enter-next { animation: enter-next 0.24s ease-out; }
.reader.enter-prev { animation: enter-prev 0.24s ease-out; }
@keyframes enter-next { from { transform: translateX(48px); opacity: 0; } }
@keyframes enter-prev { from { transform: translateX(-48px); opacity: 0; } }
.swipe-hint {
  position: fixed; top: 50%; z-index: 15; translate: 0 -50%;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--line); color: #fff; font-weight: 700; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: opacity 0.1s;
}
.swipe-hint::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; flex: none;
}
.swipe-next { right: 12px; }
.swipe-prev { left: 12px; flex-direction: row-reverse; }
.swipe-hint.ready::before { background: var(--line); box-shadow: 0 0 0 3px #fff; }
.line-2 .swipe-hint, .swipe-hint.line-2, .swipe-hint.line-10 { color: #1A1F36; }

/* ── Sheets (sources, devices) ────────────────────────────── */
.sheet { background: var(--sheet); border-radius: 18px; padding: 22px; margin-bottom: 28px; border: 1px solid var(--rule); }
.sheet h1 { margin: 0 0 16px; font-size: 1.7rem; font-weight: 800; }
.add { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sheet-tools .devices-link { margin-left: auto; align-self: center; font-weight: 600; font-size: 0.9rem; }
@media (max-width: 600px) { .add { grid-template-columns: 1fr; } }

.bulkbar {
  position: sticky; top: 64px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; margin-bottom: 20px; border-radius: 999px;
  background: var(--sheet); border: 1px solid var(--rule); font-size: 0.9rem; color: var(--muted);
}
.bulkbar.active { border-color: var(--danger); color: var(--ink); font-weight: 600; }

.line-group { margin-bottom: 32px; }
.line-group h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.25rem; font-weight: 780; margin: 0 0 8px; }
.line-group h2 a { color: var(--ink); }
.line-group h2 .seg { width: 24px; height: 10px; border-radius: 5px; background: var(--line); }
.line-group h2 .muted { font-weight: 500; letter-spacing: 0; }
.sources { list-style: none; margin: 0; padding: 0; border-left: 6px solid var(--line); border-radius: 3px; }
.source { padding: 4px 0 4px 14px; border-bottom: 1px solid var(--rule); }
.source:last-child { border-bottom: none; }
.source-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.source .name { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source.paused .name { color: var(--muted); text-decoration: line-through; }
.health { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); }
.source.failing .health { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.source.paused .health { background: var(--rule); }
.counts { white-space: nowrap; font-variant-numeric: tabular-nums; }
.err { color: var(--danger); margin: 0 0 6px 40px; }
.source-more { margin: 0 0 8px 40px; }
.source-more summary { cursor: pointer; color: var(--muted); font-weight: 600; width: fit-content; }
.source-more[open] summary { margin-bottom: 8px; }
.source-more p { margin-bottom: 4px; }
.edit { display: grid; grid-template-columns: 2fr 1.4fr 90px; gap: 10px; margin: 10px 0; align-items: end; }
.edit .check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; grid-column: 1 / 3; }
@media (max-width: 600px) {
  .edit { grid-template-columns: 1fr 1fr; }
  .counts { display: none; }
  .err, .source-more { margin-left: 0; }
}

.devices { list-style: none; padding: 0; margin: 16px 0 20px; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.devices li.revoked { opacity: 0.5; }
.tag { font-size: 0.75rem; font-weight: 700; background: var(--cobalt-soft); color: var(--cobalt); border-radius: 999px; padding: 2px 8px; }

/* ── Login ────────────────────────────────────────────────── */
.login-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 16px; }
.login { width: min(380px, 100%); }
.login-mark { width: 100%; height: auto; margin-bottom: 8px; }
.login-mark path { stroke-width: 8; stroke-linecap: round; }
.login-mark .t0 { stroke: #3346C8; } .login-mark .t1 { stroke: #0F8F80; } .login-mark .t2 { stroke: #E5A50A; }
.login-mark circle { fill: var(--paper); stroke-width: 5; }
.login-mark .s0 { stroke: #3346C8; } .login-mark .s1 { stroke: #0F8F80; } .login-mark .s2 { stroke: #E5A50A; fill: #E5A50A; }
.login h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.05em; margin: 0; }
.login > p { margin: 4px 0 24px; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.login .err { margin: 0 0 16px; font-weight: 600; }

/* ── Help ─────────────────────────────────────────────────── */
dialog { border: none; border-radius: 18px; background: var(--sheet); color: var(--ink); padding: 24px 28px; max-width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(18 21 42 / 0.55); }
dialog h2 { margin: 0 0 16px; font-size: 1.3rem; font-weight: 780; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0 0 20px; align-items: center; }
.keys dd { margin: 0; color: var(--ink-2); }

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