/* ═══════════════════════════════════════════════════════════════
   VIVANTAL · Clinical reading instrument
   Warm paper, clinical ink, one signal color. Editorial gravity.
   ═══════════════════════════════════════════════════════════════ */

@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;1,6..72,500&family=Inter:wght@400;450;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --paper:    #fbfaf8;
  --paper-2:  #f4f2ee;
  --paper-3:  #ece9e3;
  --card:     #ffffff;
  --line:     #e4e0d8;
  --line-2:   #d6d1c7;

  --ink:      #1a1a18;
  --ink-2:    #45433d;
  --ink-3:    #75726a;
  --ink-4:    #a8a499;

  --teal:     #0e7c7b;
  --teal-2:   #0a6463;
  --teal-bg:  #e4f0ef;

  --red:      #d63a3a;
  --red-bg:   #fbe9e7;
  --amber:    #c47710;
  --amber-bg: #f8efdd;
  --blue:     #2c5fa8;
  --blue-bg:  #e7eef8;
  --green:    #2f8f5b;
  --green-bg: #e4f1e9;

  --crit: var(--red); --crit-bg: var(--red-bg);
  --high: var(--amber); --high-bg: var(--amber-bg);
  --mod: var(--blue); --mod-bg: var(--blue-bg);
  --ok: var(--green); --ok-bg: var(--green-bg);

  --ease: cubic-bezier(.4,0,.2,1);
  --spring: cubic-bezier(.34,1.3,.5,1);

  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  background: var(--paper); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px; line-height: 1.6; overflow-x: hidden;
  font-feature-settings: "ss01" 1;
}
::selection { background: var(--teal-bg); }
.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Newsreader', serif; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,250,248,.85); backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo {
  font-family: 'Newsreader', serif; font-weight: 600; font-size: 23px;
  letter-spacing: -.01em; color: var(--ink); cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 9px;
}
.nav-logo::before { content: none; }
.nav-mark { height: 30px; width: auto; display: block; }
.nav-logo span.wm { color: var(--ink); }
.nav-logo span.wm b { color: var(--teal); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 14px; color: var(--ink-3); background: none; border: 0;
  padding: 8px 13px; cursor: pointer; transition: color .15s; border-radius: 7px;
  font-family: inherit; font-weight: 450; white-space: nowrap;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 500; }
.nav-cta {
  font-size: 14px; color: var(--paper); background: var(--ink); border: 0;
  padding: 9px 18px; border-radius: 8px; cursor: pointer; margin-left: 8px;
  font-family: inherit; font-weight: 500; white-space: nowrap; transition: background .2s;
}
.nav-cta:hover { background: var(--teal); }

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; }
@keyframes fadeup { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════ HERO ═══════════ */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 88px 32px 72px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center;
}
@media (max-width: 940px) { .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--teal);
  margin-bottom: 26px;
}
.hero-eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.hero h1 {
  font-family: 'Newsreader', serif; font-weight: 500;
  font-size: clamp(44px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.022em;
  color: var(--ink); margin-bottom: 26px;
}
.hero h1 em { font-style: italic; color: var(--teal); font-weight: 500; }
.hero .sub {
  font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--ink-2);
  max-width: 480px; margin-bottom: 34px; font-weight: 400;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }
.btn-fill {
  font-family: inherit; font-size: 15.5px; font-weight: 500; color: var(--paper);
  background: var(--ink); border: 0; padding: 13px 26px; border-radius: 9px; cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-fill:hover { background: var(--teal); transform: translateY(-1px); }
.btn-line {
  font-family: inherit; font-size: 15.5px; font-weight: 500; color: var(--ink);
  background: none; border: 1.5px solid var(--line-2); padding: 12px 24px; border-radius: 9px; cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-line:hover { border-color: var(--ink); }

.hero-meta { display: flex; gap: 34px; }
.hero-meta .hm .v {
  font-family: 'Newsreader', serif; font-size: 32px; font-weight: 500; color: var(--ink);
  letter-spacing: -.02em; line-height: 1;
}
.hero-meta .hm .v em { color: var(--teal); font-style: normal; }
.hero-meta .hm .k { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; max-width: 130px; line-height: 1.4; }

/* ── HERO INSTRUMENT (signature) ── */
.instrument {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(26,26,24,.04), 0 16px 50px -24px rgba(26,26,24,.22);
  animation: fadeup .7s var(--ease) .15s both;
}
.inst-top {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
}
.inst-id { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.inst-live {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--teal);
  letter-spacing: .08em; display: flex; align-items: center; gap: 7px;
}
.inst-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: ping 1.8s ease-in-out infinite; }
@keyframes ping { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.inst-rows { padding: 8px 0; }
.inst-row {
  display: grid; grid-template-columns: 66px 14px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 20px; opacity: 0; animation: fadeup .4s var(--ease) both;
}
.inst-row:nth-child(1) { animation-delay: .35s; }
.inst-row:nth-child(2) { animation-delay: .5s; }
.inst-row:nth-child(3) { animation-delay: .65s; }
.inst-row:nth-child(4) { animation-delay: .8s; }
.inst-row:nth-child(5) { animation-delay: .95s; }
.inst-row:nth-child(6) { animation-delay: 1.1s; }
.inst-date { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-4); }
.inst-marker { width: 9px; height: 9px; border-radius: 50%; justify-self: center; position: relative; }
.inst-marker::before {
  content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 11px;
  background: var(--line); transform: translateX(-50%);
}
.inst-row:last-child .inst-marker::before { display: none; }
.inst-marker.ok { background: var(--green); }
.inst-marker.warn { background: var(--amber); }
.inst-marker.crit { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.inst-label { font-size: 14px; color: var(--ink); }
.inst-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 5px; white-space: nowrap;
}
.inst-tag.crit { background: var(--red-bg); color: var(--red); }
.inst-tag.warn { background: var(--amber-bg); color: var(--amber); }
.inst-tag.ok { background: var(--green-bg); color: var(--green); }
.inst-tag.mut { background: var(--paper-2); color: var(--ink-3); }

.inst-flag {
  margin: 6px 16px 16px; padding: 15px 17px;
  background: var(--red-bg); border-radius: 9px;
  border-left: 3px solid var(--red);
  opacity: 0; animation: fadeup .4s var(--ease) 1.35s both;
}
.inst-flag-t { font-size: 13.5px; font-weight: 600; color: var(--red); margin-bottom: 4px; }
.inst-flag-d { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* ═══════════ SECTIONS ═══════════ */
.band { border-top: 1px solid var(--line); }
.band.paper2 { background: var(--paper-2); }
.band.ink { background: var(--ink); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.sec { padding: 88px 0; }
.sec-sm { padding: 56px 0; }

.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px;
}
.h2 {
  font-family: 'Newsreader', serif; font-weight: 500;
  font-size: clamp(30px, 4vw, 50px); line-height: 1.08; letter-spacing: -.02em; color: var(--ink);
  margin-bottom: 18px;
}
.h2 em { font-style: italic; color: var(--ink-3); }
.lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 580px; font-weight: 400; }
.sec-head { max-width: 680px; margin-bottom: 56px; }

/* problem — two columns, editorial */
.prob-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 8px; }
@media (max-width: 820px) { .prob-split { grid-template-columns: 1fr; gap: 40px; } }
.prob-col .pc-k { font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px; }
.prob-col h3 { font-family: 'Newsreader', serif; font-size: 27px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); margin-bottom: 14px; }
.prob-col p { font-size: 16px; color: var(--ink-2); line-height: 1.6; margin-bottom: 20px; }
.prob-col .pc-stat { font-size: 14px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 16px; }
.prob-col .pc-stat b { color: var(--red); font-weight: 600; }

/* the four lenses — numbered editorial list */
.lens-list { margin-top: 8px; }
.lens-row {
  display: grid; grid-template-columns: 56px 1fr 1.1fr; gap: 40px; align-items: start;
  padding: 38px 0; border-top: 1px solid var(--line);
}
.lens-row:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 820px) { .lens-row { grid-template-columns: 1fr; gap: 16px; } }
.lens-n { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: var(--teal); font-weight: 500; padding-top: 4px; }
.lens-main h3 { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin-bottom: 10px; line-height: 1.15; }
.lens-main p { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.lens-eg { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 16px 18px; }
.lens-eg .le-k { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.lens-eg .le-t { font-size: 14px; color: var(--ink-2); line-height: 1.5; font-style: italic; font-family: 'Newsreader', serif; }

/* metrics band on ink */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); }
@media (max-width: 760px) { .metrics { grid-template-columns: 1fr 1fr; } }
.metric { padding: 48px 32px; border-right: 1px solid rgba(255,255,255,.08); }
.metric:last-child { border-right: 0; }
@media (max-width: 760px) { .metric { border-bottom: 1px solid rgba(255,255,255,.08); } }
.metric .mv { font-family: 'Newsreader', serif; font-size: 46px; font-weight: 500; color: var(--paper); letter-spacing: -.02em; line-height: 1; }
.metric .mv em { color: var(--teal); font-style: normal; }
.metric .mk { font-size: 13px; color: rgba(255,255,255,.55); margin-top: 10px; line-height: 1.45; }

/* use cases */
.uc-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 8px; }
@media (max-width: 820px) { .uc-grid { grid-template-columns: 1fr; } }
.uc { display: flex; flex-direction: column; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .2s var(--ease); }
.uc:hover { border-color: var(--line-2); transform: translateY(-2px); }
.uc .uc-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px; }
.uc h3 { font-family: 'Newsreader', serif; font-size: 23px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); margin-bottom: 12px; line-height: 1.15; }
.uc p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 22px; flex: 1; }
.uc .uc-eg { background: var(--paper-2); border-radius: 8px; padding: 15px; border-left: 2px solid var(--teal); }
.uc .uc-eg .ek { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); margin-bottom: 7px; }
.uc .uc-eg .et { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; font-style: italic; font-family: 'Newsreader', serif; }

/* how — steps */
.steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 32px; margin-top: 8px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; gap: 28px; } }
.step .sn { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--teal); font-weight: 500; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.step h3 { font-family: 'Newsreader', serif; font-size: 20px; font-weight: 500; color: var(--ink); margin-bottom: 9px; }
.step p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

.method { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 32px; margin-top: 28px; }
.method h3 { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 500; color: var(--ink); margin-bottom: 20px; }
.mtable { width: 100%; border-collapse: collapse; }
.mtable td { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); line-height: 1.55; vertical-align: top; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable .mn { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--teal); width: 220px; padding-right: 28px; }

/* team */
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin-top: 8px; }
@media (max-width: 640px) { .team { grid-template-columns: 1fr; } }
.member { display: flex; gap: 22px; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.member .av { width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif; font-size: 22px; font-weight: 500; color: var(--paper); }
.member .mn { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 500; color: var(--ink); margin-bottom: 3px; letter-spacing: -.01em; }
.member .mr { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.member .mb { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

/* CTA */
.cta { text-align: center; padding: 88px 32px; }
.cta h2 { font-family: 'Newsreader', serif; font-size: clamp(30px, 4vw, 46px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin-bottom: 16px; }
.cta p { font-size: 18px; color: var(--ink-2); max-width: 480px; margin: 0 auto 30px; line-height: 1.55; }

/* ═══════════ TRUST PAGE ═══════════ */
.trust-top { background: var(--paper-2); border-bottom: 1px solid var(--line); padding: 72px 32px 60px; }
.trust-top .wrap { max-width: 820px; }
.pledge { display: flex; gap: 22px; align-items: flex-start; background: var(--card); border: 1px solid var(--teal); border-radius: 12px; padding: 30px 32px; max-width: 760px; }
.pledge .pl-ic { flex-shrink: 0; width: 44px; height: 44px; border-radius: 11px; background: var(--teal-bg); display: flex; align-items: center; justify-content: center; }
.pledge h3 { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 9px; }
.pledge p { font-size: 15px; color: var(--ink-2); line-height: 1.65; }
.pledge p b { color: var(--teal); font-weight: 600; }

.safe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
@media (max-width: 760px) { .safe-grid { grid-template-columns: 1fr; } }
.safe { padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.safe .si { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-bg); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.safe h3 { font-family: 'Newsreader', serif; font-size: 19px; font-weight: 500; color: var(--ink); margin-bottom: 9px; }
.safe p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

.rules { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 32px; margin-top: 8px; }
.rules h3 { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 20px; }
.rule { display: flex; gap: 15px; padding: 16px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.rule:first-of-type { border-top: 0; padding-top: 0; }
.r-mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.r-mark.y { background: var(--green-bg); color: var(--green); }
.r-mark.n { background: var(--red-bg); color: var(--red); }
.r-text { font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.r-text b { color: var(--ink); font-weight: 600; }

.flow { background: var(--ink); border-radius: 12px; padding: 36px; margin-top: 8px; }
.flow h3 { font-family: 'Newsreader', serif; font-size: 23px; font-weight: 500; color: var(--paper); margin-bottom: 26px; }
.flow-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; }
@media (max-width: 760px) { .flow-steps { grid-template-columns: 1fr 1fr; } }
.flow-step .fn { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--teal); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.flow-step .ft { font-size: 14.5px; font-weight: 600; color: var(--paper); margin-bottom: 7px; }
.flow-step .fd { font-size: 13px; color: rgba(255,255,255,.5); line-height: 1.55; }
.flow-note { margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13.5px; color: rgba(255,255,255,.55); line-height: 1.6; }
.flow-note b { color: var(--teal); }

/* ═══════════ LIVE DEMO ═══════════ */
.app { max-width: var(--maxw); margin: 0 auto; padding: 48px 32px 88px; }
.demo-notice { display: flex; gap: 11px; align-items: flex-start; background: var(--teal-bg); border: 1px solid rgba(14,124,123,.2); border-radius: 10px; padding: 14px 18px; margin-bottom: 32px; font-size: 14px; color: var(--ink-2); }
.demo-notice b { color: var(--teal); }
.demo-notice::before { content: '●'; color: var(--teal); font-size: 8px; margin-top: 5px; flex-shrink: 0; }

.tool-tabs { display: inline-flex; gap: 2px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 36px; flex-wrap: wrap; }
.tool-tab { font-family: inherit; font-size: 14px; font-weight: 450; color: var(--ink-3); background: none; border: 0; padding: 8px 17px; border-radius: 7px; cursor: pointer; transition: all .15s var(--ease); white-space: nowrap; }
.tool-tab:hover { color: var(--ink); }
.tool-tab.active { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(26,26,24,.1); }

.view { display: none; }
.view.active { display: block; animation: fade .3s var(--ease) both; }
.intro { margin-bottom: 36px; max-width: 640px; }
.view-title { font-family: 'Newsreader', serif; font-size: clamp(26px, 3.4vw, 38px); font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin-bottom: 12px; line-height: 1.1; }
.view-sub { font-size: 16.5px; color: var(--ink-2); line-height: 1.55; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.btn { font-family: inherit; font-size: 14px; font-weight: 500; border-radius: 8px; padding: 9px 18px; cursor: pointer; border: 0; transition: all .15s var(--ease); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--teal); }
.btn-ghost { background: none; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-file { background: none; color: var(--ink); border: 1.5px solid var(--line-2); position: relative; overflow: hidden; }
.btn-file:hover { border-color: var(--ink); }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.spacer { flex: 1; }
.muted-note { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-4); }

.stat-band { display: grid; grid-template-columns: repeat(4,1fr); background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
@media (max-width: 680px) { .stat-band { grid-template-columns: 1fr 1fr; } }
.stat-cell { padding: 22px 24px; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: 0; }
.stat-cell .k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.stat-cell .v { font-family: 'Newsreader', serif; font-size: 34px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.stat-cell .sub { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.roster-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.roster-head { padding: 20px 24px 0; display: flex; align-items: baseline; justify-content: space-between; }
.roster-head h2 { font-family: 'Newsreader', serif; font-size: 19px; font-weight: 500; color: var(--ink); }
.kick { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-4); }
.roster { width: 100%; border-collapse: collapse; }
.roster thead tr { border-bottom: 1px solid var(--line); }
.roster th { padding: 14px 16px; text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; }
.roster th.sorted { color: var(--teal); }
.roster td { padding: 15px 16px; font-size: 14.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.roster tbody tr { cursor: pointer; transition: background .12s; }
.roster tbody tr:hover { background: var(--paper-2); }
.roster tbody tr:last-child td { border-bottom: 0; }
.pname { font-weight: 500; color: var(--ink); font-size: 15px; }
.demo.mono { font-size: 11.5px; color: var(--ink-4); }

.risk-bar { display: flex; align-items: center; gap: 11px; }
.rb { height: 4px; max-width: 72px; flex: 1; background: var(--paper-3); border-radius: 2px; }
.rb-fill { height: 100%; border-radius: 2px; }
.rb-fill.crit { background: var(--red); }
.rb-fill.high { background: var(--amber); }
.rb-fill.mod { background: var(--blue); }
.rb-score { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink); font-weight: 500; }

.pill { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 5px; }
.pill.crit { background: var(--red-bg); color: var(--red); }
.pill.high { background: var(--amber-bg); color: var(--amber); }
.pill.mod { background: var(--blue-bg); color: var(--blue); }
.pill.clean { background: var(--green-bg); color: var(--green); }
.sev-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 5px; margin-left: 8px; }
.sev-tag.critical { background: var(--red-bg); color: var(--red); }
.sev-tag.high { background: var(--amber-bg); color: var(--amber); }
.sev-tag.moderate { background: var(--blue-bg); color: var(--blue); }

.empty { text-align: center; padding: 64px 20px; color: var(--ink-3); }
.em-t { font-family: 'Newsreader', serif; font-size: 21px; color: var(--ink); margin-bottom: 8px; }

.finding { display: flex; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.loop-glyph { width: 20px; flex-shrink: 0; margin-top: 2px; }
.f-t { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 5px; line-height: 1.35; }
.f-d { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin-bottom: 4px; }
.f-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-4); }

.pv-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--teal); background: none; border: 0; cursor: pointer; margin-bottom: 24px; padding: 0; font-family: inherit; }
.pv-id .nm { font-family: 'Newsreader', serif; font-size: 32px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin-bottom: 6px; }
.pv-id .meta { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-4); }
.pv-grid { display: grid; grid-template-columns: 1fr 330px; gap: 24px; margin-top: 28px; }
@media (max-width: 880px) { .pv-grid { grid-template-columns: 1fr; } }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 4px 10px; border-radius: 6px; }
.badge.crit { background: var(--red-bg); color: var(--red); }
.badge.high { background: var(--amber-bg); color: var(--amber); }
.badge.moderate { background: var(--blue-bg); color: var(--blue); }
.timeline-event { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline-event:last-child { border-bottom: 0; }
.te-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.te-dot.ok { background: var(--green); }
.te-dot.warn { background: var(--amber); }
.te-dot.crit { background: var(--red); }
.te-dot.neutral { background: var(--line-2); }
.te-date { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-4); flex-shrink: 0; width: 72px; padding-top: 2px; }
.te-name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.te-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.headline-box { border-radius: 12px; padding: 24px 26px; margin-bottom: 22px; }
.headline-box.alert { background: var(--red-bg); border: 1px solid rgba(214,58,58,.2); }
.headline-box.none { background: var(--green-bg); border: 1px solid rgba(47,143,91,.2); }
.headline-box.warn { background: var(--amber-bg); border: 1px solid rgba(196,119,16,.2); }
.hb-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.headline-box.alert .hb-k { color: var(--red); }
.headline-box.none .hb-k { color: var(--green); }
.headline-box.warn .hb-k { color: var(--amber); }
.hb-t { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.hb-d { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-h { padding: 20px 24px 0; }
.card-h h2 { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); }
.card-b { padding: 16px 24px 24px; }
.attr-label { font-size: 14.5px; font-weight: 600; color: var(--ink); padding: 20px 0 12px; }
.dumbbell-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dumbbell-row:last-child { border-bottom: 0; }
.db-label { font-size: 13.5px; color: var(--ink-2); width: 92px; flex-shrink: 0; text-align: right; }
.db-label.flagged { color: var(--red); font-weight: 500; }
.db-track { flex: 1; height: 2px; background: var(--paper-3); position: relative; }
.db-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; top: -4px; }
.db-dot.group { background: var(--teal); }
.db-dot.ref { background: var(--ink-4); }
.db-line { position: absolute; height: 2px; top: 0; background: rgba(14,124,123,.25); }
.db-rate { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-3); width: 50px; text-align: right; }
.db-n { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-4); }

.evt-flag { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 5px; }
.evt-flag.critical { background: var(--red-bg); color: var(--red); }
.evt-flag.high,.evt-flag.low,.evt-flag.abnormal { background: var(--amber-bg); color: var(--amber); }
.evt-flag.normal { background: var(--green-bg); color: var(--green); }
.evt-flag.open { background: var(--amber-bg); color: var(--amber); }
.evt-flag.completed { background: var(--green-bg); color: var(--green); }
.evt-flag.monitored { background: var(--blue-bg); color: var(--blue); }
.evt-type-badge { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; background: var(--paper-2); color: var(--ink-3); }

/* builder */
.builder-wrap { max-width: var(--maxw); margin: 0 auto; padding: 48px 32px 88px; }
.builder-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .builder-grid { grid-template-columns: 1fr; } }
.phi-notice { display: flex; gap: 11px; align-items: flex-start; background: var(--teal-bg); border: 1px solid rgba(14,124,123,.2); border-radius: 10px; padding: 14px 17px; margin-bottom: 24px; font-size: 14px; color: var(--ink-2); }
.phi-notice b { color: var(--teal); }
.build-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: sticky; top: 76px; }
.bp-head { padding: 20px 20px 0; }
.bp-head h2 { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 3px; }
.bp-head p { font-size: 13px; color: var(--ink-3); }
.bp-body { padding: 16px 20px 20px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.field select, .field input, .field textarea { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); border: 1px solid var(--line-2); border-radius: 7px; padding: 9px 12px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field .hint { font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.demo-fields { padding: 13px 14px; background: var(--paper-2); border-radius: 9px; margin-bottom: 14px; border: 1px solid var(--line); }
.demo-fields .df-h { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 11px; }
.subform { display: none; }
.subform.active { display: block; animation: fade .2s var(--ease) both; }
.add-btn { width: 100%; background: var(--ink); color: var(--paper); border: 0; font-family: inherit; font-size: 14px; font-weight: 500; padding: 11px; border-radius: 7px; cursor: pointer; transition: background .15s; margin-top: 6px; }
.add-btn:hover { background: var(--teal); }
.record-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 200px; }
.rec-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.rec-id { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); }
.code { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-4); margin-left: 8px; }
.rec-actions { display: flex; gap: 8px; }
.evt-table { width: 100%; border-collapse: collapse; }
.evt-table th { text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.evt-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; color: var(--ink-2); }
.evt-table tr:last-child td { border-bottom: 0; }
.row-del { background: none; border: 0; color: var(--ink-4); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 5px; transition: all .12s; }
.row-del:hover { background: var(--red-bg); color: var(--red); }
.rec-empty { padding: 48px 20px; text-align: center; color: var(--ink-3); }
.re-t { font-family: 'Newsreader', serif; font-size: 17px; color: var(--ink); margin-bottom: 5px; }
.preview-strip { padding: 13px 20px; background: var(--paper-2); border-top: 1px solid var(--line); display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.ps-stat { font-size: 13px; color: var(--ink-2); }
.ps-stat b { font-family: 'IBM Plex Mono', monospace; color: var(--ink); font-weight: 600; }
.ps-flag { color: var(--red); font-weight: 600; }
.tray { margin-top: 20px; }
.tray-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tray-h h3 { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); }
.tray-list { display: flex; flex-direction: column; gap: 8px; }
.tray-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; }
.ti-id { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; color: var(--teal); }
.ti-meta, .ti-n { font-size: 12px; color: var(--ink-3); }

/* footer */
footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 48px 0; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.fcol h4 { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.fcol a, .fcol span { display: block; font-size: 14.5px; color: var(--ink-2); margin-bottom: 9px; cursor: pointer; transition: color .12s; }
.fcol a:hover, .fcol span:hover { color: var(--ink); }
.footer-legal { max-width: var(--maxw); margin: 24px auto 0; padding: 24px 32px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); line-height: 1.6; }

.disclaimer { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.disclaimer b { color: var(--ink-2); }

/* welcome pill */
.welcome-pill { position: fixed; bottom: 22px; left: 22px; z-index: 200; display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); padding: 13px 16px 13px 14px; border-radius: 12px; box-shadow: 0 8px 40px rgba(26,26,24,.3); max-width: 350px; transform: translateY(90px); opacity: 0; transition: transform .5s var(--spring), opacity .4s ease; }
.welcome-pill.show { transform: translateY(0); opacity: 1; }
.wp-dot { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); display: flex; align-items: center; justify-content: center; }
.wp-dot svg { width: 14px; height: 14px; }
.wp-text { font-size: 13px; line-height: 1.4; }
.wp-text b { font-weight: 600; }
.wp-sub { color: rgba(255,255,255,.55); font-size: 11.5px; }
.wp-close { flex-shrink: 0; background: none; border: 0; color: rgba(255,255,255,.4); cursor: pointer; font-size: 15px; padding: 2px 4px; }
.wp-close:hover { color: var(--paper); }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 300; transform: translateX(-50%) translateY(80px); opacity: 0; background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 8px 30px rgba(26,26,24,.25); transition: all .35s var(--spring); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* aliases for legacy hooks */
.btn-hero { font-family: inherit; font-size: 15px; font-weight: 500; padding: 12px 24px; border-radius: 9px; cursor: pointer; border: 0; transition: all .2s var(--ease); }
.btn-hero.primary { background: var(--ink); color: var(--paper); }
.btn-hero.primary:hover { background: var(--teal); }
.btn-hero.ghost { background: none; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-hero.ghost:hover { border-color: var(--ink); }

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

@media (max-width: 680px) {
  .nav-links .nav-link { display: none; }
  .hero h1 { font-size: 40px; }
  .sec { padding: 56px 0; }
  .wrap { padding: 0 22px; }
  .hero { padding: 40px 22px 56px; }
}

/* ═══════════════════════════════════════════════════════════════
   DEMO ENGINE CLASSES — match exactly what app.js generates
   These fix the jumbled equity/reconcile/deteriorate layouts.
   ═══════════════════════════════════════════════════════════════ */

/* legacy CSS-variable aliases used by inline styles in app.js */
:root {
  --hair: var(--line);
  --hair-2: var(--line-2);
  --slate: var(--ink-3);
  --slate-2: var(--ink-4);
  --critical: var(--red); --critical-bg: var(--red-bg);
  --moderate: var(--blue); --moderate-bg: var(--blue-bg);
  --good: var(--green); --good-bg: var(--green-bg);
}

/* stat band (app.js emits "statband" + "stat", not "stat-band"/"stat-cell") */
.statband { display: grid; grid-template-columns: repeat(4,1fr); background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
@media (max-width: 680px) { .statband { grid-template-columns: 1fr 1fr; } }
.statband .stat { padding: 22px 24px; border-right: 1px solid var(--line); }
.statband .stat:last-child { border-right: 0; }
.statband .stat .k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.statband .stat .v { font-family: 'Newsreader', serif; font-size: 34px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.statband .stat .v.mono { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 30px; }
.statband .stat .sub { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

/* ── EQUITY: dumbbell chart (the broken one) ── */
.equity-attr { padding: 8px 0 4px; }
.equity-attr .ea-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 18px 0 12px; border-top: 1px solid var(--line); margin-top: 8px;
}
.equity-attr:first-child .ea-h { border-top: 0; margin-top: 0; padding-top: 4px; }
.equity-attr .ea-h .nm { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); }
.equity-attr .ea-h .ref { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-4); }

.dumbbell { display: flex; flex-direction: column; }
.db-row {
  display: grid; grid-template-columns: 132px 1fr 116px; gap: 16px; align-items: center;
  padding: 9px 0;
}
.db-row .lbl { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.db-row.flagged .lbl { color: var(--red); font-weight: 500; }
.db-row .lbl .sig { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--red); background: var(--red-bg); padding: 2px 6px; border-radius: 4px; }
.db-track { position: relative; height: 22px; }
.db-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--paper-3); }
.db-line { position: absolute; top: 50%; transform: translateY(-50%); height: 3px; background: rgba(14,124,123,.3); border-radius: 2px; }
.db-ref { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 2px; height: 14px; background: var(--ink-4); border-radius: 1px; }
.db-dot { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 11px; height: 11px; border-radius: 50%; transition: left .6s var(--spring); box-shadow: 0 0 0 3px var(--card); }
.db-stat { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-3); text-align: right; }
@media (max-width: 600px) {
  .db-row { grid-template-columns: 92px 1fr 84px; gap: 10px; }
  .db-stat { font-size: 11px; }
}

/* ── PATIENT VIEW ── */
.pv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cols { display: grid; grid-template-columns: 1fr 330px; gap: 22px; margin-top: 24px; }
@media (max-width: 880px) { .cols { grid-template-columns: 1fr; } }
.timeline { display: flex; flex-direction: column; }
.tl-event { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tl-event:last-child { border-bottom: 0; }
.tl-event .te-date { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-4); padding-top: 2px; }
.tl-event .te-main { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.tl-event .te-detail { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.tl-event .ty { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-4); background: var(--paper-2); padding: 2px 7px; border-radius: 4px; margin-right: 6px; }

/* ── roster riskbar (app.js uses riskbar/riskbar-wrap) ── */
.riskbar-wrap { display: flex; align-items: center; gap: 11px; }
.riskbar { height: 5px; width: 70px; flex-shrink: 0; background: var(--paper-3); border-radius: 3px; overflow: hidden; }
.riskbar > i, .riskbar > div { display: block; height: 100%; border-radius: 3px; }
.count-dot { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500; color: var(--ink); }
td.count-dot { font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: var(--ink-2); }

/* generic stat/k/v/sub fallbacks (used outside statband too) */
.stat .k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.stat .v { font-family: 'Newsreader', serif; font-size: 32px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.stat .v.mono { font-family: 'IBM Plex Mono', monospace; }

/* stat-cell mono values + small percent */
.stat-cell .v.mono { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 30px; }
.stat-cell .v small, .statband .stat .v small { font-size: 17px; color: var(--ink-3); font-weight: 400; }

/* ═══════════════════════════════════════════════════════════════
   ACCOUNT / AUTH / SETTINGS — clinical reading instrument styling
   ═══════════════════════════════════════════════════════════════ */

.nav-account {
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); background: none; border: 1.5px solid var(--line-2);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; margin-left: 4px;
  white-space: nowrap; transition: all .15s var(--ease);
}
.nav-account:hover { border-color: var(--ink); }
.nav-account.authed { border-color: var(--teal); color: var(--teal); }
@media (max-width: 680px) { .nav-account { padding: 7px 12px; font-size: 13px; } }

/* ---- account page ---- */
.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.acct-tabs { display: inline-flex; gap: 2px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 32px; flex-wrap: wrap; }
.acct-tab { font-family: inherit; font-size: 14px; font-weight: 450; color: var(--ink-3); background: none; border: 0; padding: 8px 17px; border-radius: 7px; cursor: pointer; transition: all .15s var(--ease); white-space: nowrap; }
.acct-tab:hover { color: var(--ink); }
.acct-tab.active { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(26,26,24,.1); }
.acct-view { display: none; animation: fade .3s var(--ease) both; }
.acct-view.active { display: block; }

.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.acct-card-h { padding: 22px 24px 0; }
.acct-card-h h3 { font-family: 'Newsreader', serif; font-size: 21px; font-weight: 500; color: var(--ink); margin-bottom: 7px; display: flex; align-items: center; gap: 10px; }
.acct-card-h p { font-size: 14px; color: var(--ink-2); line-height: 1.6; max-width: 640px; }
.acct-card-b { padding: 18px 24px 24px; }
.tier-pill { font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); background: var(--teal-bg); padding: 3px 9px; border-radius: 5px; }

.set-row { display: grid; grid-template-columns: 1fr 200px; gap: 24px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
@media (max-width: 600px) { .set-row { grid-template-columns: 1fr; gap: 10px; } }
.set-label b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.set-label span { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.set-input { display: flex; align-items: center; gap: 9px; }
.set-input input { width: 100%; font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: var(--ink); border: 1.5px solid var(--line-2); border-radius: 8px; padding: 9px 12px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.set-input input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.set-unit { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.lab-ov-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lab-ov-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; }
.lab-ov-row .ov-lab { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; }
.lab-ov-row .ov-vals { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--ink-2); }
.lab-ov-row .ov-del { background: none; border: 0; color: var(--ink-4); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 5px; transition: all .12s; }
.lab-ov-row .ov-del:hover { background: var(--red-bg); color: var(--red); }
.lab-ov-add { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 8px; }
@media (max-width: 600px) { .lab-ov-add { grid-template-columns: 1fr 1fr; } }
.lab-ov-add input { font-family: inherit; font-size: 14px; border: 1.5px solid var(--line-2); border-radius: 8px; padding: 9px 12px; background: var(--card); }
.lab-ov-add input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }

.acct-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.audit-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
@media (max-width: 600px) { .audit-summary { grid-template-columns: 1fr; } }
.audit-summary .as-cell { background: var(--card); padding: 18px 20px; }
.audit-summary .as-k { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 7px; }
.audit-summary .as-v { font-family: 'Newsreader', serif; font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1; }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th { text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.audit-table td { padding: 13px 14px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-table .at-crit { font-family: 'IBM Plex Mono', monospace; color: var(--red); font-weight: 500; }
.audit-empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.audit-empty .ae-t { font-family: 'Newsreader', serif; font-size: 19px; color: var(--ink); margin-bottom: 7px; }

.team-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.team-member { display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 9px; }
.team-member .tm-av { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: var(--paper); display: flex; align-items: center; justify-content: center; font-family: 'Newsreader', serif; font-size: 15px; font-weight: 500; flex-shrink: 0; }
.team-member .tm-email { flex: 1; font-size: 14px; color: var(--ink); }
.team-member .tm-role { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); background: var(--teal-bg); padding: 3px 9px; border-radius: 5px; }
.team-member .tm-del { background: none; border: 0; color: var(--ink-4); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 5px; transition: all .12s; }
.team-member .tm-del:hover { background: var(--red-bg); color: var(--red); }
.team-add { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
@media (max-width: 600px) { .team-add { grid-template-columns: 1fr; } }
.team-add input, .team-add select { font-family: inherit; font-size: 14px; border: 1.5px solid var(--line-2); border-radius: 8px; padding: 9px 12px; background: var(--card); }
.team-add input:focus, .team-add select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }

.report-preview { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.rp-letterhead { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 16px; margin-bottom: 18px; }
.rp-logo { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 600; color: var(--ink); }
.rp-logo b { color: var(--teal); }
.rp-meta { text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.rp-title { font-family: 'Newsreader', serif; font-size: 24px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.rp-org { font-size: 14px; color: var(--ink-2); margin-bottom: 20px; }
.rp-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.rp-stat { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--card); }
.rp-stat .rs-v { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 500; color: var(--ink); line-height: 1; }
.rp-stat .rs-k { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.rp-sig { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--ink-4); border-top: 1px solid var(--line); padding-top: 14px; line-height: 1.6; word-break: break-all; }

/* ---- auth modal ---- */
.auth-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(26,26,24,.45); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; }
.auth-overlay.show { display: flex; animation: fade .2s var(--ease) both; }
.auth-modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 420px; padding: 36px 34px; position: relative; box-shadow: 0 24px 80px -20px rgba(26,26,24,.4); max-height: 92vh; overflow-y: auto; animation: fadeup .3s var(--ease) both; }
.auth-close { position: absolute; top: 18px; right: 18px; background: none; border: 0; color: var(--ink-4); cursor: pointer; font-size: 16px; padding: 4px; }
.auth-close:hover { color: var(--ink); }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-logo { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 600; margin-bottom: 22px; }
.auth-logo .wm b { color: var(--teal); }
.auth-title { font-family: 'Newsreader', serif; font-size: 26px; font-weight: 500; color: var(--ink); margin-bottom: 8px; letter-spacing: -.01em; }
.auth-sub { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin-bottom: 22px; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.auth-field input { width: 100%; font-family: inherit; font-size: 15px; color: var(--ink); border: 1.5px solid var(--line-2); border-radius: 9px; padding: 11px 13px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.auth-field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-bg); }
.auth-error { font-size: 13px; color: var(--red); min-height: 18px; margin-bottom: 6px; line-height: 1.4; }
.auth-submit { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.auth-foot { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); display: flex; flex-direction: column; gap: 10px; text-align: center; }
.auth-link { background: none; border: 0; color: var(--teal); cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 500; padding: 0; }
.auth-link:hover { text-decoration: underline; }
.phrase-box { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 18px; }
.phrase-box .pw { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink); padding: 6px 8px; }
.phrase-box .pw span { color: var(--ink-4); margin-right: 6px; }
@media (max-width: 440px) { .auth-modal { padding: 28px 22px; } .phrase-box { grid-template-columns: repeat(2,1fr); } }

/* danger zone */
.danger-card { border-color: rgba(214,58,58,.25); margin-top: 28px; }
.danger-card .acct-card-h h3 { color: var(--red); }
.btn-danger { font-family: inherit; font-size: 14px; font-weight: 500; color: var(--red); background: var(--red-bg); border: 1.5px solid rgba(214,58,58,.3); padding: 10px 18px; border-radius: 8px; cursor: pointer; transition: all .15s var(--ease); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-line { font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: none; border: 1.5px solid var(--line-2); padding: 9px 18px; border-radius: 8px; cursor: pointer; transition: all .15s var(--ease); }
.btn-line:hover { border-color: var(--ink); }

/* ── team member email + contact page ── */
.me { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--teal); text-decoration: none; margin: 2px 0 8px; transition: color .15s; }
.me:hover { color: var(--ink); text-decoration: underline; }

.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 40px; }
@media (max-width: 680px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.cc-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--teal); margin-bottom: 12px; }
.contact-card p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 16px; }
.cc-mail { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 14px; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--teal); padding-bottom: 1px; transition: color .15s; }
.cc-mail:hover { color: var(--teal); }
.cc-person { display: block; margin-top: 10px; font-size: 13px; color: var(--ink-3); }

.contact-team { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 24px 28px; margin-bottom: 28px; }
.ct-head { font-family: 'Newsreader', serif; font-size: 18px; font-weight: 500; color: var(--ink); margin-bottom: 16px; }
.ct-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 680px) { .ct-list { grid-template-columns: 1fr; } }
.ct-list a { display: flex; flex-direction: column; gap: 3px; text-decoration: none; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; transition: border-color .15s; }
.ct-list a:hover { border-color: var(--teal); }
.ct-list b { font-size: 14.5px; color: var(--ink); font-weight: 600; }
.ct-list span { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--teal); }
.contact-note { font-size: 13px; color: var(--ink-3); line-height: 1.6; max-width: 640px; }

/* ── inline citations ── */
.cite { display: block; margin-top: 8px; font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 400; color: var(--ink-3); text-decoration: none; line-height: 1.5; border-left: 2px solid var(--line-2); padding-left: 9px; }
.cite:hover { color: var(--teal); border-left-color: var(--teal); }
.cite i { font-style: italic; }

/* ── burger menu ── */
.nav-burger { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 38px; padding: 0 9px; background: none; border: 1.5px solid var(--line-2); border-radius: 9px; cursor: pointer; margin-left: 4px; transition: border-color .15s; }
.nav-burger:hover { border-color: var(--ink); }
.nav-burger span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .22s var(--ease), opacity .18s; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-burger.authed { border-color: var(--teal); }
.nav-burger.authed span { background: var(--teal); }

.menu-scrim { position: fixed; inset: 0; z-index: 400; background: rgba(26,26,24,.35); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.menu-scrim.show { opacity: 1; pointer-events: auto; }
.menu-panel { position: fixed; top: 70px; right: 18px; z-index: 401; width: 280px; max-width: calc(100vw - 36px); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px -16px rgba(26,26,24,.32); padding: 10px; opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); max-height: calc(100vh - 90px); overflow-y: auto; }
.menu-panel.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.menu-section { padding: 6px 4px; }
.menu-head { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-4); padding: 6px 12px 8px; }
.menu-item { display: block; width: 100%; text-align: left; font-family: inherit; font-size: 14.5px; color: var(--ink); background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.menu-item:hover { background: var(--paper-2); }
.menu-accent { color: var(--teal); font-weight: 500; }
.menu-danger { color: var(--red); }
.menu-danger:hover { background: var(--red-bg); }
.menu-divider { height: 1px; background: var(--line); margin: 6px 8px; }
@media (max-width: 760px) {
  .nav-links .nav-link, .nav-links .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .menu-panel { top: 64px; }
}

/* ── contact: team-first with headshot placeholders ── */
.ct-people { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.ct-person { display: flex; gap: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
@media (max-width: 600px) { .ct-person { flex-direction: column; gap: 16px; } }
.ctp-photo { flex-shrink: 0; width: 130px; height: 160px; border-radius: 10px; background: var(--paper-2); border: 1.5px dashed var(--line-2); display: flex; align-items: center; justify-content: center; }
.ctp-photo span { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--ink-4); letter-spacing: .03em; }
@media (max-width: 600px) { .ctp-photo { width: 100%; height: 200px; } }
.ctp-name { font-family: 'Newsreader', serif; font-size: 22px; font-weight: 500; color: var(--ink); }
.ctp-role { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); margin: 4px 0 12px; }
.ctp-desc { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 12px; }
.ctp-did { list-style: none; margin: 0 0 14px; padding: 0; }
.ctp-did li { font-size: 13px; color: var(--ink-2); line-height: 1.5; padding-left: 18px; position: relative; margin-bottom: 5px; }
.ctp-did li::before { content: "→"; position: absolute; left: 0; color: var(--teal); }
.ctp-mail { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; color: var(--ink); text-decoration: none; border-bottom: 1.5px solid var(--teal); padding-bottom: 1px; }
.ctp-mail:hover { color: var(--teal); }

.ct-primary { background: var(--teal-bg); border: 1px solid rgba(14,124,123,.25); border-radius: 14px; padding: 24px 28px; margin-bottom: 28px; }
.ctpr-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); margin-bottom: 10px; }
.ctpr-mail { display: inline-block; font-family: 'Newsreader', serif; font-size: 24px; font-weight: 500; color: var(--ink); text-decoration: none; margin-bottom: 8px; }
.ctpr-mail:hover { color: var(--teal); }
.ct-primary p { font-size: 14px; color: var(--ink-2); line-height: 1.6; max-width: 560px; }

/* ── logo marks ── */
.auth-logo { display: flex; align-items: center; gap: 10px; }
.auth-mark { height: 30px; width: auto; }
