/* ===========================================================================
   Pressroom v2 — design system
   Light/dark themes via CSS variables on :root / [data-theme="dark"]

   The brand colour is Pantone 286 C (#0033A0). Buttons and the logo use it exactly in
   both themes. On a dark background it is too dark to read as text (1.7:1), so there
   --accent, which colours text, switches and sliders, is a lighter tint of the same blue.
   =========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: #e4e6eb;
  --text: #15181e;
  --text-muted: #69707d;
  --text-faint: #9aa1ad;
  --brand: #0033a0;        /* Pantone 286 C */
  --brand-hover: #002677;
  --accent: #0033a0;
  --accent-soft: #e6ebf5;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
  --radius: 10px;
  --sidebar-w: 250px;
}

[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #16181e;
  --surface-2: #1d2027;
  --border: #272b33;
  --text: #e8eaee;
  --text-muted: #9aa1ad;
  --text-faint: #69707d;
  --brand: #0033a0;        /* Pantone 286 C */
  --brand-hover: #1a47b8;
  --accent: #7f9ce0;       /* 286 C lifted to 6.5:1 on the dark surface */
  --accent-soft: #121d38;
  --green: #4ade80;
  --green-soft: #112318;
  --red: #f87171;
  --red-soft: #2a1414;
  --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===========================================================================
   Layout
   =========================================================================== */

.app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 14px;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 60px;
}

.main > section { max-width: 1060px; margin: 0 auto; }

/* ===========================================================================
   Sidebar
   =========================================================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}

/* Two rollers and the paper threading round them, on a 286 C tile. Built by tools/make_icons.py. */
.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

/* The name is set in a 1720s newspaper letter. It has one weight, so it runs larger than
   the text around it; the capital R needs a little air after the s. */
.brand-name {
  font-family: "IM Fell Double Pica", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.05;
}
.brand-name span { margin-left: 0.04em; }
.brand-sub { font-size: 11px; color: var(--text-faint); }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.client-block { padding: 0 6px; }
.client-row { display: flex; gap: 6px; }
.client-row select { flex: 1; min-width: 0; }

#new-client-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
#new-client-form[hidden] { display: none; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0; }

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 6px;
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}

.pill.ok .dot { background: var(--green); }
.pill.bad .dot { background: var(--red); }

.save-indicator { font-size: 11.5px; color: var(--text-faint); min-height: 16px; }
.save-indicator.error { color: var(--red); }

.global-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.global-progress .bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.between { justify-content: space-between; }

/* ===========================================================================
   Controls
   =========================================================================== */

.btn {
  font: inherit;
  font-weight: 550;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.btn:hover { background: var(--surface-2); }
a.btn { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.icon { padding: 6px 9px; line-height: 1; }
.btn.danger-text { color: var(--red); }

select, input[type="text"], input[type="search"], textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

textarea { resize: vertical; line-height: 1.5; }

select:focus, input[type="text"]:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"].plain { accent-color: var(--accent); width: 15px; height: 15px; }

/* Toggle switch */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  margin: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }

/* ===========================================================================
   Cards & view scaffolding
   =========================================================================== */

.view-header { margin-bottom: 22px; }
.view-header h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.view-header p { margin: 0; color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}

.card + .card { margin-top: 16px; }
/* Side by side in a grid, cards line up; the stacking gap is for cards in a column. */
.grid-2 > .card + .card, .grid-3 > .card + .card, .grid-4 > .card + .card { margin-top: 0; }
.card + .grid-2, .card + .grid-3, .card + .grid-4,
.grid-2 + .card, .grid-3 + .card, .grid-4 + .card { margin-top: 16px; }

.card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.card-header-row h3 { margin: 0; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3::before { content: "▸ "; color: var(--text-faint); }
details.card[open] > summary h3::before { content: "▾ "; }
details.card:not([open]) > summary { margin-bottom: 0; }
.group-summary { display: inline-flex; align-items: center; gap: 10px; }
.switch:indeterminate { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.switch:indeterminate::after { transform: translateX(8px); }
.card-header-row .meta { font-size: 12px; color: var(--text-faint); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* Sources: the outlet list gets the room, newsletters sit beside it on a wide screen. */
.sources-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1200px) {
  .sources-grid { grid-template-columns: minmax(0, 1fr); }
  .sources-grid > :last-child { order: -1; }
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Stat cards (dashboard) */
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-card .stat-value .dot { width: 9px; height: 9px; border-radius: 50%; }
.stat-card .stat-value .dot.ok { background: var(--green); }
.stat-card .stat-value .dot.bad { background: var(--red); }
.stat-card .stat-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* Source rows */
.source-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(80px, 150px) 24px auto;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
}
.source-row .row-actions { display: inline-flex; gap: 2px; }
.icon-btn {
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.icon-btn[data-role="remove-feed"]:hover:not(:disabled) { color: var(--red); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.source-row.editing { display: block; }
.source-editor { display: grid; gap: 6px; padding: 4px 0; }
.source-editor .field-label { margin: 4px 0 0; }
.source-editor input { width: 100%; }
.source-editor .row { margin-top: 6px; }
.source-row + .source-row { border-top: 1px solid var(--border); }
.source-row .name { font-weight: 500; transition: opacity 0.15s ease; }
.source-row.off .name { opacity: 0.4; }
.source-row .readout {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
}
.source-row .off-label { font-size: 12px; color: var(--text-faint); font-style: italic; text-align: right; grid-column: 3 / 5; }
@media (max-width: 520px) {
  .source-row { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 4px; }
  .source-row .row-actions { grid-column: 3; grid-row: 1; }
  .source-row input[type="range"] { grid-column: 2; grid-row: 2; }
  .source-row .readout { grid-column: 3; grid-row: 2; text-align: left; padding-left: 7px; }
  .source-row .off-label { display: none; }
}

/* Chips (multiselect) */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

.chip {
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.hint { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* Progress (dashboard job card) */
.progress-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
  width: 0%;
  transition: width 0.6s ease;
}
.progress-status { font-size: 13px; color: var(--text-muted); }

.event-log {
  margin-top: 12px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.event-log div { padding: 1px 0; }

/* ===========================================================================
   Briefing view
   =========================================================================== */

.briefing-meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.meta-chip .label { color: var(--text-faint); font-weight: 550; font-size: 12px; }

.section-card .article-row {
  display: grid;
  grid-template-columns: 64px 110px 1fr;
  gap: 12px;
  padding: 10px 2px;
  align-items: baseline;
}
.section-card .article-row + .article-row { border-top: 1px solid var(--border); }

.article-date {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  white-space: nowrap;
}

.article-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-title a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.article-title a:hover { color: var(--accent); text-decoration: underline; }

.article-raw {
  grid-column: 1 / 4;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.raw-view {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
}

/* Archive rows */
.archive-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  cursor: pointer;
}
.archive-row + .archive-row { border-top: 1px solid var(--border); }
.archive-row:hover .archive-title { color: var(--accent); }
.archive-title { font-weight: 550; }
.archive-sub { font-size: 12px; color: var(--text-faint); }
.archive-spacer { flex: 1; }

/* Empty states */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}
.empty .empty-icon { font-size: 30px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.empty p { margin: 0 0 16px; }

/* Toasts */
#toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 11px 16px;
  font-size: 13.5px;
  max-width: 360px;
  animation: toast-in 0.2s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

details.traceback summary { cursor: pointer; color: var(--text-muted); font-size: 13px; }
details.traceback pre {
  font-size: 11.5px;
  overflow-x: auto;
  background: var(--surface-2);
  padding: 10px;
  border-radius: 8px;
}

.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Run health: what a run could not do, kept with its briefing */
.run-health summary { cursor: pointer; font-size: 14px; }
.run-note { font-size: 13px; margin: 6px 0 0; line-height: 1.4; }
.run-note.error { color: var(--red); }
.run-note.warn { color: var(--amber); }
.run-note.info { color: var(--text-faint); }

/* ===========================================================================
   Dashboard runs, Settings blocks, Mentions
   =========================================================================== */

.row.wrap { flex-wrap: wrap; gap: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.badge.warn { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.badge.bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.stat-value .badge { font-size: 14px; padding: 3px 11px; }
.stat-card .stat-sub { overflow-wrap: anywhere; }

/* Two or three options side by side, one on. */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  flex: none;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.segmented.small button { font-size: 12px; padding: 4px 9px; }

/* The runs list: one summary line per run, opening onto its facts, problems and log. */
.run-head, .run-row > summary {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 70px minmax(110px, 1fr) 70px 60px 70px;
  gap: 10px;
  align-items: center;
}
.runs-card:has(.run-client) .run-head,
.runs-card:has(.run-client) .run-row > summary {
  grid-template-columns: minmax(120px, 1.4fr) minmax(80px, 1fr) 70px minmax(110px, 1fr) 70px 60px 70px;
}
.run-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding: 0 8px 6px 26px;
  border-bottom: 1px solid var(--border);
}
.run-row { border-bottom: 1px solid var(--border); }
.run-row > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 8px 10px 26px;
  position: relative;
  font-size: 13.5px;
}
.run-row > summary::-webkit-details-marker { display: none; }
.run-row > summary::before {
  content: "›";
  position: absolute;
  left: 9px;
  color: var(--text-faint);
  transition: transform 0.15s;
}
.run-row[open] > summary::before { transform: rotate(90deg); }
.run-row > summary:hover { background: var(--surface-2); }
.run-num { text-align: right; font-variant-numeric: tabular-nums; }
.run-trigger, .run-client { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-body { padding: 4px 8px 14px 26px; }
.run-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.run-facts b { color: var(--text); font-weight: 600; margin-right: 4px; }
.run-actions { margin: 4px 0 8px; gap: 8px; }
.run-log { margin-top: 10px; }
.run-log summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.run-log .event-log { max-height: 280px; }

@media (max-width: 720px) {
  .run-head { display: none; }
  .run-row > summary,
  .runs-card:has(.run-client) .run-row > summary {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .run-row > summary .run-trigger,
  .run-row > summary .run-num:not(:last-child) { display: none; }
  .run-row > summary .run-client { grid-column: 1; }
  .run-row > summary .run-num { grid-column: 2; justify-self: end; }
}

/* Settings: a jump bar, and headings for the blocks that are not single cards. */
.jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}
.jump-bar button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.jump-bar button:hover { color: var(--accent); border-color: var(--accent); }
.block-header { margin: 26px 0 12px; scroll-margin-top: 16px; }
.block-header h2 { margin: 0 0 4px; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.block-header h2 .meta { font-size: 12px; font-weight: 500; color: var(--text-faint); margin-left: 8px; }
.block-header .hint { margin: 0; }
#settings-about, #settings-sections { scroll-margin-top: 16px; }

/* Mentions */
.alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 0;
}
.alert-row + .alert-row { border-top: 1px solid var(--border); }
.alert-row.suggestion { grid-template-columns: minmax(0, 1fr) auto; }
.alert-query {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.alert-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.alert-row.pending .alert-sub { color: var(--amber); }
.alert-row .paste-row { grid-column: 1 / -1; }
.paste-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.paste-row input[type="text"] { flex: 1 1 260px; min-width: 0; }
.steps { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.steps a, .hint a { color: var(--accent); }

@media (max-width: 520px) {
  .alert-row { grid-template-columns: minmax(0, 1fr) auto; }
  .alert-row .segmented { grid-column: 1; grid-row: 2; justify-self: start; }
}

/* A phone: the sidebar sits above the page instead of beside it, and the page scrolls. */
@media (max-width: 720px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { overflow: visible; padding: 20px 16px 48px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
