:root {
  --bg: #f7f7f5; --panel: #fff; --text: #1d1d1b; --muted: #6b6b66; --line: #e3e2dd; --accent: #2f5d50;
  --ok: #1f7a4d; --ok-bg: #e3f3ea; --warn: #8a5a00; --warn-bg: #fbf0d9; --bad: #a3322b; --bad-bg: #f9e3e1;
  --grey-bg: #ecebe7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --panel: #1f1f1d; --text: #ecebe7; --muted: #a09f99; --line: #34332f; --accent: #7fc2ad;
    --ok: #7fd3a5; --ok-bg: #18382a; --warn: #f0c46c; --warn-bg: #3b2f14; --bad: #f19a92; --bad-bg: #3d1c19;
    --grey-bg: #2c2b28;
  }
}
* { 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; }
nav { display: flex; gap: 18px; align-items: center; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
nav a { color: var(--text); text-decoration: none; }
nav a:hover { color: var(--accent); }
nav .right { margin-left: auto; color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: block; overflow-x: auto; }
table tbody { display: table; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin: 12px 0; }
.card.narrow { max-width: 360px; margin: 80px auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin: 6px 0; }
label.check { flex-direction: row; align-items: center; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
button { font: inherit; background: var(--accent); color: var(--panel); border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; }
button.secondary { background: var(--grey-bg); color: var(--text); }
form.inline { display: inline-flex; gap: 8px; align-items: center; }
form.danger { margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--line); }
.flash { padding: 9px 12px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--grey-bg); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.available { background: var(--ok-bg); color: var(--ok); }
.badge.slow, .badge.held, .badge.running, .badge.new { background: var(--warn-bg); color: var(--warn); }
.badge.blocked, .badge.failing, .badge.failed, .badge.sold_out, .badge.gone { background: var(--bad-bg); color: var(--bad); }
.tag { font-size: 11px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.tile span { display: block; font-size: 24px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 3px; display: block; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery img { height: 220px; border-radius: 4px; }
.pager { display: flex; gap: 16px; align-items: center; }
details summary { cursor: pointer; font-weight: 600; }
table.matrix th { font-size: 11px; text-transform: none; letter-spacing: 0; white-space: normal; min-width: 70px; }
table.matrix td { padding: 6px 8px; font-size: 13px; }
table.matrix td.muted { color: var(--line); }
.strip { display: flex; gap: 4px; }
.strip img { width: 48px; height: 64px; object-fit: cover; border-radius: 3px; }
.strip.big img { width: 120px; height: 160px; }
.pair { display: grid; grid-template-columns: 1fr 1fr 220px; gap: 16px; align-items: start; }
.pair .side p { margin: 6px 0 0; font-size: 13px; }
.pair .choice { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } .strip.big img { width: 30%; height: auto; } }
button.small { padding: 4px 8px; font-size: 12px; }
.tabs { display: flex; gap: 16px; margin: 4px 0 8px; }
.tabs a { text-decoration: none; padding: 4px 0; color: var(--muted); }
.tabs a.on { color: var(--text); border-bottom: 2px solid var(--accent); font-weight: 600; }
pre.payload { max-width: 640px; max-height: 360px; overflow: auto; font-size: 11px; background: var(--bg); padding: 8px; border-radius: 4px; }
select[multiple] { padding: 4px; }
a.tile { text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
.note.unread { border-left: 3px solid var(--accent); }
.note p { margin: 0 0 6px; }
pre.note-body { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 0; color: var(--muted); }
.bar { width: 160px; height: 8px; background: var(--grey-bg); border-radius: 4px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar span { display: block; height: 100%; background: var(--accent); }
label.mode { margin-top: 14px; font-size: 14px; }
.mode-body { margin: 4px 0 8px 26px; }
table.matrix tr.groups th { border-bottom: 0; padding-bottom: 0; }
table.matrix th.grp { text-align: center; color: var(--text); border-bottom: 2px solid var(--line); }
.badge.interrupted { background: var(--grey-bg); color: var(--muted); }
