:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #fff;
  --text: #0f172a;
  --muted: #475569;
  --border: #dce2e9;
  --control-border: #7d8998;
  --primary: #1e3a5f;
  --on-primary: #fff;
  --soft: #eef3f9;
  --positive: #19613e;
  --negative: #9a2525;
  --notice: #fff4da;
  --notice-text: #654700;
  --series-0: #2459a6;
  --series-1: #9a4c13;
  --series-2: #1f735b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111a27;
    --surface: #192435;
    --text: #eef3fa;
    --muted: #b9c6d7;
    --border: #39485b;
    --control-border: #8c9eb5;
    --primary: #8dc2ff;
    --on-primary: #101d2d;
    --soft: #23344b;
    --positive: #7dd6a0;
    --negative: #ffb1ad;
    --notice: #352a15;
    --notice-text: #ffe0a0;
    --series-0: #8bc1ff;
    --series-1: #ffbd85;
    --series-2: #66d2ad;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.65 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
select,
label:has(input[type='checkbox']) {
  cursor: pointer;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: var(--primary);
  text-underline-offset: 4px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}
.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}
.preview-notice {
  padding: 8px 20px;
  background: var(--notice);
  color: var(--notice-text);
  font-size: 13px;
  text-align: center;
}
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 750;
  text-decoration: none;
  color: var(--text);
}
.brand svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
}
nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 7px;
  font-size: 14px;
}
nav a:hover,
nav a[aria-current='page'] {
  background: var(--soft);
  color: var(--primary);
}
.page-intro {
  padding-block: 44px 26px;
  max-width: 820px;
}
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}
.breadcrumbs a {
  padding-left: 0;
  min-height: 36px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  margin: 0 0 12px;
}
h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 760;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
p {
  margin: 0 0 16px;
}
.lead {
  color: var(--muted);
  max-width: 70ch;
  font-size: 17px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 14px;
  flex-wrap: wrap;
}
.section-heading h2 {
  margin: 0;
}
.panel {
  background: var(--surface);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 0;
}
.comparison-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 32px;
}
.advice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 36px;
}
.mini-mark {
  width: 42px;
  height: 42px;
  stroke: var(--primary);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 28px;
}
.advice p {
  max-width: 46ch;
  color: var(--muted);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 650;
  text-decoration: none;
  transition:
    background-color 160ms,
    box-shadow 160ms;
}
.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.primary:hover {
  box-shadow: 0 0 0 3px var(--soft);
}
.unit-controls {
  display: inline-flex;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 3px;
  background: var(--surface);
  gap: 4px;
}
.unit-controls button {
  min-height: 40px;
  padding: 6px 14px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}
.unit-controls button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--on-primary);
}
.table-scroll {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 100%;
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
  font-size: 15px;
  table-layout: fixed;
}
th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
thead th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  font-weight: 650;
}
th:first-child {
  width: 32%;
}
tbody th {
  font-weight: 650;
}
td {
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child > * {
  border-bottom: 0;
}
tbody a {
  text-decoration: none;
}
.chips {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips legend {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}
.chips label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13px;
}
input[type='checkbox'] {
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
}
.chips label:has(input:disabled:not(:checked)) {
  opacity: 0.6;
}
.overlay svg,
.floor-plan svg {
  display: block;
  width: 100%;
  height: 400px;
}
.overlay {
  min-height: 200px;
}
.footprint {
  fill-opacity: 0.09;
  stroke-width: 2;
}
.footprint:hover,
.footprint:focus-visible {
  fill-opacity: 0.2;
  stroke-width: 4;
}
.series-0 {
  fill: var(--series-0);
  stroke: var(--series-0);
}
.series-1 {
  fill: var(--series-1);
  stroke: var(--series-1);
  stroke-dasharray: 9 5;
}
.series-2 {
  fill: var(--series-2);
  stroke: var(--series-2);
  stroke-dasharray: 3 4;
}
.chart-label {
  fill: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.chart-secondary {
  fill: var(--muted);
  font-size: 13px;
}
.chart-axis {
  stroke: var(--control-border);
  fill: none;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 14px 0;
  font-size: 13px;
  color: var(--muted);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.swatch {
  width: 14px;
  height: 10px;
  display: inline-block;
  border: 2px solid;
}
.swatch-0 {
  border-color: var(--series-0);
}
.swatch-1 {
  border-color: var(--series-1);
  border-style: dashed;
}
.swatch-2 {
  border-color: var(--series-2);
  border-style: dotted;
}
.chart-caption {
  min-height: 48px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}
.comparison-summary {
  font-size: 18px;
  color: var(--text) !important;
  font-weight: 600;
}
.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: start;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.form-panel .section-heading {
  justify-content: flex-start;
  margin-top: 30px;
}
.form-panel .section-heading:first-child {
  margin-top: 0;
}
.form-panel h2 {
  font-size: 18px;
}
.step-number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 750;
  background: var(--soft);
  color: var(--primary);
  border-radius: 50%;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.measure-help {
  margin-bottom: 16px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
}
.measure-help summary {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.measure-help > div {
  padding: 2px 12px 12px;
}
.measure-help p:last-child,
.layout-requirements p:last-child {
  margin-bottom: 0;
}
.layout-requirements {
  padding: 16px;
  margin-block: 16px;
  background: var(--soft);
  border-radius: 8px;
}
.layout-requirements h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.required-dimensions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 12px;
}
.required-dimensions dt {
  color: var(--muted);
  font-size: 13px;
}
.required-dimensions dd {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.field {
  display: block;
  margin-bottom: 16px;
  min-width: 0;
}
.form-grid .field:has(#nightstand-width),
.form-grid .field:has(#nightstand-depth) {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 0;
}
.field > span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.unit-label {
  color: var(--muted);
  font-weight: 400;
}
input[type='number'],
select {
  width: 100%;
  min-height: 46px;
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 16px;
}
.field input:disabled {
  color: var(--muted);
  background: var(--soft);
  cursor: not-allowed;
}
.field-error {
  display: block;
  color: var(--negative);
  font-size: 12px;
  margin-top: 5px;
}
[aria-invalid='true'] {
  border-color: var(--negative) !important;
}
#form-errors {
  padding: 16px;
  border: 2px solid var(--negative);
  border-radius: 8px;
  margin-bottom: 20px;
}
#form-errors h2 {
  font-size: 18px;
}
#form-errors ul {
  padding-left: 20px;
  margin: 0;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.advice .hint {
  margin-top: 14px;
}
.result-panel {
  min-height: 560px;
}
.pending-result {
  min-height: 500px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}
.plan-room {
  stroke: var(--control-border);
  stroke-width: 2;
  fill: var(--soft);
}
.plan-bed {
  stroke: var(--series-0);
  fill: var(--series-0);
  fill-opacity: 0.16;
  stroke-width: 2;
}
.plan-nightstand {
  stroke: var(--series-1);
  fill: var(--series-1);
  fill-opacity: 0.2;
  stroke-width: 2;
}
.plan-clearance {
  fill: var(--series-2);
  fill-opacity: 0.1;
  stroke: var(--series-2);
  stroke-dasharray: 3 4;
}
.positive {
  color: var(--positive);
  font-weight: 650;
}
.negative {
  color: var(--negative);
  font-weight: 650;
}
.badge {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  border-radius: 6px;
  padding: 4px 9px;
}
.method {
  max-width: 78ch;
  margin-top: 40px;
  color: var(--muted);
}
.method h2 {
  color: var(--text);
}
.prose {
  max-width: 78ch;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding-block: 22px 32px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p {
  margin: 0;
}
.empty-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  color: var(--muted);
}
.notice {
  padding: 16px;
  background: var(--notice);
  color: var(--notice-text);
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 12px 18px;
  background: var(--primary);
  color: var(--on-primary);
  z-index: 10;
}
.skip-link:focus {
  top: 12px;
}
@media (max-width: 780px) {
  .container {
    width: calc(100% - 32px);
  }
  .comparison-layout,
  .tool-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 6px;
    padding-block: 15px;
  }
  .page-intro {
    padding-top: 30px;
  }
  .panel,
  .advice {
    padding: 22px;
  }
  .mini-mark {
    margin-bottom: 16px;
  }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .result-panel {
    min-height: 430px;
  }
}
@media (max-width: 400px) {
  .brand {
    font-size: 18px;
  }
  nav a {
    padding-inline: 10px;
  }
  .panel {
    padding: 17px;
  }
  .form-grid {
    gap: 10px;
  }
  .form-grid .field:has(select) {
    grid-column: 1 / -1;
  }
  .preview-notice {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.review-date {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}
.table-caption {
  padding: 0.5rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0.35rem 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.privacy-notice {
  position: relative;
  width: calc(100% - 2rem);
  max-width: 40rem;
  margin: 1rem auto;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control-border);
  border-radius: 0.75rem;
  z-index: 10;
  box-shadow: 0 4px 24px #0002;
}
.privacy-notice p {
  margin-top: 0;
}
dialog {
  width: min(36rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  border: 1px solid var(--control-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: #0007;
}
.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.privacy-actions .button {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--control-border);
}
.consent-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-block: 1.5rem;
}
.consent-option input {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
}
.consent-option .hint {
  display: block;
}
