:root {
  color-scheme: dark;
  --bg: #151e24; --panel: #1b272f; --card: #233540; --line: #344954;
  --text: #edf3f6; --muted: #aac0cc; --accent: #00cbe5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 system-ui, sans-serif; }
button, input { font: inherit; }
button, .file-label {
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  color: var(--text); padding: 6px 12px; cursor: pointer; min-height: 32px;
}
button:hover, .file-label:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: wait; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
header { display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.brand { flex-shrink: 0; font-size: 22px; font-weight: 750; letter-spacing: -.7px; color: var(--accent); }
.brand span { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; margin-left: 12px; }
main { margin: auto; padding: 14px 20px 28px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.login { max-width: 550px; margin: 8vh auto; font-size: 14px; }
.login p { margin: 16px 0 24px; }
.eyebrow { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: 1.3px; margin: 0 0 6px; }
h1 { font-size: 20px; line-height: 1.25; margin: 0; }
h2 { font-size: 14px; margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
.file-label { display: inline-block; background: var(--accent); color: #08212a; font-weight: 650; padding: 10px 16px; }
#key { display: block; max-width: 100%; margin-top: 16px; font-size: 13px; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
nav button { background: transparent; }
nav button[aria-current] { border-color: var(--accent); background: #163d49; color: var(--accent); }
#products { margin-bottom: 10px; }
#products button { font-size: 14px; font-weight: 650; min-height: 36px; }
#sections { padding: 10px 0; border-top: 1px solid var(--line); margin-bottom: 6px; }
#sections button { border-color: transparent; }
#sections button[aria-current] { border-color: var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#description { margin: 8px 0; }
#description:empty { display: none; }
.cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.stat { padding: 10px 14px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.cards:has(> :last-child:nth-child(3)) { grid-template-columns: repeat(3,minmax(0,1fr)); }
.stat strong { display: block; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.summary-line { color: var(--muted); margin: -2px 0 12px; font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); align-items: start; gap: 12px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; min-height: 40px; }
.panel-heading h2 { font-size: 13px; font-weight: 650; }
.panel-stack { min-width: 0; display: grid; gap: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 13px; text-align: left; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--card); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
td { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td button { padding: 3px 10px; font-size: 12px; min-height: 28px; }
tr:hover td { background: #1d2c35; }
.panel .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
.panel table { min-width: 0; }
.panel table:has(th:nth-child(5)) { min-width: 460px; }
.panel-footer { color: var(--muted); margin: 0; padding: 8px 12px; font-size: 11px; border-top: 1px solid var(--line); }
.panel > .muted { padding: 0 12px; }
.identifier { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }
.text-button { color: var(--accent); background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 5px; min-height: 26px; font-size: 12px; text-align: left; }
.panel-stack > .text-button { justify-self: start; }
.report-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 7px 12px; border-top: 1px solid var(--line); }
.report-row > div { min-width: 0; }
.report-row .text-button { margin-left: -5px; }
.report-row small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-row time { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.notes { margin-top: 12px; color: var(--muted); font-size: 12px; }
.notes summary { cursor: pointer; width: fit-content; }
.notes p { margin: 6px 0; max-width: 1000px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.pager:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
#status { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; text-align: right; }
#status.error { color: #ffb6bc; }
.empty { padding: 18px 12px; margin: 0; text-align: center; color: var(--muted); }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; width: min(850px,94vw); max-height: 90vh; padding: 20px; }
dialog::backdrop { background: #0009; }
dl { margin: 16px 0 0; }
dt { color: var(--muted); font-size: 12px; margin-top: 12px; }
dd { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--panel); font-size: 12px; }
.traffic-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 12px; }
.traffic-controls label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.traffic-controls input, .traffic-controls select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; max-width: 100%; }
.traffic-controls input[type=search] { width: 270px; }
.traffic-controls .checkbox-label { flex-direction: row; align-items: center; min-height: 34px; }
.api-route code { font-size: 12px; white-space: nowrap; }
.api-route small { display: block; color: var(--muted); font-size: 11px; }
.traffic-table table { min-width: 1100px; font-size: 12px; }
.traffic-table td { padding: 7px 10px; }
@media (max-width: 850px) { .overview-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 600px) {
  header { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  main { padding: 12px 12px 24px; }
  .brand span { font-size: 12px; margin-left: 8px; }
  #status { order: 3; flex-basis: 100%; text-align: left; }
  #status:empty { display: none; }
  #logout { margin-left: auto; }
  button, td button, .text-button, #products button { min-height: 44px; }
  nav button { padding: 8px 10px; }
  .cards, .cards:has(> :last-child:nth-child(3)) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat { padding: 10px 12px; }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat strong { font-size: 22px; }
  .summary-line { line-height: 1.8; }
  .panel-heading { padding: 5px 10px; }
  th, td { padding: 8px 10px; }
  .login { padding: 20px; margin-top: 24px; }
  dialog { padding: 16px; }
}
