:root {
  color-scheme: light;
  --ink: #1f302e;
  --muted: #667672;
  --line: #d9e2df;
  --paper: #f5f8f6;
  --white: #ffffff;
  --teal: #187d78;
  --teal-dark: #125b58;
  --teal-soft: #dcefeb;
  --coral: #cf6655;
  --amber: #e5a82f;
  --blue: #5186a3;
  --shadow: 0 10px 30px rgba(28, 58, 53, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--ink); font-weight: 760; }
.brand-mark { width: 28px; height: 28px; display: flex; align-items: end; gap: 3px; padding: 5px; border-radius: 8px 8px 8px 2px; background: var(--teal); }
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: white; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .72; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: .82; }
.topbar-meta, .live-label { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #47a37c; box-shadow: 0 0 0 3px #dff1e8; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--teal-dark); font-size: 22px; line-height: 1; }
main { max-width: 1260px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px) 42px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: end; padding: 56px 0 42px; }
.eyebrow { margin: 0 0 10px; color: var(--teal); font-size: 11px; font-weight: 780; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(32px, 4vw, 49px); line-height: 1.08; font-weight: 780; }
h1 span { color: var(--teal); }
.intro-text { max-width: 650px; margin: 0; color: #52625e; font-size: 16px; line-height: 1.65; }
.intro-note { display: flex; gap: 15px; padding: 16px 18px; border-left: 3px solid var(--amber); background: #fffaf0; color: #59645e; font-size: 13px; line-height: 1.5; }
.intro-note p { margin: 0; }
.note-number { color: #bf8120; font-weight: 800; }
.claim-band { display: grid; grid-template-columns: 175px 1fr auto; gap: 24px; align-items: center; padding: 18px 22px; border: 1px solid #c9dfda; border-radius: 10px; background: var(--teal-soft); }
.claim-label { display: flex; flex-direction: column; gap: 8px; }
.claim-index, .method-step { color: var(--teal-dark); font-size: 10px; letter-spacing: 0; font-weight: 800; }
.claim-tag { width: fit-content; padding: 5px 8px; border-radius: 5px; background: rgba(255,255,255,.75); color: #42625d; font-size: 11px; }
.claim-text { margin: 0; font-size: 17px; line-height: 1.45; }
.claim-formula { margin: 0; color: var(--teal-dark); font-size: 15px; font-weight: 750; white-space: nowrap; }
.lab-layout { display: grid; grid-template-columns: minmax(300px, .88fr) minmax(400px, 1.12fr); margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); overflow: hidden; }
.controls-panel, .simulation-panel { min-width: 0; padding: 24px; }
.controls-panel { border-right: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.section-heading h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.section-heading .eyebrow { margin-bottom: 6px; }
.live-label { padding: 6px 9px; border: 1px solid #cce3d8; border-radius: 99px; color: #3b785b; font-size: 11px; }
.live-label .status-dot { width: 6px; height: 6px; box-shadow: none; }
.control-row { display: block; margin-top: 28px; }
.control-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 650; }
.control-title strong { color: var(--teal-dark); font-size: 19px; font-variant-numeric: tabular-nums; }
.control-title small, .result-main small, .result-compare small { color: var(--muted); font-size: 11px; font-weight: 550; }
input[type="range"] { width: 100%; height: 6px; margin: 16px 0 8px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--teal) var(--progress, 40%), #e5ece9 var(--progress, 40%)); accent-color: var(--teal); }
input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; appearance: none; border: 3px solid white; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid white; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
input:focus-visible, button:focus-visible { outline: 3px solid #83c8c0; outline-offset: 3px; }
.range-ends { display: flex; justify-content: space-between; color: #87938f; font-size: 11px; }
.condition-check { display: flex; gap: 12px; align-items: flex-start; margin-top: 28px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f9fbfa; }
.condition-check-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: none; border-radius: 50%; background: #e8f4ef; color: var(--teal); font-weight: 800; }
.condition-check strong { display: block; margin: 1px 0 4px; font-size: 12px; }
.condition-check p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.condition-check.changed { border-color: #f0d8a3; background: #fffaf0; }
.condition-check.changed .condition-check-icon { background: #fff0c9; color: #ab7417; }
.baseline-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.baseline-meta { display: grid; gap: 4px; min-width: 0; }
.baseline-meta span { color: var(--muted); font-size: 10px; }
.baseline-meta strong { color: #304642; font-size: 12px; font-variant-numeric: tabular-nums; }
.baseline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.baseline-actions .text-button { font-size: 11px; }
.action-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 22px; }
.primary-button { min-height: 42px; padding: 0 15px; border: 0; border-radius: 7px; background: var(--teal); color: white; font-size: 13px; font-weight: 700; }
.primary-button:hover { background: var(--teal-dark); }
.primary-button span { margin-right: 5px; font-size: 18px; vertical-align: -1px; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.privacy-note { margin: 19px 0 0; color: #7b8985; font-size: 11px; }
.privacy-note span { margin-right: 5px; color: var(--teal); }
.equation-chip { padding: 6px 9px; border-radius: 5px; background: #eef4f5; color: #486a78; font-size: 12px; font-weight: 720; }
.simulation-stage { position: relative; height: 215px; margin-top: 18px; border-radius: 8px; background: #f2f7f5; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; }
.stage-legend { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 13px; color: #71817c; font-size: 10px; }
.stage-legend span { display: flex; align-items: center; gap: 5px; }
.stage-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.legend-force { background: var(--coral); }
.legend-mass { background: var(--teal); }
.result-strip { display: grid; grid-template-columns: 1fr 1px auto auto; gap: 16px; align-items: center; padding-top: 18px; }
.result-main, .result-compare { display: flex; flex-direction: column; gap: 4px; }
.result-main > span, .result-compare > span { color: var(--muted); font-size: 11px; }
.result-main strong { color: var(--teal-dark); font-size: 26px; font-variant-numeric: tabular-nums; }
.result-compare strong { color: #506560; font-size: 17px; font-variant-numeric: tabular-nums; }
.result-divider { height: 42px; background: var(--line); }
.delta-indicator { padding: 6px 8px; border-radius: 5px; background: #edf4f0; color: #397651; font-size: 10px; font-weight: 700; text-align: center; }
.delta-indicator.down { background: #fff1e8; color: #a75837; }
.delta-indicator.up { background: #edf4fa; color: #3f7191; }
.comparison-section { min-width: 0; margin-top: 28px; padding: 23px 24px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.comparison-actions { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 11px; }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead { background: #f4f7f6; }
th { padding: 10px 12px; color: #788782; font-size: 10px; font-weight: 750; text-transform: uppercase; }
td { padding: 13px 12px; border-bottom: 1px solid #edf1ef; color: #465752; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.condition-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 5px; background: #eaf4ef; color: #3b775b; font-size: 10px; font-weight: 700; }
.condition-pill.shifted { background: #fff1d4; color: #946c18; }
.delete-trial { padding: 4px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #85938e; font-size: 15px; }
.delete-trial:hover { border-color: #efd3d0; color: #b54f47; }
.comparison-footnote { margin: 12px 0 0; color: #82908b; font-size: 11px; }
.method-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 24px; padding: 19px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-band > div { display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: baseline; }
.method-band p { margin: 0; color: #64736f; font-size: 11px; line-height: 1.5; }
.method-step { color: var(--coral); }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 18px clamp(18px, 4vw, 64px); background: #e8efec; color: #61716c; font-size: 10px; }
.footer span:first-child { color: #304642; font-weight: 780; }
.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; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 22px; }
  .intro-note { max-width: 560px; }
  .lab-layout { grid-template-columns: 1fr; }
  .controls-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-band { gap: 14px; }
  .method-band > div { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 600px) {
  .topbar { height: 58px; padding: 0 16px; }
  .brand { font-size: 13px; }
  .topbar-meta { max-width: 145px; font-size: 10px; }
  main { padding-inline: 14px; }
  .intro { padding: 36px 0 25px; }
  h1 { font-size: 34px; }
  .intro-text { font-size: 14px; }
  .claim-band { grid-template-columns: 1fr auto; gap: 12px; padding: 15px; }
  .claim-text { grid-column: 1 / -1; grid-row: 2; font-size: 15px; }
  .claim-formula { grid-column: 2; grid-row: 1; }
  .claim-label { grid-column: 1; grid-row: 1; }
  .controls-panel, .simulation-panel, .comparison-section { padding: 17px; }
  .section-heading h2 { font-size: 18px; }
  .live-label { font-size: 9px; }
  .simulation-stage { height: 190px; }
  .result-strip { grid-template-columns: 1fr 1px auto; gap: 12px; }
  .delta-indicator { grid-column: 1 / -1; justify-self: start; }
  .baseline-control { grid-template-columns: 1fr; }
  .baseline-actions { justify-content: flex-start; }
  .comparison-heading { align-items: flex-start; flex-direction: column; }
  .comparison-actions { width: 100%; justify-content: space-between; }
  .method-band { grid-template-columns: 1fr; gap: 15px; padding-inline: 5px; }
  .method-band > div { grid-template-columns: 62px 1fr; }
  .footer { flex-wrap: wrap; }
  .footer span:last-child { width: 100%; }
}
