:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f7f1e4;
  background: #181611;
  color-scheme: dark;
  --panel: #221e17;
  --line: #443a28;
  --muted: #bfb39a;
  --accent: #f4ca64;
  --warn: #ffdb83;
  --mute: #decaf9;
  --danger: #ffafaa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 34px 18px 24px; background: #1d1912; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; margin-bottom: 34px; }
.brand-mark, .avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: #30230e; font-weight: 800; flex: none; }
.avatar { background: #493918; color: var(--accent); }
.account { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 22px; }
.account div { min-width: 0; overflow-wrap: anywhere; }
.account small { display: block; margin-top: 3px; }
nav { display: grid; gap: 4px; margin-top: 24px; }
nav button { text-align: left; background: transparent; border-color: transparent; color: var(--muted); font-weight: 600; }
nav button[aria-current] { background: #3d3018; color: var(--accent); border-color: #5b4724; }
main { width: 100%; max-width: 1420px; padding: 40px clamp(20px, 4vw, 56px); }
.page-header, .section-top, dialog header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.page-header { margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.14; }
h2 { font-size: 17px; letter-spacing: -.015em; }
h2 small { margin-left: 5px; font-size: 11px; }
.eyebrow { color: var(--accent); font-size: 13px; margin-bottom: 7px; overflow-wrap: anywhere; }
small, .muted, .group-label { color: var(--muted); }
.group-label { display: block; margin-bottom: 6px; }
button, input, select, textarea { font: inherit; font-size: 14px; color: inherit; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: 9px; background: #1a170f; padding: 10px 12px; min-height: 42px; }
button { cursor: pointer; }
button:hover { border-color: #a38955; }
button:disabled { opacity: .48; cursor: default; }
.primary { color: #30230e; background: var(--accent); border-color: var(--accent); font-weight: 720; }
.primary:hover { background: #ffe19a; }
button:focus-visible, :is(input, select, textarea, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; }
.section-top { margin-bottom: 14px; }
.section-top label { display: flex; align-items: center; gap: 9px; }
.section-top select { min-width: 115px; }
.panel, .metric, .record, .state { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric { display: grid; text-align: left; color: var(--muted); gap: 7px; }
.metric strong { color: var(--accent); font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric.warning strong { color: var(--warn); }
.metric.mute strong { color: var(--mute); }
.metric.ban strong { color: var(--danger); }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#overview .stats-grid article:first-child { grid-column: 1 / -1; }
.stats-grid h2 { margin-bottom: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(38px, 1fr) minmax(25px, auto); align-items: center; gap: 10px; min-height: 30px; font-size: 13px; overflow-wrap: anywhere; }
.bar-row strong { text-align: right; }
progress { width: 100%; height: 7px; border: 0; appearance: none; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #3c3221; border-radius: 8px; }
progress::-webkit-progress-value { background: #e7b753; border-radius: 8px; }
progress::-moz-progress-bar { background: #e7b753; border-radius: 8px; }
#days { max-height: 280px; overflow: auto; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.wide { grid-column: span 2; }
.filter-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.inline-form { display: flex; align-items: end; gap: 12px; margin-bottom: 14px; }
.inline-form label { flex: 1; }
.records { display: grid; gap: 9px; }
.developer-hint { margin-bottom: 12px; }
.group-record h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.group-record .inline-form { margin: 0; }
.group-record details { margin-top: 4px; }
.group-record details .person { padding: 8px 0; }
.group-record details .person small { display: inline; }
.record { display: grid; gap: 8px; }
.record-head, .person { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-head div, .person div { min-width: 0; overflow-wrap: anywhere; }
.person { padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.records .person { padding: 14px 17px; border-top: 1px solid var(--line); }
.person small { display: block; margin-top: 4px; }
.badge { display: inline-block; border-radius: 7px; padding: 5px 8px; background: #42341e; color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.warning, .badge.uncertain { background: #413822; color: var(--warn); }
.badge.mute { background: #3a2c49; color: var(--mute); }
.badge.ban, .badge.failed { background: #442d2b; color: var(--danger); }
details { font-size: 13px; color: var(--muted); }
summary { cursor: pointer; width: fit-content; color: var(--accent); }
details[open] summary { margin-bottom: 8px; }
details p { margin: 7px 0; overflow-wrap: anywhere; }
blockquote { margin: 8px 0; padding: 6px 11px; border-left: 2px solid #8a7041; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-quote { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #1a170f; }
.evidence-quote { border-color: #7c6231; }
.message-meta { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.message-quote blockquote { margin: 4px 0 0; padding: 0; border: 0; }
.message-context .message-quote + .message-quote { margin-top: 6px; }
a { color: var(--accent); }
.pagination { display: flex; justify-content: center; gap: 12px; align-items: center; margin-top: 14px; }
.feedback { border: 1px solid #745c30; background: #372c18; color: var(--accent); padding: 10px 12px; border-radius: 9px; margin-bottom: 14px; overflow-wrap: anywhere; }
.feedback.error { border-color: #6b4843; background: #382723; color: var(--danger); }
.state { color: var(--muted); }
dialog { width: min(450px, calc(100% - 28px)); max-height: calc(100% - 32px); overflow: auto; border: 1px solid var(--line); border-radius: 16px; color: inherit; background: var(--panel); padding: 20px; }
dialog::backdrop { background: #0a0805b8; }
dialog form { display: grid; gap: 12px; }
dialog header button { font-size: 19px; padding: 0 13px; }
dialog .feedback { margin: 0; }
@media (max-width: 820px) {
  body { grid-template-columns: 178px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr auto; gap: 12px; height: auto; padding: 14px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; font-size: 17px; }
  #workspace { grid-column: 1 / -1; grid-row: 2; }
  .account { margin: 0; padding: 0; font-size: 12px; }
  nav { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 4px; margin-top: 10px; }
  nav button { text-align: center; padding: 8px 3px; font-size: 12px; }
  main { padding: 20px 14px 32px; }
  .page-header { margin-bottom: 17px; }
  .page-header button { font-size: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
  .metrics { gap: 6px; }
  .metric { padding: 10px 6px; font-size: 11px; overflow-wrap: anywhere; }
  .metric strong { font-size: 28px; }
}
@media (max-width: 370px) {
  .inline-form { display: grid; }
  .account .avatar { display: none; }
}

