:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c1118;
  color: #edf2f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: #121a24;
  --panel-raised: #182330;
  --line: #253241;
  --muted: #93a2b4;
  --mint: #53dfb0;
  --red: #ff887d;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-screen { display: grid; min-height: 100vh; padding: 24px; place-items: center; background: radial-gradient(ellipse at 50% 10%, #17302d 0, transparent 42%), #0c1118; }
.login-card { display: grid; width: min(100%, 390px); gap: 12px; padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: #111923; box-shadow: 0 24px 80px #0008; }
.brand-mark { display: grid; width: 42px; height: 42px; margin-bottom: 8px; place-items: center; border-radius: 12px; background: var(--mint); color: #061610; font-size: 22px; font-weight: 900; }
.eyebrow { margin: 0 0 6px; color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
.login-card h1 { margin-bottom: 0; font-size: 26px; }
.muted { color: var(--muted); line-height: 1.6; }
.login-card label, .filters label { display: grid; gap: 7px; color: #b9c6d4; font-size: 12px; font-weight: 650; }
.login-card input, .filters input, .filters select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #344354; border-radius: 7px; outline: none; background: #0d141c; color: #edf2f7; }
.login-card input:focus, .filters input:focus, .filters select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px #53dfb01c; }
.primary, .quiet-button { min-height: 38px; padding: 0 14px; border-radius: 7px; font-size: 12px; font-weight: 750; }
.primary { border: 1px solid var(--mint); background: var(--mint); color: #071a13; }
.primary:hover { background: #79edc7; }
.quiet-button { border: 1px solid #344354; background: #151f2a; color: #dbe5ee; }
.quiet-button:hover:not(:disabled) { border-color: #63788e; background: #1c2937; }
button:disabled { cursor: not-allowed; opacity: .45; }
.login-error { margin: 2px 0 0; color: var(--red); font-size: 12px; }

.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; width: 226px; flex-direction: column; padding: 24px 16px; border-right: 1px solid var(--line); background: #101720; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #f3f7fa; font-size: 15px; font-weight: 850; text-decoration: none; }
.brand .brand-mark { flex: 0 0 36px; width: 36px; height: 36px; margin: 0; border-radius: 10px; font-size: 18px; }
.brand small { margin-left: 5px; color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.sidebar nav { display: grid; gap: 6px; margin-top: 42px; }
.nav-link { padding: 11px 12px; border-radius: 7px; color: #aab8c7; font-size: 13px; text-decoration: none; }
.nav-link:hover, .nav-link.active { background: #1b2935; color: var(--mint); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 8px; color: var(--muted); font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px #53dfb077; }
.main-column { max-width: 1600px; margin-left: 226px; padding: 28px clamp(20px, 3.5vw, 54px) 24px; }
.topbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar { margin-bottom: 32px; }
.topbar h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.035em; }
.section { margin: 0 0 44px; scroll-margin-top: 24px; }
.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.record-count { color: var(--muted); font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { min-height: 126px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 10px 0 6px; font-size: 28px; letter-spacing: -.04em; }
.stat-card small { font-size: 10px; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(115px, 1fr)); gap: 12px; margin: 0 0 15px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.filters label { min-width: 0; }
.filters .wide { grid-column: span 2; }
.filter-actions { display: flex; align-items: end; gap: 8px; }
.filter-actions button { flex: 1; }
.status { min-height: 20px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.status.error { color: var(--red); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 12px 13px; border-bottom: 1px solid var(--line); background: #16202b; color: #95a6b8; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
td { max-width: 240px; padding: 12px 13px; border-bottom: 1px solid #202c39; color: #dce5ee; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #192431; }
td.title-cell { max-width: 300px; overflow: hidden; color: #f4f7fa; font-weight: 700; text-overflow: ellipsis; }
td .subline { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 450; }
.rating { color: #ffd47a; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.record-summary { margin: 3px 0; color: #9cebd1; font-size: 10px; cursor: pointer; }
.record-json { max-height: 420px; overflow: auto; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #0a1016; color: #c3d3e2; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: var(--muted); font-size: 11px; }
.pagination div { display: flex; gap: 8px; }
.docs-intro { max-width: 800px; font-size: 12px; }
.docs-list { display: grid; gap: 9px; }
.doc-card { padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.doc-card > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.method { padding: 4px 6px; border-radius: 4px; background: #133a31; color: var(--mint); font-size: 9px; font-weight: 850; letter-spacing: .07em; }
.doc-card code { color: #e5eef6; font-size: 12px; }
.doc-card p { margin: 8px 0 0 43px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.doc-card p code { color: #9cebd1; font-size: 10px; }
.footnote, footer { color: #8292a4; font-size: 10px; line-height: 1.6; }
.footnote { margin-top: 15px; }
footer { padding: 20px 0 6px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: sticky; z-index: 2; top: 0; width: auto; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; gap: 2px; margin: 0 0 0 auto; }
  .nav-link { padding: 9px 8px; font-size: 11px; }
  .sidebar-foot { display: none; }
  .main-column { margin: 0; padding: 20px 14px; }
  .topbar { margin-bottom: 25px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .filters .wide { grid-column: span 2; }
  .stat-grid { gap: 8px; }
  .stat-card { min-height: 112px; padding: 12px; }
  .stat-card strong { font-size: 24px; }
  .section { margin-bottom: 34px; }
  .doc-card p { margin-left: 0; }
}
@media (max-width: 420px) {
  .brand { gap: 6px; padding: 0; font-size: 12px; }
  .brand small { margin-left: 2px; }
  .brand .brand-mark { flex-basis: 30px; width: 30px; height: 30px; }
  .nav-link { padding: 8px 5px; font-size: 10px; }
  .main-column { padding-inline: 10px; }
  .quiet-button, .primary { padding-inline: 9px; }
}
