.depth-map {
  width: min(1500px, 98vw);
  max-width: 98vw;
  max-height: 96svh;
  padding: 25px 30px 18px;
  color: #eee7d9;
  background: #15110d;
  border: 1px solid #776951;
  overflow: auto;
  overscroll-behavior: contain;
}
.depth-map::backdrop {
  background: #0b0907ef;
  backdrop-filter: blur(12px);
}
.depth-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.depth-map-header .eyebrow {
  color: #d6bd96;
  margin: 0 0 7px;
  font-size: 8px;
}
.depth-map h2 {
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -0.045em;
  margin: 0;
}
#close-depth-map {
  padding: 12px 16px;
  border: 1px solid #78705c;
  font-size: 11px;
  white-space: nowrap;
}
.map-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 16px 0 0;
  font-size: 11px;
  color: #dbd0b9;
}
.map-tools p {
  margin: 0;
  flex: 1;
  font-size: 12px;
  line-height: 1.5;
}
.map-tools button {
  min-height: 40px;
  border-bottom: 1px solid #756d58;
  padding: 6px 0;
}
.map-tools button:last-child {
  color: #eed2a2;
}
.cutaway-viewport {
  overflow: auto;
  max-height: calc(96svh - 265px);
  border-block: 1px solid #63624940;
  scrollbar-color: #8d7857 #1d1812;
}
.colony-section {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(96svh - 275px);
  min-height: 400px;
}
.colony-section[style*="1200px"] {
  max-height: none;
}
.section-caption {
  fill: #adad90;
  font:
    12px Mono,
    monospace;
  letter-spacing: 2px;
}
.section-depth {
  fill: #e3ceab;
  font:
    10px Mono,
    monospace;
  letter-spacing: 2px;
}
.section-room-title {
  fill: #f4e9ce;
  font:
    14px Inter,
    sans-serif;
  letter-spacing: 0.1px;
}
.section-chamber {
  transition: opacity 0.18s;
  cursor: pointer;
  outline: none;
}
.section-chamber > path {
  transition:
    stroke 0.18s,
    stroke-width 0.18s;
}
.section-chamber:hover > path:first-child,
.section-chamber:focus > path:first-child,
.section-chamber.is-current > path:first-child {
  stroke: #f4dca7;
  stroke-width: 6;
}
.section-chamber.is-dimmed {
  opacity: 0.28;
}
.section-chamber:focus {
  opacity: 1;
}
.depth-map-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  color: #bfbca7;
  font:
    9px Mono,
    monospace;
  line-height: 1.6;
}
#depth-topics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 12px 0 0;
}
#depth-topics button {
  font-size: 12px;
  color: var(--topic-color);
  text-align: center;
  padding: 10px 4px;
  border-top: 1px solid #64715e44;
  min-height: 40px;
}
#depth-topics button[aria-pressed="true"] {
  border-color: var(--topic-color);
  background: #ffffff07;
}
.depth-layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 20px 0;
}
.depth-layers h3 {
  font-weight: 400;
  font-size: 18px;
}
.depth-chamber {
  display: block;
  width: 100%;
  min-height: 60px;
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #77735e88;
  color: #e7dec9;
  font-size: 12px;
  line-height: 1.6;
}
.depth-chamber:hover {
  background: #ffffff09;
}
#depth-layers[hidden],
#cutaway-viewport[hidden] {
  display: none;
}
@media (max-width: 650px) {
  .depth-map {
    padding: 18px 14px;
    width: 98vw;
    max-height: 96svh;
  }
  .depth-map-header {
    gap: 12px;
    position: sticky;
    top: -18px;
    z-index: 2;
    background: #15110d;
    margin: -18px -14px 0;
    padding: 18px 14px 10px;
  }
  .depth-map h2 {
    font-size: 28px;
  }
  .map-tools {
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
  }
  .map-tools p {
    flex-basis: 100%;
    font-size: 11px;
  }
  .map-tools button {
    font-size: 11px;
  }
  .colony-section {
    min-height: 0;
    max-height: none;
    min-width: 0;
  }
  .cutaway-viewport {
    max-height: 52svh;
  }
  .depth-map-footer {
    font-size: 8px;
  }
  .depth-map-footer span:last-child {
    max-width: 130px;
    text-align: right;
  }
  #depth-topics {
    gap: 4px;
  }
  #depth-topics button {
    font-size: 9px;
    line-height: 1.5;
  }
  .depth-layers {
    grid-template-columns: 1fr;
  }
  .depth-chamber {
    font-size: 13px;
    min-height: 50px;
  }
  #close-depth-map {
    font-size: 10px;
    padding: 10px;
  }
  #room-steps {
    flex: 1;
    justify-content: center;
    gap: 1px;
  }
  #room-steps button {
    flex: 1;
    max-width: 34px;
    padding: 10px 4px;
    min-width: 24px;
  }
  .room-navigation > button {
    flex-shrink: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .section-chamber,
  .section-chamber > path {
    transition: none;
  }
}
.chamber-portrait {
  pointer-events: none;
  filter: brightness(1.1) saturate(0.84);
  opacity: 0.93;
}
.section-chamber:hover .chamber-portrait,
.section-chamber:focus .chamber-portrait {
  filter: brightness(1.24) saturate(0.92);
}

#depth-topics button small {
  display: block;
  margin-top: 4px;
  font:
    8px Mono,
    monospace;
  letter-spacing: 0.8px;
  color: #c5c7b4;
}
.section-route-end {
  fill: #c3bca5;
  font:
    10px Mono,
    monospace;
  letter-spacing: 0.7px;
}
.section-chamber[data-kind="prototype"] .chamber-portrait {
  filter: saturate(0.9);
}
@media (max-width: 650px) {
  #depth-topics button small {
    font-size: 7px;
    letter-spacing: 0;
  }
}
