:root {
  --paper: #f5f1e8;
  --paper-2: #ece6da;
  --white: #fffef9;
  --ink: #17211e;
  --muted: #65706b;
  --line: rgba(23, 33, 30, .14);
  --green: #174f45;
  --green-2: #2d7466;
  --green-soft: #dfece6;
  --rust: #a9492f;
  --rust-soft: #f4e4de;
  --amber: #9a6a24;
  --amber-soft: #f4ead7;
  --blue: #315f84;
  --blue-soft: #e0eaf1;
  --shadow: 0 18px 50px rgba(31, 45, 39, .08);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 95px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, rgba(45, 116, 102, .06), transparent 27rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(49, 95, 132, .42);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: -4rem;
  left: 1rem;
  padding: .7rem 1rem;
  color: white;
  background: var(--green);
  border-radius: .35rem;
}
.skip-link:focus { top: 1rem; }
.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;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 232, .92);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 30px;
  height: 30px;
  padding: 6px;
  border: 1px solid rgba(23, 79, 69, .3);
  border-radius: 50%;
}
.brand-mark i { display: block; width: 3px; border-radius: 2px; background: var(--green); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; }
.primary-nav { display: flex; justify-content: center; gap: clamp(.55rem, 2vw, 1.5rem); }
.primary-nav a {
  padding: .5rem .25rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-nav a:hover, .primary-nav a.active { color: var(--green); }
.top-actions { display: flex; align-items: center; gap: .7rem; }
.state-pill, .evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  width: max-content;
  padding: .38rem .62rem;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(23, 79, 69, .18);
  border-radius: 99px;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-stale { color: var(--amber); background: var(--amber-soft); }
.state-setup { color: var(--amber); background: var(--amber-soft); }
.state-updating, .state-local { color: var(--blue); background: var(--blue-soft); }
.state-insufficient, .state-offline { color: var(--rust); background: var(--rust-soft); }
.state-demo { color: var(--blue); background: var(--blue-soft); }
.state-connecting { color: var(--muted); background: var(--paper-2); }

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .72rem 1rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  font-size: .78rem;
  font-weight: 760;
  cursor: pointer;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { color: white; background: var(--green); }
.button-secondary, .button-quiet { color: var(--ink); border-color: var(--line); background: rgba(255, 254, 249, .7); }
.button.compact { min-height: 37px; padding: .5rem .7rem; font-size: .7rem; }

main, footer { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 60px;
  align-items: end;
  padding: 42px 0 30px;
}
.eyebrow, .panel-kicker {
  margin: 0;
  color: var(--green-2);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 900px;
  margin: 10px 0 18px;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.1vw, 3.9rem);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .95;
}
.lede { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: .94rem; }
.freshness-card {
  display: flex;
  flex-direction: column;
  min-width: 210px;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--green);
  background: rgba(255, 254, 249, .6);
}
.freshness-card span, .freshness-card small { color: var(--muted); font-size: .68rem; }
.freshness-card strong { margin: .15rem 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; }

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 28px;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(154, 106, 36, .25);
  border-radius: .45rem;
  background: var(--amber-soft);
}
.notice strong { font-size: .86rem; }
.notice p { margin: .1rem 0 0; color: #735927; font-size: .78rem; }
.notice-demo { border-color: rgba(49, 95, 132, .25); background: var(--blue-soft); }
.notice-demo p { color: #31536d; }
.notice-error { border-color: rgba(169, 73, 47, .25); background: var(--rust-soft); }
.notice-info { border-color: rgba(49, 95, 132, .25); background: var(--blue-soft); }
.notice-info p { color: #31536d; }
.notice-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.companion-setup {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(420px, 1.4fr);
  gap: 32px 48px;
  margin: 0 0 34px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(255, 254, 249, .82);
  box-shadow: var(--shadow);
}
.companion-setup h2 {
  margin: 7px 0 14px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}
.companion-setup-copy p:last-child,
.companion-setup-actions p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}
.companion-steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  counter-reset: setup-step;
  list-style: none;
}
.companion-steps li {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 46px;
  padding-left: 54px;
  counter-increment: setup-step;
}
.companion-steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
  content: counter(setup-step);
  font-weight: 850;
}
.companion-steps strong { font-size: .85rem; }
.companion-steps span { color: var(--muted); font-size: .76rem; }
.companion-steps .button {
  justify-self: start;
  margin-top: 4px;
}
.companion-steps .button-primary { color: white; }
.installer-details {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}
.installer-details span {
  overflow-wrap: anywhere;
}
.installer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 13px;
  margin-top: 4px;
  font-size: .72rem;
}
.installer-links a {
  color: var(--green);
  font-weight: 750;
}
.installer-unavailable {
  display: block;
  padding: .65rem .8rem;
  border-left: 3px solid var(--amber);
  color: #6f5011 !important;
  background: var(--amber-soft);
}
.companion-setup-actions {
  grid-column: 2;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.safe-close-guidance {
  padding-left: 10px;
  border-left: 3px solid var(--blue);
}

.setup-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr) minmax(220px, .65fr);
  gap: 28px;
  align-items: center;
  margin: 0 0 30px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(255, 254, 249, .72);
}
.setup-card.needs-attention { border-color: rgba(154, 106, 36, .32); }
.setup-copy h2 {
  margin: 5px 0 9px;
  font-size: 1.65rem;
  letter-spacing: -.025em;
}
.setup-copy > p:last-child,
.setup-actions p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}
.setup-checks {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.setup-checks li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: .76rem;
}
.setup-checks li::before {
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  content: "✓";
  font-size: .65rem;
  font-weight: 850;
  line-height: 14px;
  text-align: center;
}
.setup-checks li.missing::before {
  border-color: rgba(154, 106, 36, .35);
  color: var(--amber);
  content: "!";
}
.setup-actions { display: grid; gap: 10px; justify-items: start; }

.journey-disclosure {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(255, 254, 249, .55);
}
.journey-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
}
.journey-disclosure > summary::-webkit-details-marker { display: none; }
.journey-disclosure > summary::after {
  color: var(--green);
  content: "Show";
  font-size: .72rem;
  font-weight: 800;
}
.journey-disclosure[open] > summary::after { content: "Hide"; }
.journey-disclosure > summary strong {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
}
.journey-disclosure > .data-panels,
.journey-disclosure > .sync-status-panel,
.journey-disclosure > .backend-panel,
.journey-disclosure > .result-panels {
  margin-right: 24px;
  margin-left: 24px;
}
.journey-disclosure > .result-panels { margin-bottom: 24px; }

.contribution-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  margin: 8px 0 56px;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid rgba(23, 79, 69, .28);
  border-top: 5px solid var(--green);
  border-radius: .65rem;
  background:
    radial-gradient(circle at 8% 10%, rgba(223, 236, 230, .9), transparent 52%),
    rgba(255, 254, 249, .86);
  box-shadow: 0 18px 46px rgba(21, 40, 35, .07);
}
.contribution-cta h2 { font-size: clamp(2.5rem, 4.5vw, 4.25rem); }
.contribution-cta-copy > p:not(.eyebrow) {
  max-width: 58ch;
  margin: 18px 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.65;
}
.contribution-categories {
  max-width: 58ch;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.contribution-categories summary {
  color: var(--green);
  cursor: pointer;
  font-size: .74rem;
  font-weight: 800;
}
.contribution-categories div {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.contribution-categories p {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
}
.contribution-cta-action {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: rgba(255, 254, 249, .9);
}
.contribution-invite {
  grid-template-columns: 1fr;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.contribution-primary-consent {
  margin-top: 16px;
  border-color: rgba(23, 79, 69, .3);
  background: var(--green-soft);
}
.contribution-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.automatic-contribution-status {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.automatic-contribution-status > div {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.automatic-contribution-status p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .7rem;
}

body.first-run [data-requires-evidence],
body.needs-local-setup [data-requires-evidence],
body.first-run .journey-progressive,
body.needs-local-setup .journey-progressive {
  display: none !important;
}

.dashboard-section { padding: 56px 0; border-top: 1px solid var(--line); }
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 50px;
  align-items: end;
  margin-bottom: 28px;
}
.section-heading.split { grid-template-columns: 1fr auto; }
h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 3.2vw, 3.05rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1;
}
.section-heading > p { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(255, 254, 249, .72);
  box-shadow: 0 12px 34px rgba(31, 45, 39, .045);
}
.panel-heading, .chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.panel h3, .chart-heading h3 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.annotation { color: var(--muted); font-size: .76rem; }
.info-button {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: help;
}
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: rgba(255, 254, 249, .76);
}
.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
  content: "";
}
.metric-card.stale::before { background: var(--amber); }
.metric-card.insufficient::before { background: var(--rust); }
.metric-card-header { display: flex; justify-content: space-between; gap: 1rem; }
.metric-card .metric-name { color: var(--muted); font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.metric-card .metric-value { display: block; margin: 22px 0 8px; font-family: var(--serif); font-size: 3.2rem; font-weight: 400; line-height: .9; }
.metric-card .metric-value small { font-family: var(--sans); font-size: .9rem; }
.metric-card p { margin-bottom: 0; color: var(--muted); font-size: .75rem; }
.mini-progress { height: 6px; margin: 22px 0 11px; overflow: hidden; border-radius: 9px; background: var(--paper-2); }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.metric-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .67rem; }
.skeleton-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: linear-gradient(100deg, rgba(255,255,255,.25) 35%, rgba(255,255,255,.8) 50%, rgba(255,255,255,.25) 65%);
  background-size: 300% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position-x: -150%; } }

.cost-total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 20px 0; border-top: 1px solid var(--line); }
.cost-total span { color: var(--muted); font-size: .75rem; }
.cost-total strong { font-family: var(--serif); font-size: 2.8rem; font-weight: 500; }
.cost-total small { grid-column: 1 / -1; color: var(--muted); font-size: .7rem; }
.component-list { display: grid; gap: 10px; }
.component-row { display: grid; grid-template-columns: 145px 1fr auto; gap: 12px; align-items: center; font-size: .73rem; }
.component-row > span { color: var(--muted); }
.component-row > strong { min-width: 66px; text-align: right; }
.component-track { height: 7px; overflow: hidden; border-radius: 10px; background: var(--paper-2); }
.component-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.component-row:nth-child(2) i { background: var(--green-2); }
.component-row:nth-child(3) i { background: var(--rust); }
.component-row:nth-child(4) i { background: var(--amber); }

.comparison-visual { display: grid; gap: 20px; margin: 35px 0 28px; }
.comparison-row { display: grid; grid-template-columns: 170px 1fr 64px; gap: 12px; align-items: center; font-size: .73rem; }
.comparison-row span { color: var(--muted); }
.comparison-row strong { text-align: right; }
.bar-track { height: 13px; overflow: hidden; border-radius: 10px; background: var(--paper-2); }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.comparison-row.calculated .bar-track i { background: var(--rust); }
.plain-result { margin: 0; padding: 15px 17px; color: #31536d; background: var(--blue-soft); border-radius: .35rem; font-size: .8rem; }
.calibration-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: rgba(255,255,255,.38);
}
.calibration-facts div { min-width: 0; padding: 14px 15px; border-right: 1px solid var(--line); }
.calibration-facts div:last-child { border-right: 0; }
.calibration-facts dt { color: var(--muted); font-size: .62rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.calibration-facts dd { margin: 7px 0 0; font-size: .78rem; font-weight: 750; overflow-wrap: anywhere; }
.calibration-explanation { margin: 12px 0 0; }

.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: .4rem; background: rgba(255,255,255,.5); }
.segmented-control button { padding: .5rem .7rem; border: 0; border-radius: .25rem; color: var(--muted); background: transparent; font-size: .7rem; font-weight: 750; cursor: pointer; }
.segmented-control button.active { color: white; background: var(--green); }
.timeline-controls,
.chart-control-stack,
.calibration-controls { display: grid; justify-items: end; gap: 7px; }
.control-label {
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.chart-navigation { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.chart-navigation .button { min-height: 30px; }
.chart-panel { padding: 30px; }
.chart-heading p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.legend { display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: .68rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 20px; height: 3px; background: var(--green); }
.legend-dot.expected { background: var(--rust); }
.chart-empty { display: grid; place-items: center; min-height: 310px; color: var(--muted); background: rgba(236, 230, 218, .35); border: 1px dashed var(--line); border-radius: .4rem; text-align: center; }
.chart-empty p { margin: 0; font-size: .78rem; }
.chart-empty.small { min-height: 215px; font-size: .8rem; }
.chart-shell { width: 100%; overflow-x: auto; }
.chart-shell.interactive-chart { cursor: grab; touch-action: pan-y; outline: none; }
.chart-shell.interactive-chart:focus-visible { outline: 3px solid rgba(38, 107, 91, .36); outline-offset: 4px; }
.chart-shell.interactive-chart.is-panning { cursor: grabbing; user-select: none; }
.chart-shell svg { display: block; width: 100%; min-width: 720px; height: 350px; overflow: visible; }
.chart-shell.compact-chart svg { min-width: 440px; height: 235px; }
.chart-grid { stroke: rgba(23, 33, 30, .1); stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-family: var(--sans); font-size: 10px; }
.chart-line-observed { fill: none; stroke: var(--green); stroke-width: 2.7; vector-effect: non-scaling-stroke; }
.chart-line-expected { fill: none; stroke: var(--rust); stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.chart-line-value { fill: none; stroke: var(--blue); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-point { vector-effect: non-scaling-stroke; }
.chart-point.chart-line-value { fill: var(--white); stroke: var(--blue); }
.chart-line-weekly-center {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.chart-point-weekly-mature {
  fill: var(--blue);
  stroke: var(--white);
  stroke-width: 2;
}
.chart-point-weekly-partial {
  fill: var(--white);
  stroke: var(--rust);
  stroke-width: 2.4;
}
.chart-line-allowance {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.3;
  stroke-dasharray: 5 3;
  vector-effect: non-scaling-stroke;
}
.legend-dot.cost { background: var(--blue); }
.legend-dot.allowance { background: var(--green); }
.compact-legend { justify-content: flex-end; margin-top: 8px; }
.chart-area-confidence { fill: rgba(49, 95, 132, .14); }
.chart-status-missing { fill: rgba(154, 102, 50, .14); }
.chart-status-reset { fill: rgba(49, 95, 132, .14); }
.chart-status-ambiguous { fill: rgba(131, 73, 55, .13); }
.legend-dot.chart-status-missing { background: rgba(154, 102, 50, .72); }
.legend-dot.chart-status-reset { background: rgba(49, 95, 132, .72); }
.legend-dot.chart-status-ambiguous { background: rgba(131, 73, 55, .72); }
.chart-zero { stroke: var(--muted); stroke-dasharray: 5 5; }
.chart-point-observed { fill: var(--green); }
.chart-point-expected { fill: var(--rust); }
.chart-point-value { fill: var(--blue); }
.chart-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); }
.chart-summary-grid > div { padding: 13px 15px; background: var(--white); }
.chart-summary-grid span { display: block; color: var(--muted); font-size: .64rem; text-transform: uppercase; }
.chart-summary-grid strong { font-size: .84rem; }
.timeline-confidence { margin: 13px 0 0; padding: 10px 12px; color: var(--muted); border-left: 3px solid var(--line); background: rgba(236, 230, 218, .34); font-size: .75rem; }
.timeline-confidence.low { color: #784d25; border-left-color: var(--rust); background: var(--rust-soft); }
.lower-charts { margin-top: 18px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: .35rem; }
table { width: 100%; border-collapse: collapse; font-size: .73rem; }
th { color: var(--muted); background: rgba(236, 230, 218, .45); font-size: .62rem; letter-spacing: .05em; text-transform: uppercase; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.empty-cell { padding: 30px; color: var(--muted); text-align: center; }
.positive { color: var(--rust); font-weight: 750; }
.negative { color: var(--green); font-weight: 750; }

.weekly-hero {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  gap: 60px;
  align-items: center;
  margin-bottom: 18px;
  padding: 34px;
  color: white;
  background: var(--green);
  border-radius: .55rem;
}
.weekly-hero > div:first-child { display: flex; flex-direction: column; }
.weekly-hero span, .weekly-hero small { color: rgba(255,255,255,.7); font-size: .72rem; }
.weekly-hero > div:first-child strong { margin: .2rem 0; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); font-weight: 400; line-height: 1; }
.confidence-label { display: flex; justify-content: space-between; }
.confidence-label strong { font-size: .76rem; }
.meter-track { height: 9px; margin: 9px 0 12px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.18); }
.meter-track i { display: block; height: 100%; border-radius: inherit; background: #e6bd79; }
.confidence-meter p { margin: 0; color: rgba(255,255,255,.76); font-size: .78rem; }
.weekly-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.weekly-stat { padding: 17px; border: 1px solid var(--line); border-radius: .35rem; }
.weekly-stat span { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.weekly-stat strong { display: block; margin-top: 5px; font-family: var(--serif); font-size: 1.55rem; font-weight: 500; }
.weekly-trend { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--paper-soft); }
.weekly-trend strong { display: block; margin-bottom: .35rem; }
.weekly-trend p { margin: 0; color: var(--muted); line-height: 1.55; }
.weekly-table-panel { margin-top: 18px; }
.weekly-history-panel,
.weekly-validation-panel { margin-top: 18px; }
.weekly-history-panel .panel-heading { align-items: flex-start; }
.weekly-chart-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.weekly-legend { margin: 4px 0 10px; }
.weekly-history-chart svg { min-width: 1100px; height: 420px; }
.weekly-validation-panel .weekly-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.legend-dot.weekly-center { background: var(--green); }
.legend-dot.weekly-range { height: 9px; background: rgba(49, 95, 132, .2); }
.legend-dot.weekly-mature {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}
.legend-dot.weekly-partial {
  width: 9px;
  height: 9px;
  border: 2px solid var(--rust);
  border-radius: 50%;
  background: var(--white);
}

.accounting-disclosure { margin-top: -12px; }
.accounting-summary { grid-template-columns: repeat(4, 1fr); }
.compact-metric { min-height: 150px; }
.compact-metric .metric-value { margin: 16px 0 8px; font-size: 2rem; }
.accounting-bars { display: grid; gap: 10px; }
.accounting-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.accounting-dimensions .panel h3 { margin-bottom: 18px; font-size: 1.25rem; }
.dimension-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.dimension-row:last-child { border-bottom: 0; }
.dimension-row strong, .dimension-row span { display: block; }
.dimension-row strong { font-size: .75rem; }
.dimension-row span { color: var(--muted); font-size: .65rem; }
.dimension-row .dimension-share { flex: 0 0 auto; color: var(--green); font-weight: 800; }

.coverage-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.coverage-total { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; }
.coverage-list { display: grid; gap: 17px; }
.coverage-row { display: grid; grid-template-columns: 145px 1fr 52px; gap: 12px; align-items: center; font-size: .73rem; }
.coverage-row span { color: var(--muted); }
.coverage-row strong { text-align: right; }
.coverage-track { height: 8px; overflow: hidden; border-radius: 10px; background: var(--paper-2); }
.coverage-track i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.issue-list { display: grid; gap: 10px; }
.issue {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: .35rem;
}
.issue-icon { display: grid; place-items: center; width: 25px; height: 25px; color: var(--amber); background: var(--amber-soft); border-radius: 50%; font-size: .7rem; font-weight: 850; }
.issue strong { display: block; font-size: .78rem; }
.issue p { margin: 2px 0 0; color: var(--muted); font-size: .69rem; }
.issue-priority { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.empty-inline { color: var(--muted); font-size: .76rem; }
.report-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 18px; }
.report-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.report-link { display: inline-flex; padding: .55rem .75rem; color: var(--green); border: 1px solid var(--line); border-radius: .35rem; background: var(--white); font-size: .7rem; font-weight: 750; text-decoration: none; }

.advanced-calibration,
.advanced-diagnostics,
.manual-contribution {
  margin-top: 18px;
}
.advanced-calibration > summary,
.advanced-diagnostics > summary,
.manual-contribution > summary,
.evidence-disclosure > summary {
  cursor: pointer;
  color: var(--green);
  font-size: .78rem;
  font-weight: 800;
}
.advanced-calibration[open] > summary,
.advanced-diagnostics[open] > summary,
.manual-contribution[open] > summary,
.evidence-disclosure[open] > summary {
  margin-bottom: 16px;
}
.advanced-calibration > .panel + .lower-charts { margin-top: 18px; }
.primary-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.manual-contribution {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.manual-contribution code { font-family: var(--mono, ui-monospace, monospace); }
.evidence-disclosure { display: block; }
.evidence-disclosure .report-links { justify-content: flex-start; }

/* Consumer hierarchy: the default journey is allowance, one trend, and one
   weekly estimate. Technical evidence remains available through disclosure. */
h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3.25rem); }
.page-heading { padding: 52px 0 38px; }
.dashboard-section { padding: 50px 0; }
.section-heading { margin-bottom: 26px; }
.panel { padding: 24px; box-shadow: 0 8px 24px rgba(31, 45, 39, .035); }
.metric-card { min-height: 165px; padding: 21px; }
.metric-card .metric-value { margin: 16px 0 7px; font-size: 2.7rem; }
.skeleton-card { min-height: 165px; }
.weekly-hero { padding: 28px; }
.weekly-hero > div:first-child strong {
  font-size: clamp(2.5rem, 5vw, 4.1rem);
}

.boundary-diagram { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.boundary-node { display: flex; flex-direction: column; min-height: 150px; padding: 22px; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: .45rem; background: rgba(255,254,249,.7); }
.boundary-node.private { border-top-color: var(--rust); }
.boundary-node.community { border-top-color: var(--blue); }
.boundary-node span { color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .06em; }
.boundary-node strong { margin: 12px 0 5px; font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.boundary-node small { color: var(--muted); font-size: .7rem; }
.boundary-arrow { color: var(--green); font-size: 1.6rem; }
.boundary-arrow.optional { color: var(--blue); }
.schema-inspection { margin-bottom: 18px; }
.schema-inspection > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.schema-inspection > summary::-webkit-details-marker { display: none; }
.schema-inspection > summary strong { display: block; margin-top: 3px; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.schema-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.schema-grid > div { padding: 18px; color: var(--green); background: var(--green-soft); border-radius: .4rem; }
.schema-grid > .excluded { color: var(--rust); background: var(--rust-soft); }
.schema-grid h3 { color: currentColor; font-size: 1.05rem; }
.schema-grid ul { margin: 10px 0 0; padding-left: 20px; color: var(--ink); font-size: .72rem; }
.schema-grid li + li { margin-top: 6px; }
.definition-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 20px; border: 1px solid var(--line); }
.definition-grid > div { min-width: 0; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.definition-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.definition-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.definition-grid dt { color: var(--muted); font-size: .63rem; text-transform: uppercase; }
.definition-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: .78rem; font-weight: 700; }
.privacy-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.privacy-lists > div { padding: 15px; color: var(--green); background: var(--green-soft); border-radius: .35rem; font-size: .73rem; }
.privacy-lists .excluded { color: var(--rust); background: var(--rust-soft); }
.privacy-lists ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink); }
.privacy-lists li { margin: 5px 0; }
.index-progress {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--paper-2);
}
.index-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.index-progress progress {
  width: 100%;
  height: 10px;
  margin: 12px 0 8px;
  accent-color: var(--green);
}
.index-progress p { margin: 5px 0 0; }
.evidence-chip.neutral { color: var(--muted); background: var(--paper-2); }
.evidence-chip.error { color: var(--rust); background: var(--rust-soft); }
.file-drop {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 20px;
  border: 1px dashed rgba(23,79,69,.35);
  border-radius: .4rem;
  background: rgba(223,236,230,.35);
  cursor: pointer;
  text-align: center;
}
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 8px; color: white; background: var(--green); border-radius: 50%; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .8fr); gap: 16px; align-items: center; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: .35rem; background: rgba(255, 254, 249, .6); }
.invite-row strong, .invite-row small { display: block; }
.invite-row small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.invite-row input { min-width: 0; width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .3rem; color: var(--ink); background: var(--white); font-size: .76rem; }
.file-drop strong { font-size: .82rem; }
.file-drop small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.file-drop.selected { border-style: solid; background: var(--green-soft); }
.selected-contribution-inspection {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: rgba(255, 254, 249, .6);
}
.selected-contribution-facts { margin: 12px 0; }
.exact-json-inspection { padding-top: 12px; border-top: 1px solid var(--line); }
.exact-json-inspection summary { cursor: pointer; font-size: .73rem; font-weight: 750; }
.exact-json-inspection pre {
  max-height: 28rem;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: .35rem;
  color: #e8f1f7;
  background: #101923;
  font: .68rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
}
.consent-row { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: .35rem; cursor: pointer; }
.consent-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--green); }
.consent-row span { display: flex; flex-direction: column; font-size: .73rem; }
.consent-row small { color: var(--muted); }
.upload-status { margin-top: 13px; padding: 13px; border-radius: .35rem; color: var(--green); background: var(--green-soft); font-size: .75rem; }
.upload-status.error { color: var(--rust); background: var(--rust-soft); }
.backend-panel { margin-top: 18px; }
.sync-status-panel { margin-top: 18px; }
.sync-panel-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.sync-panel-summary::-webkit-details-marker { display: none; }
.sync-panel-summary::after {
  color: var(--green);
  content: "Show";
  font-size: .68rem;
  font-weight: 800;
}
.sync-status-panel[open] > .sync-panel-summary::after { content: "Hide"; }
.sync-panel-summary h3 { margin-bottom: 0; }
.sync-panel-body { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.sync-next-card { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: .4rem; background: rgba(255, 254, 249, .6); }
.sync-exact-review { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.sync-exact-review > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}
.sync-exact-review pre { max-height: 30rem; margin: 12px 0 0; padding: 15px; overflow: auto; border: 1px solid var(--line); border-radius: .35rem; background: #111b24; color: #eaf4f0; font: .7rem/1.55 var(--mono); white-space: pre; }
.preparation-readiness { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: .72rem; }
.preparation-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.compact-heading h4 { margin: 0; font-family: var(--serif); font-size: 1rem; font-weight: 500; }
.sync-next-facts { grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sync-actions .button { min-height: 38px; }
.community-connect,
.local-preparation {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: rgba(255, 254, 249, .6);
}
.community-connect .control-label,
.local-preparation > .control-label {
  display: block;
  margin-bottom: 12px;
  color: var(--green-2);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.community-connect .participant-action-status,
.local-preparation .participant-action-status { margin-bottom: 0; }
.backend-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.sync-facts { grid-template-columns: repeat(3, 1fr); }
.backend-facts > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: .35rem; background: rgba(255, 254, 249, .6); }
.backend-facts dt { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.backend-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .76rem; font-weight: 750; }
.backend-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.backend-flow li { min-width: 0; padding: 12px; border: 1px solid var(--line); border-top: 3px solid var(--green-2); border-radius: .35rem; background: var(--white); }
.backend-flow li > strong { display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 12px; color: var(--green); background: var(--green-soft); border-radius: 50%; font-size: .64rem; }
.backend-flow span, .backend-flow small { display: block; }
.backend-flow span { font-size: .7rem; font-weight: 800; }
.backend-flow small { margin-top: 5px; color: var(--muted); font-size: .61rem; line-height: 1.45; }
.backend-contract-note { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--amber); color: #6f5011; background: var(--amber-soft); font-size: .7rem; }
.calibration-reasons { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.calibration-reasons li + li { margin-top: 4px; }
.result-panels { margin-top: 18px; }
.personal-result-panel, .community-result-panel { grid-column: 1 / -1; }
.result-summary > p { margin-bottom: 0; color: var(--muted); font-size: .78rem; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-metrics > div { padding: 12px; border: 1px solid var(--line); border-radius: .35rem; }
.result-metrics span { display: block; color: var(--muted); font-size: .6rem; text-transform: uppercase; }
.result-metrics strong { display: block; margin-top: 4px; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.result-verification { margin: 12px 0 0; padding: 12px 14px; border-left: 3px solid var(--green-2); color: var(--muted); background: var(--green-soft); font-size: .72rem; }
.result-verification strong { color: var(--ink); }
.participant-detail { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.participant-detail h4, .participant-detail h5 { margin: 0; font-family: var(--serif); font-weight: 500; }
.participant-detail h4 { font-size: 1rem; }
.participant-detail h5 { font-size: .88rem; }
.participant-detail-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-top: 11px; }
.participant-detail-heading > div > p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.coverage-state, .private-chip { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border-radius: 10rem; font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.coverage-state { color: var(--green); background: var(--green-soft); }
.coverage-partially_priced { color: #7c5a13; background: var(--amber-soft); }
.coverage-unpriced, .coverage-unknown { color: var(--rust); background: var(--rust-soft); }
.coverage-not_testable { color: var(--muted); background: var(--paper-2); }
.private-chip { flex: 0 0 auto; color: var(--green); background: var(--green-soft); }
.coverage-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 11px; }
.coverage-counts > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: .3rem; background: rgba(255, 254, 249, .6); }
.coverage-counts span, .basis-label { display: block; color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.coverage-counts strong { display: block; margin-top: 3px; font-size: .78rem; }
.result-state { margin: 12px 0 0; padding: 11px 13px; border-radius: .3rem; font-size: .7rem; }
.result-state-warning { color: #6f5011; background: var(--amber-soft); }
.pricing-basis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.basis-card { padding: 14px; border: 1px solid var(--line); border-radius: .35rem; background: rgba(255, 254, 249, .62); }
.basis-card strong { display: block; margin-top: 5px; font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.basis-card p { margin: 7px 0 0; color: var(--muted); font-size: .68rem; }
.basis-fast { border-color: rgba(169, 73, 47, .24); background: rgba(247, 233, 225, .42); }
.quota-movement .participant-detail-heading { margin-top: 0; }
.movement-metadata { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.movement-metadata span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 10rem; color: var(--muted); font-size: .62rem; }
.not-testable-state { margin-top: 12px; padding: 16px; border: 1px dashed var(--line); border-radius: .35rem; background: var(--paper-2); }
.not-testable-state strong { font-family: var(--serif); font-weight: 500; }
.not-testable-state p { margin: 5px 0 0; color: var(--muted); font-size: .7rem; }
.movement-window { margin-top: 16px; }
.movement-window-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 7px; }
.movement-window-heading span, .empty-inline { color: var(--muted); font-size: .65rem; }
.movement-table { margin-top: 0; }
.movement-table table { min-width: 760px; }
.movement-table th, .movement-table td { white-space: nowrap; }
.snapshot-heading { display: grid; gap: 4px; margin-bottom: 12px; }
.snapshot-heading strong { font-family: var(--serif); font-size: 1rem; font-weight: 500; }
.snapshot-heading span, .snapshot-disclosure, .snapshot-partial { color: var(--muted); font-size: .68rem; }
.snapshot-partial { color: var(--rust); }
.snapshot-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.snapshot-quality-grid > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: .3rem;
}
.snapshot-quality-grid dt {
  color: var(--muted);
  font-size: .56rem;
  text-transform: uppercase;
}
.snapshot-quality-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: .69rem;
  font-weight: 750;
}
.snapshot-table { margin-top: 14px; }
.snapshot-table table { min-width: 920px; }
.snapshot-table th, .snapshot-table td { white-space: nowrap; }
.snapshot-table .suppressed-value { color: var(--muted); font-style: italic; }
.community-comparison .participant-detail-heading { margin-top: 0; }
.comparison-table { margin-top: 14px; }
.comparison-table table { min-width: 760px; table-layout: fixed; }
.comparison-table th, .comparison-table td { white-space: normal; overflow-wrap: anywhere; }
.comparison-table th:nth-child(1), .comparison-table td:nth-child(1) { width: 23%; }
.comparison-table th:nth-child(2), .comparison-table td:nth-child(2) { width: 15%; }
.comparison-table th:nth-child(3), .comparison-table td:nth-child(3),
.comparison-table th:nth-child(4), .comparison-table td:nth-child(4) { width: 15%; }
.comparison-table th:nth-child(5), .comparison-table td:nth-child(5) { width: 32%; }
.comparison-table td:nth-child(3), .comparison-table td:nth-child(4) { white-space: nowrap; }
.comparison-table .suppressed-value { color: var(--muted); font-style: italic; }
.contribution-history .participant-detail-heading { margin-top: 0; }
.history-disclosure { margin: 10px 0 0; color: var(--muted); font-size: .7rem; }
.history-list { display: grid; gap: 10px; margin-top: 14px; }
.history-card { padding: 15px; border: 1px solid var(--line); border-radius: .4rem; background: rgba(255, 254, 249, .62); }
.history-card-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.history-card-heading strong, .history-card-heading small { display: block; }
.history-card-heading strong { font-family: var(--serif); font-size: .95rem; font-weight: 500; }
.history-card-heading small { margin-top: 3px; color: var(--muted); font-size: .64rem; }
.history-state { flex: 0 0 auto; padding: 4px 7px; border-radius: 10rem; color: var(--green); background: var(--green-soft); font-size: .58rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.history-state-deleting { color: var(--rust); background: var(--rust-soft); }
.history-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.history-facts > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: .3rem; background: var(--white); }
.history-facts dt { color: var(--muted); font-size: .56rem; text-transform: uppercase; }
.history-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: .68rem; }
.history-retention-note { margin: 11px 0 0; color: var(--muted); font-size: .66rem; }
.history-delete { margin-top: 11px; }
.participant-controls { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.device-controls { margin-bottom: 18px; padding: 15px; border: 1px solid var(--line); border-radius: .4rem; background: rgba(255, 254, 249, .62); }
.device-controls-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.device-controls-heading h4 { margin: 0; font-family: var(--serif); font-size: 1rem; font-weight: 500; }
.device-controls-heading p { max-width: 68ch; margin: 5px 0 0; color: var(--muted); font-size: .7rem; }
.device-consent { margin-bottom: 10px; }
.device-list { display: grid; gap: 8px; margin-top: 14px; }
.device-list > p { margin: 0; color: var(--muted); font-size: .7rem; }
.device-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: .35rem; background: var(--white); }
.device-row strong, .device-row small { display: block; }
.device-row strong { font-size: .72rem; }
.device-row small { margin-top: 3px; color: var(--muted); font-size: .62rem; }
.recovery-once { margin-top: 14px; padding: 15px; border: 1px solid var(--amber); border-radius: .35rem; background: var(--amber-soft); }
.recovery-once strong, .recovery-once p, .recovery-once code { display: block; }
.recovery-once p, .participant-action-status { margin: 8px 0; color: var(--muted); font-size: .72rem; }
.recovery-once code { max-width: 100%; margin: 10px 0; padding: 10px; overflow-wrap: anywhere; color: var(--ink); background: var(--white); border-radius: .3rem; font-size: .68rem; }
.recover-access { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.recover-access summary { color: var(--green); font-size: .75rem; font-weight: 750; cursor: pointer; }
.recover-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; margin-top: 12px; }
.recover-form label { grid-column: 1 / -1; color: var(--muted); font-size: .69rem; }
.recover-form input { min-width: 0; width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .3rem; color: var(--ink); background: var(--white); font-size: .76rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.button-danger { color: var(--rust); border-color: rgba(169, 73, 47, .3); background: var(--rust-soft); }
.participant-action-status.error { color: var(--rust); }
.contribution-history-disclosure,
.privacy-controls {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.contribution-history-disclosure > summary,
.privacy-controls > summary {
  color: var(--green);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
}
.privacy-controls > p {
  max-width: 62ch;
  color: var(--muted);
  font-size: .7rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0 45px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .7rem;
}
.noscript { position: fixed; inset: auto 0 0; padding: 1rem; color: white; background: var(--rust); text-align: center; }

@media (max-width: 1050px) {
  .topbar { grid-template-columns: auto 1fr; padding-inline: 24px; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; border-top: 1px solid var(--line); }
  .top-actions { justify-self: end; }
  html { scroll-padding-top: 125px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-grid > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  main, footer { width: min(100% - 28px, 1240px); }
  .topbar { padding-inline: 14px; }
  .state-pill { max-width: 118px; overflow: hidden; white-space: nowrap; }
  .button.compact { display: none; }
  .chart-navigation .button.compact { display: inline-flex; }
  .primary-nav { gap: 1rem; }
  .page-heading, .section-heading, .section-heading.split, .weekly-hero, .setup-card, .companion-setup, .contribution-cta { grid-template-columns: 1fr; gap: 24px; }
  .companion-setup-actions { grid-column: 1; }
  .journey-disclosure > summary { align-items: flex-start; flex-direction: column; }
  .journey-disclosure > .data-panels,
  .journey-disclosure > .sync-status-panel,
  .journey-disclosure > .backend-panel,
  .journey-disclosure > .result-panels {
    margin-right: 14px;
    margin-left: 14px;
  }
  #cancel-refresh.button.compact { display: inline-flex; }
  .page-heading { padding-top: 38px; }
  .freshness-card { min-width: 0; }
  .dashboard-section { padding: 44px 0; }
  .metric-grid, .two-column, .coverage-layout, .privacy-lists, .result-metrics, .coverage-counts, .pricing-basis-grid, .backend-facts, .history-facts, .snapshot-quality-grid { grid-template-columns: 1fr; }
  .accounting-dimensions, .schema-grid { grid-template-columns: 1fr; }
  .metric-grid > :last-child { grid-column: auto; }
  .panel { padding: 21px; }
  .panel-heading, .chart-heading, .report-panel, .notice { align-items: flex-start; flex-direction: column; }
  .sync-panel-summary { align-items: flex-start; flex-wrap: wrap; }
  .component-row { grid-template-columns: 110px 1fr auto; }
  .comparison-row { grid-template-columns: 1fr auto; }
  .comparison-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .chart-summary-grid { grid-template-columns: 1fr 1fr; }
  .calibration-facts { grid-template-columns: 1fr; }
  .calibration-facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .calibration-facts div:last-child { border-bottom: 0; }
  .timeline-controls,
  .chart-control-stack,
  .calibration-controls { justify-items: start; }
  .chart-navigation { justify-content: flex-start; }
  .boundary-diagram { grid-template-columns: 1fr; }
  .invite-row, .recover-form { grid-template-columns: 1fr; }
  .boundary-arrow { transform: rotate(90deg); justify-self: center; }
  .backend-flow { grid-template-columns: 1fr; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-grid > div, .definition-grid > div:nth-child(odd), .definition-grid > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .definition-grid > div:last-child { border-bottom: 0; }
  .report-links { justify-content: flex-start; }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  h1 { font-size: 2.55rem; }
  h2 { font-size: 2.25rem; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .state-pill {
    justify-content: center;
    width: 28px;
    height: 28px;
    max-width: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    font-size: 0;
  }
  .primary-nav {
    display: flex;
    gap: .25rem;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .primary-nav a {
    flex: 0 0 auto;
    min-width: 62px;
    padding-inline: .25rem;
    font-size: .62rem;
    line-height: 1.2;
    text-align: center;
  }
  .chart-navigation {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }
  .chart-navigation .button.compact {
    min-width: 0;
    min-height: 48px;
    padding-inline: .35rem;
    font-size: .62rem;
  }
}

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