:root {
  --ink: #111d24;
  --ink-2: #1b2a33;
  --paper: #f3f4f1;
  --card: #ffffff;
  --line: #d8ddda;
  --muted: #68757a;
  --orange: #e39a32;
  --orange-soft: #fff0d8;
  --green: #0f7258;
  --green-soft: #e0f3ec;
  --red: #a2463d;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.45; }
button, input { font: inherit; }
.shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 44px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: #a86618; font-size: .76rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1 { max-width: 850px; margin: 0; font-size: clamp(1.8rem, 4vw, 3.4rem); line-height: .98; letter-spacing: -.055em; }
h1 span { color: var(--orange); font-style: italic; font-weight: 500; }
.database-status { display: flex; align-items: center; gap: 8px; flex: none; padding: 8px 11px; border: 1px solid #cfd8d4; border-radius: 999px; background: #fff; color: #4d5d62; font-size: .78rem; font-weight: 750; }
.database-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(15,114,88,.1); }

.calculator { display: grid; grid-template-columns: minmax(310px, .55fr) minmax(720px, 1.45fr); overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 22px 70px rgba(17,29,36,.08); }
.inputs { padding: 26px; border-right: 1px solid var(--line); }
.section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.section-heading > span { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 850; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.input-grid .wide { grid-column: 1 / -1; }
label em { color: #899396; font-size: .7rem; font-style: normal; font-weight: 600; }
label > span { display: block; margin-bottom: 6px; color: #526167; font-size: .84rem; font-weight: 720; }
.input-grid > label:not(.wide) { display: flex; min-width: 0; flex-direction: column; }
.input-grid > label:not(.wide) > span { display: flex; min-height: 2.9em; align-items: flex-end; }
.field { display: flex; align-items: center; border: 1px solid #ccd3d1; border-radius: 11px; background: #fafbfa; transition: .15s ease; }
.field:focus-within { border-color: #b97626; box-shadow: 0 0 0 3px rgba(227,154,50,.16); background: #fff; }
.field input { width: 100%; min-width: 0; padding: 12px 3px 12px 12px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1.12rem; font-weight: 820; }
.field b { padding: 0 11px 0 5px; color: #7a8689; font-size: .75rem; }
.tier-toggle { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid #ccd3d1; border-radius: 11px; background: #fafbfa; cursor: pointer; }
.tier-toggle input { width: 20px; height: 20px; flex: none; accent-color: var(--orange); }
.tier-toggle > span { margin: 0; }
.tier-toggle strong, .tier-toggle small { display: block; }
.tier-toggle strong { color: var(--ink); font-size: .84rem; }
.tier-toggle small { margin-top: 2px; color: var(--muted); font-size: .7rem; font-weight: 550; }
.height-settings { border-top: 1px solid var(--line); padding-top: 3px; }
.height-settings summary { padding: 7px 2px; color: #657378; cursor: pointer; font-size: .78rem; font-weight: 750; }
.height-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-top: 6px; }
.height-grid label { display: flex; min-width: 0; flex-direction: column; }
.height-grid label > span { display: flex; min-height: 4.35em; align-items: flex-end; }
button { width: 100%; margin-top: 18px; padding: 13px 18px; border: 0; border-radius: 11px; background: var(--orange); color: #231a0d; cursor: pointer; font-weight: 850; transition: .15s ease; }
button:hover { background: #efaa49; transform: translateY(-1px); }
.form-note { margin: 10px 4px 0; color: var(--muted); font-size: .76rem; }

.results { min-height: 470px; padding: 26px; background: var(--ink); color: #fff; }
.result-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.result-head p { margin: 0 0 3px; color: #aebbc0; font-size: .78rem; }
.result-head h2 { margin: 0; font-size: 1.25rem; }
.winner { padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 850; }
.comparison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); column-gap: 10px; row-gap: 0; }
.option { display: grid; grid-row: span 7; grid-template-rows: subgrid; padding: 18px; border: 1px solid rgba(255,255,255,.11); border-radius: 15px; background: rgba(255,255,255,.06); }
.option > * { min-width: 0; }
.option.plywood { border-color: rgba(67,194,151,.5); background: linear-gradient(145deg, rgba(15,114,88,.24), rgba(255,255,255,.065)); }
.option.full-depth { border-color: rgba(227,154,50,.5); background: linear-gradient(145deg, rgba(227,154,50,.16), rgba(255,255,255,.05)); }
.option-kicker { color: #9faeb3; font-size: .72rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.option.plywood .option-kicker { color: #8ee0c3; }
.price { margin: 6px 0 2px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 850; line-height: 1; letter-spacing: -.05em; }
.price-note { align-self: start; margin: 0 0 14px; color: #acb9bd; font-size: .75rem; }
.stat { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.09); color: #aebbc0; font-size: .8rem; }
.stat strong { color: #fff; text-align: right; }
.stat.advantage { margin: 0 -8px; padding: 7px 8px; border-radius: 7px; background: rgba(87,211,168,.12); color: #a8dcca; }
.stat.advantage strong { color: #9aebce; }
.stat.warning { margin: 0 -8px; padding: 7px 8px; border-radius: 7px; background: rgba(227,154,50,.12); color: #e5c28f; }
.stat.warning strong { color: #ffd79c; }
.benefits { display: flex; align-self: stretch; align-content: flex-start; align-items: flex-start; flex-wrap: wrap; gap: 6px; margin: -3px 0 12px; }
.benefits-placeholder { min-height: 30px; }
.benefits span { align-self: flex-start; flex: 0 0 auto; padding: 5px 7px; border: 1px solid rgba(142,224,195,.3); border-radius: 7px; color: #a7ead2; font-size: .69rem; font-weight: 800; line-height: 1.15; }
.plastic-benefits span { border-color: rgba(255,211,145,.32); color: #ffd391; }
.plastic-benefits .warning-badge { border-color: rgba(255,157,143,.38); color: #ffb3a8; }
.selection-reason { margin: 12px 2px 0; padding: 10px 12px; border-left: 3px solid var(--orange); background: rgba(255,255,255,.06); color: #c3cdd0; font-size: .76rem; }
.verdict { margin-top: 12px; padding: 15px; border-radius: 14px; background: #fff; color: var(--ink); }
.verdict strong { display: block; font-size: 1.08rem; }
.verdict p { margin: 4px 0 0; color: #5e6e73; font-size: .84rem; }
.verdict .positive { color: var(--green); }
.calculation-note { margin: 12px 2px 0; color: #9fadb1; font-size: .72rem; }
.result-details { margin-top: 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.045); }
.result-details summary { padding: 11px 13px; color: #c8d2d5; cursor: pointer; font-size: .8rem; font-weight: 800; }
.technical-wrap { overflow-x: auto; padding: 0 12px 12px; }
.technical-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.technical-table th, .technical-table td { padding: 8px; border-top: 1px solid rgba(255,255,255,.09); text-align: right; white-space: nowrap; }
.technical-table th:first-child, .technical-table td:first-child { color: #aebbc0; text-align: left; }
.technical-table th { color: #fff; font-size: .7rem; }
.error { display: grid; min-height: 410px; place-items: center; padding: 30px; text-align: center; color: #d5dddf; }
.error strong { display: block; margin-bottom: 5px; color: #fff; }

.method-note { display: grid; grid-template-columns: 220px 1fr; gap: 18px; margin-top: 16px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.62); }
.method-note strong { font-size: .88rem; }
.method-note p { margin: 0; color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .calculator { grid-template-columns: 1fr; }
  .inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  .comparison { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 20px, 1320px); padding-top: 18px; }
  .database-status { white-space: normal; }
  .input-grid, .comparison, .height-grid { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 10px; }
  .option { display: block; grid-row: auto; }
  .benefits-placeholder { display: none; }
  .stat { min-height: 0; }
  .input-grid > label:not(.wide) > span { min-height: 0; }
  .height-grid label > span { min-height: 0; }
  .inputs, .results { padding: 19px; }
  .method-note { grid-template-columns: 1fr; gap: 5px; }
  .result-head { flex-direction: column; }
}
