/* Layout: a review queue. Run summary strip on top, filter bar, then one column of post rows
   with the engage action on the right; collapses to stacked rows on phones. */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --ink: #1d2320;
  --muted: #5d6762;
  --line: #dfe3de;
  --ore: #b8741a;          /* accent: mined ore / copper */
  --ore-soft: #f6e8d3;
  --good: #2f7d4f; --good-soft: #e1f1e6;
  --warn: #a35d00; --warn-soft: #fbeccf;
  --bad: #b23b3b;  --bad-soft: #f8e1e1;
  --info: #2c5f8a; --info-soft: #e0ebf5;
  --chip: #eceee9;
  --f-display: "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141816; --surface: #1c211e; --ink: #e7ebe8; --muted: #9aa49e; --line: #2d3430;
  --ore: #e2a24f; --ore-soft: #3a2c18;
  --good: #6cc48f; --good-soft: #1d3326; --warn: #e6a64a; --warn-soft: #382a14;
  --bad: #ec8080; --bad-soft: #3a1f1f; --info: #84b5e0; --info-soft: #1c2b3a; --chip: #262c28;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141816; --surface: #1c211e; --ink: #e7ebe8; --muted: #9aa49e; --line: #2d3430;
  --ore: #e2a24f; --ore-soft: #3a2c18;
  --good: #6cc48f; --good-soft: #1d3326; --warn: #e6a64a; --warn-soft: #382a14;
  --bad: #ec8080; --bad-soft: #3a1f1f; --info: #84b5e0; --info-soft: #1c2b3a; --chip: #262c28;
  color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
.wrap { max-width: 980px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 64px; display: grid; gap: 22px; }
a { color: var(--info); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ore); outline-offset: 2px; }

header.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
h1 { font: 700 clamp(26px, 4vw, 34px)/1.1 var(--f-display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 span { color: var(--ore); }
.sub { color: var(--muted); margin: 4px 0 0; }
.top-right { display: flex; align-items: center; gap: 10px; }
button.ghost { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
button.link { border: 0; background: none; color: var(--info); padding: 0; font-size: inherit; text-decoration: underline; }
.run-pick { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
select { font: 500 14px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }

.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.funnel div { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.funnel b { font: 600 22px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.funnel small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.funnel .hl b { color: var(--ore); }
.warnline { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 14px; }

.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--chip); padding: 4px; border-radius: 9px; }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 500; font-size: 14px; }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.tabs .n { font-family: var(--f-mono); font-size: 12px; margin-left: 4px; color: var(--muted); }
.bar input[type=search] { font: 14px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; min-width: 0; flex: 1 1 200px; max-width: 280px; }
label.tog { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

section.group { display: grid; gap: 10px; }
section.group h2 { font: 600 13px var(--f-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 6px 0 0; display: flex; gap: 8px; align-items: center; }
section.group h2 .n { font-family: var(--f-mono); }

.post { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; }
.post.engage { border-color: var(--ore); box-shadow: inset 3px 0 0 var(--ore); }
.post.done { opacity: 0.62; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.meta .who { color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.meta .who:hover { text-decoration: underline; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.question, .pill.criticism { background: var(--warn-soft); color: var(--warn); }
.pill.praise { background: var(--good-soft); color: var(--good); }
.pill.news, .pill.partner { background: var(--info-soft); color: var(--info); }
.pill.spam, .pill.unrelated { background: var(--bad-soft); color: var(--bad); }
.pill.star { background: var(--ore-soft); color: var(--ore); }
.text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.why { margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 68ch; }
.why b { color: var(--ink); font-weight: 600; }
.body { min-width: 0; grid-column: 1; }
.act { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 6px; align-content: start; justify-items: stretch; min-width: 128px; }
.act a.open { text-align: center; text-decoration: none; font-weight: 600; font-size: 13px; padding: 7px 10px; border-radius: 7px; background: var(--ink); color: var(--bg); }
.act button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 6px 10px; font-size: 13px; }
.act button:hover { border-color: var(--muted); }
.act button[disabled] { cursor: default; opacity: 0.5; }
.state { font-size: 12px; color: var(--muted); text-align: center; }
.state.replied { color: var(--good); font-weight: 600; }
.state.skipped { color: var(--muted); font-weight: 600; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 600 17px var(--f-display); margin-bottom: 4px; }
footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
#app { display: grid; gap: 22px; }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 8px 12px; font-size: 14px; margin: 0; }

.login { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 8px; max-width: 380px; }
.login h2 { font: 600 20px var(--f-display); margin: 0 0 6px; }
.login label { font-size: 13px; font-weight: 500; }
.login label small { color: var(--muted); font-weight: 400; }
.login input { font: 15px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin-bottom: 6px; }
.login button { margin-top: 6px; font-weight: 600; padding: 9px 12px; border: 0; border-radius: 7px; background: var(--ink); color: var(--bg); }
.login button[disabled] { opacity: 0.6; cursor: default; }

@media (max-width: 640px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .act { grid-column: 1; grid-row: auto; grid-template-columns: 1fr 1fr; min-width: 0; }
  .act a.open, .act .state { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) { .post { transition: opacity .2s; } }
.login .hint { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
