@font-face {
  font-family: "Playfair Work Sans";
  src: url("fonts/work-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Darker Grotesque";
  src: url("fonts/darker-grotesque-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Fira Code";
  src: url("fonts/fira-code-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171a18;
  --ink-soft: #303632;
  --muted: #707973;
  --muted-light: #929b95;
  --line: #dce5df;
  --line-dark: #cbd6cf;
  --paper: #ffffff;
  --canvas: #f3f7f4;
  --mint: #c9f7e3;
  --mint-soft: #edfaf4;
  --mint-strong: #22cc91;
  --green: #059669;
  --green-deep: #06664e;
  --red: #d65750;
  --amber: #c79235;
  --violet: #766be3;
  --shadow: 0 22px 65px rgba(32, 55, 43, 0.08);
  --shadow-deep: 0 32px 95px rgba(24, 42, 33, 0.18);
  --display: "Playfair Darker Grotesque", "Avenir Next", "Helvetica Neue", sans-serif;
  --sans: "Playfair Work Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --mono: "Playfair Work Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--mint);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.background-grid {
  position: fixed;
  z-index: -3;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 26, 24, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 24, 0.026) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  filter: blur(105px);
  opacity: 0.24;
  pointer-events: none;
}

.ambient-one {
  top: -20rem;
  right: -11rem;
  background: #a8f1d3;
}

.ambient-two {
  bottom: -24rem;
  left: -12rem;
  background: #d4f4e6;
}

.dashboard {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 64px;
  transition:
    filter 650ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 650ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 400ms ease;
}

.is-locked {
  overflow: hidden;
}

.is-locked .dashboard {
  filter: blur(15px) saturate(0.72);
  transform: scale(0.988);
  opacity: 0.54;
  pointer-events: none;
  user-select: none;
}

.topbar {
  min-height: 114px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(23, 26, 24, 0.12);
}

.brand-lockup,
.gate-brand {
  display: flex;
  align-items: center;
  gap: 17px;
}

.logo-space,
.gate-logo {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.logo-space {
  width: 58px;
  height: 72px;
}

.gate-logo {
  width: 72px;
  height: 89px;
}

.logo-space img,
.gate-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-context {
  display: grid;
  gap: 3px;
}

.brand-context span,
.gate-brand > span,
.partner-lockup span,
.gate-partner span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-context strong {
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.partner-lockup,
.gate-partner {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.partner-lockup {
  padding-right: 24px;
  border-right: 1px solid var(--line-dark);
}

.partner-lockup img {
  display: block;
  width: 82px;
  height: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-pill,
.optimum-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.optimum-pill[hidden] {
  display: none;
}

.status-pill {
  padding: 9px 12px;
  border: 1px solid rgba(5, 150, 105, 0.18);
  background: rgba(237, 250, 244, 0.88);
  color: var(--green-deep);
}

.status-pill i,
.optimum-pill i,
.lineage-label i,
.system-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(34, 204, 145, 0.12);
}

.quiet-button {
  min-height: 37px;
  padding: 0 14px;
  border: 1px solid rgba(23, 26, 24, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: #4e5751;
  font-size: 12px;
  font-weight: 650;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.quiet-button:hover {
  border-color: rgba(23, 26, 24, 0.32);
  background: #fff;
  transform: translateY(-1px);
}

.lineage-strip {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  align-items: center;
  gap: 22px;
  margin-top: 22px;
  padding: 14px 17px;
  border: 1px solid rgba(5, 150, 105, 0.16);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 40px rgba(32, 55, 43, 0.035);
  backdrop-filter: blur(12px);
}

.lineage-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lineage-flow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 21px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.lineage-node {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.lineage-node img {
  width: 57px;
  height: auto;
}

.lineage-node strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.lineage-node small {
  color: var(--muted);
  font-size: 10px;
}

.lineage-arrow {
  color: var(--mint-strong);
  font-family: var(--mono);
  font-size: 18px;
}

.lineage-strip > p {
  margin: 0;
  color: #606962;
  font-size: 11px;
  line-height: 1.55;
}

.headline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(330px, 0.72fr);
  gap: 18px;
  padding-top: 18px;
}

.hero-card,
.snapshot-card,
.paper-card,
.metric-card {
  border: 1px solid rgba(23, 26, 24, 0.11);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 525px;
  overflow: hidden;
  padding: 34px;
  border-radius: 25px;
  background:
    radial-gradient(circle at 89% 17%, rgba(201, 247, 227, 0.72), transparent 22rem),
    rgba(255, 255, 255, 0.96);
}

.hero-card::after {
  position: absolute;
  z-index: 0;
  right: -70px;
  bottom: -105px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(5, 150, 105, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px rgba(5, 150, 105, 0.025),
    0 0 0 68px rgba(5, 150, 105, 0.018);
  content: "";
  pointer-events: none;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-heading,
.snapshot-title,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-heading h1 {
  margin: 10px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(48px, 5.2vw, 72px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.hero-heading h1 small {
  color: #78817b;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-heading h1 em {
  margin: 0 7px;
  color: var(--mint-strong);
  font-family: var(--display);
  font-style: normal;
  font-weight: 450;
}

.hero-subtitle {
  max-width: 550px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.optimum-pill {
  padding: 9px 12px;
  background: var(--mint);
  color: var(--green-deep);
}

.hero-core {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.78fr);
  align-items: end;
  gap: 28px;
  margin-top: 31px;
}

.strategy-picker {
  display: grid;
  gap: 17px;
  min-height: 264px;
  padding: 23px;
  align-content: start;
  border: 1px solid rgba(23, 26, 24, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(rgba(23, 26, 24, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 24, 0.024) 1px, transparent 1px),
    rgba(248, 251, 249, 0.92);
  background-size: 24px 24px;
}

.picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.picker-heading > span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.picker-heading small {
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.picker-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: start;
  gap: 12px;
}

.picker-row > span {
  padding-top: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-controls,
.target-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-controls button,
.target-controls button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d7e0da;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #555f59;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 550;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.pill-controls button:hover,
.target-controls button:hover {
  border-color: rgba(5, 150, 105, 0.48);
  transform: translateY(-1px);
}

.pill-controls button.active,
.target-controls button.active {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 0 -2px 0 var(--mint-strong);
  color: #fff;
}

.coordinate-note {
  display: flex;
  gap: 8px;
  margin: 3px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #79827c;
  font-size: 10px;
  line-height: 1.55;
}

.coordinate-note i {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  flex: 0 0 auto;
  border: 1px solid var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #fff;
  background: var(--mint-strong);
}

.return-panel {
  display: grid;
  justify-items: center;
  align-content: end;
  text-align: center;
}

.return-dial {
  position: relative;
  display: grid;
  width: min(252px, 100%);
  aspect-ratio: 1;
  place-items: center;
  color: var(--green);
}

.return-dial svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.return-dial circle {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.dial-grid {
  stroke: rgba(23, 26, 24, 0.09);
  stroke-width: 1;
  stroke-dasharray: 0.4 3.6;
}

.dial-ticks {
  stroke: rgba(23, 26, 24, 0.12);
  stroke-width: 5;
  stroke-dasharray: 0.42 3.58;
}

.dial-track {
  stroke: #e8eee9;
  stroke-width: 13;
}

.dial-arc {
  stroke: var(--mint-strong);
  stroke-width: 13;
  stroke-linecap: round;
  filter: drop-shadow(0 6px 9px rgba(5, 150, 105, 0.2));
  transition: stroke-dasharray 420ms cubic-bezier(0.22, 1, 0.36, 1), stroke 180ms ease;
}

.return-dial.negative .dial-arc {
  stroke: var(--red);
  filter: drop-shadow(0 6px 9px rgba(214, 87, 80, 0.2));
}

.dial-value {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
}

.dial-value span,
.dial-value small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dial-value strong {
  margin: 2px 0 0;
  color: var(--green-deep);
  font-family: var(--display);
  font-size: 55px;
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.dial-value strong.negative {
  color: var(--red);
}

.dial-rank {
  margin: 8px 0 0;
  padding: 6px 9px;
  border: 1px solid rgba(5, 150, 105, 0.15);
  border-radius: 999px;
  background: rgba(237, 250, 244, 0.84);
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 550;
}

.return-panel > span {
  max-width: 260px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.snapshot-card {
  position: relative;
  min-height: 525px;
  overflow: hidden;
  padding: 30px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 25px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    #171d1a;
  background-size: 26px 26px;
  box-shadow: 0 26px 75px rgba(17, 29, 23, 0.18);
  color: #fff;
}

.snapshot-card::after {
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(34, 204, 145, 0.11);
  filter: blur(35px);
  content: "";
  pointer-events: none;
}

.snapshot-card > * {
  position: relative;
  z-index: 1;
}

.snapshot-title h2,
.section-heading h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1;
}

.snapshot-title .eyebrow {
  color: #73e4b8;
}

.lock-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(115, 228, 184, 0.2);
  border-radius: 12px;
  background: rgba(115, 228, 184, 0.09);
  color: #73e4b8;
  font-family: var(--mono);
  font-size: 16px;
}

.system-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 25px;
  padding: 8px 11px;
  border: 1px solid rgba(115, 228, 184, 0.14);
  border-radius: 9px;
  background: rgba(115, 228, 184, 0.06);
  color: #73e4b8;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.snapshot-card dl {
  display: grid;
  gap: 0;
  margin: 23px 0 0;
}

.snapshot-card dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.snapshot-card dt {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.snapshot-card dd {
  margin: 0;
  max-width: 190px;
  color: rgba(255, 255, 255, 0.92);
  text-align: right;
  font-size: 11px;
  font-weight: 620;
}

.privacy-note {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.privacy-note > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #73e4b8;
}

.privacy-note p {
  margin: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  line-height: 1.65;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  position: relative;
  display: grid;
  min-height: 160px;
  overflow: hidden;
  padding: 22px;
  align-content: space-between;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(32, 55, 43, 0.045);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.metric-card::before {
  position: absolute;
  top: 0;
  left: 22px;
  width: 42px;
  height: 2px;
  background: var(--mint-strong);
  content: "";
}

.metric-card:hover {
  border-color: rgba(5, 150, 105, 0.24);
  box-shadow: 0 18px 45px rgba(32, 55, 43, 0.075);
  transform: translateY(-2px);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.metric-head > span {
  color: #a0aaa3;
  font-family: var(--mono);
  font-size: 9px;
}

.metric-card > strong {
  margin: 18px 0 5px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 39px;
  font-weight: 740;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.metric-card > strong.negative,
.number.negative {
  color: var(--red);
}

.metric-card > span {
  color: var(--muted-light);
  font-size: 10px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(345px, 0.72fr);
  gap: 18px;
  margin-top: 18px;
}

.paper-card {
  border-radius: 22px;
  box-shadow: 0 14px 42px rgba(32, 55, 43, 0.045);
}

.chart-card,
.outcome-card,
.table-card {
  padding: 28px;
}

.section-heading > span,
.section-heading > p,
.table-heading > p {
  margin: 3px 0 0;
  color: var(--muted-light);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
  margin-top: 21px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #667069;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 550;
}

.chart-legend i,
.composition-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a4ada7;
}

.chart-swatch-0 { background: #22cc91 !important; }
.chart-swatch-1 { background: #0b7d62 !important; }
.chart-swatch-2 { background: #26312b !important; }
.chart-swatch-3 { background: #766be3 !important; }
.chart-swatch-4 { background: #c79235 !important; }
.chart-swatch-5 { background: #d65750 !important; }

.outcome-swatch-0 { background: #22cc91 !important; }
.outcome-swatch-1 { background: #d65750 !important; }
.outcome-swatch-2 { background: #26312b !important; }
.outcome-swatch-3 { background: #c79235 !important; }
.outcome-swatch-4 { background: #aab3ad !important; }

.chart-shell {
  margin-top: 6px;
  padding: 8px 6px 0;
  border: 1px solid rgba(23, 26, 24, 0.07);
  border-radius: 16px;
  background:
    linear-gradient(rgba(23, 26, 24, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 26, 24, 0.022) 1px, transparent 1px),
    #fbfdfc;
  background-size: 30px 30px;
}

#responseChart {
  display: block;
  width: 100%;
  min-height: 278px;
  overflow: visible;
}

#responseChart .grid-line {
  stroke: #e5ebe7;
  stroke-width: 1;
}

#responseChart .zero-line {
  stroke: #aeb9b2;
  stroke-dasharray: 4 5;
}

#responseChart .axis-label,
#responseChart .axis-title {
  fill: #8a948e;
  font-family: var(--mono);
  font-size: 9px;
}

#responseChart .axis-title {
  fill: #667069;
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#responseChart .series-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.78;
}

#responseChart .series-point {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 2;
  transition: opacity 150ms ease;
}

#responseChart .point-halo {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.9;
}

#responseChart .series-point.selected {
  stroke: var(--ink);
  stroke-width: 3;
}

.outcome-layout {
  display: grid;
  grid-template-columns: minmax(145px, 0.78fr) minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
  margin-top: 31px;
}

.composition-ring {
  display: grid;
  width: min(190px, 100%);
  aspect-ratio: 1;
  place-items: center;
}

.composition-ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.composition-track,
.composition-segment {
  fill: none;
  stroke-width: 14;
}

.composition-track {
  stroke: #edf2ee;
}

.composition-segment {
  stroke-linecap: butt;
  transition: stroke-dasharray 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.composition-total {
  fill: var(--ink);
  font-family: var(--display);
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.composition-caption {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.composition-legend {
  display: grid;
  gap: 9px;
}

.composition-legend > div {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 7px;
  color: #667069;
  font-size: 10px;
}

.composition-legend strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 550;
}

.method-note {
  margin: 25px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.6;
}

.table-card {
  margin-top: 18px;
}

.table-heading {
  align-items: flex-end;
  margin-bottom: 19px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(23, 26, 24, 0.075);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid #e7ece9;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f7faf8;
  color: #7d8781;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover,
tbody tr.selected {
  background: var(--mint-soft);
}

tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--mint-strong);
}

.number {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--green-deep);
}

.row-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 7px;
  background: #edf1ee;
  color: #69736d;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 550;
}

.row-status.complete {
  background: #e4f8ef;
  color: var(--green-deep);
}

footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 4px 0;
  color: #7e8882;
  font-size: 9px;
}

footer p {
  max-width: 860px;
  margin: 0;
  line-height: 1.65;
}

footer span {
  font-family: var(--mono);
  white-space: nowrap;
}

.access-gate {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 26px;
  place-items: center;
  min-height: 100dvh;
  background: rgba(241, 246, 242, 0.48);
  backdrop-filter: blur(5px);
  transition: opacity 350ms ease, visibility 350ms ease;
}

.access-gate[hidden] {
  display: none;
}

.gate-card {
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid rgba(23, 26, 24, 0.13);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.975);
  box-shadow: var(--shadow-deep);
}

.gate-brand-row {
  display: flex;
  min-height: 92px;
  padding: 10px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.gate-brand > span {
  max-width: 120px;
  color: #667069;
  line-height: 1.5;
}

.gate-partner {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.gate-partner img {
  display: block;
  width: 96px;
  height: auto;
}

.gate-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 35px 36px 30px;
}

.gate-story {
  align-self: center;
}

.gate-story h2 {
  max-width: 560px;
  margin: 13px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(47px, 6vw, 58px);
  font-weight: 790;
  letter-spacing: -0.057em;
  line-height: 0.9;
}

.gate-story h2 span {
  color: var(--green);
}

.gate-copy {
  max-width: 525px;
  margin: 18px 0 0;
  color: #5f6862;
  font-size: 14px;
  line-height: 1.65;
}

.gate-lineage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
}

.gate-lineage span {
  padding: 6px 8px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: #fff;
  color: #5e6861;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gate-lineage i {
  color: var(--mint-strong);
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
}

.gate-form-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(5, 150, 105, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(rgba(5, 150, 105, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(5, 150, 105, 0.035) 1px, transparent 1px),
    #f0faf5;
  background-size: 24px 24px;
}

.panel-kicker {
  margin: 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gate-form-panel h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 730;
  letter-spacing: -0.035em;
  line-height: 1;
}

.gate-form-panel > p:not(.panel-kicker) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

#accessForm {
  display: grid;
  gap: 9px;
  margin-top: 23px;
}

#accessForm label {
  color: #465049;
  font-size: 11px;
  font-weight: 680;
}

#viewerEmail {
  width: 100%;
  height: 56px;
  padding: 0 15px;
  border: 1px solid #cbd7cf;
  border-radius: 11px;
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

#viewerEmail::placeholder {
  color: #98a19b;
}

#viewerEmail:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(34, 204, 145, 0.14);
}

#accessButton {
  display: flex;
  width: 100%;
  height: 56px;
  margin-top: 3px;
  padding: 0 9px 0 17px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  box-shadow: 0 14px 28px rgba(23, 26, 24, 0.17);
  color: #fff;
  font-size: 13px;
  font-weight: 680;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

#accessButton b {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
}

#accessButton:hover:not(:disabled) {
  background: #252a27;
  box-shadow: 0 18px 34px rgba(23, 26, 24, 0.22);
  transform: translateY(-1px);
}

#accessButton:disabled {
  cursor: wait;
  opacity: 0.72;
}

.gate-error {
  min-height: 19px;
  margin: 2px 0 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 650;
}

.access-properties {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.access-properties span {
  padding: 5px 7px;
  border: 1px solid rgba(5, 150, 105, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 550;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tracking-note {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
  color: #616a64;
  font-size: 10px;
  font-weight: 560;
  line-height: 1.55;
}

.tracking-note > span {
  color: var(--green);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

noscript {
  display: block;
  padding: 0 28px 16px;
  color: var(--red);
  font-size: 10px;
}

button:focus-visible,
input:focus-visible,
tbody tr:focus-visible,
#responseChart .series-point:focus-visible {
  outline: 3px solid rgba(34, 204, 145, 0.38);
  outline-offset: 2px;
}

@media (max-width: 1120px) {
  .headline-grid,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .snapshot-card {
    min-height: auto;
  }

  .snapshot-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 25px;
  }

  .outcome-layout {
    grid-template-columns: 190px 1fr;
  }
}

@media (max-width: 930px) {
  .lineage-strip {
    grid-template-columns: auto 1fr;
  }

  .lineage-strip > p {
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .lineage-flow {
    justify-self: end;
    padding-right: 0;
    border-right: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {
  .topbar {
    min-height: 102px;
  }

  .brand-context,
  .partner-lockup span,
  .status-pill {
    display: none;
  }

  .partner-lockup {
    padding-right: 14px;
  }

  .hero-core {
    grid-template-columns: 1fr;
  }

  .return-panel {
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }

  .section-heading {
    display: grid;
  }
}

@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .dashboard {
    width: calc(100% - 18px);
    padding-bottom: calc(38px + env(safe-area-inset-bottom));
  }

  .topbar-right {
    gap: 10px;
  }

  .quiet-button,
  .pill-controls button,
  .target-controls button {
    min-height: 44px;
  }

  .partner-lockup {
    display: none;
  }

  .lineage-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .lineage-flow {
    justify-self: stretch;
    justify-content: space-between;
    padding: 11px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .lineage-node {
    display: grid;
    gap: 3px;
  }

  .lineage-node small {
    font-size: 8px;
  }

  .hero-card,
  .snapshot-card,
  .paper-card {
    padding: 19px;
    border-radius: 18px;
  }

  .hero-heading {
    display: grid;
  }

  .hero-heading h1 {
    font-size: clamp(40px, 13vw, 47px);
    line-height: 0.94;
  }

  .hero-heading h1 small {
    display: none;
  }

  .optimum-pill {
    justify-self: start;
  }

  .strategy-picker {
    padding: 18px;
  }

  .picker-heading {
    display: grid;
  }

  .picker-row {
    grid-template-columns: 1fr;
  }

  .picker-row > span {
    padding-top: 0;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 145px;
  }

  .snapshot-card dl {
    grid-template-columns: 1fr;
  }

  .outcome-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .composition-legend {
    width: 100%;
  }

  .table-heading,
  footer {
    display: grid;
  }

  footer span {
    white-space: normal;
  }

  .table-scroll,
  .chart-shell {
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll {
    margin-inline: -19px;
    padding-inline: 19px;
  }

  .access-gate {
    min-height: 100dvh;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    place-items: start center;
  }

  .gate-card {
    margin: auto 0;
    border-radius: 20px;
  }

  .gate-brand-row {
    min-height: 78px;
    padding: 8px 16px;
  }

  .gate-logo {
    width: 49px;
    height: 61px;
  }

  .gate-brand > span,
  .gate-partner span {
    display: none;
  }

  .gate-partner {
    padding-left: 16px;
  }

  .gate-partner img {
    width: 75px;
  }

  .gate-body {
    gap: 21px;
    padding: 26px 17px 20px;
  }

  .gate-story h2 {
    margin-top: 10px;
    font-size: clamp(40px, 13vw, 50px);
    line-height: 0.91;
  }

  .gate-copy {
    margin-top: 15px;
    font-size: 12px;
  }

  .gate-lineage {
    margin-top: 16px;
  }

  .gate-lineage span {
    padding: 5px 6px;
    font-size: 7px;
  }

  .gate-form-panel {
    padding: 19px 16px 16px;
    border-radius: 16px;
  }

  .gate-form-panel h3 {
    font-size: 29px;
  }

  #accessForm {
    margin-top: 18px;
  }

  #viewerEmail {
    height: 52px;
    font-size: 16px;
  }

  #accessButton {
    height: 52px;
  }

  .tracking-note {
    padding: 14px 17px calc(14px + env(safe-area-inset-bottom));
    font-size: 9px;
  }
}

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

/* Refined motion system: quiet enough for a report, alive enough for a product. */
@keyframes playfairReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes playfairPulse {
  0%, 42% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.22); }
  78%, 100% { box-shadow: 0 0 0 9px rgba(5, 150, 105, 0); }
}

@keyframes playfairDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -12px, 0) scale(1.04); }
}

.ambient-one { animation: playfairDrift 13s ease-in-out infinite; }
.ambient-two { animation: playfairDrift 17s ease-in-out -5s infinite reverse; }
.status-pill i { animation: playfairPulse 2.8s ease-out infinite; }
.gate-card { animation: playfairReveal 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }

body:not(.is-locked) .headline-grid > *,
body:not(.is-locked) .metric-card,
body:not(.is-locked) .analysis-grid > *,
body:not(.is-locked) .table-card {
  animation: playfairReveal 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

body:not(.is-locked) .headline-grid > :nth-child(2) { animation-delay: 0.06s; }
body:not(.is-locked) .metric-card:nth-child(1) { animation-delay: 0.1s; }
body:not(.is-locked) .metric-card:nth-child(2) { animation-delay: 0.15s; }
body:not(.is-locked) .metric-card:nth-child(3) { animation-delay: 0.2s; }
body:not(.is-locked) .metric-card:nth-child(4) { animation-delay: 0.25s; }
body:not(.is-locked) .analysis-grid > :nth-child(1) { animation-delay: 0.28s; }
body:not(.is-locked) .analysis-grid > :nth-child(2) { animation-delay: 0.33s; }
body:not(.is-locked) .table-card { animation-delay: 0.38s; }

.paper-card,
.snapshot-card,
.hero-card {
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.paper-card:hover,
.snapshot-card:hover {
  transform: translateY(-3px);
  border-color: #c1d7c8;
  box-shadow: 0 27px 65px rgba(32, 55, 43, 0.1);
}

.dial-arc,
.series-line,
.series-point,
.composition-ring {
  transition: all 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ambient-one,
  .ambient-two,
  .status-pill i,
  .gate-card,
  body:not(.is-locked) .headline-grid > *,
  body:not(.is-locked) .metric-card,
  body:not(.is-locked) .analysis-grid > *,
  body:not(.is-locked) .table-card {
    animation: none !important;
  }
}
