* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f3f6f1;
  --card: #fff;
  --ink: #142c25;
  --muted: #4d665c;
  --line: #d6e0d9;
  --green: #17634b;
  --deep: #103b31;
  --lime: #d7ee96;
  --amber: #f3b363;
  font: 100%/1.5 "Segoe UI", system-ui, sans-serif;
}
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2.04rem); line-height: 1.15; letter-spacing: -.032em; }
h3 { font-size: 1.14rem; line-height: 1.23; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #3e7e57; outline-offset: 4px; }
.hero :focus-visible { outline-color: white; }
.shell { width: min(1430px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: absolute; top: -400px; z-index: 10; background: #fff; padding: 12px 18px; }
.skip:focus { top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top { background: #fafffa; border-bottom: 1px solid var(--line); }
.top-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.24rem; font-weight: 780; letter-spacing: -.04em; text-decoration: none; }
nav { display: flex; gap: 23px; font-size: .91rem; color: #334f44; font-weight: 650; }
nav a { text-decoration-thickness: 1px; text-underline-offset: 5px; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; min-height: 304px; margin-top: 27px; border-radius: 24px; background: radial-gradient(ellipse at 75% 40%, #1e5848, var(--deep) 72%); color: #f5fae9; }
.hero-copy { padding: 36px 0 39px 50px; z-index: 1; }
.overline { margin-bottom: 10px; color: #d7ecaf; font-size: .83rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: clamp(2.4rem, 5.8vw, 5.2rem); line-height: .99; letter-spacing: -.066em; }
.hero-copy > p:nth-of-type(2) { max-width: 34rem; margin: 17px 0 21px; font-size: clamp(1rem, 1.35vw, 1.21rem); color: #e8f2e4; }
.loop-art { display: grid; place-items: center; padding: 4px 25px 0 0; }
.loop-art svg { width: min(100%, 530px); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: .94rem; text-decoration: none; text-align: center; }
.button:hover { filter: brightness(.95); }
.lime { background: var(--lime); color: var(--ink); }
.solid { background: var(--green); color: white; width: 100%; }
.outline { background: var(--card); color: #21543f; border-color: #a9beb1; }
.button:disabled { opacity: .58; cursor: default; }
#planner, #method { scroll-margin-top: 15px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 29px 0 13px; }
.section-head p { color: var(--muted); margin-top: 5px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.metric, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.metric { min-height: 128px; padding: 14px 19px 13px; }
.metric h3, .recommend p:first-child { font-size: .9rem; font-weight: 700; }
.metric strong { display: block; font-size: 2.63rem; font-weight: 765; line-height: 1.13; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.metric p { color: var(--muted); font-size: .89rem; margin-top: 6px; }
.metric.emphasis { background: #eaf4e6; border-color: #c8debf; }
.metric.caution { background: #fff2df; border-color: #efd7b7; }
.metric.caution p { color: #72471d; }
.workbench { display: grid; grid-template-columns: minmax(290px, .33fr) minmax(0, .67fr); gap: 13px; margin-top: 14px; align-items: start; }
.panel { min-width: 0; padding: 22px; }
.inputs > p, .result-head p { color: var(--muted); margin-top: 5px; font-size: .94rem; }
form { margin-top: 14px; }
label { display: block; font-size: .88rem; font-weight: 700; margin-bottom: 4px; }
input, textarea { color: var(--ink); background: #fbfdfa; border: 1px solid #aabeb1; border-radius: 8px; width: 100%; padding: 8px 10px; }
input { min-height: 41px; }
textarea { resize: vertical; min-height: 62px; display: block; }
[aria-invalid=true] { border-color: #9e311d; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.hint { margin-top: 6px; color: var(--muted); font-size: .84rem; }
#form-message { margin: 9px 0; color: #365649; font-size: .88rem; min-height: 1.32rem; }
#form-message.error { color: #9e311d; }
.result-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.toggle { flex: none; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; padding: 3px; gap: 2px; background: #edf3ee; }
.toggle button { min-height: 36px; border-radius: 7px; padding: 5px 10px; background: none; border: 0; font-weight: 700; color: #38554a; font-size: .86rem; }
.toggle button[aria-pressed=true] { background: var(--deep); color: white; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 15px 0 9px; color: #3d5a4e; font-size: .85rem; font-weight: 620; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.green-key::before, .bar-reuse { background: #287959; }
.amber-key::before, .bar-fallback { background: repeating-linear-gradient(-45deg, #f6c283 0 5px, #eaa754 5px 8px); }
#chart { display: grid; gap: 6px; }
.wave { display: grid; grid-template-columns: 53px minmax(20px, 1fr) 62px; gap: 10px; align-items: center; font-size: .83rem; }
.wave-label { color: #3e5b4d; font-weight: 650; }
.track { background: #edf2ed; min-height: 17px; border-radius: 4px; overflow: hidden; display: flex; }
.wave-number { text-align: right; font-variant-numeric: tabular-nums; }
.wave-number.has-gap { color: #814b14; font-weight: 750; }
.recommend { background: #ecf5e8; border: 1px solid #c5dcc3; border-radius: 13px; display: grid; grid-template-columns: minmax(105px,.36fr) minmax(0,.64fr); align-items: center; gap: 12px; margin-top: 15px; padding: 11px 14px; }
.recommend strong { font-variant-numeric: tabular-nums; font-size: 2.05rem; letter-spacing: -.055em; line-height: 1.12; }
#recommend-note { color: #385649; font-size: .89rem; font-weight: 500; }
.recommend button { margin-top: 6px; min-height: 34px; padding: 3px 10px; font-size: .83rem; }
details { margin-top: 11px; }
summary { color: #264e3d; font-weight: 700; padding: 7px 3px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; text-align: right; white-space: nowrap; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
th:first-child { text-align: left; }
tr.with-gap td:nth-last-child(2) { color: #814b14; font-weight: 750; }
.method { margin-top: 16px; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 14px; }
.method p { color: var(--muted); margin-top: 5px; font-size: .91rem; }
.method .footnote { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 9px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); padding-block: 20px; font-size: .87rem; }
@media (max-width: 900px) {
  .shell { width: calc(100% - 36px); }
  .hero-copy { padding-left: 27px; }
  .workbench { grid-template-columns: minmax(245px, .39fr) minmax(0, .61fr); }
  .panel { padding: 16px; }
  .result-head { flex-wrap: wrap; }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 24px); }
  .top-inner { min-height: 59px; }
  nav { gap: 12px; font-size: .8rem; }
  .hero { grid-template-columns: 1fr; margin-top: 13px; border-radius: 16px; }
  .hero-copy { padding: 26px 21px 5px; }
  .loop-art { padding: 0 12px 4px; }
  .loop-art svg { width: min(100%, 325px); }
  .section-head { margin-top: 22px; align-items: flex-start; flex-wrap: wrap; }
  .metrics { gap: 5px; }
  .metric { padding: 9px 7px; min-height: 107px; }
  .metric h3 { font-size: .77rem; overflow-wrap: anywhere; }
  .metric strong { font-size: clamp(1.24rem, 5.9vw, 2.15rem); }
  .metric p { font-size: .75rem; line-height: 1.3; }
  .workbench, .method-grid { grid-template-columns: minmax(0,1fr); }
  .method-grid { gap: 14px; }
}
