:root {
  color-scheme: light;
  --ink: #142825;
  --muted: #4e625d;
  --accent: #12674f;
  --accent-dark: #154a3b;
  --paper: #f6f9f6;
  --white: #fff;
  --line: #d6e2db;
  --mint: #e6f4ec;
  --warm: #f9efdc;
  --warm-ink: #6f4718;
  font: 100%/1.55 "Aptos", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--accent); text-underline-offset: .19em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #278574; outline-offset: 4px; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 10; padding: .5rem; background: white; }
.skip:focus { top: .5rem; }
.shell { width: min(1160px, calc(100% - 4.5rem)); margin-inline: auto; }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.mast, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font-size: 1.22rem; font-weight: 760; letter-spacing: -.045em; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-items: end; padding: 8px; width: 33px; height: 33px; border-radius: 8px; background: #174d3e; }
.brand-mark i { height: 17px; border-radius: 2px; background: #c6f2d8; }
.brand-mark i + i { height: 11px; background: #6cca9d; }
nav, .actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
nav { gap: 1.45rem; }
nav a { text-decoration: none; font-size: .9rem; font-weight: 650; }
nav a[aria-current=page]:not(.button) { text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 1px solid transparent; border-radius: 8px; padding: .65rem .92rem; min-height: 44px; font-weight: 660; line-height: 1.25; color: var(--ink); background: var(--white); }
.button.small { font-size: .875rem; min-height: 38px; padding: .5rem .72rem; }
.button.outline { border-color: #b9cec3; color: #194f3e; }
.button.outline:hover { background: var(--mint); }
.button.primary { background: #17513f; color: white; border-color: #17513f; }
.button.primary:hover { background: #0d3e2f; }
.button.link { color: var(--accent); text-decoration: underline; text-underline-offset: .17em; padding-inline: .3rem; min-height: 30px; background: transparent; }
.button.link:hover { color: #0d3e2f; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.75rem; align-items: center; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.6rem); }
h1, h2, h3, p { margin: 0 0 .7rem; }
h1, h2, h3 { line-height: 1.12; }
h1 { font: 500 clamp(3.15rem, 6.1vw, 5.7rem)/.98 Georgia, serif; letter-spacing: -.068em; margin: 1.15rem 0 1.35rem; }
h1 em { color: var(--accent); font-weight: inherit; }
h2 { font-size: clamp(1.45rem, 3vw, 2.25rem); font-weight: 720; letter-spacing: -.042em; }
h3 { font-size: 1.08rem; letter-spacing: -.02em; }
.lede { max-width: 46ch; font-size: clamp(1.06rem, 2vw, 1.22rem); color: var(--muted); margin-bottom: 1.55rem; }
.eyebrow { color: var(--accent-dark); font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 760; }
.hero-board { border: 1px solid var(--line); background: white; border-radius: 17px; padding: 1.35rem; box-shadow: 0 20px 40px #223e3213; }
.preview-claim, .preview-result { margin: 1rem 0; padding: .8rem 1rem; border-radius: 8px; }
.preview-claim { background: var(--warm); }
.preview-claim p { margin: .38rem 0 0; }
.preview-result { background: var(--mint); }
.preview-result strong { color: var(--accent-dark); font-size: 1.75rem; line-height: 1; letter-spacing: -.05em; }
.preview-result span { margin-left: .22rem; font-weight: 650; }
.preview-result p:last-child { margin: 0; }
.trial-grid, .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.home-bottom { border-top: 1px solid var(--line); padding: 1.9rem 0 3.5rem; }
.home-bottom h2 { font-size: 1.62rem; }
.home-bottom p:not(.eyebrow) { color: var(--muted); max-width: 56ch; }
.text-link { font-weight: 690; }
.page:not(#view-home) { padding: 2.8rem 0 3.3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); margin: .5rem 0 .6rem; }
.page-head p:last-child { color: var(--muted); margin-bottom: 0; }
.page-head .actions { justify-content: flex-end; flex-shrink: 0; }
.notice { border: 1px solid #e6d5b6; background: var(--warm); border-radius: 11px; padding: 1rem 1.15rem; margin-bottom: 1rem; }
.notice h2 { color: var(--warm-ink); font-size: 1.23rem; margin-bottom: .35rem; }
.notice p { max-width: 100ch; margin: 0; }
.trial-grid { gap: 1rem; }
.trial { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-top: 4px solid #2a795e; border-radius: 12px; background: white; min-width: 0; overflow-wrap: anywhere; }
.trial:nth-child(2) { border-top-color: #467a8b; }
.trial h2 { font-size: 1.55rem; margin-bottom: .22rem; }
.trial .byline { color: var(--muted); font-size: .92rem; }
.trial .rule { font-size: 1rem; margin: .9rem 0 .75rem; }
.trial .rule strong { display: block; font-size: 1.09rem; }
.arm { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .6rem; align-items: center; padding: .67rem 0; border-top: 1px solid var(--line); }
.arm b, .arm small { display: block; }
.arm small, .quiet { color: var(--muted); font-size: .875rem; }
.arm-stats { text-align: right; }
.arm-stats strong { display: block; color: var(--accent-dark); font-size: 1.5rem; line-height: 1.1; letter-spacing: -.055em; }
.trial:nth-child(2) .arm-stats strong { color: #315f71; }
.source { display: inline-block; font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.trial .source { margin-top: .55rem; }
.trial .basis { border-radius: 7px; background: var(--paper); color: var(--muted); font-size: .9rem; margin-top: .65rem; padding: .65rem .72rem; }
.trial .basis b { color: var(--ink); display: block; }
.working { padding: .7rem 0; color: var(--muted); }
.lens { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: 11px; background: white; margin-top: 1rem; }
summary { cursor: pointer; font-weight: 690; }
.lens p { margin: .5rem 0 0; }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin: 2.55rem 0 .9rem; }
.section-title h2 { margin: 0; }
.section-title p { margin: 0; color: var(--muted); }
.matrix { border: 1px solid var(--line); overflow: hidden; border-radius: 11px; background: white; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: minmax(125px,.65fr) repeat(2,minmax(0,1.35fr)); }
.matrix-head { background: #eaf1ec; font-size: .9rem; font-weight: 725; }
.matrix-head > *, .matrix-row > * { margin: 0; padding: .82rem .95rem; min-width: 0; overflow-wrap: anywhere; }
.matrix-row { border-top: 1px solid var(--line); }
.matrix-row > h3 { padding-top: .98rem; font-size: .96rem; }
.matrix-row > div { border-left: 1px solid var(--line); }
.matrix-row p { white-space: pre-wrap; margin: .2rem 0 .36rem; }
.matrix-actions { display: flex; align-items: center; gap: .2rem .8rem; flex-wrap: wrap; }
.mobile-name { display: none; }
.audit { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.05rem; background: white; margin-top: .65rem; overflow-wrap: anywhere; }
.audit:first-child { margin-top: 0; }
.audit-tag { background: var(--mint); color: #194f3e; border-radius: 5px; padding: .12rem .43rem; font-weight: 720; font-size: .83rem; }
.audit-tag.open { background: var(--warm); color: var(--warm-ink); }
.audit h3 { margin: .45rem 0; }
.audit p { margin-bottom: .35rem; }
.audit dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .55rem; margin: .72rem 0; }
.audit dl div { padding: .5rem .66rem; background: var(--paper); border-radius: 6px; }
.audit dt { color: var(--muted); font-size: .875rem; }
.audit dd { margin: 0; font-weight: 670; white-space: pre-wrap; }
.audit .source { margin-top: .35rem; }
.demo { background: #eff7f1; }
.demo summary { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.demo summary::after { content: '+'; margin-left: auto; font-size: 1.2rem; }
.demo[open] summary::after { content: '−'; }
.demo-content { padding-top: .35rem; }
.gaps { margin-top: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; }
.gaps ul { padding-left: 1.2rem; margin: .55rem 0 .15rem; }
.gaps li + li { margin-top: .4rem; }
.form-grid { gap: 1rem; }
fieldset { min-width: 0; padding: .85rem 1rem 1rem; border: 1px solid var(--line); border-radius: 10px; margin: 0; background: white; }
fieldset > legend { font-weight: 750; padding: 0 .38rem; }
.field { display: block; margin: .6rem 0; font-size: .9rem; font-weight: 660; }
.field input, .field select, .field textarea, .share-url { display: block; width: 100%; padding: .48rem .6rem; background: #fff; color: var(--ink); border: 1px solid #aabcaf; border-radius: 6px; margin-top: .24rem; }
textarea { min-height: 4.35rem; resize: vertical; }
.form-foot { margin: 1rem 0 0; }
.form-study details { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.form-grid .field { min-width: 0; }
.form-error { color: #8d301c; font-weight: 650; }
.status { position: fixed; right: 1rem; bottom: 1rem; max-width: calc(100% - 2rem); margin: 0; z-index: 2; color: #fff; background: #164638; border-radius: 8px; box-shadow: 0 8px 28px #0e291e36; }
.status:not(:empty) { padding: .65rem .85rem; }
.footer { background: white; color: var(--muted); border-top: 1px solid var(--line); font-size: .875rem; }
.footer-inner { min-height: 61px; }
dialog { width: min(560px,calc(100% - 1.6rem)); max-height: calc(100dvh - 1.7rem); border: 1px solid var(--line); border-radius: 13px; padding: 1.2rem; background: white; color: var(--ink); overflow: auto; }
dialog::backdrop { background: #112d24a3; }
dialog h2 { font-size: 1.48rem; }
dialog .actions { justify-content: flex-end; margin-top: .95rem; }
@media (max-width: 820px) {
  .shell { width: calc(100% - 2.5rem); }
  .hero { gap: 1.6rem; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 1.6rem); }
  .mast { min-height: 63px; gap: .5rem; flex-wrap: wrap; padding-block: .5rem; }
  .brand { font-size: 1.07rem; gap: .35rem; }
  .brand-mark { width: 26px; height: 26px; padding: 5px; }
  .brand-mark i { height: 15px; }
  .brand-mark i + i { height: 10px; }
  nav { gap: .5rem; }
  nav a { font-size: .79rem; }
  nav .button.small { font-size: .79rem; padding: .37rem .42rem; }
  .hero, .trial-grid, .form-grid { grid-template-columns: minmax(0,1fr); }
  .hero { padding: 2.65rem 0 2.3rem; }
  .hero-board { padding: 1rem; }
  .page:not(#view-home) { padding-top: 1.8rem; }
  .matrix-head { display: none; }
  .matrix-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .matrix-row:first-of-type { border-top: 0; }
  .matrix-row h3 { grid-column: 1 / -1; background: #eaf1ec; }
  .matrix-row > * { padding: .58rem .58rem; }
  .matrix-row > div:nth-child(2) { border-left: 0; }
  .matrix-row p { font-size: .91rem; }
  .mobile-name { display: block; color: var(--accent-dark); font-size: .82rem; overflow-wrap: anywhere; }
}
.arm-stats .count-warning { color: var(--warm-ink); font-weight: 690; max-width: 14ch; }
.start-panel,.review-panel { padding:clamp(1rem,2.5vw,1.8rem); border:1px solid var(--line); border-radius:14px; background:white; margin:1rem 0; }
.start-panel { max-width:960px; border-top:4px solid var(--accent); }
.start-options,.file-actions { margin:.9rem 0; }
#outcome-form { border-top:1px solid var(--line); margin-top:1.3rem; padding-top:1.3rem; }
#outcome-form > .field { margin-block:1rem; }
.citation-preview { border-radius:8px; background:var(--paper); padding:.9rem; overflow-wrap:anywhere; }
.citation-preview h3,.paper-title { font-size:1.05rem; line-height:1.35; }
.citation-preview details { font-size:.9rem; margin:.5rem 0; }
#view-review { max-width:960px; }
.review-panel .section-title { margin:0 0 .8rem; }
.review-panel .lens { margin:.5rem 0 0; box-shadow:none; }
.review-panel form { margin:1rem 0 0; }
.review-slot { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; justify-content:space-between; margin:.5rem 0; padding:.7rem; background:var(--paper); border-radius:6px; }
.review-slot p { margin:0; font-size:.9rem; }
.review-table { overflow-x:auto; margin:1rem 0; }
.review-table table { width:100%; border-collapse:collapse; table-layout:fixed; }
.review-table caption { text-align:left; font-weight:700; margin:.4rem 0; }
.review-table th,.review-table td { text-align:left; vertical-align:top; border:1px solid var(--line); padding:.45rem; overflow-wrap:anywhere; }
.review-table small { display:block; color:var(--warm-ink); font-size:.8rem; }
.review-table .different { background:var(--warm); }
.review-panel summary { min-height:35px; }
.review-panel label,.review-panel p,.paper-title,.page-head h1 { overflow-wrap:anywhere; }
#worksheet-form fieldset > h2 { margin-bottom:.7rem; }
.clinical-claims { display: grid; gap: .85rem; }
.clinical-claim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); align-items: start; gap: 1rem 1.35rem; padding: clamp(.9rem, 2.4vw, 1.5rem); border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.clinical-claim header { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .85rem; }
.clinical-claim h3 { margin: 0; font-size: 1.18rem; }
.claim-draft { padding: .8rem 1rem; border-radius: 8px; background: var(--paper); }
.claim-draft .eyebrow { margin-bottom: .38rem; }
.claim-draft blockquote { margin: 0; }
.claim-review p:has(> strong:only-child) { margin-bottom: .25rem; }
.claim-sources { display: flex; flex-wrap: wrap; column-gap: 1rem; row-gap: .3rem; }
.clinical-summary { margin-top: 2rem; padding: clamp(1rem, 2.8vw, 1.65rem); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--mint); }
.clinical-summary h2 { margin-bottom: .9rem; }
.clinical-summary p { max-width: 90ch; }
@media (max-width: 600px) {
  .clinical-claim { grid-template-columns: minmax(0,1fr); gap: .65rem; }
}
