:root {
  color-scheme: dark;
  --bg: #10141c;
  --surface: #181e2a;
  --raised: #222b3a;
  --line: #303b50;
  --text: #f3f6fb;
  --muted: #aab6ce;
  --accent: #a9f189;
  --danger: #ffacb4;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: #c6d9fc; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button, .primary { display: inline-flex; align-items: center; justify-content: center; width: fit-content;
  padding: .45rem .7rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--raised);
  color: var(--text); font-weight: 600; white-space: nowrap; }
.primary { padding: .65rem .95rem; color: #10200b; background: var(--accent); border-color: transparent; }
.primary:hover { background: #c6f7b2; text-decoration: none; }
button:hover { filter: brightness(1.15); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.9rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -.055em; }
h2 { font-size: 1.15rem; margin-bottom: 1rem; }
h3 { margin-bottom: .25rem; }
small { color: var(--muted); font-size: .84rem; }
.muted { color: var(--muted); }
.kicker { margin: 0 0 .55rem; color: var(--accent); font-size: .79rem; font-weight: 700; letter-spacing: .13em; }
.app { min-height: 100vh; display: grid; grid-template-columns: 15rem minmax(0,1fr); }
.rail { display: flex; flex-direction: column; gap: 2rem; background: #141a24; border-right: 1px solid var(--line); padding: 1.4rem 1rem; }
.brand { display: flex; gap: .6rem; align-items: center; color: var(--text); font-size: 1.25rem; font-weight: 750; overflow-wrap: anywhere; }
.rail .brand { padding-left: .35rem; }
.mark { display: grid; place-items: center; background: var(--accent); color: #11230d; width: 2.15rem; height: 2.15rem; flex: 0 0 2.15rem; border-radius: .65rem; font-size: 1.45rem; }
.rail nav { display: grid; gap: .35rem; }
.rail nav a { padding: .55rem .65rem; border-radius: .55rem; color: var(--muted); font-size: .95rem; }
.rail nav a span { display: inline-block; width: 1.35rem; }
.rail nav a.selected { color: var(--accent); background: #263829; }
.identity { margin-top: auto; border-top: 1px solid var(--line); padding: .8rem .35rem 0; overflow-wrap: anywhere; }
.identity form { margin-top: .6rem; }
main { width: 100%; max-width: 100rem; padding: clamp(1rem, 3vw, 3rem); }
.page-head { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: space-between; align-items: end; margin-bottom: 1.7rem; }
.panel { border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.metric { min-width: 0; display: grid; align-content: space-between; gap: .6rem; min-height: 7rem; padding: 1rem 1.1rem; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: 1.95rem; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric strong.smaller { font-size: 1.12rem; letter-spacing: 0; }
.table-panel, .editor { padding: clamp(.9rem,2vw,1.4rem); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .91rem; text-align: left; }
th, td { padding: .75rem .65rem; border-bottom: 1px solid var(--line); }
th { background: var(--raised); font-weight: 650; color: #d9e3f6; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; }
.endpoint { overflow-wrap: anywhere; }
code { white-space: nowrap; }
.badge { display: inline-block; padding: .18rem .45rem; background: var(--raised); border-radius: .45rem; white-space: nowrap; font-size: .83rem; }
.good { background: #233b2b; color: #b9f5aa; }
.bad { background: #3f2631; color: var(--danger); }
.danger { color: var(--danger); }
.actions, .actions form { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .65rem; }
.empty { padding: clamp(1.4rem,5vw,4rem) 1rem; text-align: center; border: 1px dashed var(--line); border-radius: .65rem; }
.empty-icon { display: block; font-size: 2.4rem; line-height: 1.1; color: var(--accent); margin-bottom: .7rem; }
.empty p { color: var(--muted); }
.editor { max-width: 52rem; }
.fields { display: grid; gap: 1rem; }
.fields label { display: grid; gap: .35rem; font-size: .94rem; font-weight: 650; min-width: 0; }
.fields small { font-weight: 400; }
.fields input, .fields select, .fields textarea { width: 100%; min-width: 0; padding: .6rem .7rem; background: #111722; border: 1px solid #46536b; border-radius: .55rem; color: var(--text); }
.fields textarea { resize: vertical; }
.split { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; }
.admin-grid { margin-top: 1.25rem; }
.notice { border: 1px solid var(--line); border-radius: .6rem; padding: .65rem .9rem; background: #263829; }
.notice.bad { background: #3f2631; }
.guest { display: grid; place-items: start center; min-height: 100vh; background: radial-gradient(ellipse at 50% 0%,#222d41,var(--bg) 60%); }
.guest main { max-width: 31rem; padding-top: clamp(1.5rem,10vh,6rem); }
.guest .brand { margin-bottom: 1.5rem; }
.guest-panel { padding: clamp(1.1rem,4vw,1.9rem); }
.guest-panel h1 { font-size: clamp(1.8rem,6vw,2.5rem); margin-bottom: .65rem; }
.guest-panel .primary { width: 100%; margin-top: .3rem; }
@media (max-width: 1050px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) {
  .app { display: block; }
  .rail { border: 0; border-bottom: 1px solid var(--line); padding: .8rem 1rem; gap: .7rem; }
  .rail nav { display: flex; flex-wrap: wrap; }
  .identity { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .5rem; }
  .identity form { margin: 0; }
}
@media (max-width: 480px) { .split { grid-template-columns: 1fr; } }
