:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --keep: #0f7a4a; --keep-bg: #e8f6ef; --drop: #b42318; --drop-bg: #fdecea; --accent: #1f4fd1;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12151b; --card: #1b1f27; --text: #e7e9ee; --muted: #9aa1ad; --line: #2b313c;
    --keep: #4cc38a; --keep-bg: #15291f; --drop: #f97066; --drop-bg: #2e1a19; --accent: #7aa2ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 860px; margin: 0 auto; padding: 16px; }
header { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 20px; margin: 4px 0 12px; }
button { font: inherit; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--accent); color: #fff; cursor: pointer; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); padding: 4px; }
input { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.login { max-width: 340px; margin: 18vh auto 0; }
.err { color: var(--drop); }
.muted, .empty { color: var(--muted); }
.empty { text-align: center; padding: 40px 0; }
.runs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-bottom: 14px; }
.run { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--keep); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 13px; }
.run.bad { border-left-color: var(--drop); }
.run small { color: var(--muted); overflow-wrap: anywhere; }
nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
nav a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
nav a span { font-weight: 600; margin-left: 4px; }
.phone { font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.phone small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair > div { border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pair label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.keep { background: var(--keep-bg); } .keep label { color: var(--keep); }
.drop { background: var(--drop-bg); } .drop label { color: var(--drop); }
.pair code { font-size: 15px; overflow-wrap: anywhere; }
.pair span, .pair small { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.top { display: flex; align-items: center; gap: 4px; }
.top a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.top a.on { color: var(--text); background: var(--card); border: 1px solid var(--line); }
.fetch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; }
h2 { font-size: 16px; margin: 20px 0 6px; }
.settings > .muted { font-size: 13px; margin: 0 0 10px; }
.settings label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.settings label input { margin-bottom: 4px; color: var(--text); }
.settings label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.settings label.check input { width: auto; margin: 2px 0 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.grid .wide { grid-column: 1 / -1; }
fieldset.team { margin: 0 0 12px; }
fieldset.team legend { font-weight: 600; padding: 0 6px; }
details summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 6px 0; }
button.save { margin-top: 4px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .grid > span { display: none; } header { flex-wrap: wrap; } }
button.danger { background: var(--drop); }
button.danger.armed { outline: 3px solid var(--drop); outline-offset: 2px; font-weight: 700; }
.flash { padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; }
.flash.ok { background: var(--keep-bg); color: var(--keep); }
.flash.bad { background: var(--drop-bg); color: var(--drop); }
.note { margin: 8px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { margin: 0; padding: 7px 9px; width: auto; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.filters .grow { flex: 1 1 200px; } .filters .grow input { width: 100%; }
.filters .quick { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; order: 9; }
.filters .quick a { font-size: 13px; color: var(--accent); text-decoration: none; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.card h2 { margin: 0 0 10px; font-size: 15px; } .card h2 small { font-weight: 400; font-size: 12px; margin-left: 6px; }
.scroll { overflow-x: auto; }
table.matrix { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.matrix th, .matrix td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.matrix th:first-child { text-align: left; }
.matrix thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.matrix td.na { color: var(--line); }
.matrix .tot, .matrix tr.tot td, .matrix tr.tot th { font-weight: 700; }
.matrix a { color: var(--accent); text-decoration: none; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
nav a.csv { margin-left: auto; color: var(--accent); }
.note.warn { color: #a15c00; background: #fff4e0; padding: 6px 10px; border-radius: 6px; }
@media (prefers-color-scheme: dark) { .note.warn { color: #f5b14c; background: #2d2210; } }
.badge { font-size: 13px; color: var(--muted); }
.dup.s-cancelled, .dup.s-ignored { opacity: .75; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }
