:root {
  --ink: #172a34;
  --ink-soft: #536773;
  --line: #d6e0e5;
  --line-strong: #b9c7cf;
  --paper: #ffffff;
  --canvas: #edf2f3;
  --navy: #12313b;
  --teal: #167b80;
  --teal-soft: #d9eff0;
  --teal-text: #12676b;
  --violet: #7467a8;
  --violet-soft: #ece9f7;
  --violet-text: #67599b;
  --amber: #ce8a2d;
  --amber-soft: #fff0d7;
  --amber-text: #8a5715;
  --coral: #d85f49;
  --coral-soft: #fde6e0;
  --coral-text: #9d3f2f;
  --room-1: #e6f0eb;
  --room-2: #e8eef6;
  --room-3: #edeaf7;
  --bath-1: #f3ece8;
  --bath-2: #e2f0f2;
  --kitchen: #f4ecdc;
  --hall: #e9ecee;
  --shadow: 0 20px 55px rgba(24, 45, 56, 0.1);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  color-scheme: light;
  font-family:
    Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

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

a {
  color: var(--teal);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    calc(24px + env(safe-area-inset-right, 0px))
    12px
    calc(24px + env(safe-area-inset-left, 0px));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--navy);
  color: white;
  box-shadow: 0 10px 30px rgba(18, 49, 59, 0.15);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
}

.brand-mark svg {
  width: 24px;
  fill: #e9f7f7;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce9eb;
  font-size: 12px;
  font-weight: 650;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #dce9eb;
  font-size: 12px;
  font-weight: 700;
}

.language-picker select {
  min-width: 132px;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  background: #234b57;
  color: #ffffff;
  font: inherit;
  color-scheme: dark;
}

.language-picker select:focus-visible {
  outline: 3px solid rgba(108, 213, 218, 0.42);
  outline-offset: 2px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f3b75c;
  box-shadow: 0 0 0 5px rgba(243, 183, 92, 0.15);
}

.app-shell {
  display: grid;
  min-height: calc(100vh - 74px);
  min-height: calc(100dvh - 74px);
  grid-template-columns: 255px minmax(500px, 1fr);
  grid-template-areas:
    "rooms workspace"
    "rooms details";
}

.rental-listing {
  padding: 32px clamp(16px, 3vw, 42px) 48px;
  background:
    radial-gradient(circle at 12% 0%, rgba(22, 123, 128, 0.08), transparent 34%),
    var(--canvas);
}

.rental-listing-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.rental-listing-header {
  max-width: 850px;
}

.rental-listing-header h2 {
  margin-bottom: 14px;
  color: var(--navy);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
}

.rental-listing-header > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

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

.rental-listing-block {
  padding: 22px;
  border: 1px solid #c9e2e3;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #f7fbfb, #ffffff);
}

.rental-listing-block h3 {
  margin-bottom: 14px;
  color: var(--teal-text);
  font-size: 17px;
}

.rental-check-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

.rental-check-list li {
  position: relative;
  padding-left: 27px;
}

.rental-check-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--teal);
  content: "✓";
  font-weight: 900;
}

.rental-listing-copy {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

.rental-listing-copy p:last-child {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 700;
}

.rental-listing-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 26px;
  padding: 20px 22px;
  border: 1px solid #f2d29d;
  border-radius: var(--radius-md);
  background: var(--amber-soft);
}

.rental-listing-contact strong {
  color: var(--amber-text);
  font-size: 18px;
  white-space: nowrap;
}

.rental-listing-contact p {
  margin: 0;
  color: #60451e;
}

.rental-phone {
  display: inline-block;
  margin-left: 5px;
  color: var(--navy);
  font-size: 17px;
  font-weight: 850;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rental-phone:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(22, 123, 128, 0.3);
  outline-offset: 3px;
}

.sidebar {
  min-width: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.sidebar-left {
  grid-area: rooms;
  border-right: 1px solid var(--line);
}

.sidebar-right {
  grid-area: details;
  border-top: 1px solid var(--line);
}

.sidebar-section,
.detail-panel,
.validation-panel {
  padding: 25px 22px;
  border-bottom: 1px solid var(--line);
}

.intro-section {
  padding-top: 30px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 25px;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

h3 {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--ink-soft);
}

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

.count-badge {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: #e8eef1;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.count-badge-warn {
  background: var(--amber-soft);
  color: var(--amber-text);
}

.room-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.preset-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.preset-options-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.preset-options-hint > span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 999px;
  background: white;
  font-size: 14px;
}

.preset-button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.preset-button strong,
.preset-button small {
  display: block;
}

.preset-button strong {
  font-size: 11px;
}

.preset-button small {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.preset-button.is-active {
  border-color: #8bc5c8;
  background: linear-gradient(135deg, #e5f5f4, #f7fbfb);
  box-shadow: inset 3px 0 0 var(--teal);
}

.room-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.room-button:hover {
  border-color: var(--line);
  background: #f7f9fa;
  transform: translateX(2px);
}

.room-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.room-button.is-active {
  border-color: #aad0d2;
  background: var(--teal-soft);
}

.room-button .room-code {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
}

.room-button .room-copy {
  min-width: 0;
  flex: 1;
}

.room-button strong,
.room-button small {
  display: block;
}

.room-button strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-dot.status-m,
.legend-m {
  background: var(--teal);
}

.status-dot.status-a,
.legend-a {
  background: var(--violet);
}

.status-dot.status-s,
.legend-s {
  background: var(--amber);
}

.status-dot.status-o,
.legend-o {
  background: var(--coral);
}

.sidebar-note {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.assumption-list {
  display: grid;
  gap: 9px;
  margin: 15px 0 0;
  padding: 0 0 0 22px;
  color: var(--ink-soft);
  font-size: 11px;
}

.assumption-list li::marker {
  color: var(--amber-text);
  font-weight: 800;
}

.workspace {
  grid-area: workspace;
  min-width: 0;
  padding: 22px;
}

.status-strip {
  display: grid;
  margin-bottom: 16px;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-strip article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
}

.status-strip strong,
.status-strip span {
  display: block;
}

.status-strip strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip article > div > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
}

.status-icon-measured {
  background: var(--teal-soft);
  color: var(--teal-text);
}

.status-icon-axis {
  background: var(--violet-soft);
  color: var(--violet-text);
}

.status-icon-open {
  background: var(--coral-soft);
  color: var(--coral-text);
}

.status-icon-area {
  background: var(--amber-soft);
  color: var(--amber-text);
}

.plan-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.plan-toolbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.plan-heading {
  min-width: 170px;
}

.toolbar-controls {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.view-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #edf3f4;
}

.view-button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.view-button:last-child {
  border-right: 0;
}

.view-button:hover {
  background: white;
  color: var(--teal);
}

.view-button.is-active,
.view-button[aria-selected="true"] {
  background: var(--navy);
  color: white;
}

.view-button:focus-visible,
.zoom-controls button:focus-visible,
.three-controls button:focus-visible,
.three-mode-switch button:focus-visible,
.three-room-label:focus-visible {
  position: relative;
  z-index: 4;
  outline: 3px solid rgba(22, 123, 128, 0.34);
  outline-offset: 2px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  user-select: none;
}

.toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle > span {
  position: relative;
  display: inline-block;
  width: 29px;
  height: 17px;
  border-radius: 999px;
  background: #c9d3d8;
  transition: background 150ms ease;
}

.toggle > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  content: "";
  transition: transform 150ms ease;
}

.toggle input:checked + span {
  background: var(--teal);
}

.toggle input:checked + span::after {
  transform: translateX(12px);
}

.toggle input:focus-visible + span {
  outline: 3px solid rgba(22, 123, 128, 0.28);
  outline-offset: 2px;
}

.zoom-controls {
  display: inline-flex;
  overflow: hidden;
  margin-left: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.zoom-controls button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: white;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 800;
}

.zoom-controls button:last-child {
  border-right: 0;
}

.zoom-controls button:hover {
  background: #f1f6f7;
  color: var(--teal);
}

.plan-stage {
  position: relative;
  height: calc(100vh - 270px);
  min-height: 590px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 16%, rgba(22, 123, 128, 0.06), transparent 27%),
    #f4f7f8;
}

.three-stage {
  position: relative;
  height: calc(100vh - 270px);
  min-height: 590px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(22, 123, 128, 0.08), transparent 28%),
    #f3f7f8;
}

.three-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.three-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.three-canvas:active {
  cursor: grabbing;
}

.three-canvas:focus-visible {
  outline: 3px solid rgba(22, 123, 128, 0.34);
  outline-offset: -3px;
}

.three-label-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.three-room-label {
  position: absolute;
  display: grid;
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding: 7px 10px;
  place-items: center;
  border: 2px solid rgba(23, 42, 52, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 15px rgba(23, 42, 52, 0.16);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  pointer-events: auto;
}

/* display: grid hierboven wint van de browserregel voor [hidden]; zonder deze
   regel blijven verborgen labels zichtbaar op hun laatst bekende plek. */
.three-room-label[hidden] {
  display: none;
}

.three-room-label strong,
.three-room-label small {
  display: block;
  line-height: 1.05;
  white-space: nowrap;
}

.three-room-label small {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  opacity: 0.75;
}

.three-room-label.is-selected {
  border-color: var(--teal);
  background: var(--navy);
  color: white;
}

/* In de ingerichte appartementweergave blijven de labels selecteerbaar, maar
   ze krimpen tot kleine vloermarkeringen zodat het model zichtbaar blijft. */
.three-room-label.is-compact {
  min-width: 26px;
  min-height: 26px;
  padding: 4px 6px;
  border-width: 1px;
  border-color: rgba(23, 42, 52, 0.24);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 6px rgba(23, 42, 52, 0.14);
  font-size: 9.5px;
  opacity: 0.78;
  transition: opacity 120ms ease, transform 120ms ease;
}

.three-room-label.is-compact small {
  display: none;
}

.three-room-label.is-compact.is-selected {
  border-color: var(--teal);
  opacity: 1;
}

.three-room-label.is-compact:hover,
.three-room-label.is-compact:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .three-room-label.is-compact {
    min-width: 30px;
    min-height: 30px;
    opacity: 0.88;
  }
}

.three-mode-switch {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(23, 42, 52, 0.12);
}

.three-mode-switch button {
  min-width: 92px;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.three-mode-switch button:last-child {
  border-right: 0;
}

.three-mode-switch button:hover {
  background: #edf5f5;
  color: var(--teal);
}

.three-mode-switch button.is-active {
  background: var(--navy);
  color: white;
}

.three-marker-legend[hidden] {
  display: none;
}

.three-controls {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(23, 42, 52, 0.12);
}

.three-controls button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.three-controls button:last-child {
  border-right: 0;
}

.three-controls button:hover {
  background: #edf5f5;
  color: var(--teal);
}

.three-marker-legend {
  position: absolute;
  z-index: 4;
  top: 70px;
  right: 14px;
  display: flex;
  gap: 11px;
  padding: 7px 10px;
  border: 1px solid rgba(185, 199, 207, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.three-marker-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.three-marker-legend i {
  display: inline-block;
  width: 16px;
  height: 4px;
  border-radius: 99px;
}

.marker-door {
  background: #e77721;
}

.marker-window {
  background: #29a9d6;
}

.three-warning {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: flex;
  max-width: 570px;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #efd39e;
  border-radius: 11px;
  background: rgba(255, 248, 231, 0.94);
  box-shadow: 0 8px 22px rgba(23, 42, 52, 0.09);
  color: #74562a;
  font-size: 10px;
}

.three-warning strong {
  flex: 0 0 auto;
  color: var(--amber-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.three-loading,
.three-error {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  display: flex;
  max-width: min(420px, calc(100% - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 11px;
}

.three-error {
  border-color: #efb5a9;
  color: #9e3d2c;
}

#floorplan {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#floorplan.is-dragging {
  cursor: grabbing;
}

#floorplan:focus-visible {
  outline: 3px solid rgba(22, 123, 128, 0.28);
  outline-offset: -3px;
}

.grid-background {
  fill: url("#large-grid");
  opacity: 0.56;
}

.axis-line {
  stroke: var(--teal);
  stroke-width: 2;
  stroke-dasharray: 8 7;
  opacity: 0.58;
  vector-effect: non-scaling-stroke;
}

.axis-origin {
  fill: white;
  stroke: var(--teal);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.axis-text {
  fill: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.room-shape {
  stroke: #1b252a;
  stroke-width: 16;
  stroke-linejoin: miter;
  filter: url("#room-shadow");
  cursor: pointer;
  transition:
    filter 150ms ease,
    opacity 150ms ease,
    stroke 150ms ease;
  vector-effect: non-scaling-stroke;
}

.room-shape:hover {
  filter: url("#room-shadow") brightness(1.025);
  stroke: #294652;
}

.room-shape.is-selected {
  stroke: var(--teal);
  stroke-width: 19;
}

.room-shape.status-s {
  stroke: #243238;
}

.room-shape.status-o {
  stroke: var(--coral);
  stroke-dasharray: 11 8;
}

.room-shape.status-s.is-selected,
.room-shape.status-o.is-selected {
  stroke: var(--teal);
}

.room-room-1 {
  fill: var(--room-1);
}

.room-room-2 {
  fill: var(--room-2);
}

.room-room-3 {
  fill: var(--room-3);
}

.room-bathroom-1 {
  fill: var(--bath-1);
}

.room-bathroom-2 {
  fill: var(--bath-2);
}

.room-kitchen {
  fill: var(--kitchen);
}

.room-hall {
  fill: var(--hall);
}

.room-label {
  pointer-events: none;
  text-anchor: middle;
}

.room-label-name {
  fill: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.room-label-status {
  fill: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.uncertainty-zone {
  fill: url("#open-hatch");
  stroke: var(--coral);
  stroke-width: 2;
  stroke-dasharray: 7 5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.uncertainty-tag {
  pointer-events: none;
}

.uncertainty-tag rect {
  fill: #fff7f4;
  stroke: #efaa9d;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.uncertainty-tag text {
  fill: #a33f2f;
  font-size: 10px;
  font-weight: 750;
  text-anchor: middle;
}

.opening-gap {
  stroke: #f9fbfb;
  stroke-linecap: butt;
  stroke-width: 19;
  vector-effect: non-scaling-stroke;
}

.window-line {
  stroke: #2d9fce;
  stroke-linecap: square;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.window-line-secondary {
  stroke: #93d2e8;
  stroke-linecap: square;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.door-leaf,
.door-arc {
  fill: none;
  stroke: #d76c29;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.door-arc {
  stroke-dasharray: 3 3;
  opacity: 0.8;
}

.sliding-door-line {
  stroke: #d76c29;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.opening-status {
  fill: white;
  stroke: var(--amber);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.opening-status-text {
  fill: #98601b;
  font-size: 8px;
  font-weight: 900;
  text-anchor: middle;
}

.change-mark {
  pointer-events: none;
}

.change-mark circle {
  fill: #fff7df;
  stroke: var(--amber);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.change-mark text {
  fill: #91601c;
  font-size: 9px;
  font-weight: 800;
}

.dimension-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.8;
  marker-end: url("#arrow-measured");
  marker-start: url("#arrow-measured");
  vector-effect: non-scaling-stroke;
}

.dimension-extension {
  fill: none;
  stroke: #7fb5b8;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.dimension-label-bg {
  fill: white;
  stroke: #a5ccce;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dimension-label {
  fill: #0e686c;
  font-size: 11px;
  font-weight: 850;
  text-anchor: middle;
}

.dimension-placement-s .dimension-line {
  stroke: var(--amber);
  stroke-dasharray: 7 5;
  marker-end: url("#arrow-estimated");
  marker-start: url("#arrow-estimated");
}

.dimension-placement-s .dimension-label-bg {
  fill: #fffaf0;
  stroke: #e4bd82;
}

.dimension-placement-s .dimension-label {
  fill: #98601b;
}

.orientation-card,
.scale-warning {
  position: absolute;
  display: flex;
  align-items: center;
  border: 1px solid rgba(198, 213, 220, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 25px rgba(26, 51, 62, 0.08);
  backdrop-filter: blur(10px);
}

.orientation-card {
  top: 16px;
  left: 16px;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 12px;
}

.north-arrow {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 20px;
  font-weight: 900;
}

.orientation-card strong,
.orientation-card small {
  display: block;
}

.orientation-card strong {
  font-size: 10px;
}

.orientation-card small {
  color: var(--ink-soft);
  font-size: 9px;
}

.scale-warning {
  right: 16px;
  bottom: 16px;
  max-width: 315px;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: 10px;
}

.scale-warning > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber-text);
  font-size: 11px;
  font-weight: 900;
}

.plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fafcfc;
}

.plan-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink-soft);
  font-size: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.detail-panel {
  min-height: 540px;
  padding-top: 29px;
}

.detail-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.room-monogram {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f4f7f8;
  font-size: 12px;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill.status-m {
  background: var(--teal-soft);
  color: var(--teal-text);
}

.status-pill.status-a {
  background: var(--violet-soft);
  color: var(--violet-text);
}

.status-pill.status-s {
  background: var(--amber-soft);
  color: var(--amber-text);
}

.status-pill.status-o {
  background: var(--coral-soft);
  color: #a94635;
}

.detail-panel > h2 {
  margin-bottom: 5px;
  font-size: 23px;
}

.detail-summary {
  margin-bottom: 23px;
  font-size: 11px;
}

.detail-block {
  margin-top: 20px;
}

.furnishing-block {
  padding: 14px;
  border: 1px solid #b7d8d9;
  border-radius: 14px;
  background: linear-gradient(145deg, #f3fbfa, #fff);
}

.configuration-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-text);
  font-size: 9px;
  font-weight: 800;
}

.configuration-field {
  display: grid;
  gap: 5px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.configuration-field select {
  width: 100%;
  padding: 10px 30px 10px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

/* ------------------------------------------------------------------ *
 * Visuele inrichtingskaarten (mobiel-eerst)                           *
 * De <select> blijft als verborgen fallback bestaan; de kaarten zijn   *
 * de zichtbare radiogroep. Miniaturen zijn volledig CSS, geen assets.  *
 * ------------------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.configuration-field-cards {
  gap: 8px;
}

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

.variant-prompt {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed rgba(19, 94, 97, 0.34);
  border-radius: 0.75rem;
  color: var(--muted);
  background: rgba(231, 246, 244, 0.5);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Twee kolommen zodra er ruimte is; daaronder één kaart per rij. */
@media (min-width: 360px) {
  .variant-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Het detailpaneel staat op desktop onder het model en benut de volle breedte. */
@media (min-width: 981px) {
  .detail-panel {
    display: grid;
    align-items: start;
    gap: 20px 24px;
    grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.6fr);
  }

  .detail-panel > .detail-kicker,
  .detail-panel > h2,
  .detail-panel > .muted,
  .detail-panel > .warning-block {
    grid-column: 1 / -1;
  }

  .detail-panel > .atmosphere-preview,
  .detail-panel > .furnishing-block {
    margin-top: 0;
  }

  .variant-cards {
    grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  }
}

.variant-card {
  position: relative;
  display: grid;
  min-height: 48px;
  padding: 9px 9px 8px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  cursor: pointer;
  gap: 7px;
  grid-template-rows: auto 1fr auto auto;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.variant-card:hover {
  border-color: var(--line-strong);
}

.variant-card:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.variant-card:active {
  transform: translateY(1px);
}

.variant-card.is-selected {
  border-color: var(--teal);
  background: linear-gradient(160deg, var(--teal-soft), #fff 62%);
  box-shadow:
    inset 0 0 0 1px var(--teal),
    0 10px 22px rgba(22, 123, 128, 0.14);
}

.variant-card-body {
  display: grid;
  align-content: start;
  gap: 3px;
}

.variant-card-title {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
}

.variant-card-benefit {
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.4;
}

.variant-card-occupancy {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.variant-card.is-selected .variant-card-occupancy {
  background: #fff;
  color: var(--teal-text);
}

.variant-card-check {
  display: inline-flex;
  align-items: center;
  visibility: hidden;
  gap: 5px;
  color: var(--teal-text);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.variant-card.is-selected .variant-card-check {
  visibility: visible;
}

.variant-card-check i {
  display: inline-flex;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 1;
}

/* --- Fotorealistische variantminiatuur met CSS-plattegrondfallback - */

.variant-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  border: 1.5px solid #c4d3d8;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  background-color: #f7f3ec;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(178, 154, 118, 0.18) 0 1px,
    rgba(178, 154, 118, 0) 1px 9px
  );
}

.variant-thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.variant-card:hover .variant-thumb-image {
  transform: scale(1.025);
}

.thumb-piece {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: var(--h);
  border-radius: 2px;
}

.thumb-piece.is-bed {
  border: 1px solid #93b0c6;
  border-radius: 3px;
  background: linear-gradient(180deg, #eef5fa, #dae8f3);
}

.thumb-piece.is-bed::before {
  position: absolute;
  content: "";
  inset: 7% 16% auto 16%;
  height: 20%;
  border: 1px solid #b0c6d6;
  border-radius: 2px;
  background: #fff;
}

.thumb-piece.is-nightstand {
  border: 1px solid #c0a97f;
  background: #ecdfc4;
}

.thumb-piece.is-desk {
  border: 1px solid #bd9f6f;
  background: linear-gradient(180deg, #f0e2c6, #e3d0aa);
}

.thumb-piece.is-table {
  border: 1px solid #bd9f6f;
  border-radius: 4px;
  background: linear-gradient(180deg, #f0e2c6, #e0cba3);
}

.thumb-piece.is-chair {
  border: 1px solid #a4907a;
  border-radius: 50%;
  background: #ded0ba;
}

.thumb-piece.is-sofa {
  border: 1px solid #7fb2ad;
  border-radius: 4px;
  background: linear-gradient(180deg, #cfe7e4, #b9dbd6);
}

.thumb-piece.is-sofa::before {
  position: absolute;
  content: "";
  inset: 0 0 auto;
  height: 28%;
  border-bottom: 1px solid rgba(87, 142, 137, 0.7);
  border-radius: 3px 3px 0 0;
  background: #a9d2cc;
}

.thumb-piece.is-wardrobe,
.thumb-piece.is-media {
  border: 1px solid #a7b4bb;
  background: repeating-linear-gradient(
    90deg,
    #e6ebee 0 5px,
    #d6dee3 5px 6px
  );
}

.thumb-piece.is-rug {
  border: 1px dashed rgba(116, 103, 168, 0.55);
  border-radius: 4px;
  background: rgba(236, 233, 247, 0.75);
}

.thumb-piece.is-plant {
  border: 1px solid #7ea86f;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #b9dca6, #7fae6c);
}

.thumb-piece.is-window {
  border: 1px solid #8fbcd6;
  border-radius: 1px;
  background: linear-gradient(180deg, #d6ecf8, #eff8fc);
}

.thumb-piece.is-balcony {
  border-bottom: 1.5px solid #a2c1d0;
  border-radius: 0;
  background: linear-gradient(180deg, #eaf4f8, #dbebf1);
}

/* Balkonreling — het beeldmerk van de balkon-zithoek in kamer 2. */
.thumb-piece.is-balcony::after {
  position: absolute;
  content: "";
  inset: 26% 5% 20%;
  border-top: 1px solid rgba(110, 145, 160, 0.7);
  border-bottom: 1px solid rgba(110, 145, 160, 0.7);
  background-image: repeating-linear-gradient(
    90deg,
    rgba(110, 145, 160, 0.55) 0 1.2px,
    transparent 1.2px 6px
  );
}

/* Extra daglichtwas op de twee sleutelvarianten van kamer 2. */
.variant-thumb[data-variant="balcony-lounge"]::after,
.variant-thumb[data-variant="worker-twin"]::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 246, 224, 0.42),
    rgba(255, 255, 255, 0) 58%
  );
  pointer-events: none;
}

@media (pointer: coarse) {
  .variant-card {
    padding: 11px 11px 10px;
  }

  .variant-card-title {
    font-size: 12.5px;
  }

  .variant-card-benefit {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .variant-card:active {
    transform: none;
  }
}

.configuration-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.fact-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-list li {
  position: relative;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 11px;
}

.fact-list li::before {
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.fact-list-open li::before {
  border: 1.5px solid var(--coral);
  background: transparent;
}

.warning-block {
  padding: 13px;
  border: 1px solid #efcf9e;
  border-radius: 12px;
  background: #fff8ea;
}

.warning-block h3 {
  color: #9b651c;
}

.warning-block .fact-list li::before {
  background: var(--amber);
}

.atmosphere-preview {
  margin: 24px 0 8px;
  padding: 12px;
  border: 1px solid rgba(11, 124, 128, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(231, 247, 245, 0.92), rgba(255, 250, 240, 0.94));
  box-shadow: 0 12px 30px rgba(24, 53, 58, 0.1);
}

.atmosphere-preview h3 {
  margin: 0;
}

.atmosphere-preview .section-heading {
  margin-bottom: 9px;
}

.atmosphere-preview a {
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.atmosphere-preview .section-heading a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  text-align: right;
}

.atmosphere-preview > a {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(11, 124, 128, 0.18);
  border-radius: 14px;
  background: #edf1f2;
  box-shadow: 0 8px 20px rgba(24, 53, 58, 0.12);
}

.atmosphere-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 180ms ease;
}

.atmosphere-preview > a:hover img {
  transform: scale(1.018);
}

.atmosphere-empty {
  display: grid;
  min-height: 150px;
  padding: 24px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(11, 124, 128, 0.4);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--teal-dark);
  text-align: center;
}

.atmosphere-empty span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-soft);
  font-size: 20px;
}

.atmosphere-empty strong {
  max-width: 290px;
  font-size: 12px;
  line-height: 1.45;
}

.atmosphere-caption {
  margin: 10px 2px 1px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.validation-panel {
  border-bottom: 0;
}

.validation-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.validation-item {
  display: grid;
  align-items: start;
  gap: 9px;
  grid-template-columns: 19px 1fr;
}

.validation-item > span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
}

.validation-item strong,
.validation-item small {
  display: block;
}

.validation-item strong {
  font-size: 10px;
}

.validation-item small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 9px;
}

.validation-pass > span {
  background: var(--teal-soft);
  color: var(--teal-text);
}

.validation-conditional > span {
  background: var(--amber-soft);
  color: var(--amber-text);
}

.validation-open > span {
  background: var(--coral-soft);
  color: var(--coral-text);
}

.loading-state,
.error-state {
  position: fixed;
  z-index: 100;
  right: calc(22px + env(safe-area-inset-right, 0px));
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
  color: var(--ink-soft);
  font-size: 11px;
}

.loader {
  width: 17px;
  height: 17px;
  border: 2px solid #d6e3e6;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-state {
  display: grid;
  border-color: #efb5a9;
}

.error-state strong,
.error-state span {
  display: block;
}

.error-state strong {
  color: #9e3d2c;
}

.error-state button {
  min-height: 44px;
  justify-self: start;
  padding: 0 16px;
  border: 1px solid #b85d4a;
  border-radius: 10px;
  background: white;
  color: #843524;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.error-state button:hover {
  background: #fff4f1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 225px minmax(470px, 1fr);
  }

  .workspace {
    padding: 16px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-stage,
  .three-stage {
    height: calc(100vh - 320px);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
    grid-template-areas:
      "rooms workspace"
      "details details";
  }

  .sidebar-right {
    display: grid;
    border-top: 1px solid var(--line);
    border-left: 0;
    grid-template-columns: 1fr 1fr;
  }

  .detail-panel,
  .validation-panel {
    display: block;
    min-height: 0;
    border-right: 1px solid var(--line);
  }

  .plan-stage,
  .three-stage {
    min-height: 540px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: calc(66px + env(safe-area-inset-top, 0px));
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      10px
      calc(14px + env(safe-area-inset-left, 0px));
  }

  .brand small,
  .topbar-status {
    display: none;
  }

  .language-picker > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .language-picker select {
    min-width: 112px;
    max-width: 126px;
    min-height: 42px;
    padding-right: 28px;
  }

  .app-shell {
    display: block;
  }

  .rental-listing {
    padding:
      18px
      calc(10px + env(safe-area-inset-right, 0px))
      calc(30px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
  }

  .rental-listing-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .rental-listing-header h2 {
    font-size: 25px;
  }

  .rental-listing-columns {
    grid-template-columns: 1fr;
  }

  .rental-listing-contact {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rental-listing-contact strong {
    white-space: normal;
  }

  .sidebar-left {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .intro-section,
  .assumptions-section {
    display: none;
  }

  .sidebar-section {
    padding: 14px;
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
  }

  .room-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .preset-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 48px 6px 0;
    scroll-padding-inline: 0 48px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .preset-button {
    width: calc(100% - 48px);
    min-width: calc(100% - 48px);
    flex: 0 0 calc(100% - 48px);
    scroll-snap-align: start;
  }

  .room-list::-webkit-scrollbar,
  .preset-list::-webkit-scrollbar,
  .status-strip::-webkit-scrollbar {
    display: none;
  }

  .room-button {
    width: auto;
    min-width: 145px;
    flex: 0 0 auto;
    border-color: var(--line);
  }

  .room-button .status-dot {
    display: none;
  }

  .workspace {
    padding: 10px;
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
  }

  .status-strip {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .status-strip article {
    min-width: 175px;
  }

  .plan-toolbar {
    display: block;
    padding: 13px;
  }

  .toolbar-controls {
    display: block;
    margin-top: 12px;
  }

  .view-switch {
    display: flex;
    width: 100%;
  }

  .view-button {
    flex: 1 1 50%;
  }

  .toolbar-actions {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .toggle {
    min-height: 44px;
  }

  .zoom-controls {
    margin-left: 0;
  }

  .zoom-controls button {
    width: 44px;
    height: 44px;
  }

  .plan-stage {
    height: 55svh;
    min-height: 420px;
    max-height: 590px;
  }

  .three-stage {
    display: grid;
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
  }

  .three-viewport {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(390px, 55svh, 560px);
    min-width: 0;
    margin-top: 10px;
    grid-column: 1;
    grid-row: 3;
  }

  .orientation-card {
    top: 9px;
    left: 9px;
  }

  .scale-warning {
    right: 9px;
    bottom: 9px;
    left: 9px;
    max-width: none;
  }

  .three-controls {
    position: relative;
    top: auto;
    right: auto;
    justify-self: center;
    max-width: calc(100% - 20px);
    margin: 10px 10px 0;
    grid-column: 1;
    grid-row: 2;
  }

  .three-mode-switch {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: grid;
    width: calc(100% - 20px);
    margin: 10px 10px 0;
    grid-template-columns: repeat(3, 1fr);
    grid-column: 1;
    grid-row: 1;
  }

  .three-mode-switch button {
    min-width: 0;
  }

  .three-marker-legend {
    position: relative;
    top: auto;
    right: auto;
    justify-self: center;
    margin: 10px 10px 0;
    grid-column: 1;
    grid-row: 4;
  }

  .three-warning {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    display: grid;
    max-width: none;
    gap: 2px;
    margin: 10px;
    grid-column: 1;
    grid-row: 5;
  }

  .three-loading,
  .three-error {
    position: relative;
    top: auto;
    left: auto;
    align-self: center;
    justify-self: center;
    transform: none;
    grid-column: 1;
    grid-row: 3;
  }

  .three-room-label {
    min-width: 44px;
    min-height: 44px;
    height: auto;
  }

  .plan-footer {
    display: block;
  }

  .plan-footer p {
    margin-top: 8px;
  }

  .sidebar-right {
    display: block;
  }

  .detail-panel,
  .validation-panel {
    border-right: 0;
  }

  .loading-state,
  .error-state {
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    max-width: none;
  }
}

@media (pointer: coarse) {
  .three-canvas,
  #floorplan {
    touch-action: pan-y pinch-zoom !important;
  }
}

@media (pointer: coarse) and (orientation: landscape),
  (max-height: 520px) and (orientation: landscape) {
  .plan-stage {
    height: 76svh;
    min-height: 300px;
    max-height: 420px;
  }

  .three-stage {
    display: grid;
    height: auto;
    min-height: 0;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
  }

  .three-viewport {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(300px, 76svh, 420px);
    min-width: 0;
    margin-top: 10px;
    grid-column: 1;
    grid-row: 3;
  }

  .three-mode-switch {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    display: grid;
    width: calc(100% - 20px);
    margin: 10px 10px 0;
    grid-template-columns: repeat(3, 1fr);
    grid-column: 1;
    grid-row: 1;
  }

  .three-mode-switch button {
    min-width: 0;
  }

  .three-controls {
    position: relative;
    top: auto;
    right: auto;
    justify-self: center;
    max-width: calc(100% - 20px);
    margin: 10px 10px 0;
    grid-column: 1;
    grid-row: 2;
  }

  .three-marker-legend {
    position: relative;
    top: auto;
    right: auto;
    justify-self: center;
    margin: 10px 10px 0;
    grid-column: 1;
    grid-row: 4;
  }

  .three-warning {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    display: grid;
    max-width: none;
    gap: 2px;
    margin: 10px;
    grid-column: 1;
    grid-row: 5;
  }

  .three-loading,
  .three-error {
    position: relative;
    top: auto;
    left: auto;
    align-self: center;
    justify-self: center;
    transform: none;
    grid-column: 1;
    grid-row: 3;
  }
}

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

  .loader {
    animation: none;
  }
}
