/* InferenceView brand system — dark architectural, financial-terminal register.
   Shared by landing + demo app. Chart palette validated (dataviz six checks)
   against --surface-1 #131319 in dark mode. */

:root {
  color-scheme: dark;

  /* planes */
  --page: #0b0b0f;
  --surface-1: #131319;      /* panels, chart surface */
  --surface-2: #1a1a22;      /* raised: drawers, modals, hover */
  --surface-3: #22222c;      /* highest: menus, tooltips */

  /* ink */
  --ink: #f2f3f5;
  --ink-2: #a6a9b3;
  --ink-3: #6d717d;

  /* lines */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-2: rgba(255, 255, 255, 0.14);
  --grid: #26262e;           /* chart gridlines, one shade off surface */
  --axis: #3a3a44;

  /* brand */
  --accent: #56cadd;         /* inference cyan */
  --accent-strong: #7fdcec;
  --accent-dim: rgba(86, 202, 221, 0.12);
  --accent-ink: #062a31;     /* text on accent fills */

  /* categorical series (fixed slot order — color follows entity) */
  --s-openai: #3987e5;
  --s-anthropic: #199e70;
  --s-microsoft: #c98500;
  --s-google: #008300;
  --s-aws: #9085e9;
  --s-private: #e66767;

  /* status (reserved — never series) */
  --st-good: #0ca30c;
  --st-warn: #fab219;
  --st-serious: #ec835a;
  --st-critical: #d03b3b;

  --up-good: #0ca30c;
  --down-bad: #e66767;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
::selection { background: rgba(86, 202, 221, 0.28); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; }
p { margin: 0; }

/* ---------- primitives ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow.dim { color: var(--ink-3); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { border-color: var(--hairline-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-dim); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.panel {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font: 600 10.5px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--hairline-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-accent { color: var(--accent); border-color: rgba(86, 202, 221, 0.4); background: var(--accent-dim); }
.badge-good { color: var(--st-good); border-color: rgba(12, 163, 12, 0.45); background: rgba(12, 163, 12, 0.1); }
.badge-warn { color: var(--st-warn); border-color: rgba(250, 178, 25, 0.4); background: rgba(250, 178, 25, 0.08); }
.badge-serious { color: var(--st-serious); border-color: rgba(236, 131, 90, 0.45); background: rgba(236, 131, 90, 0.09); }
.badge-critical { color: var(--st-critical); border-color: rgba(208, 59, 59, 0.5); background: rgba(208, 59, 59, 0.12); }
.badge-neutral { color: var(--ink-3); }

.num { font-variant-numeric: tabular-nums; }

.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }

.hr { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

/* ---------- data tables ---------- */

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  font: 600 10.5px/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline-2);
  white-space: nowrap;
}
table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  vertical-align: middle;
}
table.data td.strong { color: var(--ink); font-weight: 550; }
table.data th.r, table.data td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr { transition: background 0.1s; }
table.data tbody tr.rowlink { cursor: pointer; }
table.data tbody tr.rowlink:hover { background: var(--surface-2); }

/* ---------- scrim / toast / lead modal (shared: landing + app) ---------- */

.scrim { position: fixed; inset: 0; background: rgba(5, 5, 8, 0.6); z-index: 60; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 95;
  background: var(--surface-3); border: 1px solid var(--hairline-2); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: 11px 16px; font-size: 13px;
  display: flex; gap: 14px; align-items: center; max-width: min(560px, 92vw);
}
.toast-act { background: none; border: 0; color: var(--accent); font: 600 13px var(--sans); cursor: pointer; }

.modal-root .scrim { z-index: 80; }
.modal-card {
  position: fixed; z-index: 85; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(480px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--surface-2); padding: 26px 26px 22px; box-shadow: var(--shadow-pop);
}
.modal-x { position: absolute; top: 14px; right: 14px; }
.icon-btn {
  background: transparent; border: 1px solid var(--hairline-2); color: var(--ink-3);
  width: 26px; height: 26px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; line-height: 1;
}
.icon-btn:hover, .icon-btn.on { color: var(--accent); border-color: var(--accent); }
.modal-title { margin-top: 8px; font-size: 19px; }
.modal-blurb { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 16px; }
.lead-form { display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.fld input, .fld textarea {
  background: var(--surface-1); border: 1px solid var(--hairline-2); border-radius: var(--r-sm);
  color: var(--ink); padding: 9px 11px; font: 400 13.5px/1.4 var(--sans); outline: none; resize: vertical;
}
.fld input:focus, .fld textarea:focus { border-color: var(--accent); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.lead-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.lead-note { font-size: 11px; color: var(--ink-3); }
.lead-done { text-align: center; padding: 26px 6px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lead-done-mark { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(12,163,12,0.14); color: var(--st-good); font-size: 20px; border: 1px solid rgba(12,163,12,0.4); }
.lead-done p { color: var(--ink-2); font-size: 13.5px; }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c36; border-radius: 6px; border: 2px solid var(--page); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
