:root {
  color-scheme: light;
  font: 100%/1.5 system-ui, sans-serif;
  color: #172936;
  background: #edf2f4;
  --muted: #465e6e;
  --line: #d3dfe4;
  --navy: #112d40;
  --blue: #1e63a4;
  --orange: #a44812;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, figure { margin: 0; }
a { color: #174e80; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #aa4d13; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }

.hero {
  color: #fff;
  background-color: var(--navy);
  background-image: linear-gradient(90deg, transparent 49%, #ffffff12 49%, #ffffff12 52%, transparent 52%),
    linear-gradient(0deg, transparent 49%, #ffffff12 49%, #ffffff12 52%, transparent 52%);
  background-size: 41px 41px;
  padding: clamp(29px, 5vw, 64px) 0 clamp(53px, 7vw, 91px);
}
.eyebrow { font-size: .73rem; font-weight: 800; letter-spacing: .12em; }
.hero .eyebrow { color: #ffc795; display: flex; align-items: center; gap: 9px; }
.hero .eyebrow::before { content: ""; width: 18px; height: 3px; background: #ffc795; }
h1 { max-width: 20ch; margin-top: 9px; font-size: clamp(2rem, 5vw, 3.85rem); line-height: 1.06; letter-spacing: -.042em; text-wrap: balance; }
h2 { font-size: 1.25rem; line-height: 1.24; letter-spacing: -.023em; }
h3 { font-size: 1rem; }
.intro { color: #e2edf4; margin-top: 14px; max-width: 53ch; }

main { position: relative; margin-top: -28px; display: grid; gap: 14px; }
.card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 15px; padding: clamp(14px, 2.45vw, 26px); }
.dimensions { box-shadow: 0 7px 22px #122e4010; }
.field-help { margin-bottom: 12px; color: var(--muted); font-size: .91rem; }
fieldset { margin: 0; min-width: 0; border: 0; padding: 0; }
.field-grid, .results-grid { display: grid; gap: 11px; }
.field label, .selectors label { display: block; font-size: .9rem; font-weight: 750; margin-bottom: 4px; }
.input-unit { position: relative; }
.input-unit span { pointer-events: none; position: absolute; inset: 0 13px 0 auto; display: grid; place-items: center; color: var(--muted); font-size: .87rem; }
input, select { width: 100%; color: #172936; border: 1px solid #8da3b0; border-radius: 8px; background: #f7fafb; min-height: 44px; }
input { padding: 8px 35px 8px 12px; }
input::placeholder { color: #526977; }
input[aria-invalid="true"] { border-color: #9b321c; }
.error { margin-top: 4px; color: #9b321c; font-size: .86rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dimensions .actions { margin-top: 14px; display: grid; }
button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 8px 15px; font-weight: 750; }
.primary { color: white; background: #185990; }
.primary:hover { background: #114878; }
.secondary { color: #173c59; border-color: #9bb0bf; background: white; }
.secondary:hover { background: #eaf3fa; }
button:disabled { cursor: default; opacity: .63; }

.verdict { border-left: 4px solid #c96727; background: #fff6eb; }
.verdict .eyebrow { color: var(--orange); margin-bottom: 5px; }
.verdict h2 { font-size: clamp(1.25rem, 3vw, 1.8rem); max-width: 48ch; }
.verdict p:last-child { margin-top: 6px; color: #53473d; font-size: .91rem; }
.results-grid { gap: 14px; align-items: start; }
.selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
select { display: block; padding: 7px; margin-top: 3px; }
figure { margin-top: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #f2f7fa; }
svg { display: block; width: 100%; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 5px; color: var(--muted); font-size: .73rem; }
.legend i { width: 10px; height: 10px; display: inline-block; vertical-align: 0; border-radius: 2px; }
.room-key { background: white; border: 1px solid #526c7c; }
.table-key { background: var(--blue); }
.margin-key { background: #b75920; }
.hint { margin-top: 8px; color: var(--muted); font-size: .83rem; }

table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; margin-top: 10px; font-size: .85rem; }
thead { color: var(--muted); background: #edf3f6; }
th, td { padding: 8px 6px; vertical-align: top; overflow-wrap: anywhere; }
thead th:first-child { width: 31%; border-radius: 5px 0 0 5px; }
thead th:last-child { border-radius: 0 5px 5px 0; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody span { display: block; color: var(--muted); font-weight: 400; }
td strong { display: block; color: #1e4260; }
td[data-fit="false"] strong { color: #873a18; }
td[data-selected="true"] { background: #ebf4fc; }
.help { display: grid; gap: 12px; }
.help p { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.static-example { padding: 12px; border-radius: 8px; background: #edf3f6; }
.footer { padding: 17px 0 24px; color: var(--muted); font-size: .85rem; }
.footer details { margin-top: 12px; }
.footer details p, .footer .actions { margin-top: 7px; }

@media (min-width: 640px) {
  .field-grid, .help { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .dimensions .actions { display: flex; }
  .static-example { align-self: start; }
}
@media (min-width: 900px) {
  .results-grid:has(#plan:not([hidden])) { grid-template-columns: 1fr 1fr; }
  .dimensions { display: grid; grid-template-columns: minmax(155px, .75fr) 2.6fr; gap: 25px; align-items: start; }
  .field-help { margin: 29px 0 0; }
}
