:root {
  --bg: #eef1f3; --bg-2: #e7ebee; --surface: #ffffff; --surface-2: #f6f8f9;
  --border: rgba(22,26,31,0.08); --border-2: rgba(22,26,31,0.12); --border-3: rgba(22,26,31,0.20);
  --text: #161a1f; --text-2: #3d454e; --muted: #626c77;
  --accent: #1f6b62; --accent-hi: #17534c; --accent-soft: rgba(31,107,98,0.09); --accent-line: rgba(31,107,98,0.26); --on-accent: #ffffff;
  --warn: #8a5a12; --danger: #a33a32; --ok: #1d7a53; --info: #1d4ed8;
  --ok-soft: rgba(29,122,83,0.12); --warn-soft: rgba(138,90,18,0.12); --danger-soft: rgba(163,58,50,0.12); --info-soft: rgba(29,78,216,0.10);
  --shadow: 0 1px 2px rgba(0,0,0,0.06);
  --radius: 14px; --radius-sm: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e2126; --bg-2: #24272d; --surface: #272b31; --surface-2: #2f333a;
    --border: rgba(255,255,255,0.05); --border-2: rgba(255,255,255,0.09); --border-3: rgba(255,255,255,0.15);
    --text: #dadce0; --text-2: #aaadb4; --muted: #a7abb2;
    --accent: #4ec5b3; --accent-hi: #7ad9cb; --accent-soft: rgba(78,197,179,0.10); --accent-line: rgba(78,197,179,0.24); --on-accent: #10201d;
    --warn: #fbbf24; --danger: #f87171; --ok: #34d399; --info: #5ea0f2;
    --ok-soft: rgba(52,211,153,0.14); --warn-soft: rgba(251,191,36,0.14); --danger-soft: rgba(248,113,113,0.14); --info-soft: rgba(96,165,250,0.14);
    --shadow: 0 1px 2px rgba(0,0,0,0.22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1e2126; --bg-2: #24272d; --surface: #272b31; --surface-2: #2f333a;
  --border: rgba(255,255,255,0.05); --border-2: rgba(255,255,255,0.09); --border-3: rgba(255,255,255,0.15);
  --text: #dadce0; --text-2: #aaadb4; --muted: #a7abb2;
  --accent: #4ec5b3; --accent-hi: #7ad9cb; --accent-soft: rgba(78,197,179,0.10); --accent-line: rgba(78,197,179,0.24); --on-accent: #10201d;
  --warn: #fbbf24; --danger: #f87171; --ok: #34d399; --info: #5ea0f2;
  --ok-soft: rgba(52,211,153,0.14); --warn-soft: rgba(251,191,36,0.14); --danger-soft: rgba(248,113,113,0.14); --info-soft: rgba(96,165,250,0.14);
  --shadow: 0 1px 2px rgba(0,0,0,0.22);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.card { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2:first-child { margin-bottom: 12px; }
button, .btn { font: inherit; font-weight: 550; cursor: pointer; border: 1px solid var(--border-3); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; }
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); text-decoration: none; }
button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-danger:hover:not(:disabled) { background: var(--danger); filter: brightness(0.92); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn-lg { padding: 12px 20px; min-height: 48px; font-size: 16px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; color: var(--text-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font: inherit; width: 100%; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-3); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 38px; }
textarea { min-height: 80px; resize: vertical; }
label.field input, label.field select, label.field textarea { font-weight: 400; }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-3); border-radius: var(--radius-sm); background: var(--surface-2); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; padding: 3px 0; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } * { scroll-behavior: auto !important; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.notice { border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; background: var(--info-soft); color: var(--text); }
.notice.warn { background: var(--warn-soft); } .notice.error { background: var(--danger-soft); } .notice.ok { background: var(--ok-soft); }
.error-text { color: var(--danger); font-size: 13px; }
.center-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border-2); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 24px; font-weight: 650; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.change-up { color: var(--ok); } .change-down { color: var(--danger); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 460px; max-height: 88dvh; overflow: auto; border: 1px solid var(--border-3); }
.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.bar-chart i { display: block; flex: 1 1 0; min-width: 2px; max-width: 28px; background: var(--accent); border-radius: 2px 2px 0 0; }
.meter { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.warn > i { background: var(--warn); } .meter.full > i { background: var(--danger); }
.lang-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.lang-bar .meter { flex: 1; }
