:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #7b8794;
  --line: #dbe1e8;
  --accent: #2f6feb;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 "Segoe UI", Inter, system-ui, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; letter-spacing: .01em; }

.field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field input, .field select {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-width: 130px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 6px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

.summary { color: var(--muted); font-size: 12px; }
.link { margin-left: auto; color: var(--accent); font-size: 12px; text-decoration: none; }
.link:hover { text-decoration: underline; }

.split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.pane-title {
  margin: 0;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.pane-title { display: flex; align-items: center; gap: 12px; }

.toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  text-transform: none;
}

.toggle input { accent-color: var(--accent); cursor: pointer; }

.scene { position: relative; flex: 1; min-height: 0; }

/* Attribute inspector, floating over the 3D view. */
.details {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 310px;
  max-width: calc(100% - 20px);
  overflow-y: auto;
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(31, 41, 51, .13);
  font-size: 12px;
}

.details h3 {
  margin: 0 0 2px;
  font-size: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.details .sub { color: var(--muted); margin-bottom: 10px; }

.details .close {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 7px;
  font-size: 15px;
  line-height: 1.2;
  background: transparent;
  color: var(--muted);
}

.details h4 {
  margin: 14px 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}

.details table { width: 100%; border-collapse: collapse; }
.details td { padding: 2px 0; vertical-align: top; word-break: break-word; }
.details td.k { color: var(--muted); width: 44%; padding-right: 8px; }
.details td.v { font-variant-numeric: tabular-nums; }
.details .swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid rgba(31, 41, 51, .3);
  display: inline-block;
}
.details .empty { color: var(--muted); font-style: italic; }
.scene canvas { display: block; width: 100%; height: 100%; }

.labels3d {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(31, 41, 51, .82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.dim { opacity: .35; }

/* Caller-supplied value, shown next to the room number in 3D. */
.tag-value {
  color: #9dc0ff;
  font-variant-numeric: tabular-nums;
}

.plan { flex: 1; min-height: 0; overflow: auto; padding: 10px; }
.plan svg { width: 100%; height: auto; }

.plan .room-fill { cursor: pointer; transition: fill-opacity .12s; }
.plan .room.selected .room-fill { stroke-width: 3; fill-opacity: 1; }
.plan .room.dim .room-fill { fill-opacity: .25; }

.status {
  padding: 10px 18px;
  background: #fdecea;
  color: #8c1d18;
  border-top: 1px solid #f5c6c2;
  font-size: 13px;
}
