/* Full-canvas explorer, compact building breadcrumb, and an overlay drawer. */
:root {
  --header-height: 90px;
  --drawer-width: 356px;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: clip;
}

body { position: fixed; inset: 0; }

.app-header {
  position: absolute;
  inset: 0 0 auto;
  height: var(--header-height);
  padding: 0 30px;
  gap: 24px;
  z-index: 20;
  background: #fbfcf9f5;
}

.header-leading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { flex-shrink: 0; }
.brand-title { font-size: 18px; }
.brand-subtitle { font-size: 7px; letter-spacing: 1.65px; }

.building-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 25px;
  border-left: 1px solid #dce4dd;
  color: #8c9990;
  white-space: nowrap;
  font-size: 11px;
  min-width: 0;
}

.building-breadcrumb button { padding: 6px 0; color: #73877a; font-size: inherit; }
.building-breadcrumb button:hover { color: var(--teal); }
.building-breadcrumb .icon { width: 10px; height: 10px; opacity: .55; }
#breadcrumb-current { color: #233d35; font-weight: 550; }

.building-totals {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-shrink: 0;
}

.header-metric { min-width: 91px; }
.header-metric + .header-metric { border-left: 1px solid #e0e6de; padding-left: 25px; }
.header-metric-label { display: block; color: #8a998b; font-size: 9px; letter-spacing: .4px; margin-bottom: 7px; }
.header-metric > div { display: flex; align-items: baseline; gap: 5px; line-height: 1; white-space: nowrap; }
.header-metric strong { font-size: 21px; font-weight: 500; letter-spacing: -.55px; font-variant-numeric: tabular-nums; }
.header-metric-unit { color: #8c9b8d; font-size: 10px; }
.header-metric-area strong { color: #233e35; }
.header-metric-height strong { color: #577565; }

.workspace {
  position: absolute;
  inset: var(--header-height) 0 0;
  height: auto;
  min-height: 0;
  display: flex;
  overflow: clip;
}

.viewport { width: 100%; height: 100%; min-height: 0; max-height: none; flex: 1; overflow: clip; }
.viewport-heading { top: 28px; left: 30px; }
.viewport-heading h1 { font-size: 16px; }
.extraction-hint { font-size: 9px; color: #95a392; letter-spacing: .4px; margin: 9px 0 0; }
.viewport-topbar { top: 27px; right: 30px; left: auto; }

.drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #1c352711;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s ease, visibility .4s;
}

.inspector {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--drawer-width);
  min-width: 0;
  height: 100%;
  min-height: 0;
  z-index: 11;
  border-top: 0;
  border-left: 1px solid #d8e1d5;
  background: #fbfcf9;
  box-shadow: -18px 0 60px #233e2712;
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .52s cubic-bezier(.22,.8,.22,1), visibility .52s;
  overflow: clip;
}

.drawer-chrome {
  min-height: 76px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid #e1e7dd;
}

.drawer-chrome > div { display: flex; flex-direction: column; gap: 6px; }
.drawer-chrome .eyebrow { font-size: 7px; letter-spacing: 1.5px; color: #9aa795; }
.drawer-chrome-title { font-size: 12px; letter-spacing: .6px; font-weight: 550; color: #5a7161; }
.drawer-chrome .icon-button { width: 30px; height: 30px; background: #f2f6ed; }

.inspector-scroll {
  display: block;
  padding: 24px 25px 20px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.inspector .selection-heading { justify-content: space-between; }
.inspector .selection-heading h2 { font-size: 26px; }
.inspector .area-section { margin-top: 22px; padding-top: 20px; padding-bottom: 18px; }
.inspector .area-metric strong { font-size: 42px; }
.inspector .comparison-section { margin: 0; border: 0; padding-top: 23px; }
.inspector .comparison-card { display: flex; gap: 16px; padding: 13px 11px; min-height: 94px; }
.inspector .court-diagram, .inspector .human-diagram { flex: 0 0 99px; margin: 0; }
.inspector .court-diagram { width: auto; }
.inspector .court-diagram svg { width: 91px; }
.inspector .court-length { left: 30px; }
.inspector .court-width { right: -4px; top: 34px; }
.inspector .human-diagram { height: 76px; width: auto; }
.inspector .human-diagram svg { height: 69px; }
.inspector .human-measure { right: 12px; top: 7px; }
.inspector .human-diagram:after { left: 19px; right: 16px; }
.inspector .comparison-copy h4 { font-size: 12px; margin: 2px 0 5px; }
.inspector .comparison-copy p { font-size: 9px; }
.inspector .comparison-copy p > strong { font-size: 14px; }
.inspector .comparison-copy .comparison-caption { font-size: 8px; }
.inspector .human-card { margin-top: 3px; min-height: 104px; }
.inspector .human-card .comparison-copy p > strong { font-size: 11px; }
.inspector .toggle-row { font-size: 9px; min-height: 34px; gap: 10px; }
.inspector .section-label > span { display: block; font-size: 7px; }
.inspector .section-label h3 { font-size: 11px; }
.inspector .floor-section { margin-top: 15px; padding-top: 22px; }
.inspector .floor-list button { font-size: 10px; padding: 9px 11px; }
.inspector .floor-row > span:last-child { font-size: 9px; }
.inspector .dimension-grid > div + div { padding-left: 20px; }
.inspector .dimension-grid span { font-size: 9px; }
.inspector .dimension-grid strong { font-size: 15px; }
.inspector .inspector-footer { padding: 0 25px; }
.inspector .evidence-button { justify-content: space-between; }

.drawer-toggle {
  position: absolute;
  z-index: 7;
  right: 0;
  bottom: 55px;
  width: 42px;
  height: 118px;
  border: 1px solid #cad8cb;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #fbfcf8ed;
  color: #4a6b59;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: -3px 3px 18px #253e3010;
  backdrop-filter: blur(12px);
  transition: transform .3s ease, opacity .2s ease, background .2s;
}

.drawer-toggle:hover { background: #fff; transform: translateX(-3px); }
.drawer-toggle > .icon { width: 14px; height: 14px; transform: rotate(180deg); }
.drawer-toggle > span:not(.drawer-handle-mark) { font-size: 10px; writing-mode: vertical-rl; letter-spacing: 3px; line-height: 1; }
.drawer-handle-mark { height: 3px; width: 13px; border-top: 1px solid #a8bba9; border-bottom: 1px solid #a8bba9; }

body.drawer-open .inspector { transform: translateX(0); visibility: visible; }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
body.drawer-open .drawer-toggle { opacity: 0; pointer-events: none; transform: translateX(100%); }

@media (min-width: 1650px) {
  :root { --drawer-width: 374px; }
  .app-header { padding: 0 40px; }
  .header-leading { gap: 38px; }
  .building-breadcrumb { padding-left: 35px; }
  .building-totals { gap: 35px; }
  .header-metric + .header-metric { padding-left: 35px; }
  .header-metric strong { font-size: 23px; }
  .viewport-heading { left: 40px; top: 34px; }
  .viewport-topbar { top: 32px; right: 40px; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .app-header { padding: 0 22px; gap: 16px; }
  .header-leading { gap: 18px; }
  .brand-title { font-size: 16px; }
  .brand-subtitle { font-size: 6px; letter-spacing: 1.25px; }
  .building-breadcrumb { padding-left: 17px; gap: 6px; font-size: 10px; }
  .building-totals { gap: 16px; }
  .header-metric { min-width: 72px; }
  .header-metric + .header-metric { padding-left: 16px; }
  .header-metric strong { font-size: 18px; }
  .header-metric-label { font-size: 8px; }
  .viewport-heading { left: 24px; }
  .viewport-topbar { right: 24px; }
}

@media (max-width: 900px) {
  :root { --header-height: 112px; --drawer-width: 350px; }
  .app-header { display: flex; flex-wrap: wrap; align-content: center; gap: 11px; padding: 12px 22px; }
  .header-leading { width: 100%; justify-content: space-between; gap: 20px; }
  .brand-title { font-size: 16px; }
  .brand-subtitle { font-size: 6px; letter-spacing: 1.3px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 8px; }
  .brand-mark svg { width: 25px; height: 25px; }
  .brand { gap: 9px; }
  .building-breadcrumb { padding-left: 0; border-left: 0; font-size: 10px; gap: 7px; }
  .building-totals { display: grid; grid-template-columns: 1.25fr 1fr .8fr; width: 100%; gap: 0; padding-top: 10px; border-top: 1px solid #e2e8df; }
  .header-metric { min-width: 0; }
  .header-metric + .header-metric { padding-left: 20px; }
  .header-metric-label { font-size: 8px; margin-bottom: 4px; }
  .header-metric strong { font-size: 18px; }
  .header-metric-unit { font-size: 9px; }
  .viewport-heading { top: 80px; left: 22px; }
  .viewport-heading h1 { font-size: 13px; }
  .viewport-topbar { left: 22px; right: 22px; top: 20px; justify-content: space-between; }
  .section-number { display: none; }
  .viewport-heading .eyebrow { font-size: 6px; }
  .extraction-hint { margin-top: 7px; font-size: 8px; }
}

@media (max-width: 600px) {
  :root { --header-height: 118px; --drawer-width: min(350px, calc(100vw - 28px)); }
  .app-header { padding: 11px 17px; gap: 10px; }
  .brand-title { font-size: 15px; }
  .brand-subtitle { font-size: 5.6px; letter-spacing: .95px; }
  .brand-divider { margin: 0 2px; }
  .building-breadcrumb { font-size: 9px; gap: 5px; }
  .building-breadcrumb .icon { width: 8px; height: 8px; }
  .header-leading { gap: 9px; }
  .building-totals { padding-top: 9px; }
  .header-metric + .header-metric { padding-left: 14px; }
  .header-metric strong { font-size: 17px; letter-spacing: -.5px; }
  .header-metric > div { gap: 4px; }
  .header-metric-label { font-size: 7px; letter-spacing: .2px; }
  .header-metric-unit { font-size: 8px; }
  .viewport-topbar { left: 17px; right: 17px; top: 17px; }
  .viewport-heading { left: 20px; top: 75px; }
  .viewport-heading h1 { font-size: 11px; }
  .viewport-heading .eyebrow { font-size: 5.8px; }
  .extraction-hint { font-size: 7px; margin-top: 6px; }
  .slice-control { width: 260px; bottom: 68px; left: 50%; }
  .navigation-hint { left: 50%; bottom: 39px; font-size: 7px; gap: 5px; }
  .drawer-toggle { width: 35px; height: 110px; bottom: 53px; border-radius: 8px 0 0 8px; }
  .drawer-toggle > span:not(.drawer-handle-mark) { font-size: 9px; }
  .drawer-chrome { min-height: 68px; padding: 15px 22px; }
  .inspector-scroll { padding: 22px 22px 18px; }
  .inspector .area-metric strong { font-size: 40px; }
  .inspector .comparison-card { gap: 12px; padding: 12px 9px; }
  .inspector .court-diagram, .inspector .human-diagram { flex-basis: 91px; }
  .inspector .court-diagram svg { width: 85px; }
  .inspector .comparison-copy .comparison-caption { font-size: 7px; }
  .inspector .inspector-footer { padding: 0 22px; }
  .viewport-status { padding-right: 17px; padding-left: 17px; font-size: 6px; letter-spacing: .2px; }
  .viewport-status > span:first-child { max-width: calc(100% - 70px); }
  #view-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 370px) {
  .app-header { padding-left: 13px; padding-right: 13px; }
  .brand-title { font-size: 14px; }
  .brand-subtitle { font-size: 5px; }
  .building-breadcrumb button { max-width: 45px; overflow: hidden; text-overflow: ellipsis; }
  .header-metric strong { font-size: 16px; }
  .header-metric + .header-metric { padding-left: 10px; }
}

@media (max-height: 720px) and (min-width: 601px) {
  .floor-label:not(.is-active) { height: 24px; padding: 3px 10px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .inspector, .drawer-backdrop, .drawer-toggle { transition: none; }
}
