:root {
  --ink: #1b2420;
  --muted: #5a665f;
  --line: #d9dcd3;
  --line-strong: #c9cdc2;
  --ground: #f4f4ef;
  --surface: #ffffff;
  --accent: #1f5f4e;
  --accent-dark: #174a3d;
  --accent-ink: #ffffff;
  --composer: #e8eee6;
  --chip: #ffffff;
  --warning: #8a4b00;
  --warning-surface: #fdf4e0;
  --error: #a61b1b;
  --error-surface: #fbeaea;
  --wall: #1b2420;
  --window: #2f6db5;
  --room-private: #e6ecf4;
  --room-social: #efe9da;
  --room-service: #ddede7;
  --room-garage: #e3e5e2;
  --room-circulation: #f7f7f3;
  --room-porch: #f2efe6;
  --room-outdoor: #dcebd6;
  --lot: #e7f0e2;
  --lot-line: #7e9078;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ground); }
[hidden] { display: none !important; }
#app { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, p { margin: 0; }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The bar at the top of every screen */
.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 6px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-title { min-width: 0; max-width: 260px; overflow: hidden; font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.plain-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}
.plain-button:hover:not(:disabled) { background: var(--ground); color: var(--ink); }
.plain-button:disabled { color: #8a938c; }

/* The menu that chooses the AI */
.ai-menu { position: relative; }
.ai-button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; }
.ai-button:hover { background: var(--ground); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ai-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(27, 36, 32, 0.16);
}
.ai-options { display: flex; flex-direction: column; gap: 2px; }
.ai-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.ai-option:hover:not(:disabled) { background: var(--ground); }
.ai-option[aria-checked="true"] { background: var(--composer); }
.ai-option:disabled { color: var(--muted); }
.ai-check { color: var(--accent); visibility: hidden; }
.ai-option[aria-checked="true"] .ai-check { visibility: visible; }
.ai-name { display: block; font-size: 15px; font-weight: 600; }
.ai-tool { display: block; font-size: 13px; color: var(--muted); }
.ai-status { font-size: 12px; font-weight: 600; color: var(--warning); }
.ai-divider { margin: 8px 2px; border-top: 1px solid var(--line); }
.ai-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px 8px 6px; }
.ai-selects label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ai-selects select { min-height: 44px; width: 100%; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 400; font-size: 14px; }
.ai-note { margin: 2px 10px 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ai-note + .ai-note { margin-top: 6px; }
.ai-loading { display: flex; align-items: center; gap: 10px; padding: 16px 10px; font-size: 14px; color: var(--muted); }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: inherit; }

/* The box where the person writes */
.composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--composer);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  transition: border-color 0.15s;
}
.composer:focus-within { border-color: var(--accent); }
.composer.dragging { border-color: var(--accent); border-style: dashed; background: #dfe9dc; }
.composer textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-height: 180px;
  padding: 11px 4px;
  border: 0;
  outline: none;
  resize: none;
  overflow-y: auto;
  font-size: 15px;
  line-height: 22px;
  background: transparent;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.icon-button { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; }
.icon-button:hover:not(:disabled) { background: rgba(27, 36, 32, 0.08); }
.send-button { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); }
.send-button:hover:not(:disabled) { background: var(--accent-dark); }
.send-button:disabled { opacity: 0.55; }
.composer-error { padding: 2px 6px; font-size: 13px; color: var(--error); }
.composer-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 8px 0 10px; border: 0; border-radius: 9px; background: var(--chip); color: var(--accent-dark); font-size: 14px; font-weight: 500; text-align: left; }
.chip svg { flex: none; }
.chip-mark { flex: none; width: 10px; height: 10px; background: var(--accent); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 4px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-remove { position: absolute; top: 3px; right: 3px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; }

.composer.hero { gap: 12px; padding: 20px 14px 14px 20px; border-radius: 18px; }
.composer.hero textarea { flex: none; min-height: 84px; max-height: 320px; padding: 0; font-size: 18px; line-height: 1.5; }
.composer.hero .composer-row { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.attach-labelled { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-left: -8px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; font-weight: 500; }
.attach-labelled:hover { background: rgba(27, 36, 32, 0.08); }
.create-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px 0 24px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 600; }
.create-button:hover:not(:disabled) { background: var(--accent-dark); }
.create-button:disabled { opacity: 0.55; }

/* Request */
.request-page { flex: 1; display: flex; justify-content: center; padding: 72px 24px 48px; }
.request-column { width: 100%; max-width: 820px; display: flex; flex-direction: column; gap: 20px; }
.request-column h1 { font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.request-lead { font-size: 17px; line-height: 1.5; color: var(--muted); }
.promise-title { padding-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.promises { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: -10px; }
.promise { border-top: 2px solid var(--ink); padding-top: 10px; }
.promise strong { display: block; font-size: 15px; font-weight: 600; }
.promise span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* While the AI creates */
.creating-page { flex: 1; display: flex; flex-wrap: wrap; gap: 48px; justify-content: center; padding: 56px 24px; }
.creating-column { flex: 1 1 420px; max-width: 520px; display: flex; flex-direction: column; gap: 28px; }
.creating-column h1 { margin-bottom: 8px; font-size: 32px; line-height: 1.2; font-weight: 700; }
.creating-lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.elapsed { font-family: "IBM Plex Mono", monospace; font-size: 14px; color: var(--muted); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step-mark { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); color: var(--muted); }
.step.done .step-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.now .step-mark { border-color: var(--accent); }
.step-title { font-size: 16px; color: var(--muted); }
.step.done .step-title { color: var(--ink); font-weight: 500; }
.step.now .step-title { color: var(--ink); font-weight: 700; }
.step-note { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.request-recap { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.recap-title { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.recap-text { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.draft-panel { flex: 1 1 360px; max-width: 460px; align-self: flex-start; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.draft-title { font-size: 14px; font-weight: 600; color: var(--muted); }
.draft-panel svg { display: block; width: 100%; height: auto; max-height: 620px; }
.draft-empty { display: flex; align-items: center; justify-content: center; min-height: 420px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 14px; text-align: center; padding: 16px; }
.spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
.step-mark .spinner { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Question or failure before there is a plan */
.notice-page { flex: 1; display: flex; justify-content: center; padding: 72px 24px; }
.notice-column { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 18px; }
.notice-column h1 { font-size: 30px; line-height: 1.25; font-weight: 700; }
.notice-text { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.notice-text.failure { color: var(--error); }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary-button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; }
.primary-button:hover { background: var(--accent-dark); }

/* The working screen: what to see, the drawing, and what to do */
.workspace { flex: 1; display: flex; min-height: 0; }
.workspace.with-drawing { display: grid; grid-template-columns: 224px minmax(0, 1fr) clamp(340px, 24vw, 400px); grid-template-rows: minmax(0, 1fr); }
#app:has(> .workspace.with-drawing) { height: 100vh; }

.left-panel { display: flex; flex-direction: column; gap: 22px; min-height: 0; padding: 16px 12px; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); }
.panel-label { padding: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; text-align: left; }
.pick:hover { background: rgba(27, 36, 32, 0.05); }
.pick[aria-pressed="true"] { background: rgba(31, 95, 78, 0.14); color: var(--accent-dark); font-weight: 600; }
.layer { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 10px; font-size: 14px; }
.layer input { flex: none; margin: 0; }
.layer-mark { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.layer-name { min-width: 0; }
.layer-count { margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--muted); }
.walk-map { padding: 0 6px; }
.walk-map svg { display: block; width: 100%; height: auto; max-height: 240px; }
.left-facts { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; font-size: 13px; color: var(--muted); }
.fact strong { font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--ink); }

.center { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--surface); }
.center-canvas { position: relative; min-height: 0; overflow: hidden; display: flex; }
.center-canvas > * { flex: 1; min-width: 0; }
.center-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 40px; padding: 4px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.bar-text { flex: 1 1 240px; display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar-text strong { flex: none; color: var(--ink); font-weight: 600; }
.bar-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-tools, .center-bar .small-button { flex: none; }
.bar-tools { display: flex; align-items: center; gap: 6px; }
.zoom-value { min-width: 44px; text-align: center; font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }
.small-button { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; min-width: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; text-decoration: none; }
.small-button:hover:not(:disabled) { background: var(--ground); color: var(--ink); }
.small-button:disabled { color: #8a938c; }
.small-button[aria-pressed="true"] { background: rgba(31, 95, 78, 0.14); border-color: var(--accent); color: var(--accent-dark); }
.small-button.danger { color: var(--error); }

.plan-stage { position: relative; min-width: 0; overflow: hidden; touch-action: none; user-select: none; }
.plan-stage svg { display: block; width: 100%; height: 100%; }
.plan-stage.can-move { cursor: grab; }
.plan-stage.moving { cursor: grabbing; }
.plan-ring { fill: none; stroke: #ff6a00; pointer-events: none; }
.plan-muted rect[class^="room-"] { opacity: 0.5; }

.design-table { overflow: auto; padding: 8px 0 24px; }
.design-table h2 { padding: 18px 16px 8px; font-size: 16px; font-weight: 600; }
.design-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.design-table th { position: sticky; top: -8px; background: var(--surface); padding: 10px 16px; border-bottom: 2px solid var(--ink); text-align: left; font-weight: 600; }
.design-table td { padding: 8px 16px; border-bottom: 1px solid var(--line); }
.design-table .quantity { text-align: right; font-family: "IBM Plex Mono", monospace; white-space: nowrap; }
.design-table th.quantity { font-family: inherit; }
.design-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; font-size: 15px; color: var(--muted); }

.side-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.side-tabs { display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.side-tab { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font-size: 14px; white-space: nowrap; }
.side-tab:hover { background: rgba(27, 36, 32, 0.05); }
.side-tab[aria-pressed="true"] { background: rgba(31, 95, 78, 0.14); color: var(--accent-dark); font-weight: 600; }
.tab-badge { padding: 1px 7px; border-radius: 999px; background: var(--warning-surface); color: #6e3c00; font-size: 12px; font-weight: 600; }
.tab-count { font-size: 12px; font-weight: 400; color: var(--muted); }
.side-body { min-height: 0; overflow-y: auto; padding: 16px; font-size: 14px; line-height: 1.5; }
.side-title { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-title:first-child { margin-top: 0; }
.side-list { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; }
.side-list li { margin-bottom: 8px; }
.side-note { margin-bottom: 14px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.side-ok { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; font-weight: 500; color: var(--accent); }
.side-ok svg { flex: none; }
.chat-messages { display: flex; flex-direction: column; gap: 16px; font-size: 15px; }
.message-premises { margin-top: 8px; white-space: normal; }
.message-premises summary { cursor: pointer; font-size: 13.5px; color: var(--accent); text-decoration: underline; }
.message-premises .assumptions { margin-top: 8px; font-size: 14px; }
.clash { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; font-size: 13.5px; line-height: 1.4; text-align: left; }
.clash:hover { background: rgba(27, 36, 32, 0.05); }
.clash[aria-pressed="true"] { background: var(--warning-surface); color: #6e3c00; }
.side-foot { min-width: 0; }
.clash-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.clash-position { margin-right: auto; }
.item-card { margin: 10px 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 2px solid var(--accent); border-radius: 10px; }
.item-name { font-size: 16px; font-weight: 700; }
.item-card dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; font-size: 13.5px; }
.item-card dt { color: var(--muted); }
.item-card dd { margin: 0; }
.chat-box { padding: 10px 12px 12px; }
.site-note { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--muted); }
.site-mark { font-size: 13px; color: var(--muted); white-space: nowrap; }
dl.lot-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 10px 24px; font-size: 16px; }
.lot-facts dt { color: var(--muted); }
.lot-facts dd { margin: 0; font-weight: 500; }

.house-viewer { min-width: 0; display: flex; }
.house-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #e3edf2; }

@media (pointer: coarse) {
  .walk-keys { display: none; }
}
/* On a notebook, the top bar and the tabs still fit on one line. */
@media (max-width: 1420px) {
  .top-title { max-width: 200px; }
  .step-link { gap: 6px; padding: 0 8px; font-size: 13.5px; }
  .side-tab { gap: 5px; padding: 0 9px; }
  .top-bar { column-gap: 12px; }
}
@media (max-width: 1330px) {
  .top-title { max-width: 150px; }
}
@media (max-width: 1100px) {
  #app:has(> .workspace.with-drawing) { height: auto; }
  .workspace.with-drawing { display: flex; flex-direction: column; }
  .left-panel { flex-direction: row; flex-wrap: wrap; gap: 12px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-group { flex: 1 1 200px; }
  .walk-map svg { max-height: 160px; }
  .center { min-height: 70vh; }
  .side-panel { min-height: 420px; border-left: 0; border-top: 1px solid var(--line); }
  .side-body { max-height: 60vh; }
}

/* Inside the conversation and on the plan */
.workspace { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.plan-muted .wall, .plan-muted .door-leaf, .plan-muted .door-arc, .plan-muted .tread { opacity: 0.45; }
.plan-muted .room-name, .plan-muted .room-area { opacity: 0.6; }
.project-run { fill: none; stroke-linejoin: round; pointer-events: none; }
.project-item { cursor: pointer; }
/* Inside a drawing the browser's own ring grows with the zoom, so what has focus gets a line of its own. */
.plan-stage svg :focus { outline: none; }
.project-item:focus-visible :is(rect, circle, path) { stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.project-ring { fill: rgba(31, 95, 78, 0.16); stroke: var(--accent); }

.message-user { align-self: flex-end; max-width: 88%; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--ground); overflow-wrap: anywhere; white-space: pre-wrap; }
.message-ai { overflow-wrap: anywhere; white-space: pre-wrap; }
.message-ai.failed { color: var(--error); }
.message-images { display: flex; flex-wrap: wrap; gap: 6px; }
.message-images img { display: block; width: 200px; max-width: 100%; border-radius: 8px; }
.message-selection { font-size: 13px; font-weight: 500; color: var(--accent-dark); }
.assumptions { margin: 0; padding-left: 18px; white-space: normal; }
.thinking { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.chat-box { padding: 14px 16px 16px; }

/* The stages of a project */
.stepper-holder, .top-bar > .stepper { flex: 1; min-width: 0; }
.stepper { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.step-link { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 14px; }
a.step-link:hover { background: rgba(27, 36, 32, 0.05); color: var(--ink); }
.step-link.off { color: var(--muted); }
.step-link[aria-current="step"] { background: rgba(31, 95, 78, 0.14); color: var(--accent-dark); font-weight: 600; }
.step-number { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid #8a938c; border-radius: 50%; font-size: 12px; font-weight: 600; }
.step-link[aria-current="step"] .step-number { border-color: var(--accent); }
.step-number.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage-page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding: 40px 24px; }
.stage-page.narrow { max-width: 860px; }
.stage-head h1 { margin-bottom: 8px; font-size: 32px; line-height: 1.2; font-weight: 700; }
.stage-head p { font-size: 16px; line-height: 1.5; color: var(--muted); }
.lot-layout { display: flex; flex-wrap: wrap; gap: 40px; }
.lot-column { flex: 1 1 420px; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.lot-aside { flex: 1 1 320px; max-width: 440px; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.lot-preview svg { display: block; width: 100%; height: auto; max-height: 480px; }
.lot-area { margin-top: 10px; font-size: 14px; color: var(--muted); }
.lot-area strong { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.lot-empty { padding: 48px 12px; text-align: center; font-size: 14px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.form-field input { min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font: inherit; font-weight: 400; font-size: 16px; }
.form-error { font-size: 14px; color: var(--error); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.saved { padding-top: 8px; border-top: 1px solid var(--line); }
.saved h2 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.saved ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.saved li { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; font-size: 15px; }
.saved span { font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--muted); }
.layer-mark { width: 12px; height: 12px; border-radius: 3px; }
.pillar-code { fill: var(--ink); font-family: "IBM Plex Mono", monospace; font-weight: 500; pointer-events: none; }
.export-table { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.export-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); }
.export-row:first-child { border-top: 0; }
.export-name { font-size: 17px; font-weight: 600; }
.export-what { margin-top: 2px; font-size: 14px; color: var(--muted); }
.get-file { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 128px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.get-file:hover { background: var(--ground); color: var(--ink); }
.export-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.export-foot p { font-size: 13px; line-height: 1.45; color: var(--muted); }
.export-foot a { text-decoration: none; }
.rebuilt { display: flex; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 14px; white-space: normal; color: var(--ink); }
.rebuilt svg { flex: none; color: var(--accent); }


/* The 3D view */
.house-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.house-canvas.dragging { cursor: grabbing; }
.house-failed { padding: 48px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; line-height: 1.5; text-align: center; }
.map-room { fill: var(--ground); }
.map-open { fill: var(--room-outdoor); }
.map-wall { stroke: var(--ink); stroke-width: 0.14; stroke-linecap: square; }
.map-view { fill: var(--accent); opacity: 0.4; }
.map-dot { fill: var(--accent); }
.top-labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.top-label { position: absolute; left: 0; top: 0; min-height: 28px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: rgba(255, 255, 255, 0.92); font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: auto; }
.top-label:hover { background: #fff; border-color: var(--accent); }
.top-label.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.walk-pad { position: absolute; right: 16px; bottom: 16px; display: none; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 4px; }
.pad-button { display: flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: rgba(27, 36, 32, 0.82); color: #fff; touch-action: none; }
.pad-forward { grid-column: 2; grid-row: 1; }
.pad-left { grid-column: 1; grid-row: 2; }
.pad-back { grid-column: 2; grid-row: 2; }
.pad-right { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) {
  .walk-pad:not([hidden]) { display: grid; }
}

/* The drawings */
svg text { font-family: inherit; }
.lot { fill: var(--lot); stroke: var(--lot-line); stroke-width: 0.1; }
.buildable { fill: none; stroke: var(--lot-line); stroke-width: 0.08; stroke-dasharray: 0.4 0.3; }
.street { fill: #d3d6d0; }
.street-label { fill: var(--muted); }
.room-private { fill: var(--room-private); }
.room-social { fill: var(--room-social); }
.room-service { fill: var(--room-service); }
.room-garage { fill: var(--room-garage); }
.room-circulation { fill: var(--room-circulation); }
.room-porch { fill: var(--room-porch); stroke: #a8a593; stroke-width: 0.03; stroke-dasharray: 0.12 0.08; }
.room-outdoor { fill: var(--room-outdoor); stroke: var(--lot-line); stroke-width: 0.03; }
.wall { stroke: var(--wall); stroke-linecap: square; }
.wall.outside { stroke-width: 0.2; }
.wall.inside { stroke-width: 0.12; }
.gap { stroke: var(--surface); stroke-width: 0.24; }
.door-leaf { stroke: var(--wall); stroke-width: 0.03; fill: none; }
.door-arc { stroke: var(--muted); stroke-width: 0.02; fill: none; }
.gate-line { stroke: var(--wall); stroke-width: 0.05; stroke-dasharray: 0.16 0.1; }
.window-line { stroke: var(--window); stroke-width: 0.07; }
.tread { stroke: var(--muted); stroke-width: 0.02; }
.room-name { fill: var(--ink); font-weight: 600; pointer-events: none; }
.room-area { fill: var(--muted); pointer-events: none; }
.room-hit { fill: transparent; cursor: pointer; }
.room-hit:hover { fill: rgba(31, 95, 78, 0.08); }
.room-hit:focus-visible { stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.room-hit.selected { fill: rgba(31, 95, 78, 0.14); stroke: var(--accent); stroke-width: 0.09; }

@media (max-width: 860px) {
  .top-bar { padding: 8px 16px; }
  .request-page, .creating-page, .notice-page { padding: 32px 16px; }
  .request-column h1 { font-size: 30px; }
  .stage-page { padding: 24px 16px; }
  .draft-empty { min-height: 200px; }
}
