:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #66645e;
  --line: #dedbd3;
  --line-strong: #c8c3b8;
  --paper: #ffffff;
  --canvas: #f3f1ec;
  --gold: #b89455;
  --gold-dark: #7c6133;
  --gold-soft: #f1e8d6;
  --black: #11110f;
  --success: #2f654e;
  --danger: #9f382d;
  --shadow: 0 18px 50px rgba(25, 23, 18, .09);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 5% 2%, rgba(184, 148, 85, .12), transparent 25rem), linear-gradient(180deg, #f8f7f4 0, var(--canvas) 34rem, #efede8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.topbar-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { display: block; width: 130px; height: auto; }
.store-link { color: #463a30; font-size: .88rem; font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 3px; }

.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 70px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--gold-dark); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { max-width: 830px; margin: 0; font-size: clamp(2.15rem, 5.4vw, 4.35rem); line-height: .98; letter-spacing: -.035em; }
.intro-copy { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 1.03rem; }
.time-note { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--muted); font-size: .88rem; font-weight: 700; }
.time-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(184,148,85,.13); }

.tool-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.step-rail { position: sticky; top: 22px; padding: 24px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.78); box-shadow: 0 14px 38px rgba(30,26,19,.05); backdrop-filter: blur(10px); }
.step-rail-label { margin: 0 0 16px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.step-list { list-style: none; padding: 0; margin: 0; }
.step-list li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 11px; align-items: center; min-height: 54px; color: #77736b; font-size: .88rem; font-weight: 650; }
.step-list li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 41px; width: 1px; height: 26px; background: var(--line); }
.step-dot { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: #77736b; font-size: .8rem; font-weight: 800; }
.step-list li.is-active { color: var(--ink); }
.step-list li.is-active .step-dot { background: var(--black); border-color: var(--black); color: #fff; box-shadow: 0 0 0 5px rgba(184,148,85,.18); }
.step-list li.is-done .step-dot { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-dark); }
.rail-note { margin: 20px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; }

.tool-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); }
.tool-accent { height: 5px; background: linear-gradient(90deg, var(--gold-dark), #dfc48d 55%, var(--gold-dark)); }
.panel { display: none; padding: clamp(25px, 5vw, 46px); }
.panel.is-active { display: block; animation: panel-in .28s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.panel-kicker { margin: 0 0 6px; color: var(--gold-dark); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.panel h2 { margin: 0; font-size: clamp(1.85rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -.025em; }
.panel-lead { max-width: 720px; margin: 11px 0 31px; color: var(--muted); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset, .field-group + .field-group, fieldset + .field-group, .field-group + fieldset { margin-top: 31px; }
legend, .field-label { display: block; width: 100%; margin: 0 0 12px; color: var(--ink); font-size: .95rem; font-weight: 780; }
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.required { color: var(--gold-dark); }
.compact-group { margin-top: 24px; }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice { position: relative; min-width: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfaf8; color: #4f4d48; text-align: center; line-height: 1.25; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease; }
.choice small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.25; }
.choice input:checked + span { border-color: var(--gold-dark); background: var(--gold-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold); }
.choice input:focus-visible + span { outline: 3px solid rgba(184,148,85,.32); outline-offset: 2px; }
.choice span:hover { border-color: var(--gold); transform: translateY(-1px); }

.unit-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #f4f2ed; }
.unit-toggle .choice span { min-height: auto; min-width: 112px; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; font-size: .88rem; }
.unit-toggle .choice input:checked + span { background: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.09); }

.input-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.input-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input-grid.one { grid-template-columns: minmax(0, 300px); }
.input-wrap { min-width: 0; }
.input-wrap label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.input-unit { position: relative; }
.input-unit input { width: 100%; min-height: 52px; padding: 11px 54px 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font-size: 1rem; outline: none; transition: border-color .16s, box-shadow .16s; }
.input-unit input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(184,148,85,.18); }
.input-unit b { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; font-weight: 750; pointer-events: none; }

.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.check-choice { position: relative; }
.check-choice input { position: absolute; opacity: 0; }
.check-choice span { min-height: 74px; display: flex; flex-direction: column; justify-content: center; padding: 12px 13px 12px 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfaf8; cursor: pointer; }
.check-choice span::before { content: ""; position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.check-choice input:checked + span { border-color: var(--gold-dark); background: var(--gold-soft); }
.check-choice input:checked + span::before { border-color: var(--gold-dark); background: var(--gold-dark); box-shadow: inset 0 0 0 4px #fff; }
.check-choice input:focus-visible + span { outline: 3px solid rgba(184,148,85,.32); outline-offset: 2px; }
.check-choice strong { font-size: .91rem; }
.check-choice small { margin-top: 2px; color: var(--muted); font-size: .75rem; }

.conditional { display: none; margin-top: 20px; padding: 20px; border: 1px solid #dfd6c5; border-radius: var(--radius-md); background: #faf7f0; }
.conditional.is-visible { display: block; }
.conditional fieldset + fieldset, .conditional .input-grid + fieldset { margin-top: 24px; }
.fixture-preference { border-color: #cbb17e; background: linear-gradient(145deg, #fffdf8, #faf4e8); }
.fixture-lock-note { margin: -3px 0 15px; color: var(--muted); font-size: .86rem; }
.fixture-option.is-hidden { display: none; }
.form-error { min-height: 24px; margin: 20px 0 0; color: var(--danger); font-size: .88rem; font-weight: 700; }
.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 27px; padding-top: 22px; border-top: 1px solid var(--line); }
.action-right { margin-left: auto; }

.btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 1px solid transparent; border-radius: 999px; background: var(--black); color: #fff; font-weight: 780; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,15,14,.16); }
.btn:focus-visible { outline: 3px solid rgba(184,148,85,.4); outline-offset: 3px; }
.btn.secondary { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.btn.gold { background: var(--gold-dark); }
.btn.text { min-height: 42px; padding: 8px 10px; background: transparent; color: var(--muted); }
.btn.text:hover { box-shadow: none; color: var(--ink); }

.results-panel { padding: 0; }
.results-head { position: relative; overflow: hidden; padding: clamp(28px, 5vw, 48px); background: var(--black); color: #fff; }
.results-head::after { content: ""; position: absolute; right: -65px; top: -80px; width: 220px; height: 220px; border: 1px solid rgba(200,167,107,.48); transform: rotate(45deg); }
.results-head .panel-kicker { color: #d7bb85; }
.results-head h2 { max-width: 680px; }
.results-summary { max-width: 770px; margin: 12px 0 0; color: #d8d5ce; }
.results-body { padding: clamp(23px, 5vw, 45px); }
.result-overview { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 11px; margin-bottom: 24px; }
.overview-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #faf9f6; }
.overview-card span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.overview-card strong { display: block; overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; line-height: 1.25; font-weight: 500; }

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.result-card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.result-card.wide { grid-column: 1 / -1; }
.result-card.emphasis { border-color: #cbb17e; background: linear-gradient(145deg, #fffdf8, #faf4e8); }
.result-card.warning { border-color: #dfc2bd; background: #fffaf9; }
.result-card h3 { margin: 0 0 10px; font-size: 1.28rem; line-height: 1.2; }
.result-card p { margin: 0; color: #52504b; }
.result-card p + p { margin-top: 9px; }
.result-card ul { margin: 10px 0 0; padding-left: 20px; color: #52504b; }
.result-card li + li { margin-top: 7px; }
.result-card strong { color: var(--ink); }
.result-badge { display: inline-flex; align-items: center; margin-bottom: 11px; padding: 4px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-dark); font-size: .69rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.result-card.warning .result-badge { background: #f4e1de; color: #7e3028; }

.spec-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.spec-item { padding: 13px 14px; border: 1px solid #e3ded4; border-radius: 10px; background: #fff; }
.spec-item span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.spec-item strong { display: block; font-size: .92rem; line-height: 1.35; }
.formula-note { margin-top: 13px; padding: 13px 15px; border-radius: 10px; background: #f6f3ed; color: var(--muted); font-size: .82rem; }
.assumption-list { margin-top: 12px; }
.confidence { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--success); font-size: .8rem; font-weight: 750; }
.confidence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

.notice { margin-top: 18px; padding: 18px 19px; border-left: 4px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f6f3ed; color: #59564f; font-size: .86rem; }
.planning-basis { margin-top: 13px; color: var(--muted); font-size: .78rem; }
.planning-basis a { color: var(--gold-dark); font-weight: 720; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; padding-top: 22px; border-top: 1px solid var(--line); }
.copy-status { min-height: 22px; margin: 10px 0 0; color: var(--success); font-size: .83rem; font-weight: 700; }

.footer { margin-top: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .79rem; }
.footer p { max-width: 760px; margin: 0; }
.footer a { font-weight: 750; }

@media (max-width: 1000px) {
  .result-overview { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 13px; }
  .tool-layout { grid-template-columns: 1fr; }
  .step-rail { position: static; padding: 15px; }
  .step-rail-label, .rail-note { display: none; }
  .step-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .step-list li { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: auto; text-align: center; font-size: .67rem; }
  .step-list li:not(:last-child)::after { left: calc(50% + 18px); right: calc(-50% + 18px); top: 14px; width: auto; height: 1px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-card.wide { grid-column: auto; }
}

@media (max-width: 650px) {
  .topbar-inner { width: min(100% - 24px, 1120px); min-height: 78px; }
  .brand-logo { width: 108px; }
  .store-link { font-size: .76rem; }
  .page-shell { width: min(100% - 22px, 1120px); padding: 35px 0 42px; }
  .intro { margin-bottom: 20px; }
  .intro-copy { font-size: .96rem; }
  .panel { padding: 24px 18px; }
  .choice-grid, .choice-grid.four { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .choice-grid.two { grid-template-columns: 1fr; }
  .choice span { min-height: 54px; padding: 10px; font-size: .9rem; }
  .input-grid, .input-grid.two, .input-grid.one { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .unit-toggle { width: 100%; }
  .unit-toggle .choice span { min-width: 0; }
  .panel-actions { align-items: stretch; }
  .panel-actions .btn:not(.text) { flex: 1; }
  .result-overview { grid-template-columns: 1fr; }
  .results-body { padding: 22px 17px; }
  .result-card { padding: 20px 17px; }
  .spec-list { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
  .footer { flex-direction: column; }
}

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