:root {
  --bg: #0a0e20;
  --bg-2: #0f1530;
  --panel: #141b3a;
  --panel-2: #1a2247;
  --line: #262f5a;
  --line-soft: #1e2650;
  --text: #eef1fb;
  --muted: #a3acd0;
  --faint: #6f79a3;
  --amber: #ffc400;
  --amber-soft: rgba(255, 196, 0, 0.14);
  --coral: #ff5448;
  --coral-soft: rgba(255, 84, 72, 0.14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --views: #5cc8ff;
  --interest: #c08bff;
  --radius: 14px;
  --radius-sm: 9px;
  --display: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --t-tech: #5cc8ff;
  --t-world: #ff8a5c;
  --t-entertainment: #ff6fb5;
  --t-science: #34d399;
  --t-business: #ffc400;
  --t-sport: #a78bfa;
  --t-viral: #ff5448;
  --t-feelgood: #7ee0c3;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 84, 72, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 196, 0, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* ---------- Brand mark ---------- */
.mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #3a2a3a, #141a3a);
  border: 2px solid var(--amber);
  font: 700 15px/1 var(--display); letter-spacing: 0.02em;
  flex: none;
}
.mark.lg { width: 64px; height: 64px; font-size: 26px; border-width: 3px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: rgba(10, 14, 32, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font: 700 22px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.brand-name .amp { color: var(--amber); }
.brand-sub { color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.pill.live .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.user {
  position: relative;
}
.user-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 4px; border-radius: 999px;
  background: transparent; border: 1px solid transparent;
}
.user-btn:hover { background: var(--panel); border-color: var(--line); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  color: #1a1020; font-weight: 700; font-size: 13px;
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 240px; padding: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: none;
}
.user.open .user-menu { display: block; }
.user-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-menu .who small { display: block; color: var(--faint); font-size: 12px; }
.user-menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); }
.user-menu a:hover { background: var(--panel-2); color: var(--text); }

/* ---------- Layout ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 28px 28px 64px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font: 700 34px/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.grid { display: grid; gap: 18px; }
.grid.top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font: 700 19px/1.1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.card-head .hint { color: var(--faint); font-size: 12px; }
.eyebrow { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- Posting mode ---------- */
.mode-card { margin-bottom: 18px; }
.modes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.mode {
  text-align: left; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--muted);
  display: grid; gap: 4px; align-content: start; transition: border-color .15s, background .15s;
}
.mode:hover { border-color: var(--line); color: var(--text); }
.mode b { font: 700 17px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--text); }
.mode span { font-size: 12px; line-height: 1.4; }
.mode small { font-size: 11px; color: var(--faint); }
.mode[aria-checked="true"] { border-color: var(--amber); background: var(--amber-soft); }
.mode[aria-checked="true"] b { color: var(--amber); }
.mode[data-mode="rage"] b::after { content: " 🔥"; }
.mode:disabled { opacity: .6; cursor: progress; }
@media (max-width: 1100px) { .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Next post hero ---------- */
.hero { position: relative; overflow: hidden; padding: 24px; }
.hero::after {
  content: ""; position: absolute; inset: auto -80px -120px auto; width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(255, 84, 72, 0.22), transparent 65%);
  pointer-events: none;
}
.hero-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.countdown { font: 700 64px/0.95 var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.hero-rounds { text-align: right; }
.countdown small { font-size: 18px; color: var(--muted); margin-left: 6px; letter-spacing: 0.04em; }

.stages { display: flex; gap: 6px; margin: 22px 0 20px; }
.stage { flex: 1; }
.stage .bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.stage .bar i { display: block; height: 100%; background: var(--amber); border-radius: inherit; }
.stage.done .bar i { width: 100%; background: var(--green); }
.stage.todo .bar i { width: 0; }
.stage label { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--faint); }
.stage.active label { color: var(--amber); }
.stage.done label { color: var(--muted); }

.leader {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px; border-radius: var(--radius-sm);
  background: rgba(255, 196, 0, 0.06); border: 1px solid rgba(255, 196, 0, 0.28);
}
.leader .crown { font: 700 13px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: #1a1020; background: var(--amber); padding: 6px 9px; border-radius: 6px; }
.leader h3 { margin: 2px 0 4px; font-size: 17px; line-height: 1.3; font-weight: 600; }
.leader .meta { color: var(--muted); font-size: 12px; }

/* ---------- Schedule ---------- */
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: var(--bg-2); }
.slot time { font: 700 22px/1 var(--display); }
.slot time small { display: block; font: 600 11px/1.6 var(--body); color: var(--faint); letter-spacing: 0.08em; }
.slot .status { font-size: 12px; font-weight: 600; }
.slot .title { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot.posted .status { color: var(--green); }
.slot.next { border-color: rgba(255, 84, 72, 0.5); background: rgba(255, 84, 72, 0.07); }
.slot.next .status { color: var(--coral); }
.slot.later .status { color: var(--faint); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.stat { padding: 18px 20px; }
.stat .value { font: 700 40px/1 var(--display); margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 18px; color: var(--faint); }
.stat .delta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.stat .delta b { color: var(--green); font-weight: 600; }

/* ---------- Shortlist ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.select {
  appearance: none; padding: 7px 30px 7px 12px; border-radius: 999px;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a3acd0' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); color: var(--text); font: 600 12px var(--body);
}

.sample-tag { font-size: 11px; font-weight: 600; color: var(--amber); background: var(--amber-soft); padding: 3px 8px; border-radius: 6px; letter-spacing: 0.04em; }

.list-head, .row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 190px 74px 78px;
  gap: 16px; align-items: center;
}
.list-head { padding: 0 14px 8px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.list-head .r { text-align: right; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line-soft);
  transition: border-color 0.15s, background 0.15s;
}
.row:hover { border-color: var(--line); background: #121937; }
.row.lead { border-color: rgba(255, 196, 0, 0.4); background: rgba(255, 196, 0, 0.05); }
.row.pinned { border-color: rgba(92, 200, 255, 0.5); }

.rank { display: grid; justify-items: center; gap: 2px; }
.rank b { font: 700 26px/1 var(--display); }
.row.lead .rank b { color: var(--amber); }
.move { font-size: 11px; font-weight: 700; }
.move.up { color: var(--green); }
.move.down { color: var(--coral); }
.move.same { color: var(--faint); }
.move.new { color: var(--amber); letter-spacing: 0.06em; }

.story h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.story h3 a:hover { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.story .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--faint); font-size: 12px; }
.topic {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--tc, var(--muted));
}
.topic::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--tc, var(--muted)); }
.badge { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; }
.badge.next { background: var(--amber); color: #1a1020; }
.badge.pin { background: rgba(92, 200, 255, 0.18); color: var(--views); }

.meters { display: grid; gap: 7px; }
.meter { display: grid; grid-template-columns: 58px minmax(0, 1fr) 24px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.meter .track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: inherit; }
.meter.views .track i { background: var(--views); }
.meter.interest .track i { background: var(--interest); }
.meter b { font-weight: 600; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

.score { text-align: right; }
.score b { display: block; font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.score .votes { display: flex; justify-content: flex-end; gap: 3px; margin-top: 6px; }
.score .votes i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.score .votes i.on { background: var(--amber); }
.score small { display: block; color: var(--faint); font-size: 11px; margin-top: 3px; }

.actions { display: flex; justify-content: flex-end; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); background: var(--panel); }
.icon-btn.on { color: var(--views); border-color: rgba(92, 200, 255, 0.6); background: rgba(92, 200, 255, 0.1); }
.icon-btn svg { width: 16px; height: 16px; }

.legend { display: flex; gap: 16px; color: var(--faint); font-size: 12px; margin-top: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 4px; border-radius: 2px; display: inline-block; }

/* ---------- Empty / waiting states ---------- */
.empty { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 500; }
.searching {
  position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--amber);
}
.searching::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--amber); opacity: 0;
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.8; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .searching::after { animation: none; } }
.leader.is-empty { display: block; background: rgba(255, 255, 255, 0.02); border: 1px dashed var(--line); padding: 20px; }
.rows-empty {
  padding: 40px 20px; border-radius: var(--radius-sm); border: 1px dashed var(--line);
  display: grid; justify-items: center; text-align: center; gap: 10px;
}
.rows-empty .empty { font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.rows-empty p { margin: 0; max-width: 440px; color: var(--faint); font-size: 13px; }
.posted-empty { display: block !important; padding: 6px 0 !important; color: var(--faint); font-size: 13px; }

/* ---------- Side panels ---------- */
.posted { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.posted li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.posted li:last-child { border-bottom: 0; }
.posted h4 { margin: 0 0 3px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.posted .meta { color: var(--faint); font-size: 12px; }
.posted .eng { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.posted .eng b { display: block; font: 700 18px/1.1 var(--display); color: var(--text); }

.mix { display: grid; gap: 10px; }
.mix-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.mix-row .track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.mix-row .track i { display: block; height: 100%; background: var(--tc); border-radius: inherit; }
.mix-row b { text-align: right; color: var(--text); font-weight: 600; }

.how { margin: 0; padding: 0; list-style: none; counter-reset: how; display: grid; gap: 10px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; color: var(--muted); font-size: 13px; }
.how li::before { content: counter(how); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--amber); font: 700 13px/1 var(--display); }
.how b { color: var(--text); font-weight: 600; }

/* ---------- Buttons & forms (auth pages) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; border: 0;
  background: var(--amber); color: #17110a; font-weight: 700; letter-spacing: 0.01em;
}
.btn:hover { filter: brightness(1.06); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); font-weight: 600; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; }
.auth-card .brand { justify-content: center; flex-direction: column; text-align: center; gap: 14px; margin-bottom: 26px; }
.auth-card h1 { margin: 0; font: 700 30px/1.05 var(--display); text-transform: uppercase; }
.auth-card p.lede { margin: 6px 0 0; color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font: 500 15px var(--body);
}
.field input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.field-row { display: flex; justify-content: space-between; align-items: center; }
.field-row a { font-size: 12px; color: var(--muted); }
.field-row a:hover { color: var(--text); }
.notice {
  display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 20px; border-radius: 10px;
  background: var(--coral-soft); border: 1px solid rgba(255, 84, 72, 0.35); color: #ffd6d2; font-size: 13px;
}
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 4px; }
.strength i { height: 4px; border-radius: 999px; background: var(--line); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--coral); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #ff9f43; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--amber); }
.strength[data-score="4"] i { background: var(--green); }
.rules { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--faint); }
.rules li { display: flex; gap: 8px; align-items: center; }
.rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.rules li.ok { color: var(--muted); }
.rules li.ok::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%230a0e20' fill='none' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat center; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--faint); font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid.top, .grid.main { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .nav, .brand-sub, .user-btn .email { display: none; }
  .page { padding: 20px 16px 48px; }
  .countdown { font-size: 48px; }
  .hero-rounds { text-align: left; }
  .list-head { display: none; }
  .row { grid-template-columns: 40px minmax(0, 1fr) 64px; grid-template-areas: "rank story score" "rank meters actions"; row-gap: 12px; }
  .row .rank { grid-area: rank; align-self: start; }
  .row .story { grid-area: story; }
  .row .meters { grid-area: meters; }
  .row .score { grid-area: score; align-self: start; }
  .row .actions { grid-area: actions; }
  .leader { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 12px; }
}

/* ---------- Round controls ---------- */
.head-actions { display: flex; align-items: center; gap: 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--amber); outline-offset: 2px; }
.switch b { color: var(--text); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: progress; filter: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.round-title { font: 700 26px/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.stage.failed .bar i { width: 100%; background: var(--coral); }
.stage.failed label { color: var(--coral); }
.stage.active .bar i { width: 55%; }
.stage label .searching { display: inline-block; width: 7px; height: 7px; margin-left: 8px; vertical-align: middle; }
.source-log { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; position: relative; z-index: 1; }
.source-log li { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,.03); }
.source-log li b { font-weight: 600; }
.source-log li span { color: var(--muted); }
.source-log li.fail span { color: var(--coral); }
.source-log li.ok span::first-letter { color: var(--green); }
.auto-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- This round's 9 ---------- */
.list-head.nine, .row.nine { grid-template-columns: 52px minmax(0, 1fr) 210px 74px; }
.row.nine { align-items: start; }
.row.nine .summary { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.row.nine .reason { margin: 6px 0 0; color: var(--amber); font-size: 12px; }
.meter.fresh .track i { background: var(--green); }
.meter.style .track i { background: var(--amber); }

/* ---------- Potential posts ---------- */
.draft { padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); display: grid; gap: 10px; }
.draft + .draft { margin-top: 12px; }
.draft-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.draft-meta { color: var(--faint); font-size: 12px; }
.draft h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.draft h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.draft-text { width: 100%; resize: vertical; min-height: 130px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: 400 14.5px/1.55 var(--body); }
.draft-text:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.draft-sub { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; }
.research summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.research pre { white-space: pre-wrap; font: 400 12.5px/1.55 var(--body); color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; margin: 8px 0 0; max-height: 280px; overflow: auto; }
.draft-actions { display: flex; align-items: center; gap: 8px; }
.draft-actions .spacer { flex: 1; }
.icon-btn.vote { font-size: 15px; width: 38px; height: 34px; }
.icon-btn.down { color: var(--coral); border-color: rgba(255, 84, 72, .6); background: var(--coral-soft); }
.posted .eng a { color: var(--views); font-weight: 600; }

@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .row.nine { grid-template-columns: 40px minmax(0, 1fr) 56px; grid-template-areas: "rank story score" "rank meters meters"; }
  .row.nine .meters { grid-area: meters; }
  .source-log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- Image cards & alternatives ---------- */
.badge.alt { background: rgba(192, 139, 255, .18); color: var(--interest); }
.write-state { display: block; margin-top: 8px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.write-state .searching { display: inline-block; width: 7px; height: 7px; margin-right: 4px; }
.write-btn { margin-top: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.card-image { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.card-image > .btn { grid-column: 1 / -1; justify-self: start; }
.card-preview .card-img { width: 100%; height: auto; aspect-ratio: 4 / 5; display: block; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.card-preview .card-missing { display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.variants { margin: 8px 0; font-size: 13px; }
.variants summary { cursor: pointer; color: var(--faint); font-weight: 600; }
.variant { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.variant-head b { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.variant p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.eng-counts { color: var(--faint); font-size: 12px; margin-right: 10px; white-space: nowrap; }
.card-fields { display: grid; gap: 8px; }
.card-fields label { display: grid; gap: 4px; font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.card-in { width: 100%; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: 500 13.5px/1.4 var(--body); resize: vertical; text-transform: none; letter-spacing: 0; }
.card-in:focus { outline: none; border-color: var(--amber); }
.card-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-status { font-size: 12px; color: var(--faint); margin-right: auto; }
@media (max-width: 760px) { .card-image { grid-template-columns: minmax(0, 1fr); } .card-preview { max-width: 260px; } }

/* ---------- Activity & errors ---------- */
.hint.bad { color: var(--coral); font-weight: 600; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.log-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.log-list li:last-child { border-bottom: 0; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--green); }
.log-warn .log-dot { background: var(--amber); }
.log-error .log-dot { background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.log-msg { font-size: 13px; line-height: 1.4; }
.log-error .log-msg { color: #ffd6d2; font-weight: 600; }
.log-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.log-list details summary { cursor: pointer; font-size: 11px; color: var(--muted); margin-top: 4px; }
.log-list pre { white-space: pre-wrap; word-break: break-word; font: 11.5px/1.45 ui-monospace, Menlo, monospace; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 8px; margin: 6px 0 0; }

/* ---------- Public legal pages ---------- */
.legal { max-width: 760px; }
.legal .brand { margin-bottom: 28px; display: inline-flex; }
.legal h1 { font: 700 40px/1.05 var(--display); text-transform: uppercase; margin: 0 0 6px; }
.legal h2 { font: 700 22px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--muted); font-size: 15px; line-height: 1.65; }
.legal a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.legal .brand, .legal .brand * { text-decoration: none; color: var(--text); }
.legal .updated { color: var(--faint); font-size: 13px; margin: 0 0 20px; }
.archived { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.archived summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.archived .hint { margin: 8px 0 4px; }

/* ---------- Breaking ---------- */
.badge.breaking { background: var(--coral); color: #fff; letter-spacing: .1em; }
.draft.is-breaking { border-color: rgba(255, 84, 72, .7); box-shadow: 0 0 0 3px var(--coral-soft); }
.head-actions { flex-wrap: wrap; justify-content: flex-end; }
.mode-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- health checks ---------- */
.health { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.check { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.check-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--faint); }
.check.ok .check-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.check.warn .check-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.check.bad .check-dot { background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.check.bad { border-color: var(--coral); }
.check b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.check div span { display: block; font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
@media (max-width: 760px) { .health { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* ---------- breaking radar ---------- */
.radar { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.radar li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.radar li:last-child { border-bottom: 0; }
.radar .score { font: 700 24px/1 var(--display); text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.radar .score small { display: block; font: 500 10px/1.3 var(--body); color: var(--faint); }
.radar li.over .score { color: var(--coral); }
.radar h4 { margin: 0 0 3px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.radar p { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.4; }
.badge.live { background: var(--coral-soft); color: var(--coral); }
.badge.sent { background: var(--green-soft); color: var(--green); }

/* ---------- posted: totals ---------- */
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.totals div { padding: 10px 8px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); text-align: center; }
.totals b { display: block; font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.totals span { font-size: 11px; color: var(--faint); }
.posted li.best h4::before { content: "★ "; color: var(--amber); }
#posted-more { margin-top: 10px; }

/* ---------- settings ---------- */
.setting { padding: 12px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 10px; }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.setting-label b { display: block; font-size: 14px; }
.setting-label span { display: block; font-size: 12px; color: var(--faint); line-height: 1.45; margin-top: 2px; }
.times { display: flex; flex-wrap: wrap; gap: 8px; }
.time { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding-right: 4px; }
.time input, .money input { background: transparent; border: 0; color: var(--text); font: 600 15px/1 var(--body); padding: 9px 4px 9px 10px; min-height: 40px; color-scheme: dark; }
.time input:focus, .money input:focus { outline: none; }
.time:focus-within, .money:focus-within { border-color: var(--amber); }
.time button { background: none; border: 0; color: var(--faint); font-size: 18px; line-height: 1; padding: 8px; cursor: pointer; border-radius: 6px; }
.time button:hover { color: var(--coral); }
.setting-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.money { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding-left: 12px; color: var(--faint); font-weight: 600; }
.money input { width: 90px; }

/* ---------- rewrite ---------- */
.rewrite { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.rewrite > span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-right: 2px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 12.5px/1 var(--body); padding: 8px 12px; border-radius: 999px; cursor: pointer; min-height: 34px; }
.chip:hover { border-color: var(--amber); color: var(--text); }
.chip:disabled { opacity: .5; cursor: progress; }
.rewrite input { flex: 1 1 180px; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; color: var(--text); font: 500 13px/1 var(--body); padding: 9px 14px; min-height: 34px; }
.rewrite input:focus { outline: none; border-color: var(--amber); }

/* ---------- phone fit: nothing may push the page wider than the screen ---------- */
.grid > *, .stack > * { min-width: 0; }
.draft, .draft > * { min-width: 0; max-width: 100%; }
.draft h3, .posted h4, .radar h4 { overflow-wrap: anywhere; }
.draft-actions { flex-wrap: wrap; }
.posted .meta .eng-counts { margin: 0; display: inline; }
@media (max-width: 760px) {
  .draft-actions .spacer { flex-basis: 100%; height: 0; }
  .draft-actions .btn { flex: 1 1 auto; }
}

/* ---------- Videos tab ---------- */
.videos { display: grid; gap: 18px; margin-top: 18px; }
.videos [hidden], #posts[hidden] { display: none; }
.reel-candidates, .reel-list { list-style: none; margin: 0; padding: 0; }
.reel-candidates li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.reel-candidates li:first-child { border-top: 0; }
/* Each reel is its own card: title and "Goes out" across the top, text left, video right. */
.reel { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 10px 18px; padding: 14px 16px 16px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); align-items: start; }
.reel-head { grid-column: 1 / -1; }
.reel-name { display: block; font-size: 1.05rem; line-height: 1.3; margin-bottom: 8px; }
.reel-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reel-script { font-size: 0.9rem; line-height: 1.45; }
.reel-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.reel-video { width: 220px; aspect-ratio: 9 / 16; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); object-fit: cover; }
.reel-placeholder { display: grid; place-items: center; font-size: 2rem; }
.pill.wait { color: var(--amber); }
.pill.bad, .bad { color: #ff7a6b; }
.pill.ok { color: #7ee0a0; }
/* Phone: title, then the video, then the words and buttons, all inside the one card. */
@media (max-width: 720px) { .reel { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 14px; } .reel-video { width: 100%; max-width: 300px; order: 1; } .reel-main { order: 2; } }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: inherit; }
.btn-ghost:hover { border-color: var(--amber); }

/* Posts / Videos switch: shown on every screen size (the top nav is hidden on phones). */
.tabs { display: flex; gap: 6px; margin: 18px 0 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 999px; width: max-content; }
.tabs a { padding: 8px 18px; border-radius: 999px; text-decoration: none; color: inherit; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--amber); color: #0a0e20; }
.draft-reel { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 0.9rem; }
.reel-delay-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 0 0 12px; font-size: 0.92rem; }
.reel-delay-row select { background: var(--bg-2); color: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }

/* =====================================================================
   Panels and tiles (18 Oct 2026). One section on screen at a time; the
   home screen is a grid of square tiles. Written for phones first.
   ===================================================================== */
.page { padding: 20px 16px 56px; max-width: 1100px; }
.home-head { margin: 4px 0 14px; }
.home-head h1 { margin: 0; font: 700 30px/1.05 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.home-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 12px; }
.controls .switches { display: flex; gap: 18px; flex-wrap: wrap; }
.controls .btn { margin-left: auto; }

.health { display: grid; gap: 8px; margin: 0 0 16px; }
.health .check { padding: 10px 12px; font-size: 13px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  aspect-ratio: 1; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft);
  color: inherit; transition: border-color .15s, transform .15s;
}
.tile:hover, .tile:focus-visible { border-color: var(--amber); transform: translateY(-1px); }
.tile-icon { font-size: 30px; line-height: 1; margin-bottom: auto; }
.tile b { font: 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.tile-sub { color: var(--muted); font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-badge {
  position: absolute; top: 12px; right: 12px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; background: var(--amber); color: #0a0e20; font: 700 13px/1 var(--display);
}
.tile-badge.bad { background: var(--coral); color: #fff; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .tile b { font-size: 22px; } }

/* ---------- panels ---------- */
[data-panel] { display: grid; gap: 14px; }
[data-panel][hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 2px; }
.panel-head h2 { margin: 0; font: 700 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.panel-head .hint { color: var(--muted); font-size: 13px; }
.panel-head .back { padding: 6px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--muted); }
.panel-head .back:hover { color: var(--text); border-color: var(--line); }
.pnav { flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pnav::-webkit-scrollbar { display: none; }
.pnav a { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-soft); }
.pnav a.on { background: var(--amber); color: #0a0e20; border-color: var(--amber); }
.card-head .switch { margin-left: auto; }
.small-p { margin: -4px 0 10px; font-size: 13px; }

/* ---------- this round: compact rows ---------- */
.hero { padding: 18px; }
.hero .countdown { font-size: 32px !important; }
.hero .hero-rounds { text-align: right; }
.cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cand details { border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.02); }
.cand details[open] { border-color: var(--line); }
.cand.lead details { border-color: rgba(255, 196, 0, .45); background: rgba(255, 196, 0, .05); }
.cand summary { list-style: none; display: grid; grid-template-columns: 34px minmax(0, 1fr) 48px; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.cand summary::-webkit-details-marker { display: none; }
.cand-rank { font: 700 18px/1 var(--display); color: var(--faint); text-align: center; }
.cand.lead .cand-rank { color: var(--amber); }
.cand-main { display: grid; gap: 2px; min-width: 0; }
.cand-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cand-meta { color: var(--faint); font-size: 11.5px; }
.cand-meta .win { color: var(--amber); }
.cand-score { font: 700 22px/1 var(--display); text-align: right; color: var(--text); }
.cand-body { padding: 0 12px 12px 56px; display: grid; gap: 8px; }
.cand-body .summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cand-body .reason { margin: 0; color: var(--amber); font-size: 12px; }
.cand-body .meters { display: grid; gap: 4px; }
.cand-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 560px) { .cand-body { padding-left: 12px; } }
.source-log li { grid-template-columns: minmax(0, 1fr); gap: 2px; }

/* ---------- potential posts: the card, tidied ---------- */
.draft { padding: 14px; }
.draft h3 { font-size: 15px; line-height: 1.3; margin: 6px 0 10px; }
.draft-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.draft-meta { font-size: 11.5px; color: var(--faint); }
.draft-body { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; align-items: start; }
.draft-side { display: grid; gap: 6px; justify-items: center; }
.draft-side .card-preview { width: 104px; }
.draft-side .card-img, .draft-side img.card-img { width: 104px; height: auto; border-radius: 8px; display: block; }
.draft-side .card-missing { width: 104px; height: 130px; display: grid; place-items: center; font-size: 11px; color: var(--faint); text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.draft-side .card-status { font-size: 11px; color: var(--faint); text-align: center; }
.draft-text { font-size: 14px; }
.draft-actions { margin-top: 10px; }
details.more { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 6px; }
details.more > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--faint); font-size: 16px; width: 10px; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary b { color: var(--text); }
.more-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 8px; align-items: center; }
details.more .rewrite { margin: 4px 0 8px; }
details.more .card-fields { padding: 4px 0 8px; }
details.more .card-tools { margin-top: 8px; }
details.more pre { white-space: pre-wrap; font-size: 12px; }
@media (max-width: 460px) { .draft-body { grid-template-columns: minmax(0, 1fr) 84px; } .draft-side .card-preview, .draft-side .card-img, .draft-side img.card-img { width: 84px; } }

/* ---------- posted / stats ---------- */
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat .value { font-size: 28px; }

/* ---------- settings ---------- */
.modes { gap: 8px; }
@media (max-width: 760px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .topbar .pill { display: none; } }

/* ---------- Fit the phone: nothing may be wider than the screen ---------- */
html, body { overflow-x: hidden; }
[data-panel] > *, .card, .draft, .draft-main, .draft-side, .cand-main, .log-list li > div, .radar li > div, .posted li > div { min-width: 0; }
.draft-side.card-image { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; } /* the old 200px card-image grid must not apply to the thumbnail */
.draft-text, .card-in, textarea, input[type="text"], input[type="number"], .rewrite-own { max-width: 100%; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.draft-meta, .cand-meta, .log-meta, .posted .meta { overflow-wrap: anywhere; }
.draft h3, .cand-title, .posted h4, .radar h4, .log-msg { overflow-wrap: anywhere; }
.rewrite { display: flex; flex-wrap: wrap; gap: 6px; }
.rewrite-own { flex: 1 1 160px; min-width: 0; }
.stages { flex-wrap: wrap; }
.hero-top { flex-direction: column; gap: 8px; }
.hero .hero-rounds { text-align: left; }
.source-log li { grid-template-columns: minmax(0, 1fr); }
.times .time { max-width: 100%; }
.totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .totals { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hero-top { flex-direction: row; } .hero .hero-rounds { text-align: right; } }
/* On a phone the text box needs the full width: the card thumbnail goes under it, as a small row. */
@media (max-width: 600px) {
  .draft-body { grid-template-columns: minmax(0, 1fr); }
  .draft-side.card-image { grid-template-columns: 72px minmax(0, 1fr); align-items: center; justify-items: start; gap: 10px; }
  .draft-side .card-preview, .draft-side .card-img, .draft-side img.card-img { width: 72px; }
  .draft-side .card-missing { width: 72px; height: 90px; }
  .draft-side .card-status { text-align: left; }
  .draft-side > .btn { grid-column: 1 / -1; }
  .draft-text { min-height: 150px; }
}

/* Videos: is the Mac's reel maker alive */
.reel-maker { font-size: .85rem; margin: .4rem 0 .6rem; }
.reel-maker.ok { color: var(--ok, #4ade80); }
.reel-maker.bad { color: var(--bad, #f87171); font-weight: 600; }
.reel-maker.warn { color: var(--warn, #fbbf24); font-weight: 600; }

/* A reel being made: stage, bar, and the Mac's heartbeat, in the slot the video will fill. */
.reel-progress { display: flex; flex-direction: column; justify-content: center; gap: .5rem; padding: 1rem; }
.reel-progress-label { font-weight: 600; font-size: .9rem; }
.reel-progress-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.reel-progress-bar span { display: block; height: 100%; background: var(--accent, #f5c242); border-radius: 999px; transition: width .6s ease; min-width: 2px; }
.reel-progress-sub { font-size: .74rem; opacity: .7; }
.reel-progress-warn { font-size: .8rem; color: var(--bad, #f87171); font-weight: 600; }
.reel-progress.stalled .reel-progress-bar span { background: var(--bad, #f87171); }

/* Home: "Right now" */
.now-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.now-head h2 { margin: 0; font-size: 1rem; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.now-list li { padding-left: 1.2rem; position: relative; font-size: .92rem; line-height: 1.4; }
.now-list li::before { content: "●"; position: absolute; left: 0; top: 0; font-size: .7rem; line-height: 1.9; }
.now-ok::before { color: var(--ok, #4ade80); }
.now-work::before { color: var(--accent, #f5c242); animation: now-pulse 1.4s ease-in-out infinite; }
.now-wait::before { color: var(--accent, #f5c242); }
.now-warn::before { color: var(--warn, #fbbf24); }
.now-bad { color: var(--bad, #f87171); font-weight: 600; }
.now-bad::before { color: var(--bad, #f87171); }
.now-muted { opacity: .7; }
.now-muted::before { opacity: .5; }
@keyframes now-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Facebook's retention curve under a reel: one bar a second, height = share still watching. */
.ret { display: flex; align-items: flex-end; gap: 1px; height: 30px; margin: .3rem 0 .4rem; max-width: 420px; }
.ret i { flex: 1; min-width: 2px; background: var(--accent, #f5c242); opacity: .85; border-radius: 1px 1px 0 0; }
.reel-stats { font-size: .82rem; }

/* Settings: the "+ post" tick next to each post time. */
.time-post { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; margin: 0 .4rem; white-space: nowrap; }

.now-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

/* Videos: the "Goes out" pill is a button; tapping it opens the time editor below the title. */
.pill-btn { cursor: pointer; border: 0; font: inherit; }
.reel-when { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .6rem 0 .2rem; padding: .6rem .75rem; font-size: .86rem; border: 1px solid var(--amber); border-radius: var(--radius-sm); background: var(--amber-soft); }
.reel-when-name { flex-basis: 100%; }
.reel-when input { font: inherit; padding: .25rem .4rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: inherit; }

/* Videos: the folded "Make a reel from a post" list. A tall summary so it's an easy tap on a phone. */
details.reel-pick > summary { padding: 12px 0; font-size: 14px; flex-wrap: wrap; row-gap: 2px; }
details.reel-pick > summary span { color: var(--muted); }
details.reel-pick .small-p { margin: 2px 0 8px; }

/* ===================== Tidy pass, 23 Oct 2026: summaries instead of sentences (phone first) ===================== */

/* One summary cell: small label, big value, short line. Two across on a phone, four on a wide screen. */
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mini-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 700px) { .mini-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .mini-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini-stats:empty { display: none; }
.mini { display: block; min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
a.mini:hover, a.mini:focus-visible { border-color: var(--amber); }
.mini .k { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .v { margin-top: 4px; font: 700 24px/1.05 var(--display); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.mini .s { margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini.ok .v { color: var(--green); }
.mini.warn { border-color: rgba(255, 196, 0, .45); }
.mini.warn .v { color: var(--amber); }
.mini.bad { border-color: var(--coral); }
.mini.bad .v { color: var(--coral); }
.mini-stats.three .mini { padding: 9px 10px; }
.mini-stats.three .mini .v { font-size: 22px; }

/* Home: the one "Right now" card. Switches, then what's happening, then numbers, then two buttons. */
.card.now { display: grid; gap: 12px; padding: 14px 16px 16px; }
.now-switches { display: flex; gap: 18px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.now-main .eyebrow { margin-bottom: 2px; }
.now-headline { margin: 0; font: 700 26px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.now-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.now-sub:empty { display: none; }
.now-list[hidden] { display: none; }
.now-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.now-actions .btn { width: 100%; margin: 0; }
@media (min-width: 700px) { .now-actions { display: flex; justify-content: flex-end; } .now-actions .btn { width: auto; min-width: 150px; } }
#now-note { margin: 0; }
#now-note:empty { display: none; }

/* Home: health as three dots in one row; notes underneath only when needed. */
.health { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; }
.health .checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.health .check { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 9px 8px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.health .check.bad { border-color: var(--coral); }
.health .check.warn { border-color: rgba(255, 196, 0, .45); }
.health .check .check-dot { margin: 0; flex: none; }
.health .check b { display: inline; margin: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check-notes[hidden] { display: none; }
.check-notes li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--line-soft); font-size: 13px; line-height: 1.4; }
.check-notes li.warn { border-color: rgba(255, 196, 0, .45); }
.check-notes li.bad { border-color: var(--coral); }
.check-notes li b { margin-right: 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* Home: shorter section tiles on a phone (no forced squares). */
@media (max-width: 699px) {
  .tiles { gap: 10px; }
  .tile { aspect-ratio: auto; justify-content: flex-start; padding: 12px 14px 13px; gap: 2px; }
  .tile-icon { font-size: 22px; margin-bottom: 10px; }
  .tile b { font-size: 17px; }
  .tile-badge { top: 10px; right: 10px; min-width: 22px; height: 22px; padding: 0 6px; font-size: 12px; }
}

/* Videos: alert line under the summary, and the card of folds. */
.video-alert { margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.4; border: 1px solid rgba(255, 196, 0, .45); background: var(--amber-soft); }
.video-alert.bad { border-color: var(--coral); background: var(--coral-soft); }
.video-alert[hidden] { display: none; }
.card.folds { padding: 4px 16px; }
.card.folds details.more { margin-top: 0; padding-top: 0; }
.card.folds details.more:first-child { border-top: 0; }
.card.folds details.more[open] { padding-bottom: 10px; }
.card.folds .reel-maker:empty { display: none; }
/* Fold summaries: bold label, and a quiet line under it lined up with the label. */
details.reel-pick > summary span { flex-basis: 100%; padding-left: 18px; font-size: 12.5px; }
/* The reel cards stand on their own; no box around the boxes. */
.card.bare { background: none; border: 0; padding: 0; }
.card.bare > .card-head { margin: 4px 2px 10px; }

/* Home: followers against the 500 Facebook Stars needs. */
.follow-goal { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line-soft); }
.follow-goal[hidden] { display: none; }
.fg-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fg-top b { font: 700 24px/1 var(--display); }
.fg-top b small { font-size: 15px; color: var(--muted); font-weight: 600; }
.fg-bar { margin-top: 8px; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.fg-bar i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--amber); }
.fg-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
