/* Shorts Tracker. Same palette and type as the Crazy Fishing Board: one centred column (max 1180px), cards, mono numbers. */
:root {
  --bg: #edf1f1; --surface: #fbfcfc; --surface-2: #f2f5f5;
  --ink: #0e1f29; --ink-2: #364952; --muted: #5f707a;
  --line: #d3dcdf; --line-strong: #b7c4c8;
  --accent: #0d5d70; --accent-ink: #ffffff; --accent-soft: #dbeaed;
  --vs: #cf2e26;
  --good: #1d7446; --good-bg: #dff0e5;
  --warn: #8d5600; --warn-bg: #f8ead2;
  --bad: #ac2a21; --bad-bg: #f9e2df;
  --hot: #c2410c; --hot-bg: #fde7d9;
  --shadow: 0 1px 2px rgba(14, 31, 41, .05), 0 8px 24px rgba(14, 31, 41, .05);
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1317; --surface: #111e24; --surface-2: #17272e; --ink: #e4edef; --ink-2: #b9c8cd; --muted: #8b9ea6;
    --line: #233540; --line-strong: #3a4f5a; --accent: #6cc3d5; --accent-ink: #05212a; --accent-soft: #15343d; --vs: #ff6b5e;
    --good: #6fd39a; --good-bg: #133022; --warn: #f2b64f; --warn-bg: #33270f; --bad: #ff8174; --bad-bg: #3a1a17;
    --hot: #ff9a5c; --hot-bg: #3a2113;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1317; --surface: #111e24; --surface-2: #17272e; --ink: #e4edef; --ink-2: #b9c8cd; --muted: #8b9ea6;
  --line: #233540; --line-strong: #3a4f5a; --accent: #6cc3d5; --accent-ink: #05212a; --accent-soft: #15343d; --vs: #ff6b5e;
  --good: #6fd39a; --good-bg: #133022; --warn: #f2b64f; --warn-bg: #33270f; --bad: #ff8174; --bad-bg: #3a1a17;
  --hot: #ff9a5c; --hot-bg: #3a2113;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); font-stretch: 78%; text-wrap: balance; margin: 0; letter-spacing: .005em; }
h1 { font-size: clamp(28px, 4.6vw, 42px); font-weight: 900; line-height: 1; text-transform: uppercase; }
h2 { font-size: 21px; font-weight: 800; }
p { margin: 0; }
a { color: var(--accent); }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.up { color: var(--good); }
.err { color: var(--bad); font-weight: 600; }
.warn-text { color: var(--warn); }
.eyebrow { font: 600 12px/1.2 var(--body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.brand { font: 800 18px/1 var(--display); font-stretch: 80%; text-transform: uppercase; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block;
  background-image: linear-gradient(135deg, transparent 45%, rgba(255,255,255,.85) 46%, rgba(255,255,255,.85) 54%, transparent 55%); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.switch select { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); max-width: 220px; }
.out { margin-left: auto; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 64px; display: grid; gap: 18px; }

/* Buttons and pills */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.bad { color: var(--bad); border-color: var(--bad); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; line-height: 1.6; }
.pill.hot { background: var(--hot-bg); color: var(--hot); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.new { background: var(--accent-soft); color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; }
.head .muted { margin-top: 8px; max-width: 62ch; }
.empty { text-align: center; padding: 32px 16px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.filters label { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.filters label.check { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; color: var(--ink-2); }
.filters select, .row input, .settings input, .setorig input, textarea { padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }

/* Rising list */
.shorts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.short { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
.thumb img, .ph { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.short .title { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.short .title a { color: var(--ink); text-decoration: none; }
.short .title a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; color: var(--muted); font-size: 14px; }
.meta a { color: var(--ink-2); font-weight: 600; }
.credit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 14px; }
.credit .lbl { color: var(--muted); }
.credit .ctext { overflow-wrap: anywhere; }
.setorig summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.setorig form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.setorig input { min-width: 220px; flex: 1; }
.nums { text-align: right; display: grid; gap: 2px; min-width: 90px; }
.nums .v { font: 700 22px/1.1 var(--mono); }

/* Channels */
.group-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: center; }
.who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.av.big { width: 64px; height: 64px; }
.av.sm { width: 28px; height: 28px; }
.av.ph { display: inline-block; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.stats dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 0; font: 700 18px/1.2 var(--mono); }
.stats small { font-weight: 400; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.r { text-align: right; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; gap: 8px; align-items: center; min-width: 180px; }
.cname { font-weight: 700; color: var(--ink); }
.acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
details.danger summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.danger form { margin-top: 6px; }
.add { display: grid; gap: 6px; }
.add label { font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 220px; }

/* Channel page */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile .v { font: 700 26px/1.1 var(--mono); letter-spacing: -.01em; }
.tile .v.sm { font-size: 18px; }
.spark { width: 100%; height: 28px; margin-top: 4px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.seg a { margin-left: 8px; text-decoration: none; }
.seg a[aria-current="true"] { font-weight: 700; text-decoration: underline; }
.shorts-table .t { display: flex; gap: 10px; align-items: center; min-width: 260px; }
.shorts-table .t img, .ph.sm { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; }
.shorts-table .t a { color: var(--ink); }
.notes { display: grid; gap: 8px; }
.notes label { font-weight: 700; }

/* Settings */
.settings { display: grid; gap: 10px; }
.settings .btn, .notes .btn { justify-self: start; }
.settings input[type="number"] { width: 110px; margin: 0 4px; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; max-height: 420px; overflow: auto; }
.events li.error { color: var(--bad); }
.events li.warn { color: var(--warn); }

/* Login / messages */
.login { max-width: 380px; margin: 10vh auto 0; }
.login form { display: grid; gap: 10px; }
.login input { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.msg { max-width: 560px; }

@media (max-width: 640px) {
  .short { grid-template-columns: 72px minmax(0, 1fr); }
  .thumb img, .ph { width: 72px; height: 72px; }
  .nums { grid-column: 2; text-align: left; display: flex; gap: 12px; align-items: baseline; }
  .nums .v { font-size: 18px; }
  .out { margin-left: 0; }
}
