:root {
  color-scheme: light;
  --ink: #17312f;
  --ink-strong: #102726;
  --ink-soft: #385b59;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --mist: #e7f0ef;
  --line: #d3ddda;
  --muted: #607876;
  --coral: #dc634f;
  --coral-dark: #b84738;
  --sun: #f4bd54;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.5;
}

button,
input { font: inherit; }

button,
label,
input { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 9px 12px;
  color: var(--ink-strong);
  background: var(--sun);
  border-radius: 4px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  min-height: 68px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  width: fit-content;
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: 800;
  text-decoration: none;
}

.brand span { color: var(--coral); }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a[aria-current="page"] { color: var(--ink); }

.header-action {
  justify-self: end;
  padding: 8px 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 700;
}

.site-header > .header-action:last-child { grid-column: 3; }

main { overflow: hidden; }

.planner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 70px 28px 80px;
}

.planner-heading { max-width: 680px; }

.eyebrow,
.section-index {
  margin: 0;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1,
h2,
h3 { margin-top: 0; }

h1 {
  max-width: 620px;
  margin-bottom: 12px;
  color: var(--ink-strong);
  font-size: 52px;
  line-height: 1.04;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  align-items: start;
  gap: 56px;
  margin-top: 52px;
}

.planner-form { min-width: 0; }

.form-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.form-section:last-of-type { border-bottom: 1px solid var(--line); }

.section-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 24px;
}

.section-heading h2,
.access-section h2 {
  margin-bottom: 4px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.18;
}

.section-heading p:last-child,
.access-section p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset + fieldset { margin-top: 22px; }

legend {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
}

.segmented-control {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 4px;
  background: var(--mist);
  border-radius: var(--radius);
}

.room-control { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.furnishing-control { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.segmented-control label {
  min-width: 0;
  position: relative;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 8px 6px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.segmented-control input:checked + span {
  color: var(--ink-strong);
  background: var(--surface);
  border-color: #c7d4d0;
  box-shadow: 0 1px 2px rgba(16, 39, 38, 0.08);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stepper-field,
.box-field {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 750;
}

.box-field { margin-top: 10px; }

.stepper {
  display: grid;
  grid-template-columns: 34px 36px 34px;
  flex: 0 0 auto;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.stepper button {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  font-size: 19px;
  line-height: 1;
}

.stepper button:hover { background: var(--mist); }

.stepper input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink-strong);
  background: var(--surface);
  border: 0;
  border-inline: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }

.access-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.access-section .section-index { margin-bottom: 10px; }

.switch-label {
  display: inline-flex;
  max-width: 220px;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.switch-label input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  background: #b9c8c4;
  border-radius: 14px;
  transition: background-color 160ms ease;
}

.switch::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-radius: 50%;
  content: "";
  transition: transform 160ms ease;
}

.switch-label input:checked + .switch { background: var(--ink); }
.switch-label input:checked + .switch::after { transform: translateX(18px); }
.switch-label input:focus-visible + .switch { outline: 3px solid var(--sun); outline-offset: 3px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 26px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 800;
}

.primary-button {
  color: var(--surface);
  background: var(--coral);
}

.primary-button:hover { background: var(--coral-dark); }

.text-button {
  min-height: 40px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 750;
}

.result-panel {
  position: sticky;
  top: 22px;
  min-width: 0;
  padding: 28px;
  color: var(--surface);
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 18px 34px rgba(16, 39, 38, 0.13);
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-panel .eyebrow { color: var(--sun); }

.update-status {
  margin: 0;
  color: #c3d8d1;
  font-size: 13px;
  font-weight: 750;
}

.unit-label {
  margin: 10px 0 6px;
  color: var(--surface);
  font-size: 44px;
  line-height: 1;
}

.fit-message {
  min-height: 44px;
  margin: 0;
  color: #d2e3de;
  font-size: 15px;
}

.capacity-check {
  margin: 24px 0;
  padding: 16px;
  background: #214541;
  border: 1px solid #456561;
  border-radius: 4px;
}

.capacity-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.capacity-heading h3,
.capacity-heading p { margin: 0; }
.capacity-heading h3 { color: var(--surface); font-size: 14px; }
.capacity-heading p { color: #c3d8d1; font-size: 12px; font-weight: 700; text-align: right; }

.capacity-meter {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  background: #456561;
  border-radius: 2px;
}

.capacity-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sun);
  border-radius: inherit;
  transition: width 180ms ease;
}

.capacity-meter.is-over-capacity span { background: var(--coral); }

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 18px 0;
  border-block: 1px solid #456561;
}

.result-metrics div { min-width: 0; }
.result-metrics dt { color: #a7c1ba; font-size: 12px; }
.result-metrics dd { margin: 4px 0 0; color: var(--surface); font-size: 14px; font-weight: 800; }

.choice-section { padding-top: 21px; }
.choice-section h3 { margin-bottom: 10px; color: #c7d9d4; font-size: 14px; }
.plan-choices { display: grid; gap: 7px; }

.plan-choice {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  color: #bbd1cb;
  border: 1px solid #456561;
  border-radius: 4px;
}

.plan-choice p { margin: 0; font-size: 12px; }
.plan-choice strong { display: block; color: var(--surface); font-size: 16px; }
.plan-choice > span { max-width: 92px; color: #b4cbc4; font-size: 12px; text-align: right; }


.result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 21px; }
.secondary-button { width: 100%; color: var(--ink-strong); background: var(--sun); }
.secondary-button:hover { background: #e5aa43; }
.result-disclaimer { margin: 15px 0 0; color: #9eb8b1; font-size: 12px; }

.guide-strip {
  padding: 78px max(28px, calc((100vw - 1184px) / 2));
  color: var(--surface);
  background: var(--ink-strong);
}

.guide-strip .eyebrow { color: var(--sun); }
.guide-strip h2 { max-width: 760px; margin: 12px 0 22px; font-size: 30px; line-height: 1.16; }
.guide-strip > p:last-child { max-width: 660px; margin: 0; color: #d7e8e2; }
.guide-strip .method-boundary { margin-top: 14px; color: #b9d0c8; font-size: 14px; }

.practical-notes {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 28px 70px;
  border-bottom: 1px solid var(--line);
}

.notes-intro { max-width: 580px; }
.notes-intro h2 { margin: 8px 0 0; color: var(--ink-strong); font-size: 28px; line-height: 1.16; }

.note-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 38px;
}

.note-list article { min-width: 0; padding-top: 16px; border-top: 2px solid var(--sun); }
.note-list h3 { margin-bottom: 7px; color: var(--ink-strong); font-size: 17px; line-height: 1.25; }
.note-list p { margin: 0; color: var(--muted); font-size: 14px; }

.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 42px;
}

.faq-list details { min-width: 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.faq-list summary { color: var(--ink-strong); cursor: pointer; font-size: 15px; font-weight: 800; }
.faq-list p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 28px 82px;
}

.legal-page h1 { margin-bottom: 8px; }
.legal-lead { margin: 0 0 48px; color: var(--muted); font-size: 15px; }
.legal-page section { padding: 22px 0; border-top: 1px solid var(--line); }
.legal-page h2 { margin-bottom: 8px; color: var(--ink-strong); font-size: 22px; line-height: 1.2; }
.legal-page section p { margin: 0; color: var(--ink-soft); }
.legal-return { margin: 30px 0 0; font-weight: 800; }
.legal-return a { color: var(--coral-dark); text-underline-offset: 4px; }

.not-found {
  display: grid;
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 28px;
  align-content: center;
  justify-items: start;
}

.not-found .brand { margin-bottom: 68px; }
.not-found h1 { margin: 8px 0 12px; }
.not-found > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 18px; }
.not-found .primary-button { display: inline-grid; margin-top: 28px; place-items: center; text-decoration: none; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px;
  color: var(--muted);
  font-size: 13px;
}

footer nav { display: flex; gap: 16px; }
footer a { color: var(--ink-soft); font-weight: 750; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .site-header { padding-inline: 22px; }
  .planner { padding-inline: 22px; }
  .planner-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, 0.74fr); gap: 32px; }
  .result-panel { padding: 22px; }
  h1 { font-size: 46px; }
}

@media (max-width: 720px) {
  .site-header { display: flex; min-height: 62px; gap: 16px; padding-inline: 18px; }
  .site-header nav { display: none; }
  .header-action { margin-left: auto; }
  .planner { padding: 44px 18px 52px; }
  h1 { font-size: 38px; }
  .lead { font-size: 17px; }
  .planner-layout { grid-template-columns: 1fr; gap: 28px; margin-top: 36px; }
  .result-panel { position: static; padding: 22px; }
  .form-section { padding-block: 23px; }
  .section-heading { margin-bottom: 20px; }
  .item-grid { grid-template-columns: 1fr; }
  .access-section { grid-template-columns: 1fr; gap: 18px; }
  .switch-label { max-width: none; }
  .unit-label { font-size: 40px; }
  .guide-strip { padding: 54px 18px; }
  .guide-strip h2 { font-size: 26px; }
  .practical-notes { padding: 42px 18px 54px; }
  .note-list, .faq-list { grid-template-columns: 1fr; gap: 16px; }
  .note-list { margin-top: 30px; }
  .faq-list { margin-top: 32px; }
  footer { padding-inline: 18px; }
  .legal-page { padding: 48px 18px 58px; }
  .legal-lead { margin-bottom: 34px; }
  .not-found { padding-inline: 18px; }
}

@media (max-width: 390px) {
  .room-control { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .room-control label:last-child { grid-column: span 2; }
  .result-metrics { gap: 8px; }
  .result-metrics dd { font-size: 13px; }
  .stepper-field, .box-field { padding-inline: 10px; }
  .result-actions { grid-template-columns: 1fr; }
}
