:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #64748b;
  --line: #d7dee8;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --soft-blue: #dbeafe;
  --soft-green: #dcfce7;
  --soft-yellow: #fef3c7;
  --soft-red: #fee2e2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  align-items: end;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 24px clamp(16px, 4vw, 40px);
}

.eyebrow {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  margin-bottom: 8px;
}

h2 {
  font-size: 20px;
  margin-bottom: 0;
}

.lead {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 720px;
}

.demo-status {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  padding: 12px 14px;
}

.demo-status span {
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: 340px minmax(0, 1fr);
  padding: 18px;
}

.sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.panel-heading {
  margin-bottom: 12px;
}

.option-list,
.furniture-list {
  display: grid;
  gap: 10px;
}

.option-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.option-card span,
.furniture-toggle small {
  color: var(--muted);
  font-size: 13px;
}

.option-card.is-active {
  background: #eff6ff;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.segmented {
  background: #e9eef5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
}

.segmented button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  min-height: 38px;
}

.segmented button.is-active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 1px 4px rgb(15 23 42 / .12);
}

.furniture-toggle {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 11px 12px;
}

.furniture-toggle input {
  inline-size: 18px;
  block-size: 18px;
}

.furniture-toggle span {
  display: grid;
}

.stage {
  display: grid;
  gap: 14px;
}

.stage-toolbar {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-actions button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary-dark);
  font-weight: 800;
  min-height: 38px;
  padding: 8px 12px;
}

.room-canvas {
  background:
    linear-gradient(#e2e8f0 1px, transparent 1px),
    linear-gradient(90deg, #e2e8f0 1px, transparent 1px),
    #ffffff;
  background-size: 32px 32px;
  border: 2px solid #475569;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1.3fr .8fr;
  grid-template-rows: 210px 170px;
  min-height: 520px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.room {
  align-items: start;
  border: 2px solid #334155;
  border-radius: 8px;
  display: flex;
  font-weight: 900;
  justify-content: center;
  padding-top: 14px;
  position: relative;
  z-index: 1;
}

.living {
  background: var(--soft-blue);
  grid-row: span 2;
}

.bed {
  background: var(--soft-green);
}

.bath {
  background: var(--soft-yellow);
}

.entry {
  background: var(--soft-red);
  bottom: 16px;
  height: 84px;
  left: 18px;
  position: absolute;
  width: 150px;
}

.placed-furniture {
  inset: 0;
  position: absolute;
  z-index: 3;
}

.furniture-piece {
  align-items: center;
  border: 2px solid rgb(255 255 255 / .8);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  font-size: clamp(11px, 1.2vw, 14px);
  font-weight: 900;
  justify-content: center;
  padding: 4px;
  position: absolute;
  text-align: center;
  box-shadow: 0 10px 22px rgb(15 23 42 / .18);
}

.flow-line,
.point-cloud {
  display: none;
}

.room-canvas[data-view="flow"] .flow-line {
  align-items: center;
  background: rgb(15 118 110 / .15);
  border: 2px dashed #0f766e;
  border-radius: 999px;
  color: #115e59;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  justify-content: center;
  position: absolute;
  z-index: 2;
}

.flow-main {
  height: 54px;
  left: 19%;
  top: 44%;
  width: 58%;
}

.flow-window {
  height: 42px;
  left: 12%;
  top: 14%;
  width: 34%;
}

.room-canvas[data-view="pointcloud"] .point-cloud {
  background-image: radial-gradient(#0f172a 1.2px, transparent 1.2px);
  background-size: 12px 12px;
  border-radius: 50%;
  display: block;
  height: 210px;
  left: 18%;
  opacity: .28;
  position: absolute;
  top: 24%;
  width: 260px;
  z-index: 2;
}

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

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

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  font-weight: 900;
  margin: 2px 0 0;
}

.check-list {
  margin: 0;
  padding-left: 20px;
}

.check-list li + li {
  margin-top: 8px;
}

@media (max-width: 920px) {
  .app-header,
  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace,
  .inspector-grid {
    grid-template-columns: 1fr;
  }

  .room-canvas {
    grid-template-columns: 1fr;
    grid-template-rows: 190px 130px 110px;
  }

  .living {
    grid-row: auto;
  }

  .entry {
    bottom: 12px;
    width: 120px;
  }
}
