:root {
  --bg: #f6f4ef;
  --panel: #fffdf9;
  --text: #2a2620;
  --dim: #7a7266;
  --line: #e3ddd2;
  --accent: #a06a1c;
  --on: #2f7a3e;
  --off: #a33a2a;
  --warn: #9a5b00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151b;
    --panel: #201d25;
    --text: #e9e4da;
    --dim: #9a9387;
    --line: #34303b;
    --accent: #d9a55a;
    --on: #6cc27f;
    --off: #e07a68;
    --warn: #e2a64a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
a { color: var(--accent); }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .08em; text-decoration: none; color: var(--accent); }
.brand span { color: var(--dim); font-weight: 400; letter-spacing: 0; }
nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--dim); }
nav a.here { color: var(--text); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.dim { color: var(--dim); }
.warn { color: var(--warn); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.narrow { max-width: 360px; margin: 80px auto; display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: var(--off); }
button.link { background: none; color: var(--dim); padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.actions form { display: flex; gap: 8px; align-items: center; }
.note { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.note label, .note textarea { width: 100%; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.card table { border: 0; }
.settings th { width: 260px; font-weight: 500; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0 0 8px; }
dt { color: var(--dim); }
dd { margin: 0; }
.badge { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; }
.badge.on { color: var(--on); }
.badge.off { color: var(--off); }
.badge.none { color: var(--dim); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.stats b { font-size: 26px; }
.stats span { color: var(--dim); font-size: 13px; }
.stats .warn b { color: var(--warn); }
.filters { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; }
.flash { background: var(--panel); border-left: 4px solid var(--on); padding: 8px 12px; border-radius: 6px; }
.flash.error { border-color: var(--off); }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 3px 0; }
.pages { display: flex; justify-content: space-between; }
code { font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
