:root {
  --bg: #0b0f14;
  --panel: rgba(25, 29, 34, .86);
  --panel-soft: rgba(30, 35, 40, .66);
  --line: rgba(255, 255, 255, .1);
  --text: #f5f7fa;
  --muted: #a8b0ba;
  --blue: #0a84ff;
  --green: #32d74b;
  --cyan: #00d0ff;
  --amber: #ff9f0a;
  --purple: #bf5af2;
  --red: #ff453a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 208, 255, .14), transparent 28%),
    radial-gradient(circle at 88% 24%, rgba(191, 90, 242, .13), transparent 28%),
    #0b0f14;
}

body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; border: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#app {
  min-height: 100vh;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}

#app.ready {
  opacity: 1;
  transform: translateY(0);
}

.app {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 20px 118px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -22px -20px 20px;
  padding: 22px 20px 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  background: linear-gradient(180deg, rgba(11, 15, 20, .96), rgba(11, 15, 20, .74));
  backdrop-filter: blur(24px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 7vw, 44px); letter-spacing: 0; }
h2 { font-size: clamp(23px, 5vw, 32px); letter-spacing: 0; }
p { color: var(--muted); line-height: 1.38; }

.pill,
.primary,
.secondary {
  min-height: 46px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
}

.pill {
  padding: 0 14px;
  background: rgba(255, 255, 255, .08);
  color: #d6dde5;
  white-space: nowrap;
}

.primary {
  padding: 0 18px;
  background: var(--blue);
  color: white;
  box-shadow: 0 16px 36px rgba(10, 132, 255, .24);
}

.primary.wide,
.secondary {
  width: 100%;
}

.secondary {
  background: rgba(10, 132, 255, .12);
  color: #8ac2ff;
  border: 1px solid rgba(10, 132, 255, .42);
}

.property-card,
.panel,
.instrument,
.stock-panel,
.tool-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
  backdrop-filter: blur(28px);
}

.property-card {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.main-hero {
  min-height: 220px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, .14), transparent 46%),
    linear-gradient(160deg, rgba(50, 215, 75, .12), transparent 58%),
    var(--panel);
}

.main-hero p + p {
  margin-top: 14px;
  max-width: 620px;
}

.main-hero.proposed {
  background:
    linear-gradient(135deg, rgba(255, 159, 10, .18), transparent 46%),
    linear-gradient(160deg, rgba(191, 90, 242, .12), transparent 58%),
    var(--panel);
}

.control-strip {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  display: grid;
  gap: 10px;
}

.control-strip div {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
}

.control-strip span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.control-strip button,
.shortcut-list button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: #dfe5ec;
  background: rgba(255,255,255,.08);
}

.control-strip button.active {
  color: #071016;
  background: #fff;
  font-weight: 850;
}

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

.status-grid article {
  min-height: 112px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  display: grid;
  align-content: end;
  gap: 8px;
}

.status-grid span,
.inventory span {
  color: var(--muted);
  font-size: 18px;
}

.status-grid strong {
  font-size: 27px;
}

.panel {
  margin-top: 14px;
  padding: 18px;
  display: grid;
  gap: 12px;
}

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

.command-grid h2 {
  grid-column: 1 / -1;
}

.command-card,
.scenario-list article {
  min-height: 142px;
  padding: 16px;
  border-radius: 12px;
  display: grid;
  align-content: start;
  gap: 9px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
}

.command-card em {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--green);
  background: rgba(50,215,75,.12);
  font-style: normal;
  font-weight: 850;
}

.tighten-list,
.impact-chain,
.shortcut-list {
  display: grid;
  gap: 10px;
}

.tighten-list article,
.impact-chain article {
  min-height: 94px;
  padding: 14px;
  border-radius: 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.075);
}

.tighten-list span,
.impact-chain span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.impact-chain .changed-item span { color: var(--blue); }
.impact-chain .directly-affected span { color: var(--green); }
.impact-chain .limiting-constraint span { color: var(--red); }
.impact-chain .uncertain span { color: var(--purple); }
.impact-chain .additional-work span { color: var(--amber); }

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

.shortcut-list button {
  min-height: 54px;
  text-align: left;
  font-weight: 850;
}

.twin-notebook {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr);
  gap: 14px;
}

.notebook-page {
  min-height: 260px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.06));
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.overview-page {
  grid-row: span 2;
}

.notebook-page ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: #dfe5ec;
  line-height: 1.45;
}

.mini-map {
  position: relative;
  margin-top: 18px;
  min-height: 300px;
  border-radius: 14px;
  background: rgba(10, 14, 18, .78);
  overflow: hidden;
}

.mini-map::before {
  content: "";
  position: absolute;
  inset: 34px;
  border: 4px solid rgba(255,255,255,.74);
  clip-path: polygon(0 0, 72% 0, 72% 30%, 100% 30%, 100% 100%, 0 100%);
}

.twin-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 14px;
}

.floorplan,
.twin-side {
  min-height: 560px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.floorplan {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(255,255,255,.08) 50%, transparent 50.3%),
    linear-gradient(0deg, transparent 49.7%, rgba(255,255,255,.08) 50%, transparent 50.3%),
    rgba(24, 29, 35, .9);
}

.floorplan::before {
  content: "";
  position: absolute;
  inset: 48px;
  border: 4px solid rgba(255,255,255,.74);
  clip-path: polygon(0 0, 73% 0, 73% 28%, 100% 28%, 100% 100%, 0 100%);
}

.run-board {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 14px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
}

.timeline span {
  color: var(--muted);
  font-weight: 900;
}

.room,
.system,
.evidence-dot {
  position: absolute;
  z-index: 2;
}

.room {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
  font-weight: 850;
}

.room.kitchen { left: 54%; top: 58%; }
.room.hall { left: 21%; top: 49%; }
.room.lounge { left: 18%; top: 20%; }
.room.utility { left: 66%; top: 22%; }

.system {
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 159, 10, .84);
  font-weight: 900;
}

.system.boiler { left: 64%; top: 49%; }
.system.cylinder { left: 72%; top: 38%; background: rgba(10,132,255,.72); }

.evidence-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(50,215,75,.14);
}

.evidence-dot.one { left: 34%; top: 26%; }
.evidence-dot.two { left: 58%; top: 66%; }
.evidence-dot.three { left: 79%; top: 31%; background: var(--amber); box-shadow: 0 0 0 8px rgba(255,159,10,.14); }

.twin-side {
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.fact-list,
.question-list,
.scenario-list {
  display: grid;
  gap: 10px;
}

.fact-list div,
.question-list button {
  min-height: 70px;
  padding: 13px;
  border-radius: 10px;
  display: grid;
  gap: 5px;
  text-align: left;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
}

.fact-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.fact-list .observed span { color: var(--green); }
.fact-list .candidate span { color: var(--amber); }
.fact-list .unknown span { color: var(--purple); }
.fact-list .conflict span { color: var(--red); }

.question-list button {
  font-weight: 850;
  color: #fff;
}

.session-row {
  min-height: 76px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
}

.session-row span {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: rgba(50, 215, 75, .11);
}

.session-row.purple span { color: var(--purple); background: rgba(191, 90, 242, .12); }
.session-row.amber span { color: var(--amber); background: rgba(255, 159, 10, .12); }
.session-row em { color: var(--green); font-style: normal; font-weight: 800; }
.session-row.purple em { color: var(--purple); }
.session-row.amber em { color: var(--amber); }

.handoff-summary {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
}

.handoff-summary > span {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: rgba(10, 132, 255, .12);
}

.capture-surface,
.workspace-surface {
  position: relative;
  min-height: calc(100vh - 158px);
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.74) 2px, transparent 2px) 18% 0 / 180px 100%,
    linear-gradient(0deg, rgba(255,255,255,.64) 2px, transparent 2px) 0 48% / 100% 210px,
    linear-gradient(135deg, #485056, #c8c0af 42%, #434b4f);
  border: 1px solid rgba(255, 255, 255, .14);
}

.capture-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 54% 36%, transparent 0 42px, rgba(255,255,255,.42) 43px 45px, transparent 46px),
    linear-gradient(180deg, rgba(0,0,0,.16), transparent 32%, rgba(0,0,0,.22));
  pointer-events: none;
}

.capcom {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  right: 12px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  background: rgba(36, 38, 41, .62);
  backdrop-filter: blur(18px);
}

.capcom span {
  min-width: 0;
  color: #e0e3e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-rail {
  position: absolute;
  z-index: 6;
  top: 72px;
  display: grid;
  gap: 10px;
}

.tag-rail.left { left: 12px; }
.tag-rail.right { right: 12px; }

.tag-root,
.tag-branch button {
  min-width: 78px;
  min-height: 64px;
  border-radius: 10px;
  background: rgba(37, 38, 40, .68);
  border: 1px solid rgba(255, 255, 255, .18);
  display: grid;
  place-items: center;
  gap: 2px;
  backdrop-filter: blur(12px);
  font-weight: 800;
}

.tag-root.open {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, .4);
}

.tag-root svg { width: 22px; height: 22px; color: white; }

.tag-branch {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.tag-rail.right .tag-branch { padding-left: 0; padding-right: 18px; }

.tag-branch button {
  min-height: 42px;
  min-width: 112px;
  padding: 0 10px;
  color: #fff;
  border-color: rgba(255, 159, 10, .38);
}

.readiness-ring {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 82px;
  height: 82px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.72);
  box-shadow: 0 0 0 1px rgba(0,0,0,.1);
}

.readiness-ring::before,
.readiness-ring::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,.8);
}

.readiness-ring::before { width: 2px; height: 104px; left: 38px; top: -14px; }
.readiness-ring::after { height: 2px; width: 104px; left: -14px; top: 38px; }

.thumbnail {
  position: absolute;
  left: 28px;
  bottom: 144px;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.35);
}

.dollhouse {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 138px;
  height: 112px;
  transform: translateX(-50%) perspective(280px) rotateX(55deg) rotateZ(-10deg);
  background: #ececec;
  box-shadow: inset 0 0 0 10px #181818, 0 18px 28px rgba(0,0,0,.35);
  clip-path: polygon(0 18%, 70% 0, 100% 34%, 84% 100%, 0 86%);
}

.dollhouse::before {
  content: "";
  position: absolute;
  inset: 26px 18px;
  border-left: 22px solid #1b1b1b;
  border-top: 18px solid #555;
  border-right: 12px solid #1b1b1b;
}

.shutter {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 170px;
  width: 88px;
  height: 88px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, white 0 52%, #f7f7f7 53% 72%, transparent 73%);
  border: 3px solid rgba(0,0,0,.42);
  box-shadow: 0 6px 18px rgba(0,0,0,.28), 0 0 0 5px rgba(255,255,255,.88);
}

.finish-room {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 84px;
  min-height: 42px;
  padding: 0 20px;
  transform: translateX(-50%);
  border-radius: 12px;
  border: 2px solid var(--cyan);
  background: rgba(20, 28, 32, .66);
  backdrop-filter: blur(12px);
  font-weight: 800;
}

.compact-strip {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.compact-strip span {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #d7dde4;
}

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

.tool-group {
  padding: 16px;
}

.tool-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.tool-list button {
  min-height: 74px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  text-align: left;
  display: grid;
}

.tool-list button.active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .5);
}

.tool-list span {
  color: var(--muted);
  font-size: 25px;
}

.instrument {
  margin-top: 14px;
  padding: 20px;
}

.big-reading {
  margin: 18px 0;
  min-height: 170px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.07);
}

.big-reading strong {
  font-size: clamp(72px, 20vw, 144px);
  line-height: .8;
}

.big-reading span {
  color: var(--muted);
  font-size: 30px;
}

.field-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.field-chips span {
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #dfe5ec;
}

.workspace-surface {
  padding: 16px;
  background: linear-gradient(135deg, #384047, #6e7169 42%, #202428);
}

.workspace-header {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 8px 2px 14px;
}

.tracking {
  padding: 9px 12px;
  border-radius: 18px;
  background: rgba(0,0,0,.38);
  color: var(--green);
  font-weight: 850;
  white-space: nowrap;
}

.ar-canvas {
  position: relative;
  min-height: 430px;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.36) 2px, transparent 2px) 50% 0 / 190px 100%,
    linear-gradient(0deg, rgba(255,255,255,.32) 2px, transparent 2px) 0 52% / 100% 180px,
    linear-gradient(135deg, rgba(229,232,226,.45), rgba(28,33,38,.18));
}

.wall-plane {
  position: absolute;
  inset: 34px 66px 66px;
  border-radius: 4px;
  background: rgba(245, 245, 238, .26);
}

.clearance-box {
  position: absolute;
  left: 34%;
  top: 22%;
  width: 36%;
  height: 56%;
  border: 4px solid var(--green);
  background: rgba(50, 215, 75, .18);
}

.appliance {
  position: absolute;
  left: 42%;
  top: 34%;
  width: 20%;
  height: 34%;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(0,0,0,.32);
}

.object-label {
  position: absolute;
  left: 42%;
  top: 29%;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.58);
  font-weight: 800;
}

.measure-line {
  position: absolute;
  left: 20%;
  top: 47%;
  width: 60%;
  height: 4px;
  background: var(--blue);
  transform: rotate(-12deg);
}

.measure-line span {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(0,0,0,.68);
  font-weight: 900;
}

.endpoint {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
}

.endpoint.a { left: 18%; top: 51%; }
.endpoint.b { right: 20%; top: 38%; }

.space-rect {
  position: absolute;
  left: 24%;
  top: 24%;
  width: 46%;
  height: 50%;
  border: 4px solid var(--green);
  background: rgba(50,215,75,.12);
}

.space-rect span {
  position: absolute;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(0,0,0,.68);
  font-weight: 900;
}

.space-rect .width { left: 50%; top: -34px; transform: translateX(-50%); }
.space-rect .height { right: -72px; top: 50%; transform: translateY(-50%); }

.mode-switch {
  margin: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: rgba(0,0,0,.55);
}

.mode-switch button {
  min-height: 50px;
  border-radius: 14px;
  background: transparent;
  font-weight: 850;
}

.mode-switch button.active {
  color: #111;
  background: #fff;
}

.stock-panel {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.inventory {
  display: grid;
  gap: 10px;
}

.inventory div {
  min-height: 64px;
  padding: 12px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  background: rgba(255,255,255,.08);
}

.inventory strong {
  font-size: 28px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  width: min(calc(100% - 24px), 720px);
  min-height: 72px;
  padding: 7px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  border-radius: 28px;
  background: rgba(245, 245, 245, .88);
  box-shadow: 0 18px 48px rgba(0,0,0,.36);
  backdrop-filter: blur(24px);
}

.tabbar a {
  min-width: 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  gap: 2px;
  color: #111;
  font-size: 11px;
  font-weight: 820;
}

.tabbar svg {
  width: 22px;
  height: 22px;
}

.tabbar a.active {
  background: rgba(10,132,255,.24);
  color: var(--blue);
}

.build-plan-intro {
  margin-bottom: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(216, 222, 233, .14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .14), transparent 52%), var(--panel);
}

.build-plan-intro p:last-child {
  margin-top: 8px;
}

.authority-badge {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: #b9d7ff;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .42);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.build-plan-document {
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(216, 222, 233, .14);
  border-radius: 18px;
  color: #e8edf4;
  background: rgba(14, 17, 22, .88);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .34);
}

.build-plan-document h1,
.build-plan-document h2,
.build-plan-document h3,
.build-plan-document h4 {
  margin: 1.4em 0 .5em;
  line-height: 1.12;
}

.build-plan-document h1:first-child {
  margin-top: 0;
}

.build-plan-document h1 { font-size: clamp(28px, 5vw, 42px); }
.build-plan-document h2 { font-size: clamp(22px, 4vw, 30px); }
.build-plan-document h3 { font-size: 20px; }

.build-plan-document p,
.build-plan-document li {
  color: #c7d0dc;
  line-height: 1.58;
}

.build-plan-document p + p {
  margin-top: 10px;
}

.build-plan-document ul,
.build-plan-document ol {
  margin: 10px 0 18px;
  padding-left: 24px;
}

.build-plan-document li + li {
  margin-top: 6px;
}

.build-plan-document code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #b9d7ff;
  background: rgba(59, 130, 246, .12);
}

.build-plan-document pre {
  padding: 14px;
  overflow-x: auto;
  border-radius: 10px;
  background: #07090c;
  border: 1px solid rgba(216, 222, 233, .12);
}

.build-plan-document pre code {
  padding: 0;
  color: #dfe6ef;
  background: transparent;
}

.build-plan-loading,
.build-plan-error {
  min-height: 240px;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
}

@media (max-width: 620px) {
  .build-plan-intro {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .app { padding: 18px 14px 112px; }
  .topbar { margin: -18px -14px 16px; padding: 18px 14px 12px; }
  .property-card { grid-template-columns: 1fr; }
  .status-grid, .tool-grid { grid-template-columns: 1fr 1fr; }
  .status-grid strong { font-size: 24px; }
  .tag-root { min-width: 72px; min-height: 60px; }
  .tag-branch button { min-width: 104px; }
  .capture-surface { min-height: calc(100vh - 140px); }
  .shutter { bottom: 164px; }
  .finish-room { bottom: 82px; }
  .tabbar span { display: none; }
}

@media (max-width: 430px) {
  .status-grid, .tool-grid { grid-template-columns: 1fr; }
  .tag-root { min-width: 64px; font-size: 13px; }
  .tag-rail.right .tag-branch,
  .tag-branch { display: none; }
}

/* Course-corrected Place Twin sandbox */
.place-shell {
  width: min(100%, 1180px);
}

.place-context {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(216, 222, 233, .16);
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .13), transparent 48%),
    rgba(20, 22, 26, .82);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .24);
}

.place-readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.place-readouts span {
  min-height: 54px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(216, 222, 233, .12);
  background: rgba(255, 255, 255, .055);
  color: #d8dee9;
}

.place-readouts b,
.component-meta b {
  display: block;
  margin-bottom: 2px;
  color: #8b95a1;
  font-size: 11px;
  text-transform: uppercase;
}

.place-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 14px;
  align-items: start;
}

.place-canvas-card,
.instrument-panel,
.lower-dock .lens-card {
  border: 1px solid rgba(216, 222, 233, .14);
  border-radius: 16px;
  background: rgba(20, 22, 26, .88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  backdrop-filter: blur(20px);
}

.place-canvas-card {
  overflow: hidden;
}

.canvas-toolbar {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid rgba(216, 222, 233, .1);
}

.layer-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: min(58vw, 520px);
  padding-bottom: 2px;
}

.layer-bar button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  color: #d8dee9;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(216, 222, 233, .12);
  font-weight: 780;
}

.layer-bar button.active {
  color: #071016;
  background: #d8dee9;
}

.cad-viewport {
  padding: 12px;
  background:
    radial-gradient(circle at 30% 18%, rgba(59, 130, 246, .12), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    #080b0f;
}

.place-svg {
  display: block;
  width: 100%;
  min-height: 520px;
  border-radius: 14px;
  background: #0d1117;
}

.cad-bg {
  fill: #0d1117;
  stroke: rgba(216, 222, 233, .09);
}

.room-plate {
  fill: rgba(216, 222, 233, .035);
  stroke: rgba(216, 222, 233, .08);
}

.outer-wall,
.inner-wall {
  fill: none;
  stroke: #d8dee9;
  stroke-width: 10;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.inner-wall {
  stroke-width: 7;
  opacity: .86;
}

.opening {
  fill: none;
  stroke: #0d1117;
  stroke-width: 14;
  stroke-linecap: butt;
}

.exterior-path,
.scale-bar {
  fill: none;
  stroke: rgba(216, 222, 233, .44);
  stroke-width: 2;
}

.room-name,
.scale-label {
  fill: rgba(245, 247, 250, .82);
  font-size: 15px;
  font-weight: 800;
}

.scale-label {
  fill: rgba(168, 176, 186, .9);
  font-size: 12px;
}

.route-svg {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .86;
}

.route-svg.heating { stroke: #ff9f0a; }
.route-svg.water { stroke: #3b82f6; }
.route-svg.electrical { stroke: #e5d34f; }
.route-svg.network { stroke: #5aa7ff; stroke-dasharray: 12 10; }
.route-svg.access { stroke: #b685ff; stroke-dasharray: 18 8; }
.route-svg.run-active {
  filter: url(#glow);
  stroke-width: 12;
}
.route-svg.route-bottleneck {
  stroke: #ff453a;
}

.route-text,
.component-text,
.operation-overlay text,
.clone-overlay text {
  fill: #f5f7fa;
  font-size: 14px;
  font-weight: 850;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .72);
  stroke-width: 4px;
}

.component-svg {
  cursor: pointer;
}

.component-svg .component-body {
  fill: rgba(245, 247, 250, .94);
  stroke: rgba(245, 247, 250, .74);
  stroke-width: 2;
}

.component-svg.heating .component-body { fill: #ffcf7a; }
.component-svg.water .component-body { fill: #76b7ff; }
.component-svg.electrical .component-body { fill: #ffe970; }
.component-svg.network .component-body { fill: #79bbff; }
.component-svg.access .component-body { fill: none; stroke: #cba7ff; }
.component-svg.evidence .component-body { fill: #9fe7ff; }

.component-svg.selected .component-body,
.component-svg.edited .component-body {
  stroke: #ffffff;
  stroke-width: 4;
  filter: url(#glow);
}

.component-svg.edited .component-body {
  fill: #ffffff;
}

.tighten-pins circle {
  fill: #ff9f0a;
  stroke: #ffffff;
  stroke-width: 3;
}

.tighten-pins text {
  fill: #101318;
  text-anchor: middle;
  font-size: 13px;
  font-weight: 950;
}

.clone-overlay rect {
  fill: #ffffff;
  stroke: rgba(255, 159, 10, .8);
  stroke-width: 3;
}

.clone-overlay path {
  fill: none;
  stroke: #ff9f0a;
  stroke-width: 6;
  stroke-dasharray: 10 8;
}

.operation-overlay rect {
  fill: rgba(12, 16, 22, .78);
  stroke: rgba(216, 222, 233, .16);
}

.selected-strip {
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(216, 222, 233, .1);
}

.selected-strip span {
  color: var(--muted);
}

.instrument-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.component-meta span {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(216,222,233,.1);
}

.evidence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.evidence-chips span {
  padding: 7px 9px;
  border-radius: 999px;
  color: #d8dee9;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .28);
  font-weight: 750;
}

.relationship-panel {
  display: grid;
  gap: 8px;
}

.relationship-panel article {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.055);
  border-left: 4px solid #8b95a1;
}

.relationship-panel article.heating { border-left-color: #ff9f0a; }
.relationship-panel article.water { border-left-color: #3b82f6; }
.relationship-panel article.electrical { border-left-color: #e5d34f; }
.relationship-panel article.network { border-left-color: #5aa7ff; }
.relationship-panel article.access { border-left-color: #b685ff; }

.relationship-panel span,
.ambiguity-card > span {
  color: #8b95a1;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.inspector-actions,
.clone-actions,
.run-controls {
  display: grid;
  gap: 8px;
}

.run-controls {
  grid-template-columns: repeat(3, 1fr);
}

.lower-dock {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lower-dock .lens-card {
  padding: 14px;
}

.lower-dock ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #d8dee9;
}

.tighten-questions {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}

.ambiguity-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(216,222,233,.12);
  display: grid;
  gap: 8px;
}

.ambiguity-card.resolved {
  border-color: rgba(50, 215, 75, .42);
  background: rgba(50, 215, 75, .09);
}

.ambiguity-card h3 {
  margin: 0;
  font-size: 17px;
}

.xyz-readout,
.quiet-note {
  color: #9ba6b2;
  font-size: 12px;
}

.resolution-actions {
  display: grid;
  gap: 7px;
}

.choice-card {
  min-height: 58px;
  padding: 10px;
  border-radius: 10px;
  text-align: left;
  display: grid;
  gap: 4px;
  color: #f5f7fa;
  background: rgba(59, 130, 246, .11);
  border: 1px solid rgba(59, 130, 246, .38);
}

.choice-card span {
  color: #b9c3cf;
  font-size: 13px;
}

.compact-chain {
  max-height: 42vh;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline div.active {
  border: 1px solid rgba(255, 159, 10, .6);
  background: rgba(255, 159, 10, .12);
}

.timeline p {
  grid-column: 2;
  font-size: 13px;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .place-context,
  .place-workbench {
    grid-template-columns: 1fr;
  }

  .canvas-toolbar {
    grid-template-columns: 1fr;
  }

  .layer-bar {
    max-width: 100%;
  }

  .place-svg {
    min-height: 430px;
  }

  .lower-dock {
    grid-template-columns: 1fr;
  }
}

/* Main living-twin prototype layer */
.hero-card {
  margin-bottom: 14px;
  padding: 18px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, .14), transparent 48%),
    linear-gradient(160deg, rgba(50, 215, 75, .12), transparent 64%),
    var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.hero-card.proposed {
  background:
    linear-gradient(135deg, rgba(255, 159, 10, .2), transparent 48%),
    linear-gradient(160deg, rgba(191, 90, 242, .12), transparent 64%),
    var(--panel);
}

.status-pill {
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(50, 215, 75, .13);
  font-weight: 900;
  white-space: nowrap;
}

.workspace-grid,
.compare-grid,
.run-board {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 14px;
}

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

.small {
  min-height: 36px;
  width: auto;
  padding: 0 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
}

.breadcrumb button {
  min-height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  font-weight: 800;
}

.breadcrumb button.active {
  color: #0b0f14;
  background: #fff;
}

.graphic-twin {
  position: relative;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(255,255,255,.08), transparent 42%),
    radial-gradient(circle at 18% 22%, rgba(255, 159, 10, .12), transparent 18%),
    radial-gradient(circle at 78% 68%, rgba(10, 132, 255, .12), transparent 22%),
    rgba(8, 11, 15, .76);
}

.house-shell {
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 49.4%, rgba(255,255,255,.16) 49.7%, rgba(255,255,255,.16) 50.3%, transparent 50.6%),
    linear-gradient(0deg, transparent 49.4%, rgba(255,255,255,.16) 49.7%, rgba(255,255,255,.16) 50.3%, transparent 50.6%),
    rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 999px rgba(0,0,0,.04);
}

.room-zone,
.appliance,
.system-overlay {
  position: absolute;
  z-index: 2;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
  color: #fff;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}

.room-zone {
  padding: 11px;
  display: grid;
  align-content: start;
  gap: 3px;
}

.room-zone strong,
.appliance strong,
.system-overlay span {
  font-size: 15px;
  line-height: 1.05;
}

.room-zone span,
.appliance em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.room-zone.kitchen { left: 6%; top: 9%; width: 38%; height: 36%; }
.room-zone.lounge { right: 7%; top: 9%; width: 43%; height: 48%; }
.room-zone.hall { left: 6%; bottom: 10%; width: 42%; height: 36%; }
.room-zone.utility { right: 7%; bottom: 10%; width: 43%; height: 29%; }

.appliance.boiler-object {
  left: 15%;
  top: 20%;
  width: 74px;
  height: 106px;
  padding: 9px;
  border-color: rgba(255,159,10,.56);
  display: grid;
  align-content: end;
  gap: 3px;
}

.appliance-body {
  position: absolute;
  left: 18px;
  top: 10px;
  width: 38px;
  height: 62px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.28);
}

.appliance.selected,
.system-overlay.selected,
.room-zone:focus-visible {
  outline: 3px solid rgba(10,132,255,.55);
  outline-offset: 2px;
}

.appliance.active .appliance-body {
  box-shadow: 0 0 0 4px rgba(255,159,10,.42), 0 12px 22px rgba(0,0,0,.3);
}

.system-overlay {
  min-height: 30px;
  padding: 5px 10px;
  display: grid;
  align-items: center;
  white-space: nowrap;
}

.system-overlay.primary-pipe {
  left: 24%;
  top: 45%;
  width: 55%;
  height: 12px;
  padding: 0;
  border: 0;
  background: #36c4ff;
  border-radius: 999px;
  transform: rotate(7deg);
  transform-origin: left center;
}

.system-overlay.primary-pipe span {
  position: absolute;
  left: 24%;
  top: -32px;
  transform: rotate(-7deg);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.56);
}

.system-overlay.primary-pipe.constraint,
.system-overlay.primary-pipe.active {
  background: #ff453a;
  box-shadow: 0 0 0 4px rgba(255,69,58,.22);
}

.system-overlay.control-link {
  right: 12%;
  top: 28%;
  border-color: rgba(191,90,242,.55);
}

.system-overlay.control-link.limited {
  border-color: rgba(255,159,10,.65);
  background: rgba(255,159,10,.16);
}

.system-overlay.heat-zone {
  right: 11%;
  bottom: 18%;
  width: 31%;
  height: 22%;
  border-color: rgba(50,215,75,.42);
  background: rgba(50,215,75,.11);
  align-items: end;
}

.focus-boiler .room-zone:not(.kitchen),
.focus-boiler .system-overlay:not(.primary-pipe) {
  opacity: .58;
}

.evidence-marker {
  position: absolute;
  z-index: 5;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: #fff;
  color: #111;
  border: 2px solid rgba(10,132,255,.65);
}

.evidence-marker.photo { left: 11%; top: 14%; }
.evidence-marker.manual { left: 29%; top: 16%; }
.evidence-marker.declared { left: 23%; top: 38%; }

.graphic-callout {
  position: absolute;
  z-index: 4;
  max-width: 230px;
  padding: 10px 12px;
  border-radius: 12px;
  display: grid;
  gap: 3px;
  background: rgba(7,10,14,.82);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 36px rgba(0,0,0,.24);
}

.graphic-callout strong { font-size: 15px; }
.graphic-callout span { color: var(--muted); font-size: 13px; line-height: 1.25; }
.boiler-callout { left: 36%; top: 12%; }
.pipe-callout { right: 9%; top: 51%; border-color: rgba(255,69,58,.48); }
.controls-callout { right: 11%; top: 19%; border-color: rgba(255,159,10,.5); }
.bottleneck-callout { left: 44%; bottom: 16%; border-color: rgba(255,69,58,.6); }

.proposed .appliance-body {
  box-shadow: 0 0 0 5px rgba(255,159,10,.25), 0 10px 20px rgba(0,0,0,.28);
}

.clone-copy .graphic-twin,
.current .graphic-twin {
  min-height: 300px;
  margin-top: 12px;
}

.run-board .graphic-twin {
  min-height: 520px;
}

.inspector {
  align-content: start;
}

.action-stack,
.action-row {
  display: grid;
  gap: 10px;
}

.action-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-stack.compact {
  min-width: 220px;
}

.secondary svg,
.primary svg {
  width: 21px;
  height: 21px;
}

button:disabled,
.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.dimensions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dimensions article {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
}

.dimensions h3 {
  margin: 0;
  font-size: 18px;
}

.dimensions ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #dfe5ec;
  line-height: 1.42;
}

.fact-list,
.evidence-list {
  display: grid;
  gap: 10px;
}

.evidence-list article {
  padding: 13px;
  border-radius: 12px;
  display: grid;
  gap: 5px;
  background: rgba(255,255,255,.075);
  border: 1px solid var(--line);
}

.evidence-list span,
.evidence-list em {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  font-style: normal;
}

.evidence-list .confirmed em,
.fact-list .confirmed span,
.fact-list .observed span { color: var(--green); }
.evidence-list .candidate em,
.fact-list .candidate span,
.fact-list .declared span { color: var(--amber); }
.evidence-list .unknown em,
.fact-list .unknown span { color: var(--purple); }

.explanation {
  border-color: rgba(10,132,255,.45);
}

.shortcut-list button.active {
  color: #0b0f14;
  background: #fff;
}

.tighten-list article.resolved {
  border-color: rgba(50,215,75,.4);
  background: rgba(50,215,75,.1);
}

.tighten-list .candidate span { color: var(--amber); }
.tighten-list .unknown span { color: var(--purple); }
.tighten-list .conflict span { color: var(--red); }
.tighten-list .resolved span { color: var(--green); }

.compare-grid .current {
  border-color: rgba(50,215,75,.28);
}

.compare-grid .clone-copy {
  border-color: rgba(255,159,10,.36);
}

.impact-chain .changed span { color: var(--blue); }
.impact-chain .constraint span { color: var(--red); }
.impact-chain .unchanged span { color: var(--green); }
.impact-chain .work span { color: var(--amber); }

.timeline div.active {
  border: 1px solid rgba(10,132,255,.55);
  background: rgba(10,132,255,.18);
}

@media (max-width: 720px) {
  .hero-card,
  .workspace-grid,
  .compare-grid,
  .run-board,
  .dimensions {
    grid-template-columns: 1fr;
  }

  .graphic-twin {
    min-height: 520px;
  }

  .house-shell {
    inset: 14px;
  }

  .room-zone strong,
  .appliance strong,
  .system-overlay span {
    font-size: 13px;
  }

  .graphic-callout {
    max-width: 190px;
  }
}

/* Living Dollhouse visual sandbox override.
   Sandbox is the visual PWA proving ground, not the production renderer. */
:root {
  --bg: #0b0d10;
  --panel: rgba(17, 20, 25, .84);
  --panel-soft: rgba(28, 33, 40, .72);
  --line: rgba(216, 222, 233, .16);
  --text: #f7f9fc;
  --muted: #9aa6b5;
  --blue: #3b82f6;
  --cyan: #70d6ff;
  --steel: #d8dee9;
  --amber: #ff9f0a;
  --red: #ff453a;
  --green: #8fa3b8;
  --purple: #8795aa;
}

html,
body {
  background:
    radial-gradient(circle at 22% 10%, rgba(59, 130, 246, .16), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(216, 222, 233, .08), transparent 30%),
    linear-gradient(180deg, #12151b, #07090c 58%, #050608);
}

.app {
  width: min(100%, 1220px);
  padding: 18px 18px 118px;
}

.topbar {
  margin: -18px -18px 16px;
  padding: 18px 18px 12px;
  align-items: center;
  border-bottom: 1px solid rgba(216, 222, 233, .08);
  background: linear-gradient(180deg, rgba(8, 10, 13, .94), rgba(8, 10, 13, .62));
}

.topbar h1 {
  font-size: clamp(24px, 4vw, 36px);
}

.mission-strip {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(216, 222, 233, .14);
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(130deg, rgba(59, 130, 246, .14), transparent 48%),
    rgba(15, 18, 23, .78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.mission-strip h2 {
  font-size: clamp(27px, 5vw, 44px);
}

.mission-metrics {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 8px;
}

.mission-metrics span {
  min-height: 48px;
  padding: 9px 12px;
  border-radius: 10px;
  display: grid;
  gap: 2px;
  color: #dfe6ef;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(216, 222, 233, .12);
}

.mission-metrics b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.living-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 14px;
}

.dollhouse-stage,
.twin-inspector,
.lens-card {
  border: 1px solid rgba(216, 222, 233, .14);
  border-radius: 18px;
  background: rgba(14, 17, 22, .82);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .34);
  backdrop-filter: blur(24px);
}

.dollhouse-stage {
  min-height: 690px;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
}

.workspace-head,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.layer-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(216, 222, 233, .1);
}

.layer-bar button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 10px;
  color: #dbe4ee;
  background: transparent;
  font-weight: 850;
}

.layer-bar button.active {
  color: #07111f;
  background: var(--steel);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.breadcrumb button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  color: #cdd6e2;
  background: rgba(255, 255, 255, .07);
}

.breadcrumb button.active {
  color: white;
  background: rgba(59, 130, 246, .34);
}

.spatial.graphic-twin {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-height: 520px;
}

.spatial-map {
  width: 100%;
  height: min(64vh, 640px);
  min-height: 440px;
  border-radius: 18px;
  background: #090c10;
}

.map-backdrop {
  fill: #0d1218;
  stroke: rgba(216, 222, 233, .08);
}

.captured-room {
  fill: rgba(36, 47, 61, .9);
  stroke: rgba(216, 222, 233, .72);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.captured-room.strong {
  fill: rgba(34, 57, 84, .92);
  stroke: rgba(112, 214, 255, .9);
}

.room-label {
  fill: #f7f9fc;
  font-size: 18px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.room-role {
  fill: #a8b3c2;
  font-size: 12px;
  font-weight: 720;
  text-anchor: middle;
  pointer-events: none;
}

.system-route {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .82;
  vector-effect: non-scaling-stroke;
}

.system-route.heating { stroke: #f59e0b; }
.system-route.water { stroke: #38bdf8; }
.system-route.electrical { stroke: #facc15; }
.system-route.network { stroke: #60a5fa; stroke-dasharray: 14 9; }
.system-route.access { stroke: #d8dee9; stroke-dasharray: 10 10; }
.system-route.constraint { stroke: var(--red); }
.system-route.active {
  stroke-width: 13;
  opacity: 1;
  filter: url(#softGlow);
  stroke-dasharray: 18 10;
  animation: flowDash 1.1s linear infinite;
}
.system-route.selected {
  opacity: 1;
  stroke-width: 12;
  filter: url(#softGlow);
}

.route-label {
  fill: #f8fafc;
  font-size: 14px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(4, 9, 16, .78);
  stroke-width: 5;
  pointer-events: none;
}

.component-node {
  cursor: pointer;
}

.component-body {
  fill: #eef4fb;
  stroke: rgba(4, 9, 16, .62);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.component-core {
  fill: #0f1720;
}

.component-node.heating .component-body { fill: #fff3df; }
.component-node.water .component-body { fill: #c6ecff; }
.component-node.electrical .component-body { fill: #fff1a3; }
.component-node.network .component-body { fill: #dbeafe; }
.component-node.access .component-body { fill: none; stroke: #d8dee9; stroke-width: 5; }
.component-node.evidence .component-body { fill: #70d6ff; }
.component-node.unknown .component-body { stroke: var(--amber); stroke-dasharray: 5 5; }

.component-node.selected .component-body {
  stroke: #3b82f6;
  stroke-width: 5;
}

.component-node.edited .component-body {
  fill: #ffffff;
  stroke: #f59e0b;
  stroke-width: 6;
  filter: url(#softGlow);
}

/* Workstation visual target pass: one place canvas, system overlays, compact instruments. */
.workstation-panel {
  overflow: hidden;
  border-color: rgba(216, 222, 233, .18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 18%),
    rgba(6, 8, 11, .94);
}

.workstation-chrome {
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, .72);
  border-bottom: 1px solid rgba(216, 222, 233, .12);
}

.workstation-chrome h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f8fafc;
  font-size: clamp(21px, 3vw, 34px);
  letter-spacing: 0;
  text-transform: uppercase;
}

.workstation-chrome h2 span {
  color: var(--blue);
}

.workstation-panel.heating .workstation-chrome h2 span { color: #f97316; }
.workstation-panel.water .workstation-chrome h2 span { color: #38bdf8; }
.workstation-panel.electrical .workstation-chrome h2 span { color: #facc15; }
.workstation-panel.network .workstation-chrome h2 span { color: #60a5fa; }
.workstation-panel.access .workstation-chrome h2 span { color: #a78bfa; }

.workstation-actions {
  display: flex;
  gap: 6px;
}

.workstation-actions button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #d8dee9;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(216, 222, 233, .12);
}

.lens-tabs {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  background: rgba(11, 13, 17, .92);
  border-bottom: 1px solid rgba(216, 222, 233, .1);
}

.lens-tabs button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgba(216, 222, 233, .16);
  color: #d8dee9;
  background: rgba(255, 255, 255, .045);
  font-weight: 820;
}

.lens-tabs button.active {
  color: #081018;
  background: #d8dee9;
}

.lens-tabs .subtab.active {
  color: white;
  background: #3b82f6;
  border-color: rgba(96, 165, 250, .75);
}

.workstation-panel.heating .lens-tabs .subtab.active { background: #f97316; }
.workstation-panel.access .lens-tabs .subtab.active { background: #7c3aed; }

.tab-divider {
  flex: 0 0 1px;
  height: 28px;
  background: rgba(216, 222, 233, .2);
}

.lens-stats {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
  background: rgba(12, 15, 20, .9);
  border-bottom: 1px solid rgba(216, 222, 233, .1);
}

.lens-stats span {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(216, 222, 233, .1);
  color: #f8fafc;
  font-size: 15px;
  font-weight: 850;
}

.lens-stats b {
  display: block;
  color: #a8b3c2;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.workstation-body {
  position: relative;
  background: #07090c;
}

.workstation-body .cad-viewport {
  padding: 0;
  background:
    radial-gradient(circle at 48% 42%, rgba(216, 222, 233, .08), transparent 34%),
    #07090c;
}

.workstation-body .place-svg {
  min-height: 680px;
  border-radius: 0;
  background: #07090c;
}

.map-legend,
.map-popover {
  position: absolute;
  z-index: 2;
  width: min(260px, 34%);
  padding: 12px;
  border-radius: 10px;
  background: rgba(6, 8, 11, .82);
  border: 1px solid rgba(216, 222, 233, .14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .36);
  backdrop-filter: blur(18px);
}

.map-legend {
  top: 14px;
  left: 14px;
  display: grid;
  gap: 7px;
}

.map-legend strong,
.map-popover b {
  color: #f8fafc;
  font-size: 14px;
}

.map-legend span,
.map-popover span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.2;
}

.map-legend i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  background: #d8dee9;
  border: 1px solid rgba(255,255,255,.5);
}

.legend-hot { background: #f97316 !important; }
.legend-cool { background: #38bdf8 !important; }
.legend-power { background: #facc15 !important; }
.legend-network { background: #60a5fa !important; }
.legend-access { background: #a78bfa !important; }
.legend-amber { background: #f59e0b !important; }
.legend-red { background: #ef4444 !important; }
.legend-unknown { background: #6b7280 !important; }
.legend-coverage {
  border-radius: 4px !important;
  background: linear-gradient(90deg, rgba(34,197,94,.75), rgba(250,204,21,.75), rgba(239,68,68,.75)) !important;
}
.legend-dash {
  border-radius: 0 !important;
  height: 3px !important;
  margin: 5px 0;
  background: repeating-linear-gradient(90deg, #d8dee9 0 8px, transparent 8px 14px) !important;
  border: 0 !important;
}

.map-popover {
  right: 16px;
  bottom: 24px;
  display: grid;
  gap: 6px;
}

.coverage {
  pointer-events: none;
  mix-blend-mode: screen;
}

.coverage.good { fill: rgba(34, 197, 94, .28); }
.coverage.weak { fill: rgba(250, 204, 21, .24); }
.coverage.blocked { fill: rgba(239, 68, 68, .24); }

.access-fill {
  fill: none;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .75;
}

.access-fill.reachable { stroke: #22c55e; }
.access-fill.constrained { stroke: #f59e0b; }

.access-zone {
  fill: rgba(168, 85, 247, .14);
  stroke: #a78bfa;
  stroke-width: 3;
  stroke-dasharray: 10 7;
}

.workstation-dock {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  background: rgba(0, 0, 0, .76);
  border-top: 1px solid rgba(216, 222, 233, .12);
}

.workstation-dock article {
  min-height: 58px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(216, 222, 233, .12);
}

.workstation-dock strong {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  margin-bottom: 3px;
}

.workstation-dock span {
  color: #a8b3c2;
  font-size: 12px;
}

.workstation-panel .outer-wall,
.workstation-panel .inner-wall {
  stroke: rgba(216, 222, 233, .9);
}

.workstation-panel .room-plate {
  fill: rgba(226, 232, 240, .10);
}

@media (max-width: 760px) {
  .lens-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workstation-body .place-svg {
    min-height: 520px;
  }

  .map-legend,
  .map-popover {
    position: static;
    width: auto;
    margin: 10px;
  }

  .workstation-body {
    display: flex;
    flex-direction: column;
  }

  .workstation-body .cad-viewport {
    order: 1;
  }

  .map-legend {
    order: 2;
  }

  .map-popover {
    order: 3;
  }

.workstation-dock {
    grid-template-columns: 1fr;
  }
}

/* Light architectural correction: Daedalus is a spatial CAD/BIM twin, not a black dashboard. */
body {
  background:
    radial-gradient(circle at 24% 8%, rgba(59, 130, 246, .10), transparent 34%),
    linear-gradient(180deg, #eef2f7, #dfe5ec 54%, #cdd6e1) !important;
  color: #14161a;
}

.app {
  color: #14161a;
}

.topbar,
.mission-strip,
.place-context,
.place-canvas-card,
.instrument-panel,
.lower-dock .lens-card,
.dollhouse-stage,
.twin-inspector,
.lens-card {
  background: rgba(248, 250, 252, .88) !important;
  border-color: rgba(84, 95, 112, .20) !important;
  box-shadow: 0 22px 70px rgba(47, 58, 76, .16) !important;
}

.topbar {
  background: rgba(248, 250, 252, .92) !important;
}

.topbar h1,
.mission-strip h2,
.place-context h2,
.instrument-panel h2,
.lens-card h3 {
  color: #14161a !important;
}

p,
.quiet-note,
.place-readouts span,
.component-meta span,
.relationship-panel p,
.ambiguity-card p {
  color: #556171;
}

.workstation-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .90), rgba(234, 239, 245, .94)) !important;
}

.workstation-chrome {
  background: rgba(255, 255, 255, .86) !important;
  border-bottom-color: rgba(84, 95, 112, .20);
}

.workstation-chrome h2 {
  color: #14161a;
}

.workstation-actions button {
  color: #283241;
  background: rgba(20, 22, 26, .045);
  border-color: rgba(84, 95, 112, .20);
}

.lens-tabs,
.lens-stats,
.workstation-dock {
  background: rgba(238, 242, 247, .78) !important;
  border-color: rgba(84, 95, 112, .18);
}

.lens-tabs button {
  color: #303a48;
  background: rgba(255, 255, 255, .72);
  border-color: rgba(84, 95, 112, .20);
}

.lens-tabs button.active {
  color: #fff;
  background: #3b82f6;
}

.lens-stats span,
.workstation-dock article,
.place-readouts span,
.component-meta span {
  color: #172033;
  background: rgba(255, 255, 255, .78);
  border-color: rgba(84, 95, 112, .18);
}

.lens-stats b,
.workstation-dock span,
.place-readouts b,
.component-meta b {
  color: #687386;
}

.workstation-body,
.workstation-body .cad-viewport {
  background:
    radial-gradient(circle at 48% 34%, rgba(255, 255, 255, .76), transparent 34%),
    linear-gradient(180deg, #f8fafc, #e4ebf3) !important;
}

.workstation-body .place-svg {
  background: #eef3f8;
}

.cad-bg {
  fill: #eef3f8 !important;
  stroke: rgba(84, 95, 112, .14);
}

.map-legend,
.map-popover {
  background: rgba(255, 255, 255, .84);
  border-color: rgba(84, 95, 112, .20);
  box-shadow: 0 20px 48px rgba(47, 58, 76, .20);
}

.map-legend strong,
.map-popover b {
  color: #14161a;
}

.map-legend span,
.map-popover span {
  color: #3a4555;
}

.dollhouse-shadow path {
  fill: rgba(84, 95, 112, .12);
}

.dollhouse-room {
  filter: drop-shadow(0 14px 18px rgba(47, 58, 76, .18));
}

.room-plate {
  fill: url(#roomSurface) !important;
  stroke: rgba(84, 95, 112, .30);
  stroke-width: 1.4;
}

.room-side {
  fill: #b8c4d0;
  stroke: rgba(84, 95, 112, .22);
}

.room-side.east {
  fill: #a9b6c4;
}

.room-wall {
  fill: rgba(255, 255, 255, .70);
  stroke: rgba(84, 95, 112, .25);
  stroke-width: 1.2;
}

.iso-wall-line {
  stroke: rgba(37, 46, 60, .55) !important;
  stroke-width: 5 !important;
}

.iso-opening {
  stroke: #eef3f8 !important;
  stroke-width: 12 !important;
}

.room-name {
  fill: #1b2431;
  stroke: rgba(255, 255, 255, .75);
  stroke-width: 3px;
  paint-order: stroke;
}

.room-role {
  fill: #687386;
}

.route-text,
.component-text,
.operation-overlay text,
.clone-overlay text {
  stroke: rgba(255, 255, 255, .78);
  fill: #14161a;
}

.component-body {
  stroke: rgba(37, 46, 60, .55);
}

.map-popover,
.map-legend,
.workstation-dock article {
  backdrop-filter: blur(18px);
}

.comment-layer {
  pointer-events: none;
}

.comment-leader {
  fill: none;
  stroke: rgba(112, 214, 255, .82);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.comment-card {
  fill: rgba(9, 14, 22, .88);
  stroke: rgba(112, 214, 255, .76);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.comment-label,
.comment-xyz {
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .72);
  pointer-events: none;
}

.comment-label {
  fill: #f8fafc;
  stroke-width: 4;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.comment-xyz {
  fill: #70d6ff;
  stroke-width: 3;
  font-size: 10px;
  font-weight: 780;
}

.comment-pin.selected .comment-card {
  stroke: #f59e0b;
}

.relationship-panel {
  display: grid;
  gap: .55rem;
  margin: .8rem 0 1rem;
}

.relationship-panel > strong {
  color: var(--text);
  font-size: .88rem;
}

.relationship-panel article {
  border: 1px solid rgba(216, 222, 233, .16);
  border-radius: 12px;
  padding: .7rem;
  background: rgba(15, 23, 32, .66);
}

.relationship-panel article span {
  color: var(--steel);
  display: block;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.relationship-panel article b {
  display: block;
  margin-top: .2rem;
}

.relationship-panel article p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.relationship-panel.empty {
  border: 1px dashed rgba(216, 222, 233, .24);
  border-radius: 12px;
  padding: .8rem;
}

.resolution-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .7rem;
  margin: -.25rem 0 1rem;
}

.choice-card {
  display: grid;
  gap: .45rem;
  min-height: 112px;
  padding: .85rem;
  border-radius: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(15, 23, 42, .68);
  border: 1px solid rgba(59, 130, 246, .38);
}

.choice-card:hover,
.choice-card:focus {
  transform: translateY(-1px);
  border-color: rgba(112, 214, 255, .75);
  box-shadow: 0 14px 34px rgba(59, 130, 246, .18);
}

.choice-card strong {
  font-size: .98rem;
}

.choice-card span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  text-transform: none;
}

.tighten-list article em {
  display: block;
  margin-top: .6rem;
  color: var(--steel);
  font-style: normal;
  font-weight: 800;
}

.ambiguity-card h3 {
  margin: .2rem 0;
  color: #f8fafc;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  line-height: 1.22;
}

.tighten-list article q {
  display: block;
  margin-top: .55rem;
  padding: .7rem;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  color: #e5edf6;
  background: rgba(59, 130, 246, .12);
  quotes: none;
}

.component-node.active .component-body {
  stroke: #fff;
  stroke-width: 6;
  filter: url(#softGlow);
}

.component-node.active .component-core {
  fill: var(--blue);
}

.component-label {
  fill: #f7f9fc;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .72);
  stroke-width: 5;
  font-size: 13px;
  font-weight: 850;
  text-anchor: middle;
  pointer-events: none;
}

.run-overlay rect {
  fill: rgba(5, 10, 16, .78);
  stroke: rgba(216, 222, 233, .22);
}

.run-overlay text {
  fill: #f8fafc;
  font-size: 16px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .5);
  stroke-width: 4;
}

@keyframes flowDash {
  to { stroke-dashoffset: -28; }
}

.consequence-layer .constraint-zone {
  fill: none;
  stroke: var(--red);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
}

.warning-label {
  fill: var(--amber);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .76);
  stroke-width: 5;
  font-size: 16px;
  font-weight: 900;
}

.warning-label.small {
  font-size: 12px;
}

.map-caption {
  padding: 10px 12px;
  border-radius: 12px;
  display: grid;
  gap: 3px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(216, 222, 233, .1);
}

.map-caption span {
  color: var(--muted);
}

.twin-inspector {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 13px;
}

.component-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.component-meta span {
  min-height: 64px;
  padding: 10px;
  border-radius: 10px;
  display: grid;
  align-content: center;
  gap: 3px;
  color: #f4f7fb;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(216, 222, 233, .1);
}

.component-meta b {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.evidence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.evidence-chips span {
  padding: 7px 9px;
  border-radius: 999px;
  color: #cbd8e8;
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .28);
  font-weight: 760;
}

.inspector-actions,
.action-stack {
  display: grid;
  gap: 9px;
}

.twin-lenses {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.lens-card {
  min-height: 164px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 9px;
}

.lens-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.24;
}

.lens-card ul {
  margin: 0;
  padding-left: 16px;
  color: #c3cedb;
  line-height: 1.35;
}

.lens-card.unresolved-lens {
  border-color: rgba(255, 159, 10, .28);
}

.primary {
  background: var(--blue);
  box-shadow: 0 16px 42px rgba(59, 130, 246, .26);
}

.secondary {
  color: #b9d7ff;
  border-color: rgba(59, 130, 246, .42);
  background: rgba(59, 130, 246, .12);
}

.tabbar {
  background: rgba(232, 238, 247, .88);
}

.tabbar a {
  color: #111820;
}

.tabbar a.active {
  background: rgba(59, 130, 246, .22);
  color: var(--blue);
}

@media (max-width: 980px) {
  .mission-strip,
  .living-workspace,
  .run-board,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .mission-metrics {
    grid-template-columns: 1fr;
  }

  .dollhouse-stage {
    min-height: auto;
  }

  .spatial-map {
    height: 58vh;
    min-height: 390px;
  }

  .twin-lenses {
    grid-template-columns: 1fr;
  }

  .component-meta {
    grid-template-columns: 1fr;
  }
}

/* Final sandbox visual contract: light architectural twin, not a black dashboard. */
html,
body,
.app {
  background:
    radial-gradient(circle at 18% 10%, rgba(59, 130, 246, .10), transparent 30%),
    radial-gradient(circle at 78% 12%, rgba(148, 163, 184, .16), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, #e8edf4 52%, #d4dde8 100%) !important;
  color: #14161a !important;
}

.topbar,
.mission-strip,
.place-context,
.place-canvas-card,
.instrument-panel,
.dollhouse-stage,
.twin-inspector,
.lens-card,
.workstation-panel,
.workstation-chrome,
.lens-tabs,
.lens-stats,
.workstation-dock,
.map-legend,
.map-popover,
.relationship-panel article,
.component-meta span,
.place-readouts span {
  background: rgba(255, 255, 255, .82) !important;
  border-color: rgba(82, 94, 112, .20) !important;
  color: #14161a !important;
  box-shadow: 0 20px 58px rgba(56, 68, 88, .14) !important;
}

.workstation-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(232, 238, 246, .94)) !important;
}

.workstation-body,
.cad-viewport,
.dollhouse-stage {
  background:
    radial-gradient(circle at 52% 36%, rgba(255, 255, 255, .9), transparent 34%),
    linear-gradient(180deg, #f8fafc, #e1e8f1) !important;
}

.cad-bg {
  fill: #edf2f7 !important;
  stroke: rgba(82, 94, 112, .14) !important;
}

.workstation-chrome h2,
.workstation-chrome strong,
.topbar h1,
.place-context h2,
.instrument-panel h2,
.lens-card h3,
.map-legend strong,
.map-popover b,
.relationship-panel > strong,
.component-meta b,
.place-readouts b {
  color: #14161a !important;
}

.workstation-chrome p,
.place-context p,
.instrument-panel p,
.lens-card p,
.map-legend span,
.map-popover span,
.relationship-panel article p,
.component-meta span,
.place-readouts span,
.quiet-note,
.lens-card ul {
  color: #536173 !important;
}

.lens-tabs button,
.workstation-actions button,
.secondary,
.choice-card {
  background: rgba(255, 255, 255, .78) !important;
  border-color: rgba(82, 94, 112, .22) !important;
  color: #253041 !important;
}

.lens-tabs button.active,
.primary {
  background: #3b82f6 !important;
  color: #fff !important;
}

.dollhouse-room {
  filter: drop-shadow(0 18px 22px rgba(61, 73, 94, .20)) !important;
}

.dollhouse-shadow path {
  fill: rgba(82, 94, 112, .12) !important;
}

.room-plate {
  fill: url(#roomSurface) !important;
  stroke: rgba(82, 94, 112, .34) !important;
  stroke-width: 1.5 !important;
}

.room-side {
  fill: #b9c5d2 !important;
  stroke: rgba(82, 94, 112, .24) !important;
}

.room-side.east {
  fill: #a8b5c4 !important;
}

.room-wall {
  fill: rgba(255, 255, 255, .74) !important;
  stroke: rgba(82, 94, 112, .30) !important;
  stroke-width: 1.35 !important;
}

.outer-wall,
.inner-wall,
.iso-wall-line {
  stroke: rgba(28, 38, 52, .60) !important;
  stroke-width: 5 !important;
}

.opening,
.iso-opening {
  stroke: #edf2f7 !important;
  stroke-width: 13 !important;
}

.room-name {
  fill: #172033 !important;
  stroke: rgba(255, 255, 255, .86) !important;
  stroke-width: 4px !important;
  paint-order: stroke !important;
  font-weight: 900 !important;
}

.room-role,
.scale-label {
  fill: #64748b !important;
}

.component-text,
.route-text,
.operation-overlay text,
.clone-overlay text,
.warning-label,
.comment-label,
.comment-xyz {
  fill: #14161a !important;
  stroke: rgba(255, 255, 255, .88) !important;
  stroke-width: 4px !important;
  paint-order: stroke !important;
}

.component-svg .component-body,
.component-node .component-body {
  stroke: rgba(28, 38, 52, .58) !important;
  stroke-width: 3 !important;
}

.component-svg.access .component-body,
.component-node.access .component-body {
  fill: rgba(255, 255, 255, .86) !important;
}

.run-overlay rect,
.comment-card {
  fill: rgba(255, 255, 255, .86) !important;
  stroke: rgba(82, 94, 112, .22) !important;
}

.ambiguity-card.active {
  border-color: rgba(59, 130, 246, .72) !important;
  background: rgba(232, 240, 252, .92) !important;
  box-shadow: inset 4px 0 0 rgba(59, 130, 246, .78), 0 18px 46px rgba(47, 58, 76, .12);
}

.ambiguity-card.active h3,
.ambiguity-card h3 {
  color: #14161a !important;
}

.ambiguity-card > strong,
.spatial-review-editor h3 {
  color: #14161a;
}

.micro-link {
  justify-self: start;
  appearance: none;
  border: 0;
  border-bottom: 1px solid rgba(59, 130, 246, .55);
  border-radius: 0;
  padding: 0;
  color: #2563eb;
  background: transparent;
  font: inherit;
  font-size: .86rem;
  font-weight: 850;
  cursor: pointer;
}

.spatial-review-editor {
  display: grid;
  gap: .85rem;
  margin: .35rem 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(59, 130, 246, .28);
  border-radius: 18px;
  background:
    linear-gradient(rgba(59, 130, 246, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .05) 1px, transparent 1px),
    rgba(255, 255, 255, .84);
  background-size: 22px 22px;
  box-shadow: 0 20px 56px rgba(47, 58, 76, .14);
}

.spatial-review-editor p {
  margin: 0;
}

.spatial-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}

.spatial-edit-grid span {
  min-height: 58px;
  padding: .65rem;
  border: 1px solid rgba(84, 95, 112, .18);
  border-radius: 12px;
  color: #172033;
  background: rgba(248, 250, 252, .88);
  font-weight: 850;
}

.spatial-edit-grid span:last-child {
  grid-column: 1 / -1;
}

.spatial-edit-grid b {
  display: block;
  margin-bottom: .25rem;
  color: #64748b;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.cad-nudge-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  max-width: 320px;
}

.cad-nudge-pad button {
  min-height: 42px;
  border: 1px solid rgba(37, 99, 235, .38);
  border-radius: 12px;
  color: #1e3a8a;
  background: rgba(219, 234, 254, .78);
  font-weight: 900;
}

.cad-nudge-pad button:first-child,
.cad-nudge-pad button:last-child {
  grid-column: 2;
}

.cad-nudge-pad button:nth-child(2) {
  grid-column: 1;
}

.cad-nudge-pad button:nth-child(3) {
  grid-column: 3;
}

.review-pin {
  cursor: pointer;
  pointer-events: auto;
}

.review-pin circle {
  fill: rgba(255, 159, 10, .92);
  stroke: rgba(255, 255, 255, .96);
  stroke-width: 3;
}

.review-pin.active circle {
  fill: #2563eb;
  stroke: #f8fafc;
  stroke-width: 5;
  filter: drop-shadow(0 0 12px rgba(37, 99, 235, .42));
}

.review-pin text {
  fill: #fff;
  font-size: 12px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

/* Grounded spatial-twin correction: captured plan first, overlays second. */
body,
.app-shell,
.place-shell {
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, .10), transparent 28rem),
    linear-gradient(180deg, #f7f6f2 0%, #eceff4 100%) !important;
  color: #14161a !important;
}

.topbar,
.place-canvas-card,
.workstation-panel,
.instrument-panel,
.lens-card,
.map-legend,
.map-popover,
.workstation-dock article,
.ambiguity-card,
.spatial-review-editor,
.relationship-panel,
.place-context,
.run-control-card {
  background: rgba(255, 255, 255, .90) !important;
  border-color: rgba(73, 87, 108, .18) !important;
  box-shadow: 0 18px 48px rgba(48, 58, 76, .12) !important;
}

.workstation-body,
.cad-viewport {
  background: linear-gradient(180deg, #fbfaf6, #eef2f7) !important;
}

.cad-bg {
  fill: #f7f5ef !important;
}

.captured-extent {
  fill: rgba(255, 255, 255, .30);
  stroke: rgba(28, 38, 52, .16);
  stroke-dasharray: 9 7;
}

.room-plan {
  filter: drop-shadow(0 16px 24px rgba(48, 58, 76, .16));
}

.room-plan .room-plate {
  fill: rgba(255, 255, 255, .74) !important;
  stroke: rgba(31, 42, 58, .55) !important;
  stroke-width: 2 !important;
}

.room-plan:nth-of-type(2) .room-plate,
.room-plan:nth-of-type(5) .room-plate {
  fill: rgba(231, 236, 244, .78) !important;
}

.service-spine {
  fill: none;
  stroke: rgba(100, 116, 139, .42);
  stroke-width: 2.5;
  stroke-dasharray: 8 8;
}

.outer-wall,
.inner-wall,
.iso-wall-line {
  fill: none !important;
  stroke: rgba(20, 22, 26, .72) !important;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7 !important;
}

.opening,
.iso-opening {
  fill: none !important;
  stroke: #f7f5ef !important;
  stroke-linecap: round;
  stroke-width: 15 !important;
}

.route-svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-svg.heating {
  stroke: #e35f2d !important;
}

.route-svg.water {
  stroke: #2f80ed !important;
}

.route-svg.electrical {
  stroke: #d9a300 !important;
}

.route-svg.network {
  stroke: #3b82f6 !important;
}

.route-svg.access {
  stroke: #7c3aed !important;
}

.route-svg.run-active {
  stroke-width: 16 !important;
  filter: drop-shadow(0 0 14px rgba(227, 95, 45, .38));
}

.route-svg.route-bottleneck {
  stroke: #f97316 !important;
  stroke-dasharray: 18 10;
}

.clone-overlay rect {
  fill: rgba(255, 255, 255, .72) !important;
  stroke: rgba(59, 130, 246, .82) !important;
  stroke-width: 3 !important;
}

.operation-overlay rect {
  fill: rgba(255, 255, 255, .88) !important;
  stroke: rgba(227, 95, 45, .30) !important;
}
