:root {
  color-scheme: dark;
  --bg: #10131c;
  --panel: #191e2a;
  --line: #353f53;
  --text: #f8efe1;
  --muted: #b4bfd1;
  --gold: #f4c785;
  --red: #ffb2a0;
  font: 16px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at top, #322327, var(--bg) 36rem); color: var(--text); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem max(1rem, calc((100vw - 1070px) / 2)); border-bottom: 1px solid #835f3e; background: #141620; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand > span { color: var(--gold); border: 1px solid #835f3e; border-radius: .6rem; padding: .35rem .65rem; }
.brand b, .brand small { display: block; }
.brand small, p, dt { color: var(--muted); }
.session { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem .75rem; text-align: right; }
.session span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.session button { white-space: nowrap; }
main { width: min(1070px, calc(100% - 2rem)); margin: 1.8rem auto 2rem; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 4vw, 2.65rem); }
h2 { font-size: 1.35rem; margin-bottom: .65rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 1.15rem; }
.auth { max-width: 28rem; margin: 3rem auto; }
.auth h1 { margin-bottom: .6rem; }
.auth form { margin-top: 1rem; }
form { display: grid; gap: .8rem; }
label { display: grid; gap: .3rem; min-width: 0; color: var(--muted); font-size: .87rem; font-weight: 650; }
button, input, select, textarea { min-height: 2.55rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: .55rem; font: inherit; color: var(--text); background: #11151f; }
input, select, textarea { width: 100%; }
button { cursor: pointer; font-weight: 650; }
button:hover { border-color: var(--gold); }
button:disabled { opacity: .6; cursor: wait; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.primary { background: var(--gold); color: #22170c; border-color: var(--gold); }
button.danger { background: #502726; color: #ffe9e4; border-color: #dd9285; }
.links, .overview, .history-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.overview p { margin-top: .35rem; }
.scope-note, .notice { padding: .65rem .85rem; border: 1px solid #59687b; border-radius: .65rem; background: #1b2a37; margin: .8rem 0; }
.scope-note.official, .notice.error { background: #3d2427; color: var(--red); border-color: #875552; }
.notice.success { background: #1c352b; color: #c3ebce; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.search { grid-template-columns: 1fr auto; align-items: end; }
.action-help { font-size: .85rem; }
#profile { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.badges { margin-top: .25rem; color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-bottom: 0; }
.stats div { padding: .45rem; background: #11151f; border-radius: .5rem; }
dt { font-size: .75rem; }
dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.history { margin-top: 1rem; }
.history-head h2 { margin: 0; }
#audit { margin: .65rem 0 0; padding: 0; list-style: none; }
#audit li { display: grid; gap: .2rem; padding: .7rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
#audit small { color: var(--muted); }
footer { margin-top: .9rem; text-align: right; }
a { color: var(--gold); }
@media (max-width: 680px) {
  .columns { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
