:root {
  --ink-950: oklch(0.25 0.035 245);
  --ink-800: oklch(0.36 0.035 245);
  --ink-600: oklch(0.49 0.025 245);
  --ink-500: oklch(0.56 0.02 245);
  --paper-50: oklch(0.985 0.005 220);
  --paper-100: oklch(0.965 0.006 220);
  --paper-200: oklch(0.915 0.008 220);
  --mint-500: oklch(0.79 0.16 165);
  --mint-700: oklch(0.48 0.105 165);
  --red-700: oklch(0.48 0.16 25);
  --surface: var(--paper-50);
  --surface-muted: var(--paper-100);
  --border: var(--paper-200);
  --text: var(--ink-950);
  --text-muted: var(--ink-600);
  --accent: var(--mint-700);
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--surface-muted); }
body { margin: 0; min-height: 100dvh; color: var(--text); background: var(--surface-muted); font: 16px/1.55 "Segoe UI Variable", "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.58; }
a { color: var(--accent); }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--mint-500); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: Consolas, monospace; }

.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink-950); }
.login-card { width: 100%; max-width: 420px; padding: 32px; border-radius: 16px; background: var(--surface); box-shadow: 0 20px 60px oklch(0.1 0.02 245 / 0.24); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--paper-50); text-decoration: none; font-size: 21px; font-weight: 750; line-height: 1.05; letter-spacing: -0.4px; }
.brand small { display: block; margin-top: 5px; color: var(--mint-500); font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--ink-950); background: var(--mint-500); font-size: 21px; font-weight: 850; }
.brand-login { color: var(--text); margin-bottom: 36px; }
.brand-login .brand-mark { color: var(--paper-50); background: var(--ink-950); }
.brand-login small { color: var(--accent); }
.login-heading { margin-bottom: 24px; }
.login-heading h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -0.7px; }
.login-heading p, .login-help { margin: 0; color: var(--text-muted); }
.login-card label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
.login-card input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.login-card input::placeholder { color: var(--ink-500); }
.login-card .button { width: 100%; margin-top: 16px; }
.login-help { margin-top: 20px; font-size: 13px; }
.login-help code { overflow-wrap: anywhere; color: var(--ink-800); }
.form-error { margin: 12px 0 0; color: var(--red-700); font-size: 14px; }

.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(16px, calc((100vw - 1320px) / 2)); color: var(--paper-50); background: var(--ink-950); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.health { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; color: var(--paper-200); font-size: 13px; }
.health i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-200); }
.health.online i { background: var(--mint-500); }
.health.offline i { background: oklch(0.7 0.17 25); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 650; transition: background-color 150ms ease-out, border-color 150ms ease-out, opacity 150ms ease-out, transform 150ms ease-out; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: var(--paper-50); background: var(--accent); }
.button-primary:hover:not(:disabled) { background: oklch(0.43 0.1 165); }
.button-secondary { color: var(--paper-50); border-color: oklch(0.5 0.035 245); background: transparent; }
.button-secondary:hover:not(:disabled) { background: var(--ink-800); }
.button-quiet { color: var(--paper-200); background: transparent; }
.button-quiet:hover:not(:disabled) { color: var(--paper-50); background: var(--ink-800); }

main { width: calc(100% - 32px); max-width: 1320px; margin: 0 auto; padding: 32px 0 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
.page-heading h1 { margin-bottom: 4px; font-size: 30px; line-height: 1.25; letter-spacing: -0.7px; }
.page-heading p, .panel-head p { margin-bottom: 0; color: var(--text-muted); }
.page-heading p { font-size: 15px; }
.updated { flex: none; color: var(--text-muted); font-size: 13px; }
.notice { margin: -8px 0 20px; padding: 12px 16px; border: 1px solid oklch(0.75 0.12 70); border-radius: 8px; color: oklch(0.39 0.09 60); background: oklch(0.95 0.04 85); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metrics article, .panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.metrics article { min-width: 0; padding: 18px 20px; }
.metrics span { display: block; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.metrics strong { display: block; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; font-size: 30px; line-height: 1.25; letter-spacing: -0.8px; }
.metrics small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.panel { min-width: 0; margin-bottom: 16px; padding: 20px; }
.overview-grid .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h2 { margin-bottom: 2px; font-size: 18px; line-height: 1.35; letter-spacing: -0.25px; }
.panel-head p { font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-muted); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--surface-muted); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-muted); }
th:first-child, td:first-child { padding-left: 4px; }
th:last-child, td:last-child { padding-right: 4px; }
.num { text-align: right; white-space: nowrap; }
.primary-cell { max-width: 360px; font-weight: 650; overflow-wrap: anywhere; }
.secondary-cell { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.rate { display: inline-block; min-width: 56px; color: var(--accent); font-weight: 750; text-align: right; }
.rate-low { color: var(--text-muted); }
.bar { width: 90px; height: 5px; margin-top: 6px; overflow: hidden; border-radius: 4px; background: var(--border); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.empty { margin: 12px 0 0; padding: 18px 8px 8px; color: var(--text-muted); text-align: center; font-size: 14px; }
select { min-height: 44px; max-width: 280px; padding: 8px 34px 8px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.catalog-list { margin: 4px 0 18px; }
.catalog-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--surface-muted); }
.catalog-list dt { color: var(--text-muted); font-size: 13px; }
.catalog-list dd { margin: 0; text-align: right; font-size: 14px; font-weight: 700; }
.client-download { margin-top: 18px; }
.download-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.download-link:hover { border-color: var(--accent); background: var(--surface-muted); }
.download-link small { display: block; color: var(--text-muted); font-size: 12px; }
.download-link b { color: var(--accent); font-size: 20px; }
.privacy-note { margin: 18px 0 0; color: var(--text-muted); font-size: 12px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 2px 4px 0; color: var(--text-muted); font-size: 12px; }

@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-grid .panel { margin-bottom: 0; }
  .health { display: none; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .top-actions { gap: 2px; }
  .button { padding: 8px 10px; }
  .button-secondary svg { display: none; }
  main { padding-top: 24px; }
  .page-heading { display: block; margin-bottom: 20px; }
  .updated { display: block; margin-top: 10px; }
  .metrics { gap: 8px; }
  .metrics article { padding: 14px; }
  .metrics strong { font-size: 25px; }
  .metrics small { white-space: normal; }
  .panel { padding: 15px; }
  .strategies-head { align-items: stretch; flex-direction: column; }
  select { width: 100%; max-width: none; }
  .col-optional, .col-mobile-optional { display: none; }
  th, td { padding: 10px 7px; font-size: 13px; }
  .primary-cell { max-width: 150px; }
  .bar { width: 64px; }
  footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
