@font-face {
  font-family: "Montserrat";
  src: url("./fonts/montserrat-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("./fonts/poppins-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("./fonts/poppins-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("./fonts/poppins-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  color: #292e3b;
  background: #e3e8e1;
  --dax-deep: #164451;
  --dax-blue: #317a90;
  --dax-cyan: #7dcdd0;
  --dax-paper: #e3e8e1;
  --dax-yellow: #e1e355;
  --dax-orange: #ed5933;
  --dax-gray: #9da9aa;
  --dax-medium: #4d5759;
  --dax-charcoal: #292e3b;
  --white: #ffffff;
  --viewport: #292e3b;
  --panel-line: rgba(125, 205, 208, 0.28);
  --panel-muted: rgba(227, 232, 225, 0.66);
  --shadow: 0 24px 70px rgba(22, 68, 81, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  margin: 0;
  background: var(--dax-paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 18%, rgba(125, 205, 208, 0.34) 0 7rem, transparent 7.1rem),
    linear-gradient(145deg, #f7f8f4 0%, #eef2ed 52%, #e3e8e1 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
}

body::before {
  top: 0;
  right: -76px;
  width: 260px;
  height: 94px;
  border-radius: 0 0 0 94px;
  background: var(--dax-yellow);
  opacity: 0.62;
}

body::after {
  right: -88px;
  bottom: 5vh;
  width: 210px;
  height: 210px;
  border: 34px solid rgba(49, 122, 144, 0.14);
  border-radius: 50%;
}

button,
select {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--dax-yellow);
  outline-offset: 3px;
}

.site-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 48px) 24px;
}

.brand-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(22, 68, 81, 0.18);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
}

.brand-mark img {
  display: block;
  width: 126px;
  height: auto;
}

.header-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(22, 68, 81, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--dax-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dax-cyan);
  box-shadow: 0 0 0 4px rgba(125, 205, 208, 0.22);
}

.demo-page {
  padding: clamp(28px, 4vw, 52px) 0 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 28px;
}

.eyebrow,
.workspace-kicker,
.question-eyebrow {
  margin: 0 0 8px;
  color: var(--dax-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Montserrat", "Poppins", sans-serif;
  color: var(--dax-deep);
  letter-spacing: -0.035em;
}

h1 {
  max-width: 760px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 0.98;
}

.intro-copy {
  max-width: 520px;
  margin: 0 0 3px auto;
  color: var(--dax-medium);
  font-size: 14px;
  line-height: 1.75;
}

.workspace {
  position: relative;
  padding: clamp(16px, 2.2vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(22, 68, 81, 0.16);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.workspace::before {
  position: absolute;
  top: 0;
  right: clamp(26px, 7vw, 100px);
  width: 118px;
  height: 7px;
  border-radius: 0 0 8px 8px;
  background: var(--dax-orange);
  content: "";
}

.workspace::after {
  position: absolute;
  top: 0;
  right: clamp(150px, 16vw, 230px);
  width: 54px;
  height: 7px;
  border-radius: 0 0 8px 8px;
  background: var(--dax-yellow);
  content: "";
}

.workspace-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px 22px;
}

.workspace-kicker {
  display: block;
  margin-bottom: 4px;
}

.workspace-heading h2 {
  font-size: clamp(21px, 2vw, 28px);
}

.demo-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* Beats the class rule above; the UA's [hidden] rule alone loses to it. */
.demo-controls[hidden] {
  display: none;
}

.control-field {
  display: grid;
  gap: 5px;
}

.control-field > span {
  color: var(--dax-medium);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.model-select,
.view-badge {
  height: 42px;
  border: 1px solid rgba(22, 68, 81, 0.22);
  border-radius: 11px;
  background: var(--white);
  color: var(--dax-deep);
}

.model-select {
  width: min(230px, 42vw);
  padding: 0 34px 0 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.view-badge {
  display: grid;
  min-width: 58px;
  place-items: center;
  border-color: var(--dax-deep);
  background: var(--dax-deep);
  color: var(--dax-cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.question-panel,
.viewer-shell {
  height: clamp(540px, 62vh, 720px);
}

.question-panel {
  display: none;
  min-width: 0;
  overflow: hidden;
  border-radius: 21px;
  background: var(--dax-deep);
  color: var(--dax-paper);
  box-shadow: inset 0 0 0 1px rgba(125, 205, 208, 0.18);
}

.question-panel[data-visible="true"],
.question-panel[data-visible="loading"],
.question-panel[data-visible="empty"] {
  display: flex;
  flex-direction: column;
}

.question-panel[data-visible="loading"] .question-scroll {
  overflow: hidden;
}

.question-loading {
  display: flex;
  flex-direction: column;
  padding: 18px 7px;
}

.question-loading span {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 205, 208, 0.11);
}

.question-loading span::after {
  display: block;
  width: 52%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(227, 232, 225, 0.14), transparent);
  content: "";
  animation: loading-sheen 1.6s ease-in-out infinite;
}

.question-loading-label {
  width: 34%;
  height: 7px;
  margin-bottom: 17px;
}

.question-loading-label.is-second {
  width: 46%;
  margin-top: 18px;
}

.question-loading-line {
  width: 68%;
  height: 8px;
  margin-bottom: 11px;
}

.question-loading-line.is-wide {
  width: 92%;
}

.question-loading-line.is-value {
  width: 42%;
  height: 10px;
  margin-bottom: 20px;
  background: rgba(227, 232, 225, 0.13);
}

.question-empty {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 11px;
  padding: 30px 22px;
  color: rgba(227, 232, 225, 0.56);
  text-align: center;
}

.question-empty-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(125, 205, 208, 0.3);
  border-radius: 50%;
  color: var(--dax-cyan);
}

.question-empty p {
  max-width: 210px;
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
}

.question-header {
  display: flex;
  flex: 0 0 auto;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--panel-line);
}

.question-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--dax-cyan);
  font-size: 8px;
}

.question-title {
  display: block;
  color: var(--white);
  font-family: "Montserrat", "Poppins", sans-serif;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.question-stats {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(125, 205, 208, 0.14);
  color: var(--dax-cyan);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.question-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1px 13px 18px;
  scrollbar-color: var(--dax-cyan) transparent;
  scrollbar-width: thin;
}

.question-scroll::-webkit-scrollbar {
  width: 7px;
}

.question-scroll::-webkit-scrollbar-thumb {
  border-radius: 9px;
  background: var(--dax-cyan);
}

.question-group {
  padding-top: 17px;
}

.question-group-label {
  padding: 0 3px 8px;
  border-bottom: 1px solid var(--panel-line);
  color: var(--dax-cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.question-group-label.with-note {
  display: flex;
  align-items: baseline;
  gap: 4px;
  letter-spacing: 0.08em;
}

.group-note {
  color: rgba(227, 232, 225, 0.48);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.question-row {
  padding: 10px 7px 11px;
  border-bottom: 1px solid rgba(125, 205, 208, 0.1);
}

.question-row:last-child {
  border-bottom: 0;
}

.question-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.question-label {
  min-width: 0;
  color: var(--panel-muted);
  font-size: 10px;
  line-height: 1.35;
}

.question-value {
  display: block;
  margin-top: 5px;
  color: var(--white);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.question-badge-na {
  flex: 0 0 auto;
  color: rgba(227, 232, 225, 0.4);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.question-row[data-state="na"] .question-value {
  color: rgba(227, 232, 225, 0.42);
}

/* Rows that can locate their segments in the 3D model. */
.question-row.is-highlightable {
  position: relative;
  margin: 0 -7px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.question-row.is-highlightable::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: rgba(237, 89, 51, 0.45);
  content: "";
}

.question-row.is-highlightable:hover,
.question-row.is-highlightable:focus-visible {
  background: rgba(125, 205, 208, 0.1);
  outline: none;
}

.question-row.is-highlightable[data-active="true"] {
  background: rgba(237, 89, 51, 0.16);
}

.question-row.is-highlightable[data-active="true"]::before {
  background: var(--dax-orange);
}

/* Perspective image: inline thumbnail in the segment dialog + full-screen lightbox. */
.perspective-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(22, 68, 81, 0.16);
  border-radius: 10px;
  background: rgba(22, 68, 81, 0.06);
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.perspective-thumb:hover,
.perspective-thumb:focus-visible {
  border-color: var(--dax-blue);
  box-shadow: 0 6px 18px rgba(22, 68, 81, 0.16);
  outline: none;
}

.perspective-thumb:disabled {
  cursor: default;
}

.perspective-thumb-image {
  display: block;
  width: 100%;
  /* Reserve the slot (16:9 source) so the section keeps its height while the photo decodes. */
  aspect-ratio: 16 / 9;
  max-height: 260px;
  object-fit: cover;
}

.perspective-thumb-hint {
  display: block;
  padding: 7px 10px;
  color: var(--dax-medium);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.perspective-thumb-missing {
  display: block;
  padding: 18px 10px;
  color: var(--dax-medium);
  font-size: 11px;
}

dialog.perspective-lightbox {
  position: fixed;
  display: flex;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border: 0;
  margin: 0;
  background: rgba(22, 34, 41, 0.94);
  inset: 0;
  overflow: hidden;
}

dialog.perspective-lightbox:not([open]) {
  display: none;
}

dialog.perspective-lightbox::backdrop {
  background: rgba(22, 34, 41, 0.6);
}

.perspective-lightbox-figure {
  display: flex;
  max-width: min(1400px, 100%);
  max-height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.perspective-lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.perspective-lightbox-caption {
  color: rgba(227, 232, 225, 0.82);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
}

.perspective-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(227, 232, 225, 0.3);
  border-radius: 50%;
  background: rgba(22, 34, 41, 0.7);
  color: var(--dax-paper);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.perspective-lightbox-close:hover,
.perspective-lightbox-close:focus-visible {
  border-color: var(--dax-cyan);
  outline: none;
}

.question-badge-locate {
  flex: 0 0 auto;
  color: rgba(237, 89, 51, 0.75);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.question-row.is-highlightable[data-active="true"] .question-badge-locate {
  color: var(--dax-orange);
}

.slope-row {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 7px;
  border-bottom: 1px solid rgba(125, 205, 208, 0.1);
}

.slope-row .question-label {
  color: rgba(227, 232, 225, 0.58);
}

.slope-row .question-value {
  margin: 0;
  color: var(--white);
  white-space: nowrap;
}

.viewer-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.viewer-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 5px solid var(--dax-charcoal);
  border-radius: 21px;
  background: var(--viewport);
  box-shadow: inset 0 0 0 1px rgba(125, 205, 208, 0.16);
}

.viewer-shell::after {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dax-cyan);
  box-shadow: 0 0 0 5px rgba(125, 205, 208, 0.12);
  content: "";
  pointer-events: none;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

#scene.is-orbiting,
#scene.is-trucking {
  cursor: grabbing;
}

.viewer-shell:not([data-measuring="true"]) #scene.is-overlay-hover {
  cursor: pointer;
}

.viewer-shell[data-measuring="true"] #scene {
  cursor: crosshair;
}

.viewer-help {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  padding: 9px 7px 0;
  color: #667274;
  font-size: 9px;
}

.viewer-help span {
  white-space: nowrap;
}

.viewer-help b {
  color: var(--dax-deep);
  font-weight: 600;
}

.measure-toolbar {
  position: absolute;
  z-index: 30;
  top: 16px;
  left: 50%;
  display: flex;
  min-height: 42px;
  max-width: calc(100% - 32px);
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(125, 205, 208, 0.42);
  border-radius: 12px;
  background: rgba(22, 68, 81, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.overlay-toggle {
  position: absolute;
  z-index: 30;
  bottom: 16px;
  left: 16px;
  display: none;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(125, 205, 208, 0.42);
  border-radius: 11px;
  background: rgba(22, 68, 81, 0.9);
  color: var(--dax-paper);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.overlay-toggle[data-visible="true"] {
  display: inline-flex;
}

.overlay-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overlay-toggle[data-active="true"] {
  background: rgba(22, 68, 81, 0.94);
  color: var(--dax-cyan);
}

.overlay-toggle[data-active="false"] {
  border-color: rgba(227, 232, 225, 0.25);
  color: rgba(227, 232, 225, 0.58);
}

.overlay-toggle:hover {
  background: rgba(49, 122, 144, 0.94);
  color: var(--white);
}

.measure-toggle,
.measure-mode,
.measure-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(227, 232, 225, 0.68);
  cursor: pointer;
}

.measure-toggle {
  min-height: 30px;
  gap: 7px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 600;
}

.measure-toggle svg,
.measure-mode svg,
.measure-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measure-toolbar[data-active="true"] .measure-toggle {
  background: rgba(125, 205, 208, 0.16);
  color: var(--dax-cyan);
}

.measure-tools {
  display: none;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-left: 5px;
  padding-left: 8px;
  border-left: 1px solid var(--panel-line);
}

.measure-toolbar[data-active="true"] .measure-tools {
  display: flex;
}

.measure-modes {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 7px;
}

.measure-mode {
  width: 29px;
  height: 28px;
  border-radius: 0;
}

.measure-mode + .measure-mode {
  border-left: 1px solid var(--panel-line);
}

.measure-mode[data-active="true"] {
  background: rgba(125, 205, 208, 0.15);
  color: var(--dax-cyan);
}

.measure-readout {
  max-width: min(300px, 28vw);
  overflow: hidden;
  color: var(--dax-paper);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-unit {
  height: 28px;
  border: 1px solid var(--panel-line);
  border-radius: 7px;
  background: var(--dax-charcoal);
  color: var(--dax-paper);
  font-size: 9px;
}

.measure-icon {
  width: 28px;
  height: 28px;
}

.measure-icon:disabled {
  cursor: default;
  opacity: 0.28;
}

.measure-toggle:hover,
.measure-mode:hover,
.measure-icon:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.measure-overlay {
  position: absolute;
  z-index: 25;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.measure-point {
  fill: var(--dax-yellow);
  stroke: var(--dax-deep);
  stroke-width: 1.5;
}

.measure-line {
  stroke: var(--dax-yellow);
  stroke-width: 1.5;
}

.measure-line-preview {
  stroke-dasharray: 6 4;
  opacity: 0.8;
}

.measure-label {
  fill: var(--white);
  stroke: rgba(22, 68, 81, 0.95);
  stroke-width: 4px;
  paint-order: stroke fill;
  font-family: "Poppins", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.model-loading,
.status {
  position: absolute;
  z-index: 45;
  bottom: 24px;
  left: 50%;
  max-width: calc(100% - 32px);
  border: 1px solid rgba(125, 205, 208, 0.38);
  border-radius: 11px;
  background: rgba(22, 68, 81, 0.94);
  color: var(--dax-paper);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.model-loading {
  top: 50%;
  bottom: auto;
  display: none;
  width: min(330px, calc(100% - 32px));
  padding: 18px 19px;
  border-color: rgba(125, 205, 208, 0.3);
  border-radius: 15px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
}

.model-loading[data-visible="true"] {
  display: block;
}

.model-loading-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
}

#loadingPercent {
  margin-left: auto;
  color: var(--dax-cyan);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(125, 205, 208, 0.25);
  border-top-color: var(--dax-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-track {
  height: 4px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.loading-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--dax-cyan);
  transition: width 120ms linear;
}

.model-loading[data-indeterminate="true"] .loading-track span {
  animation: loading-track 1.35s ease-in-out infinite;
}

.viewer-shell[data-loading="true"]::before {
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(49, 122, 144, 0.1), transparent 46%),
    linear-gradient(120deg, rgba(125, 205, 208, 0.025), transparent 45%);
  content: "";
  pointer-events: none;
}

.viewer-shell[data-loading="true"] #scene {
  opacity: 0.42;
  transition: opacity 180ms ease;
}

.status {
  padding: 9px 13px;
  font-size: 10px;
  text-align: center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.status.is-hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
}

.slab-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(760px, calc(100svh - 40px));
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--dax-charcoal);
  box-shadow: 0 30px 90px rgba(22, 68, 81, 0.32);
}

.slab-dialog::backdrop {
  background: rgba(22, 31, 38, 0.56);
  backdrop-filter: blur(5px);
}

.slab-dialog-card {
  display: flex;
  max-height: min(760px, calc(100svh - 40px));
  overflow: hidden;
  border: 1px solid rgba(22, 68, 81, 0.18);
  border-radius: 22px;
  background: #f7f8f4;
  flex-direction: column;
}

.slab-dialog-header {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 25px 20px;
  overflow: hidden;
  border-bottom: 1px solid rgba(22, 68, 81, 0.12);
  background:
    linear-gradient(125deg, rgba(125, 205, 208, 0.2), transparent 58%),
    var(--white);
}

.slab-dialog-header::before,
.slab-dialog-header::after {
  position: absolute;
  top: 0;
  height: 6px;
  border-radius: 0 0 7px 7px;
  content: "";
}

.slab-dialog-header::before {
  right: 72px;
  width: 94px;
  background: var(--dax-orange);
}

.slab-dialog-header::after {
  right: 174px;
  width: 42px;
  background: var(--dax-yellow);
}

.slab-dialog-heading {
  min-width: 0;
}

.slab-dialog-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--dax-blue);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.slab-dialog-heading h2 {
  color: var(--dax-deep);
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.12;
}

.slab-dialog-heading p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--dax-medium);
  font-size: 10px;
  line-height: 1.4;
}

.slab-dialog-swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid rgba(22, 68, 81, 0.16);
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(125, 205, 208, 0.12);
}

.slab-dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(22, 68, 81, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--dax-deep);
  cursor: pointer;
}

.slab-dialog-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.slab-dialog-close:hover {
  border-color: var(--dax-blue);
  background: var(--white);
  color: var(--dax-blue);
}

.slab-dialog-content {
  min-height: 0;
  padding: 5px 25px 19px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: var(--dax-cyan) transparent;
  scrollbar-width: thin;
}

.slab-dialog-content::-webkit-scrollbar {
  width: 7px;
}

.slab-dialog-content::-webkit-scrollbar-thumb {
  border-radius: 9px;
  background: var(--dax-cyan);
}

.slab-data-section {
  padding-top: 18px;
}

.slab-data-heading {
  margin: 0 0 8px;
  color: var(--dax-blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.slab-data-list {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(22, 68, 81, 0.12);
  border-radius: 13px;
  background: var(--white);
}

.slab-data-row {
  display: grid;
  min-height: 42px;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 20px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(22, 68, 81, 0.09);
}

.slab-data-row:last-child {
  border-bottom: 0;
}

.slab-data-row dt,
.slab-data-row dd {
  margin: 0;
  line-height: 1.4;
}

.slab-data-row dt {
  color: #667274;
  font-size: 10px;
}

.slab-data-row dd {
  color: var(--dax-deep);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.slab-dialog-footer {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 25px;
  border-top: 1px solid rgba(22, 68, 81, 0.12);
  background: var(--white);
}

.slab-dialog-footer span {
  color: #758183;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slab-dialog-done {
  min-width: 78px;
  min-height: 34px;
  border: 1px solid var(--dax-deep);
  border-radius: 9px;
  background: var(--dax-deep);
  color: var(--dax-cyan);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.slab-dialog-done:hover {
  background: var(--dax-blue);
  color: var(--white);
}

.site-footer {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--dax-medium);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-sheen {
  from { transform: translateX(-110%); }
  to { transform: translateX(210%); }
}

@keyframes loading-track {
  0% { transform: translateX(-130%); }
  55% { transform: translateX(210%); }
  100% { transform: translateX(210%); }
}

@media (max-width: 980px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .intro-copy {
    max-width: 650px;
    margin-left: 0;
  }

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

  .viewer-column {
    grid-row: 1;
  }

  .question-panel {
    height: min(560px, 68vh);
  }

  .viewer-shell {
    height: clamp(480px, 62vh, 650px);
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-header {
    min-height: 70px;
  }

  .brand-mark img {
    width: 104px;
  }

  .header-label {
    min-height: 30px;
    padding: 0 11px;
    font-size: 8px;
  }

  .demo-page {
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(34px, 12vw, 49px);
  }

  .intro-copy {
    font-size: 12px;
    line-height: 1.65;
  }

  .workspace {
    padding: 12px;
    border-radius: 21px;
  }

  .workspace-header {
    display: grid;
    gap: 16px;
    padding: 7px 2px 18px;
  }

  .demo-controls {
    width: 100%;
  }

  .control-field {
    min-width: 0;
    flex: 1;
  }

  .model-select {
    width: 100%;
  }

  .viewer-shell {
    height: max(420px, 58svh);
    border-width: 3px;
    border-radius: 17px;
  }

  .question-panel {
    height: 520px;
    border-radius: 17px;
  }

  .viewer-help {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    gap: 5px 8px;
    padding: 10px 3px 2px;
  }

  .measure-toolbar {
    top: 12px;
    max-width: calc(100% - 24px);
  }

  .measure-toolbar[data-active="true"] {
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }

  .measure-tools {
    gap: 4px;
    margin-left: 3px;
    padding-left: 5px;
  }

  .measure-readout {
    max-width: 19vw;
  }

  .measure-icon {
    width: 25px;
  }

  .site-footer {
    flex-wrap: wrap;
    padding: 16px;
    text-align: center;
  }

  .slab-dialog {
    width: calc(100% - 20px);
    max-height: calc(100svh - 20px);
  }

  .slab-dialog-card {
    max-height: calc(100svh - 20px);
    border-radius: 17px;
  }

  .slab-dialog-header {
    padding: 21px 18px 17px;
  }

  .slab-dialog-content {
    padding: 3px 18px 16px;
  }

  .slab-data-row {
    grid-template-columns: minmax(0, 1fr) minmax(100px, auto);
    gap: 12px;
  }

  .slab-dialog-footer {
    padding: 11px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Single-viewport application shell */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.site-shell {
  display: grid;
  width: min(1480px, 100%);
  height: 100svh;
  min-height: 0;
  grid-template-rows: 76px minmax(0, 1fr);
  padding-bottom: 16px;
}

.brand-header {
  min-height: 0;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 24px;
}

.brand-mark {
  flex: 0 0 auto;
}

.brand-mark img {
  width: 110px;
}

.product-title {
  min-width: 0;
  padding-left: 23px;
  border-left: 1px solid rgba(22, 68, 81, 0.2);
}

.product-title > span {
  display: block;
  margin-bottom: 2px;
  color: var(--dax-blue);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.product-title h1 {
  overflow: hidden;
  color: var(--dax-deep);
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-page {
  min-height: 0;
  padding: 16px 0 0;
}

.workspace {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  border-radius: 24px;
}

.workspace-header {
  min-height: 0;
  flex: 0 0 auto;
  padding: 0 2px 12px;
}

.workspace-kicker {
  margin-bottom: 1px;
  font-size: 8px;
}

.workspace-heading h2 {
  font-size: clamp(19px, 1.7vw, 24px);
}

.control-field {
  gap: 3px;
}

.model-select,
.view-badge {
  height: 38px;
}

.workspace-grid {
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: 304px minmax(0, 1fr);
}

.question-panel,
.viewer-shell {
  height: auto;
  min-height: 0;
}

.question-header {
  min-height: 68px;
  justify-content: flex-start;
  padding: 13px 17px;
}

.question-stats {
  display: none;
}

.viewer-column {
  height: 100%;
  min-height: 0;
}

.viewer-shell {
  flex: 1 1 auto;
}

.viewer-help {
  min-height: 30px;
  flex: 0 0 30px;
  padding-top: 7px;
}

@media (max-width: 760px) {
  .site-shell {
    grid-template-rows: 64px minmax(0, 1fr);
    padding-right: 12px;
    padding-bottom: 10px;
    padding-left: 12px;
  }

  .brand-mark img {
    width: 92px;
  }

  .brand-lockup {
    gap: 14px;
  }

  .product-title {
    padding-left: 13px;
  }

  .product-title > span {
    display: none;
  }

  .product-title h1 {
    font-size: 16px;
  }

  .header-label {
    min-height: 28px;
    padding: 0 10px;
    font-size: 7px;
  }

  .header-dot {
    width: 6px;
    height: 6px;
  }

  .demo-page {
    padding-top: 10px;
  }

  .workspace {
    padding: 10px;
    border-radius: 19px;
  }

  .workspace-header {
    display: flex;
    gap: 12px;
    padding: 2px 2px 10px;
  }

  .workspace-heading h2 {
    font-size: 18px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 1.45fr) minmax(180px, 0.8fr);
    gap: 10px;
  }

  .viewer-column {
    min-height: 0;
    grid-row: 1;
  }

  .viewer-shell,
  .question-panel {
    height: auto;
    min-height: 0;
  }

  .question-panel {
    border-radius: 15px;
  }

  .question-header {
    min-height: 52px;
    padding: 9px 14px;
  }

  .question-title {
    font-size: 15px;
  }

  .viewer-help {
    display: flex;
    min-height: 26px;
    flex: 0 0 26px;
    justify-content: center;
    gap: 9px;
    padding: 6px 0 0;
    font-size: 7px;
  }

  .viewer-help span:nth-child(2),
  .viewer-help span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 520px) {
  .product-title {
    display: none;
  }

  .header-label {
    letter-spacing: 0.05em;
  }

  .workspace-heading {
    display: none;
  }

  .demo-controls {
    width: 100%;
  }

  .control-field {
    min-width: 0;
    flex: 1;
  }

  .model-select {
    width: 100%;
  }
}

/* ── Tabbed shell (3D models / map / report) ───────────────────────────────── */

.tab-bar {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(22, 68, 81, 0.12);
  border-radius: 12px;
  background: rgba(22, 68, 81, 0.05);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dax-medium);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.tab svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.tab:hover {
  color: var(--dax-deep);
  background: rgba(125, 205, 208, 0.16);
}

.tab[aria-selected="true"] {
  background: var(--dax-deep);
  color: var(--dax-paper);
}

.tab:focus-visible {
  outline: 2px solid var(--dax-blue);
  outline-offset: 2px;
}

/* The shell is a flex height chain: .workspace > (pane) > .workspace-grid. The pane has to
   participate in it, otherwise .workspace-grid loses its constrained height and the 3D canvas
   grows to fit its content instead of the viewport. */
.tab-pane {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.tab-pane[hidden] {
  display: none;
}

.tab-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(237, 89, 51, 0.4);
  border-radius: 10px;
  background: rgba(237, 89, 51, 0.08);
  color: var(--dax-orange);
  font-size: 12px;
}

/* ── Map tab ───────────────────────────────────────────────────────────────── */

.map-shell {
  padding: 0;
  overflow: hidden;
}

.map-canvas {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.map-loading-note {
  margin: 0;
  padding: 12px 7px;
  color: var(--panel-muted);
  font-size: 11px;
}

.map-legend {
  padding: 12px 7px 16px;
  border-bottom: 1px solid rgba(125, 205, 208, 0.14);
}

.map-legend-title {
  margin-bottom: 8px;
  color: var(--dax-cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.map-ramp {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ed5933 0%, #e1e355 60%, #7dcdd0 100%);
}

.map-ramp-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--panel-muted);
  font-size: 9px;
}

.map-legend-note {
  margin: 10px 0 0;
  color: var(--panel-muted);
  font-size: 10px;
  line-height: 1.5;
}

.map-layer-list {
  padding: 14px 7px;
}

.map-layer-list.is-context {
  padding-top: 0;
  border-top: 1px solid rgba(125, 205, 208, 0.14);
  margin-top: 4px;
  padding-top: 10px;
}

.map-layer-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
}

.map-layer-row:hover {
  background: rgba(125, 205, 208, 0.1);
}

.map-layer-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--dax-cyan);
  cursor: pointer;
}

.map-swatch {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--dax-gray);
}

.map-swatch.is-ramp {
  background: linear-gradient(90deg, #ed5933, #e1e355, #7dcdd0);
}

.map-swatch.is-split {
  background: linear-gradient(90deg, #7dcdd0 50%, #ed5933 50%);
}

.map-layer-name {
  flex: 1 1 auto;
  color: var(--white);
}

.map-layer-count {
  color: var(--panel-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* MapLibre popup, restyled to match the 3D tab's dialog. */
.maplibregl-popup-content {
  padding: 0;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 18px 44px rgba(22, 68, 81, 0.22);
  overflow: hidden;
}

.map-popup {
  min-width: 220px;
  padding: 14px 16px 12px;
}

.map-popup-kicker {
  display: block;
  margin-bottom: 9px;
  color: var(--dax-blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.map-popup-list {
  display: grid;
  margin: 0;
  gap: 0;
}

.map-popup-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(22, 68, 81, 0.08);
}

.map-popup-row:last-child {
  border-bottom: 0;
}

.map-popup-row dt {
  color: var(--dax-medium);
  font-size: 11px;
}

.map-popup-row dd {
  margin: 0;
  color: var(--dax-charcoal);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

/* ── Report tab ────────────────────────────────────────────────────────────── */

.report-layout {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  justify-content: center;
  overflow-y: auto;
}

.report-viewer {
  width: 100%;
  max-width: 1000px;
  padding: 18px;
  border: 1px solid rgba(22, 68, 81, 0.18);
  border-radius: 18px;
  background: rgba(22, 68, 81, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(22, 68, 81, 0.12);
}

.report-count {
  color: var(--dax-medium);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.report-pages {
  display: grid;
  gap: 18px;
}

.report-page {
  width: 100%;
  height: auto;
  border: 1px solid rgba(22, 68, 81, 0.22);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 6px 20px rgba(22, 68, 81, 0.16);
}

.report-placeholder {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 64px 24px;
  border: 1px dashed rgba(22, 68, 81, 0.25);
  border-radius: 14px;
  background: rgba(22, 68, 81, 0.04);
  text-align: center;
}

.report-placeholder-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 10px;
  background: var(--dax-deep);
  color: var(--dax-paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.report-placeholder p {
  margin: 0;
  color: var(--dax-medium);
  font-size: 13px;
}

.report-placeholder-hint {
  font-size: 11px !important;
  opacity: 0.8;
}

@media (max-width: 900px) {
  .tab-bar {
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 9px 8px;
  }

  .tab span {
    font-size: 11px;
  }
}
