/* ============================================================
   TallyUp — Financial Operating Layer
   Cream surfaces, navy ink, plum accent. Tokens re-mapped from
   the original dark theme so semantic names persist:
     --ink-N  = surfaces (lightest at 1, deeper at 4–6)
     --bone   = primary ink text (now navy, not off-white)
     --line-N = warm rule lines on cream
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink-0: #ffffff;
  --ink-1: #fdfcfa;
  --ink-2: #f7f4ec;
  --ink-3: #efeadd;
  --ink-4: #e6dfce;
  --ink-5: #d6cfbb;
  --ink-6: #b8b09a;
  --line:   rgba(20,32,58,0.10);
  --line-2: rgba(20,32,58,0.16);
  --line-3: rgba(20,32,58,0.26);

  --bone:   #14203a;
  --bone-2: #2c3a5c;
  --mute:   #5a6781;
  --mute-2: #8892ab;
  --mute-3: #b3bbcc;

  --teal: #3a6f8a;
  --teal-2: #2d5a73;
  --teal-dim: #e3ecf2;
  --amber: #9a7b4f;
  --amber-2: #836841;
  --amber-dim: #f5f0e7;
  --red: #b14a52;
  --red-2: #94343c;
  --red-dim: #f5e6e8;
  --steel: #5a6781;

  --plum:   #6b3a5d;
  --plum-2: #5a2f4e;
  --plum-soft: #f3edf1;
  --sage:   #5b7f6e;

  --paper: #ede7d8;
  --paper-2: #e2dac7;
  --ink-on-paper: #14203a;
  --rule-on-paper: #c8c2b0;

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink-1);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: 0; color: inherit; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Top nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--ink-1) 88%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
  color: var(--bone);
}
.brand-wordmark { height: 18px; width: auto; display: block; }
.brand-mark { width: 22px; height: 22px; display: block; }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--bone-2);
  margin-left: 8px;
}
.nav-links a { color: var(--bone-2); transition: color .15s; }
.nav-links a:hover { color: var(--bone); }
.nav-cta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-cta .pill {
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  border: 1px solid var(--line-2);
  color: var(--bone);
  border-radius: 2px;
  transition: border-color .15s, background .15s;
}
.nav-cta .pill:hover { border-color: var(--line-3); background: var(--ink-2); }
.nav-cta .pill.primary {
  background: var(--bone);
  color: var(--ink-0);
  border-color: var(--bone);
  font-weight: 500;
}
.nav-cta .pill.primary:hover { background: var(--bone-2); border-color: var(--bone-2); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 56px 32px 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(58,138,122,0.08), transparent 60%),
    var(--ink-1);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 30%, black 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1480px;
  margin: 0 auto;
  position: relative;
}
.hero-preamble {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 4px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--bone);
  margin-top: 24px;
  max-width: 1100px;
  text-wrap: balance;
}
.hero-title em {
  font-style: italic;
  color: var(--bone-2);
}
.hero-sub {
  margin-top: 22px;
  max-width: 640px;
  color: var(--bone-2);
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
}
.hero-cta-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--bone);
  color: var(--ink-0);
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--bone-2); }
.btn-primary .arr {
  display: inline-block;
  transition: transform .2s;
}
.btn-primary:hover .arr { transform: translateX(3px); }
.btn-secondary {
  border: 1px solid var(--line-3);
  color: var(--bone);
  padding: 11px 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 2px;
  transition: border-color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--bone-2); background: var(--ink-2); }

.hero-stage {
  margin-top: 56px;
  padding-bottom: 80px;
  position: relative;
}

/* ============================================================
   Workspace
   ============================================================ */
.workspace {
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 40px 80px -40px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.02);
}
.ws-statusbar {
  display: flex;
  align-items: center;
  background: var(--ink-1);
  border-bottom: 1px solid var(--line-2);
  padding: 0 14px;
  height: 36px;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  overflow-x: auto;
  white-space: nowrap;
}
.ws-statusbar .ws-cluster {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ws-statusbar .ws-divider {
  width: 1px;
  height: 14px;
  background: var(--line-2);
  flex-shrink: 0;
}
.ws-statusbar .stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ws-statusbar .stat b {
  color: var(--bone);
  font-weight: 500;
}
.ws-statusbar .stat .led {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal-2);
}
.ws-statusbar .stat.warn .led { background: var(--amber-2); }
.ws-statusbar .stat.crit .led { background: var(--red-2); }
.ws-statusbar .stat .led.live { animation: pulse 2s infinite; }
.ws-statusbar .ws-spacer { flex: 1; }
.ws-statusbar .ws-time {
  color: var(--mute-2);
  letter-spacing: 0.06em;
}

.ws-body {
  display: grid;
  grid-template-columns: 220px 1fr 360px;
  min-height: 640px;
}

.ws-side {
  background: var(--ink-1);
  border-right: 1px solid var(--line-2);
  padding: 16px 0;
  font-size: 13px;
}
.ws-side-section {
  padding: 14px 16px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute-2);
}
.ws-nav { display: flex; flex-direction: column; }
.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--bone-2);
  font-size: 13px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s;
  position: relative;
}
.ws-nav-item:hover { background: var(--ink-2); color: var(--bone); }
.ws-nav-item.active {
  background: var(--ink-2);
  color: var(--bone);
  border-left-color: var(--teal-2);
}
.ws-nav-item .ico {
  width: 14px; height: 14px;
  display: grid; place-items: center;
  color: var(--mute);
  flex-shrink: 0;
}
.ws-nav-item.active .ico { color: var(--teal-2); }
.ws-nav-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  background: var(--ink-3);
  padding: 1px 6px;
  border-radius: 2px;
}
.ws-nav-item.has-warn .count { color: var(--amber-2); background: var(--amber-dim); }
.ws-nav-item.has-crit .count { color: var(--red-2); background: var(--red-dim); }

.ws-side-foot {
  margin-top: 24px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.ws-side-foot .row { display: flex; justify-content: space-between; padding: 3px 0; }
.ws-side-foot .row b { color: var(--bone-2); font-weight: 500; }

.ws-main {
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ws-main-head {
  border-bottom: 1px solid var(--line-2);
  padding: 16px 22px 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.ws-crumbs {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ws-crumbs .sep { color: var(--mute-3); margin: 0 6px; }
.ws-crumbs b { color: var(--bone-2); font-weight: 500; }
.ws-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--bone);
}
.ws-actions { display: flex; gap: 6px; }
.ws-actions .ico-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--mute);
  transition: all .15s;
  background: transparent;
}
.ws-actions .ico-btn:hover { color: var(--bone); border-color: var(--line-3); }

.ws-scenarios {
  display: flex;
  border-bottom: 1px solid var(--line-2);
  padding: 0 22px;
  background: var(--ink-1);
  gap: 0;
  overflow-x: auto;
}
.scen-tab {
  padding: 10px 14px 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  white-space: nowrap;
}
.scen-tab:hover { color: var(--bone-2); }
.scen-tab.active {
  color: var(--bone);
  border-bottom-color: var(--bone);
}
.scen-tab .badge {
  font-size: 10px;
  padding: 1px 5px;
  background: var(--red-dim);
  color: var(--red-2);
  border-radius: 2px;
}
.scen-tab.active .badge { background: var(--red); color: var(--ink-0); }

.ws-table-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ws-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line-2);
}
.ws-stat {
  padding: 14px 18px;
  border-right: 1px solid var(--line-2);
}
.ws-stat:last-child { border-right: 0; }
.ws-stat .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}
.ws-stat .val {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--bone);
  letter-spacing: -0.01em;
  line-height: 1;
}
.ws-stat .val.warn { color: var(--amber-2); }
.ws-stat .val.crit { color: var(--red-2); }
.ws-stat .val.good { color: var(--teal-2); }
.ws-stat .delta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  margin-top: 4px;
}
.ws-stat .delta b { color: var(--bone-2); font-weight: 500; }
.ws-stat .spark {
  margin-top: 6px;
  height: 16px;
  width: 100%;
  display: block;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--ink-1);
  flex-wrap: wrap;
}
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--bone-2);
  font-size: 11px;
  letter-spacing: 0.02em;
  background: var(--ink-2);
  transition: border-color .15s;
}
.ws-chip:hover { border-color: var(--line-3); }
.ws-chip.filter::after {
  content: "▾";
  color: var(--mute);
  font-size: 9px;
  margin-left: 2px;
}
.ws-toolbar .spacer { flex: 1; }
.ws-search {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 4px 10px;
  background: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  min-width: 180px;
}

.ws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-family: var(--sans);
}
.ws-table thead th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  font-weight: 500;
  color: var(--mute);
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--ink-1);
}
.ws-table thead th.right { text-align: right; }
.ws-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--bone-2);
  vertical-align: middle;
}
.ws-table tbody td.right { text-align: right; font-family: var(--mono); }
.ws-table tbody td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--bone-2); }
.ws-table tbody tr {
  transition: background .12s;
  cursor: pointer;
}
.ws-table tbody tr:hover { background: var(--ink-3); }
.ws-table tbody tr.selected { background: rgba(58,138,122,0.06); }
.ws-table tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--teal-2); }
.ws-table tbody tr.resolved td { color: var(--mute); }
.ws-table tbody tr.resolved td.entity { text-decoration: line-through; text-decoration-color: var(--mute-3); }

.sev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sev::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--mute);
}
.sev.crit { color: var(--red-2); }
.sev.crit::before { background: var(--red-2); }
.sev.warn { color: var(--amber-2); }
.sev.warn::before { background: var(--amber-2); }
.sev.info { color: var(--steel); }
.sev.info::before { background: var(--steel); }
.sev.ok { color: var(--teal-2); }
.sev.ok::before { background: var(--teal-2); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  color: var(--mute);
  background: var(--ink-2);
  border-radius: 2px;
  text-transform: uppercase;
}
.tag.entity { color: var(--bone-2); border-color: var(--line-3); background: var(--ink-3); text-transform: none; letter-spacing: 0.02em; }

.amount.neg { color: var(--red-2); }
.amount.pos { color: var(--teal-2); }

.ws-aside {
  background: var(--ink-1);
  border-left: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.aside-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-2);
}
.aside-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 8px;
}
.aside-eyebrow .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal-2);
  animation: pulse 2s infinite;
}
.aside-title {
  font-family: var(--serif);
  font-size: 17px;
  margin-top: 6px;
  color: var(--bone);
  line-height: 1.25;
}
.aside-sub {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}
.aside-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-2);
  padding: 0 18px;
}
.aside-tab {
  padding: 8px 0;
  margin-right: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.aside-tab.active {
  color: var(--bone);
  border-bottom-color: var(--bone);
}

.aside-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 22px;
}

.trace {
  position: relative;
  padding-left: 18px;
  margin-top: 4px;
}
.trace::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line-3);
}
.trace-step {
  position: relative;
  padding: 8px 0 14px 14px;
  border-bottom: 1px dashed var(--line);
}
.trace-step:last-child { border-bottom: 0; }
.trace-step::before {
  content: "";
  position: absolute;
  left: -16px; top: 12px;
  width: 11px; height: 11px;
  border: 1px solid var(--line-3);
  background: var(--ink-1);
  border-radius: 50%;
  box-sizing: border-box;
}
.trace-step.done::before {
  background: var(--teal-2);
  border-color: var(--teal-2);
  box-shadow: 0 0 0 3px var(--teal-dim);
}
.trace-step.active::before {
  background: var(--amber-2);
  border-color: var(--amber-2);
  box-shadow: 0 0 0 3px var(--amber-dim);
  animation: pulse 1.6s infinite;
}
.trace-src {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 3px;
  display: flex;
  gap: 8px;
}
.trace-src .pill {
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--bone-2);
}
.trace-headline {
  font-size: 12.5px;
  color: var(--bone);
  margin-bottom: 4px;
}
.trace-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.trace-meta b { color: var(--bone-2); font-weight: 500; }

.ai-block {
  margin-top: 18px;
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--teal-2);
  background: linear-gradient(180deg, rgba(58,138,122,0.04), transparent 60%);
  padding: 12px 14px;
  border-radius: 0 2px 2px 0;
}
.ai-block .ai-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-2);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-block .body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--bone);
}
.ai-block .body .src {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal-2);
  background: var(--teal-dim);
  padding: 1px 5px;
  margin: 0 2px;
  border-radius: 2px;
  vertical-align: 1px;
  cursor: help;
}
.ai-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ai-foot b { color: var(--bone-2); font-weight: 500; }

.aside-actions {
  border-top: 1px solid var(--line-2);
  padding: 14px 18px;
  background: var(--ink-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aside-actions .row {
  display: flex;
  gap: 8px;
}
.act-btn {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line-3);
  color: var(--bone);
  border-radius: 2px;
  transition: all .15s;
  text-align: center;
  background: transparent;
}
.act-btn:hover { background: var(--ink-3); border-color: var(--bone-2); }
.act-btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--ink-0);
  font-weight: 500;
}
.act-btn.primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.act-btn.danger {
  border-color: var(--red-dim);
  color: var(--red-2);
}
.act-btn.danger:hover { background: var(--red-dim); border-color: var(--red); }
.aside-actions .gov {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--mute);
  display: flex;
  gap: 14px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.aside-actions .gov b { color: var(--bone-2); font-weight: 500; }

/* ============================================================
   Section primitives
   ============================================================ */
.section {
  padding: 96px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.section.dark { background: var(--ink-1); }
.section.darker { background: var(--ink-0); }
.section.paper {
  background: var(--paper);
  color: var(--ink-on-paper);
  border-bottom-color: var(--rule-on-paper);
}
.section-inner {
  max-width: 1480px;
  margin: 0 auto;
}
.sec-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: end;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-2);
}
.section.paper .sec-head { border-bottom-color: var(--rule-on-paper); }
.sec-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.section.paper .sec-eyebrow { color: #5e5a4f; }
.sec-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.sec-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 60px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 20px;
  text-wrap: balance;
}
.sec-title em { font-style: italic; color: var(--bone-2); }
.section.paper .sec-title em { color: #404045; }
.sec-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--bone-2);
  text-wrap: pretty;
}
.section.paper .sec-lede { color: #404045; }

/* ============================================================
   Ingest section
   ============================================================ */
.ingest {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-2);
}
.ingest-col {
  padding: 24px 22px;
  border-right: 1px solid var(--line-2);
  position: relative;
  min-height: 460px;
  display: flex;
  flex-direction: column;
}
.ingest-col:last-child { border-right: 0; }
.ingest-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 18px;
  font-weight: 500;
}
.src-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.src-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  background: var(--ink-1);
  border-radius: 3px;
  transition: border-color .15s;
}
.src-item:hover { border-color: var(--line-3); }
.src-logo {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--bone);
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  flex-shrink: 0;
}
.src-info { flex: 1; min-width: 0; }
.src-name {
  font-size: 12.5px;
  color: var(--bone);
  font-weight: 500;
}
.src-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  margin-top: 2px;
}
.src-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.src-status.warn { color: var(--amber-2); }
.src-status.idle { color: var(--mute); }

.ingest-mid {
  background: var(--ink-1);
}
.ingest-mid h4 { color: var(--bone); }
.norm-stack { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; flex: 1; }
.norm-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.norm-row .from, .norm-row .to {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bone-2);
}
.norm-row .from { color: var(--mute); }
.norm-row .arrow { color: var(--mute-2); font-size: 11px; }
.norm-row .to b { color: var(--teal-2); font-weight: 500; }
.norm-row .to .detail { font-size: 10px; color: var(--mute); margin-top: 2px; }

.ingest-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 10px;
}
.ingest-foot b { color: var(--bone-2); font-weight: 500; }
.ingest-foot .good b { color: var(--teal-2); }

.obj-out {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.obj-card {
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  background: var(--ink-1);
  border-radius: 3px;
  transition: border-color .15s;
}
.obj-card:hover { border-color: var(--teal); }
.obj-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.obj-card .ident {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--teal-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.obj-card .ts {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
}
.obj-card .name {
  font-size: 13px;
  color: var(--bone);
  font-weight: 500;
}
.obj-card .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute);
  margin-top: 4px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ============================================================
   Ontology graph
   ============================================================ */
.graph-wrap {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--ink-2);
  overflow: hidden;
}
.graph-canvas {
  position: relative;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(58,138,122,0.05), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  background-color: var(--ink-2);
  height: 560px;
}
.graph-canvas svg {
  width: 100%; height: 100%;
  display: block;
}
.graph-legend {
  border-left: 1px solid var(--line-2);
  background: var(--ink-1);
  padding: 22px 22px 22px;
  display: flex;
  flex-direction: column;
}
.legend-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 16px;
  font-weight: 500;
}
.legend-list { display: flex; flex-direction: column; gap: 6px; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--bone-2);
}
.legend-item .swatch {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-item .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
}
.legend-section + .legend-section { margin-top: 22px; }

/* ============================================================
   Workflow tabs
   ============================================================ */
.wf {
  margin-top: 56px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  overflow: hidden;
  background: var(--ink-2);
}
.wf-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-2);
  background: var(--ink-1);
  overflow-x: auto;
}
.wf-tab {
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color .15s;
  background: transparent;
}
.wf-tab:hover { color: var(--bone-2); }
.wf-tab.active {
  color: var(--bone);
  border-bottom-color: var(--teal-2);
  background: var(--ink-2);
}
.wf-tab .num {
  font-size: 10px;
  color: var(--mute-2);
}
.wf-tab.active .num { color: var(--teal-2); }
.wf-body { padding: 0; }

.wf-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 500px;
}
.wf-narrative {
  padding: 32px 28px;
  border-right: 1px solid var(--line-2);
  background: var(--ink-1);
}
.wf-headline {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--bone);
  text-wrap: balance;
}
.wf-blurb {
  margin-top: 14px;
  color: var(--bone-2);
  line-height: 1.55;
  font-size: 14px;
}
.wf-metrics {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
}
.wf-metric .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 4px;
}
.wf-metric .val {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--bone);
  font-weight: 500;
  line-height: 1;
}
.wf-metric .val.good { color: var(--teal-2); }
.wf-metric .val.warn { color: var(--amber-2); }
.wf-metric .delta { font-family: var(--mono); font-size: 11px; color: var(--mute); margin-top: 4px; }

.wf-screen {
  padding: 28px;
  background: var(--ink-2);
}
.wf-screen-inner {
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--bone-2);
  height: 100%;
  min-height: 440px;
  display: flex;
  flex-direction: column;
}
.wf-screen-head {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 12px;
}
.wf-row-mono {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 11.5px;
  gap: 8px;
}

/* ============================================================
   Governance
   ============================================================ */
.gov-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--rule-on-paper);
  border-radius: 4px;
  overflow: hidden;
}
.gov-card {
  padding: 28px 28px 32px;
  border-right: 1px solid var(--rule-on-paper);
  border-bottom: 1px solid var(--rule-on-paper);
  background: var(--paper);
  position: relative;
}
.gov-card:nth-child(3n) { border-right: 0; }
.gov-card:nth-last-child(-n+3) { border-bottom: 0; }
.gov-card .num {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #5e5a4f;
  letter-spacing: 0.14em;
  margin-bottom: 16px;
}
.gov-card h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #0c1014;
  margin-bottom: 12px;
  line-height: 1.2;
}
.gov-card p {
  font-size: 14px;
  color: #404045;
  line-height: 1.55;
}
.gov-card .tag-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gov-card .tag-row .t {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border: 1px solid var(--rule-on-paper);
  color: #5e5a4f;
  border-radius: 2px;
  text-transform: uppercase;
}

/* ============================================================
   CTA
   ============================================================ */
.cta {
  background: var(--ink-0);
  padding: 96px 32px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black, transparent 80%);
  pointer-events: none;
}
.cta-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 80px;
  align-items: start;
}
.cta-title {
  font-family: var(--serif);
  font-size: clamp(40px, 4.4vw, 56px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.cta-sub {
  margin-top: 18px;
  color: var(--bone-2);
  font-size: 16px;
  line-height: 1.55;
  max-width: 460px;
}
.cta-bullets {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--mute);
  letter-spacing: 0.04em;
}
.cta-bullets li {
  list-style: none;
  padding: 7px 0;
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 14px;
}
.cta-bullets li::before {
  content: "—";
  color: var(--teal-2);
}
.cta-bullets li:last-child { border-bottom: 1px solid var(--line-2); }

.access-form {
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 28px;
}
.access-form h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.access-form h4 .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal-2);
  animation: pulse 2s infinite;
  display: inline-block;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: var(--ink-1);
  border: 1px solid var(--line-2);
  color: var(--bone);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  border-radius: 2px;
  transition: border-color .15s;
}
.field input:focus, .field select:focus {
  outline: 0;
  border-color: var(--teal-2);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.access-submit {
  width: 100%;
  background: var(--bone);
  color: var(--ink-0);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  border-radius: 2px;
  transition: background .15s;
  margin-top: 6px;
}
.access-submit:hover { background: var(--bone-2); }
.access-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.access-foot {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.access-status {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.04em;
  min-height: 1.4em;
}
.access-status[data-state="error"] { color: var(--red-2); }
.access-status[data-state="success"] { color: var(--teal-2); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--ink-1);
  padding: 48px 32px 32px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
}
.footer h5 {
  font-size: 10px;
  color: var(--mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 500;
}
.footer ul { list-style: none; }
.footer li { padding: 4px 0; }
.footer li a { color: var(--bone-2); transition: color .15s; }
.footer li a:hover { color: var(--bone); }
.footer-brand {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--bone-2);
}
.footer-brand .lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--bone);
  margin-bottom: 14px;
}
.footer-brand .tagline {
  color: var(--mute);
  font-size: 11.5px;
  line-height: 1.6;
  font-family: var(--mono);
}
.footer-bot {
  max-width: 1480px;
  margin: 32px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
  color: var(--mute);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* utility */
.kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--line-3);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--mute);
}

/* responsive */
@media (max-width: 1200px) {
  .ws-body { grid-template-columns: 200px 1fr 320px; }
  .ingest { grid-template-columns: 1fr; }
  .ingest-col { border-right: 0; border-bottom: 1px solid var(--line-2); min-height: auto; }
  .graph-wrap { grid-template-columns: 1fr; }
  .graph-legend { border-left: 0; border-top: 1px solid var(--line-2); }
  .gov-grid { grid-template-columns: repeat(2, 1fr); }
  .gov-card:nth-child(3n) { border-right: 1px solid var(--rule-on-paper); }
  .gov-card:nth-child(2n) { border-right: 0; }
  .cta-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .sec-head { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 820px) {
  .ws-body { grid-template-columns: 1fr; }
  .ws-side, .ws-aside { display: none; }
  .ws-summary { grid-template-columns: 1fr 1fr; }
  .ws-stat { border-bottom: 1px solid var(--line-2); }
  .nav-links { display: none; }
  .wf-grid { grid-template-columns: 1fr; }
  .wf-narrative { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .gov-grid { grid-template-columns: 1fr; }
  .gov-card { border-right: 0 !important; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .nav-cta .pill { padding: 7px 10px; font-size: 11.5px; }
  .hero { padding: 32px 20px 0; }
  .section { padding: 64px 20px; }
  .cta { padding: 64px 20px; }
}
