/* VESTA landing design system.
   All layout spacing uses the 4px base scale. Borders and chart geometry are optical sizes.
   Containers stay fluid; content may exceed a viewport when needed for readable text. */
:root {
  --orange: #f47b0b;
  --ink: #171717;
  --muted: #626262;
  --paper: #fafafa;
  --gray: #ecebea;
  --surface: #fff;
  --line: #c4c2bf;
  --border: #e4e4e7;
  --border-strong: #a8a6a3;
  --comparison: #94a3b8;

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --text-meta: .75rem;
  --text-small: .875rem;
  --text-body: 1rem;
  --text-lead: 1.125rem;
  --text-h3: 1.25rem;
  --text-h2: 2.5rem;
  --text-h1: 4rem;
  --line-meta: 1rem;
  --line-small: 1.25rem;
  --line-body: 1.5rem;
  --line-lead: 1.75rem;
  --line-h3: 1.75rem;
  --line-h2: 3rem;
  --line-h1: 4.5rem;

  --content-max: 90rem;
  --heading-max: 64rem;
  --copy-max: 48rem;
  --gutter: var(--space-8);
  --section-pad: var(--space-8);
  --header: 72px;
  --section-screen: calc(100svh - var(--header));
  --radius: .5rem;
  --shadow: 0 4px 16px #17171708;
  --motion: 200ms ease;
}
@supports (height: 100dvh) {
  :root { --section-screen: calc(100dvh - var(--header)); }
}

/* Foundation and shared content boundaries. */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-block-start: var(--header);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--text-body)/var(--line-body) Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}
h1, h2, h3, h4, h5, h6 {
  max-width: var(--heading-max);
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--text-h1); line-height: var(--line-h1); letter-spacing: -.035em; }
h2 { font-size: var(--text-h2); line-height: var(--line-h2); letter-spacing: -.025em; }
h3 { font-size: var(--text-h3); line-height: var(--line-h3); letter-spacing: -.015em; }
p { max-width: var(--copy-max); margin: 0; text-wrap: pretty; }
small, .sample { font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
.wrap { width: calc(100% - 2 * var(--gutter)); max-width: var(--content-max); margin-inline: auto; }
.vesta-word { color: var(--orange); }
main > section { scroll-snap-align: start; scroll-snap-stop: normal; isolation: isolate; }
.section-screen { min-height: var(--section-screen); padding-block: var(--section-pad); }
.intro-kicker, .eyebrow, .pilot-kicker, .evidence-label {
  display: block;
  max-width: var(--copy-max);
  color: var(--orange);
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-wrap: balance;
}
.skip { position: fixed; top: -8rem; left: var(--space-4); z-index: 100; padding: var(--space-3); background: var(--surface); }
.skip:focus { top: var(--space-4); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation and controls. */
.header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); padding-block: var(--space-3); }
.brand { display: flex; flex-shrink: 0; }
.brand img { width: 6.5rem; height: 2.5rem; object-fit: contain; }
.header nav { display: flex; align-items: center; gap: var(--space-8); font-size: var(--text-small); line-height: var(--line-small); }
.header nav a:hover { color: var(--orange); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  font-size: var(--text-small);
  line-height: var(--line-small);
  font-weight: 600;
  text-align: center;
  transition: box-shadow var(--motion), border-color var(--motion);
}
.button:hover { box-shadow: inset 0 0 0 2px #17171720; }
.button.compact { padding-inline: var(--space-4); }
.button-outline, .button.waitlist { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.button-outline:hover, .button.waitlist:hover { border-color: var(--ink); box-shadow: none; }

/* Hero: a wide headline, readable supporting copy, no forced line breaks. */
.intro { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--space-6); }
.intro h1 { width: 100%; }
.intro h1 span { color: #424242; }
.intro p { width: 100%; font-size: var(--text-lead); line-height: var(--line-lead); color: var(--muted); }
.intro-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-3); }
.trust-line { max-width: var(--copy-max); font-size: var(--text-small); line-height: var(--line-small); color: var(--muted); text-wrap: pretty; }

/* Scroll narrative. These hooks are shared with app.js's fit/scroll controller. */
.hero-story { position: relative; height: calc(450svh - var(--header)); background: var(--gray); }
/* End anchor supplies the missing full-screen landing point before the platform. */
.story-end-anchor {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: var(--section-screen);
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}
.hero-sticky {
  position: sticky;
  top: var(--header);
  height: var(--section-screen);
  min-height: var(--section-screen);
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--space-1);
  background: var(--gray);
}
.story-layout { display: flex; align-items: stretch; gap: var(--space-12); min-height: 0; padding-block: var(--section-pad); }
.story-left { flex: 1 1 0; min-width: 0; align-self: center; }
.process-heading { max-width: var(--heading-max); margin-bottom: var(--space-6); }
.process-heading .eyebrow { margin-bottom: var(--space-3); }
.phase-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--line);
}
.phase-list > li { display: flex; min-width: 0; }
.phase-list > li + li { border-top: 1px solid var(--line); }
.phase {
  display: grid;
  grid-template-columns: var(--space-8) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  width: 100%;
  min-height: 5rem;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  text-align: left;
  transition: background 400ms ease, border-color 400ms ease;
}
.phase.active { border-left-color: var(--orange); background: #ffffff66; }
.phase:hover { background: #ffffff40; }
.phase-num { color: var(--muted); font-size: var(--text-small); line-height: var(--line-body); font-variant-numeric: tabular-nums; }
.phase.active .phase-num { color: var(--orange); }
.phase-body { display: grid; gap: var(--space-1); min-width: 0; max-width: var(--copy-max); }
.phase-body strong { font-size: var(--text-body); line-height: var(--line-body); font-weight: 600; }
.phase-body > span { color: var(--muted); font-size: var(--text-small); line-height: var(--line-small); text-wrap: pretty; }
.story-evidence { display: grid; margin-top: var(--space-6); min-width: 0; isolation: isolate; }
.phase-panel {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(var(--space-1));
  pointer-events: none;
  transition: opacity 800ms cubic-bezier(.22,1,.36,1), transform 1000ms cubic-bezier(.22,1,.36,1);
}
.phase-panel.is-active { opacity: 1; transform: none; pointer-events: auto; z-index: 1; }
.phase-panel p { font-size: var(--text-small); line-height: var(--line-small); color: var(--muted); }
.phase-panel small { display: block; max-width: var(--copy-max); }
.scene-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: center; gap: var(--space-4); }
.scene-panel > picture {
  display: block;
  min-width: 0;
  width: 100%;
  max-height: 10rem;
  overflow: hidden;
  border-radius: var(--space-1);
}
.scene-panel > img,
.scene-panel > picture img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 6rem;
  max-height: 10rem;
  object-fit: cover;
  border-radius: var(--space-1);
}
.scene-panel > div { display: grid; gap: var(--space-2); min-width: 0; max-width: var(--copy-max); }
.scene-panel strong { font-size: var(--text-body); line-height: var(--line-body); font-weight: 600; }
.loss-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-4); }
.loss-summary > strong { font-size: 2rem; line-height: var(--space-10); font-variant-numeric: tabular-nums; }
.loss-summary > strong > span, .loss-summary > span { font-size: var(--text-small); line-height: var(--line-small); font-weight: 400; }
.evidence-context { display: grid; gap: var(--space-1); padding-left: var(--space-3); border-left: 2px solid var(--orange); max-width: var(--copy-max); }
.evidence-context > span { color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.evidence-context > strong { font-size: var(--text-small); line-height: var(--line-small); font-weight: 600; }
.comparison { display: grid; gap: var(--space-2); margin: 0; }
.comparison > div { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 4rem; align-items: center; gap: var(--space-4); min-height: var(--space-8); }
.comparison dt, .comparison dd { margin: 0; font-size: var(--text-small); line-height: var(--line-small); }
.comparison-track { height: var(--space-2); background: var(--gray); overflow: hidden; }
.comparison-track > span { display: block; height: 100%; background: var(--comparison); }
.comparison > div:last-child .comparison-track > span { background: var(--orange); }
.comparison-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.camera-stage { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; align-self: stretch; }
#camera { position: absolute; inset: 0 0 var(--space-10); }
#camera canvas { display: block; width: 100%; height: 100%; }
.camera-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); line-height: var(--line-body); }
.camera-caption { position: absolute; bottom: 0; inset-inline: 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
#camera-phase { color: var(--orange); }
.story-progress { background: var(--line); overflow: hidden; }
.story-progress > div { height: 100%; width: 0; background: var(--orange); }
.compact-story .story-layout { padding-block: var(--space-4); gap: var(--space-6); }
.compact-story .process-heading { margin-bottom: var(--space-4); }
.compact-story .process-heading h2 { font-size: 2rem; line-height: var(--space-10); }
.compact-story .process-heading .eyebrow { margin-bottom: var(--space-2); }
.compact-story .phase { min-height: 0; padding-block: var(--space-2); }
.compact-story .story-evidence { margin-top: var(--space-4); }
.compact-story .story-bottom { padding-block: var(--space-2); }
.natural-flow.hero-story { height: auto; }
.natural-flow .hero-sticky { position: relative; top: 0; height: auto; grid-template-rows: auto auto; }
.natural-flow .camera-stage { min-height: 50svh; }
.natural-flow .story-progress { display: none; }

/* Product canvas: equal KPI cells, two consistent trend panels, detail on demand. */
.product {
  height: var(--section-screen);
  min-height: min-content;
  display: grid;
  grid-template-rows: auto auto minmax(min-content, 1fr) auto;
  gap: var(--space-6);
}
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); }
.product-intro { min-width: 0; max-width: var(--heading-max); }
.product-intro p { margin-top: var(--space-2); color: var(--muted); }
.section-heading > .sample { flex: 0 0 auto; max-width: 14rem; text-align: right; }
.dashboard-tabs { display: none; }
.dashboard-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-6); min-width: 0; min-height: 0; }
.dashboard-surface { display: grid; grid-template-rows: auto minmax(min-content, 1fr); min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.product-meta-sim { font-weight: 600; color: var(--muted); }
.product-disclosure { margin: 0; }
.context-matrix-note { max-width: none; margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-meta); line-height: var(--line-small); text-wrap: pretty; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(min-content, 1fr)); gap: var(--space-3); padding: var(--space-3); min-height: 0; }
.summary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  min-height: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color var(--motion), box-shadow var(--motion);
}
.summary-card:hover, .summary-card:focus-visible { border-color: var(--border-strong); box-shadow: 0 4px 16px #17171714; }
.metric-name { max-width: var(--copy-max); color: var(--muted); font-size: var(--text-small); line-height: var(--line-small); font-weight: 500; text-wrap: pretty; }
.metric-value { font-size: 2rem; line-height: var(--space-10); font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: var(--text-small); font-weight: 400; }
.metric-note { max-width: var(--copy-max); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.metric-viz { display: flex; align-items: center; gap: var(--space-1); height: var(--space-1); flex-shrink: 0; background: var(--gray); font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
.metric-viz i { display: block; height: 100%; background: var(--orange); }
.metric-viz:has(b) { height: auto; min-height: var(--space-4); flex-wrap: wrap; background: transparent; }
.metric-viz b { font-weight: 500; }
.metric-viz .pending-track { width: 100%; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 12px); }
.unavailable { background: #f4f4f5; box-shadow: none; }
.unavailable .metric-value { color: var(--muted); }
.product-bottom { position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
details { max-width: var(--copy-max); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.product-bottom details[open] > p { position: absolute; bottom: 100%; right: 0; z-index: 5; width: min(100%, 32rem); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: var(--text-small); line-height: var(--line-small); }
.trend-stack { display: grid; grid-template-rows: repeat(2, minmax(min-content, 1fr)); gap: var(--space-6); min-width: 0; min-height: 0; }
.trend-card { display: grid; grid-template-rows: auto auto minmax(6rem, 1fr) auto; gap: var(--space-2); min-width: 0; min-height: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.trend-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.trend-heading h3 { font-size: var(--text-body); line-height: var(--line-body); }
.trend-select { max-width: 100%; min-height: var(--space-8); padding: var(--space-1) var(--space-2); border: 1px solid var(--line); border-radius: var(--space-1); background: var(--surface); color: var(--ink); font-size: var(--text-meta); line-height: var(--line-meta); }
.trend-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.trend-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.trend-legend i { width: var(--space-5); border-top: 2px solid var(--orange); }
.trend-legend span:last-child i { border-color: var(--comparison); border-top-style: dashed; }
.trend-plot { position: relative; min-width: 0; min-height: 6rem; touch-action: pan-y; }
.trend-plot svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.trend-readout { min-height: var(--space-4); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); font-variant-numeric: tabular-nums; }
.trend-tooltip { position: absolute; top: var(--space-1); left: 50%; z-index: 4; transform: translateX(-50%); width: max-content; max-width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--space-1); background: var(--surface); box-shadow: var(--shadow); font-size: var(--text-meta); line-height: var(--line-meta); pointer-events: none; }
.trend-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); }
.trend-data-button { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); text-decoration: underline; text-underline-offset: 4px; }

/* Pilot invitation and compact footer. */
.closing { display: flex; align-items: center; background: var(--gray); border-bottom: 1px solid var(--line); }
.pilot-invitation { position: relative; padding: var(--space-16); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.pilot-copy { max-width: var(--heading-max); }
.pilot-kicker { margin-bottom: var(--space-4); }
.pilot-copy p { margin-top: var(--space-6); color: var(--muted); }
.pilot-copy p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pilot-copy p a:hover { color: var(--orange); }
.pilot-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6); padding-block: var(--space-6); color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); scroll-snap-align: end; }
footer .brand img { width: 5rem; height: var(--space-8); }
footer .footer-contact { margin-left: auto; }

/* Native detail dialog and data table. */
dialog { width: min(40rem, calc(100% - 2 * var(--gutter))); max-height: calc(100dvh - var(--space-8)); padding: var(--space-8); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); overflow: auto; }
dialog::backdrop { background: #17171780; }
.dialog-top { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); margin-bottom: var(--space-4); }
.dialog-top button { width: var(--space-12); height: var(--space-12); padding: 0; border: 0; background: transparent; font-size: 2rem; }
dialog h2 { font-size: 2rem; line-height: var(--space-10); }
#detail-value { margin-block: var(--space-6); font-size: 2rem; line-height: var(--space-10); color: var(--orange); font-variant-numeric: tabular-nums; }
#detail-value:empty { display: none; }
#detail-description { margin-top: var(--space-4); color: var(--muted); }
#detail-context { margin-block: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--line); max-width: var(--copy-max); overflow-wrap: break-word; }
#detail-context > strong { display: block; margin-bottom: var(--space-2); }
.detail-action { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.trend-table { width: 100%; margin-block: var(--space-4); border-collapse: collapse; font-size: var(--text-small); line-height: var(--line-small); font-variant-numeric: tabular-nums; }
.trend-table caption { text-align: left; margin-bottom: var(--space-3); }
.trend-table th, .trend-table td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); text-align: right; }
.trend-table th:first-child, .trend-table td:first-child { text-align: left; }
body:has(dialog[open]) { overflow: hidden; }

/* Operational context: shared visual language, structured sources and evidence. */
.nav-toggle { display: none; }
.header nav a[aria-current="page"] { color: var(--orange); }
.context-section, .integration-intro, .integration-example, .integration-import { background: var(--paper); }
.platform-section, .source-roles, .integration-sources { background: var(--gray); }
.home-page .closing { background: var(--paper); }
.context-section { display: flex; align-items: center; }
.integration-layout { display: grid; gap: var(--space-8); }
.context-heading { max-width: var(--heading-max); min-width: 0; }
.context-heading .eyebrow { margin-bottom: var(--space-4); }
.context-heading p { max-width: var(--copy-max); margin-top: var(--space-4); color: var(--muted); }
.context-section.section-screen {
  min-height: var(--section-screen);
  padding-block: clamp(var(--space-4), 2vh, var(--space-6));
}
.context-sync-page {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: var(--space-6) var(--space-10);
  align-items: start;
  min-width: 0;
  width: 100%;
}
.context-sync-main,
.context-sync-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}
.context-intro {
  max-width: none;
}
.context-intro .eyebrow { margin-bottom: var(--space-2); }
.context-intro h2 {
  max-width: 36rem;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -.022em;
  font-weight: 600;
}
.context-intro p {
  max-width: 44rem;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--text-body);
  line-height: var(--line-body);
}
.context-sync {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.context-sync-timelines {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  min-width: 0;
}
.context-matrix {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
}
.context-matrix .eyebrow {
  max-width: none;
  margin: 0;
}
.context-matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-size: var(--text-meta);
  line-height: 1.25;
}
.context-matrix-table th:first-child,
.context-matrix-table td:first-child {
  width: 58%;
}
.context-matrix-table thead th {
  padding: 0 var(--space-3);
  height: 2.25rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  background: var(--gray);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}
.context-matrix-table thead th:first-child {
  border-right: 1px solid var(--border);
}
.context-matrix-table tbody th,
.context-matrix-table tbody td {
  padding: 0 var(--space-3);
  height: 2.25rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.context-matrix-table tbody th {
  border-right: 1px solid var(--border);
  font-weight: 500;
  color: var(--ink);
}
.context-matrix-table tbody td {
  color: var(--muted);
}
.sync-chart { display: grid; gap: var(--space-3); min-width: 0; }
.sync-axis {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-variant-numeric: tabular-nums;
}
.sync-lanes-body {
  position: relative;
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-5);
}
.sync-lane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
}
.sync-lane-label {
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sync-lane-sub {
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  color: var(--muted);
}
.sync-lane { position: relative; z-index: 1; min-width: 0; }
.sync-lane-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  min-height: 2.25rem;
  align-items: stretch;
}
.sync-block {
  grid-column: var(--col-start) / var(--col-end);
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--space-1);
  background: var(--paper);
  border: 1px solid var(--border);
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-weight: 500;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-block-key {
  background: #fff8f2;
  border-color: #f0d4b8;
  border-left: 2px solid var(--orange);
  color: var(--ink);
}
.sync-block-key-muted {
  background: var(--paper);
  border-left-color: var(--line);
}
.sync-correlation {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 25%;
  margin-left: 0;
  transform: translateX(0);
  background: rgb(244 123 11 / 0.06);
  border-inline: 1px solid rgb(244 123 11 / 0.12);
  pointer-events: none;
  z-index: 0;
}
.sync-correlation-time {
  position: absolute;
  top: calc(-1 * var(--space-5));
  left: 50%;
  transform: translateX(-50%);
  color: var(--orange);
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.context-sync-insight {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.context-sync-insight-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
}
.context-sync-insight .eyebrow { margin: 0; }
.context-insight-title {
  max-width: none;
  margin: 0;
  font-size: var(--text-lead);
  line-height: var(--line-lead);
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.context-insight-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  max-width: none;
  margin: 0;
  font-size: var(--text-small);
  line-height: var(--line-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.context-insight-copy {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: var(--line-small);
}
.context-insight-meta {
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--space-2);
}
.context-insight-meta > div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  align-items: baseline;
}
.context-insight-meta dt {
  margin: 0;
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.context-insight-meta dd {
  margin: 0;
  max-width: none;
  font-size: var(--text-meta);
  line-height: var(--line-meta);
  color: var(--muted);
}
.context-sync-page:not(.is-revealed) .sync-reveal-lane,
.context-sync-page:not(.is-revealed) .sync-reveal-correlation,
.context-sync-page:not(.is-revealed) .sync-reveal-insight {
  opacity: 0;
  transform: translateY(8px);
}
.context-sync-page.is-revealed .sync-reveal-lane {
  opacity: 1;
  transform: none;
  transition: opacity 400ms ease, transform 400ms ease;
}
.context-sync-page.is-revealed .sync-lane-ops.sync-reveal-lane {
  transition-delay: 80ms;
}
.context-sync-page.is-revealed .sync-reveal-correlation {
  opacity: 1;
  transform: none;
  transition: opacity 400ms ease 160ms;
}
.context-sync-page.is-revealed .sync-reveal-insight {
  opacity: 1;
  transform: none;
  transition: opacity 400ms ease 240ms;
}
.context-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-10);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.context-result > div { min-width: 0; max-width: var(--copy-max); }
.context-result .eyebrow { margin-bottom: var(--space-2); }
.context-result h3 { margin-bottom: var(--space-2); }
.context-result p { color: var(--muted); font-size: var(--text-small); line-height: var(--line-small); }
.context-result .button { flex: 0 0 auto; }
.evidence-availability { display: grid; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
.evidence-sources { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-1) var(--space-3); list-style: none; padding: 0; margin: 0; font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
.context-text-button { justify-self: start; padding: var(--space-1) 0; border: 0; background: transparent; font-size: var(--text-meta); line-height: var(--line-meta); text-decoration: underline; text-underline-offset: 4px; }
.context-text-button[aria-pressed="true"] { color: var(--orange); }
.product-bottom { justify-content: flex-end; }
.signal-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-8); }
.signal-overview > div { min-width: 0; padding-top: var(--space-6); border-top: 1px solid var(--line); }
.signal-overview h3 { margin-top: var(--space-3); }
.signal-overview ul { display: grid; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--text-small); line-height: var(--line-small); }
.signal-overview .signal-output { border-top: 2px solid var(--orange); }
.integration-intro-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.integration-intro-bottom p { color: var(--muted); }
.integration-intro-bottom .button { flex-shrink: 0; }
.source-roles-table { display: grid; margin: 0; border-top: 1px solid var(--line); }
.source-roles-table > div { display: grid; grid-template-columns: 15rem minmax(0,1fr); gap: var(--space-8); padding-block: var(--space-5); border-bottom: 1px solid var(--line); }
.source-roles-table dt { font-weight: 600; }
.source-roles-table dd { display: grid; grid-template-columns: 6rem minmax(0,1fr); gap: var(--space-4); margin: 0; max-width: var(--copy-max); color: var(--muted); }
.source-roles-table dd > span { color: var(--ink); font-size: var(--text-small); line-height: var(--line-body); }
.example-workspace { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: var(--space-8); }
.example-evidence, .example-result { padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.source-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.source-controls button { min-height: var(--space-10); padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--space-1); background: var(--surface); font-size: var(--text-small); line-height: var(--line-small); }
.source-controls button[aria-pressed="true"] { border-color: var(--orange); box-shadow: inset 0 -2px var(--orange); }
.timeline-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.event-timeline { display: grid; gap: var(--space-4); margin: var(--space-6) 0; }
.event-timeline > div { display: grid; grid-template-columns: 10rem minmax(0,1fr) 4rem; align-items: center; gap: var(--space-4); min-height: var(--space-10); }
.event-timeline dt, .event-timeline dd { margin: 0; font-size: var(--text-small); line-height: var(--line-small); }
.event-timeline dd:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-timeline .timeline-track { height: var(--space-2); background: var(--gray); }
.timeline-track span { display: block; height: 100%; background: var(--orange); }
.timeline-track.muted-track span { background: var(--comparison); }
.order-context { color: var(--muted); }
.source-pending dt { color: var(--muted); }
.source-pending dd { visibility: hidden; }
.example-result { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); border-top: 2px solid var(--orange); }
.example-result p { color: var(--muted); }
.example-result .button { margin-top: auto; }
.source-catalog { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-6); margin: 0; }
.source-catalog > div { min-width: 0; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.source-catalog dt { font-size: var(--text-lead); line-height: var(--line-lead); font-weight: 600; }
.source-catalog dd { margin: var(--space-3) 0 0; color: var(--muted); max-width: var(--copy-max); }
.source-footnote { font-size: var(--text-small); line-height: var(--line-small); color: var(--muted); }
.import-method { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--space-8); padding-block: var(--space-6); border-block: 1px solid var(--line); }
.import-method h3 { margin-bottom: var(--space-2); }
.import-method > div > p { color: var(--orange); font-size: var(--text-lead); line-height: var(--line-lead); font-weight: 600; }
.import-method > p { color: var(--muted); }
.import-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-8); margin: 0; padding: 0; list-style: none; }
.import-steps li { display: grid; align-content: start; gap: var(--space-3); min-width: 0; }
.import-steps li > span { color: var(--orange); font-size: var(--text-small); line-height: var(--line-small); font-variant-numeric: tabular-nums; }
.import-steps p { color: var(--muted); }
.evidence-detail-note { padding-top: var(--space-4); border-top: 1px solid var(--line); font-size: var(--text-small); line-height: var(--line-small); color: var(--muted); }
#evidence-dialog > p:first-of-type { margin-top: var(--space-4); }

/* Legal / privacy page */
.legal-page { padding-block: var(--space-12) var(--space-16); max-width: var(--copy-max); }
.legal-header { margin-bottom: var(--space-10); }
.legal-header h1 { font-size: var(--text-h2); line-height: var(--line-h2); }
.legal-updated { margin-top: var(--space-3); color: var(--muted); font-size: var(--text-small); }
.legal-body { display: grid; gap: var(--space-10); }
.legal-body h2 { font-size: var(--text-h3); line-height: var(--line-h3); margin-bottom: var(--space-3); }
.legal-body p, .legal-body li { color: var(--muted); }
.legal-body ul { margin: var(--space-3) 0 0; padding-left: var(--space-6); }
.legal-body a { text-decoration: underline; text-underline-offset: 3px; }
.legal-body a:hover { color: var(--orange); }
.legal-back { margin-top: var(--space-12); }
@media (max-width: 64rem) {
  .header-inner { gap: var(--space-3); }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .header nav { display: none; }
  .header nav.is-open { display: flex; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; align-items: stretch; gap: 0; padding: var(--space-3) var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .header nav a { padding-block: var(--space-3); }
  .context-result .button { flex-shrink: 1; max-width: 18rem; text-align: center; }
  .example-workspace { grid-template-columns: minmax(0,1fr); }
  .source-catalog { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .source-roles-table > div { grid-template-columns: 12rem minmax(0,1fr); gap: var(--space-6); }
}
@media (max-width: 48rem) {
  .integration-layout { gap: var(--space-6); }
  .context-sync-page {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
    display: flex;
    flex-direction: column;
  }
  .context-sync-main,
  .context-sync-side {
    display: contents;
  }
  .context-intro { order: 1; }
  .context-matrix { order: 2; }
  .context-sync-timeline { order: 3; }
  .context-sync-insight { order: 4; }
  .context-sync-timelines,
  .context-sync-insight { padding: var(--space-4); }
  .sync-block { white-space: normal; }
  .sync-axis span:nth-child(4),
  .sync-axis span:nth-child(5) { display: none; }
  .context-result { flex-direction: column; align-items: flex-start; gap: var(--space-5); padding: var(--space-6); }
  .context-result .button { max-width: 100%; }
  .signal-overview { grid-template-columns: minmax(0,1fr); gap: var(--space-6); }
  .signal-overview ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .source-roles-table > div { grid-template-columns: minmax(0,1fr); gap: var(--space-2); }
  .source-roles-table dd { grid-template-columns: 5rem minmax(0,1fr); gap: var(--space-3); }
  .integration-intro-bottom { align-items: flex-start; flex-direction: column; }
  .import-method, .import-steps { grid-template-columns: minmax(0,1fr); gap: var(--space-6); }
}
@media (max-width: 600px) {
  .source-catalog { grid-template-columns: minmax(0,1fr); gap: var(--space-4); }
  .source-catalog > div, .example-evidence, .example-result { padding: var(--space-4); }
  .event-timeline > div { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 3rem; gap: var(--space-2); }
  .source-controls { gap: var(--space-1); }
  .source-controls button { padding-inline: var(--space-2); font-size: var(--text-meta); }
  .evidence-availability { gap: var(--space-1); }
  .nav-toggle, .header .button.compact { padding-inline: var(--space-3); }
}
@media (max-height: 48rem) {
  .compact-story .phase-body > span { display: none; }
  .compact-story .phase { min-height: var(--space-12); align-items: center; }
}

/* Responsive scale: discrete spacing/type steps, never arbitrary fluid padding. */
@media (min-width: 100rem) { :root { --gutter: var(--space-12); } }
@media (min-height: 56.25rem) { :root { --section-pad: var(--space-12); } }
@media (max-width: 75rem) {
  :root { --text-h1: 3rem; --line-h1: 3.5rem; --text-h2: 2rem; --line-h2: 2.5rem; }
  .story-layout { gap: var(--space-8); }
  .product { gap: var(--space-4); }
  .product-intro p, .product-meta .product-meta-zone { display: none; }
  .dashboard-workspace, .trend-stack { gap: var(--space-4); }
  .summary-card { padding: var(--space-3); }
  .metric-note, .metric-viz { display: none; }
  .metric-value { font-size: 1.5rem; line-height: var(--space-8); }
  .pilot-invitation { padding: var(--space-12); }
}
/* This threshold matches the dashboard tab controller in trends.js. */
@media (max-width: 799px) {
  :root { --gutter: var(--space-6); --section-pad: var(--space-6); }
  .header nav { display: none; }
  .product { grid-template-rows: auto auto auto minmax(min-content, 1fr) auto; }
  .dashboard-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); }
  .dashboard-tabs button { min-height: var(--space-10); padding: var(--space-2) var(--space-4); border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: var(--text-small); line-height: var(--line-small); }
  .dashboard-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
  .dashboard-workspace { grid-template-columns: minmax(0, 1fr); }
  .dashboard-workspace[data-view="metrics"] > .trend-stack, .dashboard-workspace[data-view="trends"] > .dashboard-surface { display: none; }
}
@media (max-width: 48rem) {
  :root { --text-h1: 2.25rem; --line-h1: 2.5rem; --text-h2: 1.75rem; --line-h2: 2rem; }
  .hero-story { height: calc(400svh - var(--header)); }
  .story-layout { flex-direction: column-reverse; gap: var(--space-6); }
  .story-left { flex: none; width: 100%; align-self: stretch; }
  .camera-stage { flex: 1 1 auto; min-height: 22svh; }
  .camera-caption { font-size: var(--text-meta); }
  .phase-list { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; border: 0; }
  .phase-list > li + li { border-top: 0; }
  .phase { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: var(--space-1); padding: var(--space-2) var(--space-1); min-height: var(--space-16); border-left: 0; border-bottom: 2px solid var(--line); text-align: center; }
  .phase.active { border-bottom-color: var(--orange); }
  .phase-body > span { display: none; }
  .phase-body strong { font-size: var(--text-small); line-height: var(--line-small); }
  .phase-num { font-size: var(--text-meta); line-height: var(--line-meta); }
  .scene-panel > picture { max-height: 8rem; }
  .scene-panel > img,
  .scene-panel > picture img { max-height: 8rem; min-height: 5rem; }
  .compact-story .process-heading h2 { font-size: var(--text-h2); line-height: var(--line-h2); }
  .natural-flow .camera-stage { flex: none; min-height: 0; height: 32svh; }
  .pilot-invitation { padding: var(--space-8); }
}
@media (max-width: 600px) {
  :root { --gutter: var(--space-4); }
  .header-inner { gap: var(--space-4); }
  .brand img { width: 5rem; }
  .intro { gap: var(--space-6); }
  .intro p { font-size: var(--text-body); line-height: var(--line-body); }
  .product { gap: var(--space-2); }
  .section-heading { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .section-heading > .sample { max-width: var(--copy-max); text-align: left; }
  .product-meta .product-meta-zone { display: none; }
  .dashboard-surface { grid-template-rows: minmax(min-content, 1fr); }
  .metric-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(9, minmax(3rem, 1fr)); gap: var(--space-1); padding: var(--space-1); }
  .summary-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); }
  .metric-value { font-size: var(--text-lead); line-height: var(--line-body); white-space: nowrap; }
  .product-bottom { gap: var(--space-2); }
  .trend-card { padding: var(--space-3); }
  .pilot-invitation { padding: var(--space-6); }
  .pilot-actions { flex-direction: column; }
  footer { gap: var(--space-4); }
  dialog { width: 100%; max-width: none; max-height: calc(100dvh - var(--space-4)); margin: auto 0 0; padding: var(--space-6); padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
}
@media (max-height: 56.25rem) and (min-width: 601px) {
  .metric-viz { display: none; }
}
@media (max-height: 45rem) and (min-width: 601px) {
  :root { --section-pad: var(--space-4); }
  .product { gap: var(--space-3); }
  .product-intro p, .metric-viz, .metric-note { display: none; }
  .summary-card { padding: var(--space-3); }
  .metric-value { font-size: 1.5rem; line-height: var(--space-8); }
  .trend-card { padding: var(--space-3); }
  .pilot-invitation { padding-block: var(--space-8); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-story { height: auto; }
  .hero-sticky { position: relative; top: 0; height: auto; grid-template-rows: auto auto; }
  .camera-stage { min-height: 50svh; }
  .story-progress { display: none; }
  .phase-panel { transform: none; }
}

@media (max-width: 1024px) { .header nav.is-open { display: flex; } }
