@font-face {
  font-family: "Inter Levels";
  src: url("./assets/Inter-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "Inter Levels";
  src: url("./assets/Inter-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Inter Levels";
  src: url("./assets/Inter-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
}

:root {
  --black: #000000;
  --cement: #f4f3e9;
  --white: #ffffff;
  --teal: #62bcba;
  --green: #4fbf75;
  --yellow: #f8d332;
  --pink: #e86275;
  --orange: #e77b37;
  --bg: var(--cement);
  --panel: var(--white);
  --panel-soft: #fbfaf5;
  --ink: var(--black);
  --muted-strong: rgba(0, 0, 0, 0.74);
  --muted: rgba(0, 0, 0, 0.62);
  --line-strong: rgba(0, 0, 0, 0.2);
  --line: rgba(0, 0, 0, 0.14);
  --shadow-strong: 0 16px 34px rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 1060px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter Levels", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

img {
  display: block;
  max-width: 100%;
}

.app-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 28px 18px;
  background: var(--white);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-logo {
  width: 176px;
  max-width: 22vw;
  min-width: 132px;
  background: transparent;
  border-radius: 0;
}

.header-copy {
  display: grid;
  gap: 4px;
  width: 100%;
}

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

h1, h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 27px;
  line-height: 1.15;
  font-weight: 400;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 500;
}

.source-note {
  max-width: none;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.app-shell {
  padding: 20px 28px 28px;
}

.sticky-controls {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 70;
  width: min(440px, calc(100vw - 48px));
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--black);
  background: var(--white);
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  transition: transform 180ms ease, visibility 180ms ease;
}

.controls-drawer-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--black);
  color: var(--white);
}

.controls-drawer-head span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.controls-drawer-head h2 {
  color: var(--white);
  font-size: 17px;
  font-weight: 500;
}

#closeControls {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--white);
  background: transparent;
  font-size: 22px;
  line-height: 1;
}

#closeControls:hover {
  border-color: var(--orange);
  color: var(--black);
  background: var(--orange);
}

.controls-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.12);
  cursor: default;
}

.nav-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(104px, 1fr));
  height: 32px;
  border: 1px solid var(--black);
  border-radius: 5px;
  overflow: hidden;
}

.view-tab {
  height: 30px;
  border: 0;
  border-right: 1px solid var(--black);
  border-radius: 0;
  background: var(--white);
}

.view-tab:last-child {
  border-right: 0;
}

.view-tab.active {
  background: var(--black);
  color: var(--white);
}

.view-tab.active:hover {
  background: var(--black);
  color: var(--white);
}

#toggleControls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 92px;
  height: 32px;
  padding: 0 12px;
  border-color: var(--black);
  border-radius: 5px;
  background: var(--black);
  color: var(--white);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.14);
}

#toggleControls .filter-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#toggleControls:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--black);
}

body:not(.controls-collapsed) #toggleControls {
  display: none;
}

.sticky-controls.is-collapsed {
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-100%);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: end;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.control-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 14px 12px;
  margin: 0;
  padding: 16px 18px 22px;
}

.nav-legends {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  margin: 2px 0 0;
}

.nav-legend-group {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.nav-legend-group > span {
  flex: 0 0 auto;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.nav-legend-group > .shared-legend-label {
  color: var(--black);
  font-weight: 300;
  text-decoration: underline;
  text-transform: none;
}

.unit-type-control {
  width: 260px;
}

.metro-group-control {
  width: 300px;
}

.market-layer-control {
  width: 170px;
}

.competitor-mode-control {
  width: 260px;
}

.competitor-filter-control {
  width: 250px;
}

.top-x-control {
  width: 330px;
}

.cam-fee-control,
.self-managed-control {
  width: 170px;
}

.sticky-controls .geography-control,
.sticky-controls .range-control,
.sticky-controls .confidence-control,
.sticky-controls .unit-type-control,
.sticky-controls .metro-group-control,
.sticky-controls .competitor-mode-control,
.sticky-controls .competitor-filter-control,
.sticky-controls .top-x-control,
.sticky-controls #resetFilters,
.sticky-controls .nav-legends {
  grid-column: 1 / -1;
}

.sticky-controls .nonmetro-control {
  order: 1;
}

.sticky-controls .market-layer-control {
  order: 2;
}

.sticky-controls .unit-type-control {
  order: 3;
}

.sticky-controls .metro-group-control {
  order: 4;
}

.sticky-controls .competitor-mode-control {
  order: 5;
}

.sticky-controls .competitor-filter-control {
  order: 6;
}

.sticky-controls .top-x-control {
  order: 7;
}

.sticky-controls .cam-fee-control {
  order: 8;
}

.sticky-controls .self-managed-control {
  order: 9;
}

.sticky-controls #resetFilters {
  order: 10;
}

.sticky-controls .nav-legends {
  order: 11;
}

.sticky-controls .unit-type-control,
.sticky-controls .metro-group-control,
.sticky-controls .market-layer-control,
.sticky-controls .competitor-mode-control,
.sticky-controls .competitor-filter-control,
.sticky-controls .top-x-control,
.sticky-controls .cam-fee-control,
.sticky-controls .self-managed-control {
  width: auto;
}

.percent-input {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.percent-input input {
  width: 100%;
  height: 26px;
  border: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
}

.percent-input input:focus {
  outline: 0;
}

.top-x-inputs {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 8px;
}

.top-x-inputs input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 8px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

select,
input[type="search"],
.multi-trigger {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  padding: 0 10px;
  font-family: inherit;
}

.multi-select {
  position: relative;
}

.multi-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.multi-trigger::after {
  content: "▾";
  color: var(--muted);
  font-size: 11px;
}

.toggle-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: var(--panel-soft);
}

.multi-trigger::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-left: 12px;
  border-right: 1.5px solid var(--muted-strong);
  border-bottom: 1.5px solid var(--muted-strong);
  opacity: 0.8;
  transform: rotate(45deg) translateY(-2px);
}

.unit-toggle-group {
  height: 32px;
}

.group-toggle-group {
  grid-template-columns: repeat(2, 1fr);
  height: 32px;
}

.geography-toggle-group {
  grid-template-columns: repeat(4, 1fr);
}

.nonmetro-toggle-group {
  grid-template-columns: repeat(2, 1fr);
  height: 32px;
}

.market-layer-toggle-group {
  grid-template-columns: repeat(2, 1fr);
  height: 32px;
}

.competitor-mode-group {
  grid-template-columns: 0.7fr 0.8fr 1.45fr;
  height: 32px;
}

.toggle-button {
  height: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-soft);
  color: var(--muted);
}

.toggle-button:last-child {
  border-right: 0;
}

.toggle-button.active {
  background: var(--black);
  color: var(--white);
}

.toggle-button:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--black);
}

.toggle-button.active:hover {
  background: rgba(0, 0, 0, 0.88);
  color: var(--white);
}

#confidenceFilter {
  overflow: visible;
}

#assessmentConfidenceFilter {
  overflow: visible;
}

.toggle-button[data-tooltip] {
  position: relative;
}

.toggle-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: 220px;
  padding: 8px 10px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.toggle-button[data-tooltip]:hover::after {
  display: block;
}

.rank-button-active {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.rank-button-active:hover {
  background: rgba(0, 0, 0, 0.88);
  color: var(--white);
}

.multi-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  width: min(340px, 92vw);
  max-height: 320px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: var(--shadow-strong);
}

.multi-menu input[type="search"] {
  margin-bottom: 8px;
}

.checklist {
  display: grid;
  gap: 2px;
  max-height: 258px;
  overflow: auto;
}

.multi-menu-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.clear-select,
.select-all {
  width: 100%;
}

.check-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 6px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
}

.check-option:hover {
  background: rgba(98, 188, 186, 0.14);
}

.check-option.disabled {
  color: var(--muted);
  opacity: 0.5;
}

.check-option.disabled:hover {
  background: transparent;
}

.check-option input {
  flex: 0 0 auto;
}

.option-swatch {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
}

.dual-range {
  position: relative;
  height: 32px;
}

.range-track {
  position: absolute;
  top: 13px;
  left: 9px;
  right: 9px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.14) 0%, var(--black) 0%, var(--black) 100%, rgba(0, 0, 0, 0.14) 100%);
}

.dual-range input[type="range"] {
  position: absolute;
  top: 4px;
  left: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  background: none;
  pointer-events: none;
  appearance: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--black);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  pointer-events: auto;
}

.dual-range input[type="range"]::-moz-range-track {
  background: transparent;
}

.range-control output {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.map-panel,
.detail-panel,
.viz-panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.map-panel,
.detail-panel {
  width: 100%;
  min-width: 0;
}

.map-panel {
  display: flex;
  flex-direction: column;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(430px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.main-grid.map-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.panel-title span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 500;
}

.panel-title h2[data-tooltip],
.assessment-surface-head h2[data-tooltip] {
  position: relative;
  cursor: help;
}

.panel-title h2[data-tooltip]::after,
.assessment-surface-head h2[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 35;
  display: none;
  width: min(340px, 70vw);
  padding: 9px 11px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  box-shadow: var(--shadow);
}

.panel-title h2[data-tooltip]:hover::after,
.assessment-surface-head h2[data-tooltip]:hover::after {
  display: block;
}

.mini-legend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.mini-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 400;
}

.mini-legend .mini-metric {
  color: var(--black);
  font-weight: 500;
}

.mini-swatch {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}

.mini-swatch.observed {
  background: var(--teal);
}

.mini-swatch.modeled {
  background: var(--yellow);
}

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

#mapWidthToggle {
  width: auto;
  min-width: 74px;
  padding: 0 10px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zoom-controls button {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

#resetFilters {
  width: auto;
  min-width: 68px;
  align-self: center;
  padding: 0 12px;
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

#resetFilters:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--black);
}

#resetFilters:disabled,
#resetFilters:disabled:hover {
  border-color: var(--line);
  background: var(--white);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
}

#zoomValue {
  min-width: 44px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.map-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 560px;
  height: auto;
  padding: 10px 14px 14px;
}

@media (min-width: 1181px) {
  .main-grid.map-expanded .map-wrap {
    height: clamp(620px, 48vw, 860px);
  }
}

#metroMap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  display: block;
  background: #f8f7f1;
  border-radius: 6px;
  cursor: grab;
}

#metroMap.dragging {
  cursor: grabbing;
}

.map-grid {
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 1;
}

.us-state {
  fill: rgba(255, 255, 255, 0.84);
  stroke: rgba(0, 0, 0, 0.24);
  stroke-width: 0.85;
  vector-effect: non-scaling-stroke;
}

.us-state.inset {
  fill: rgba(255, 255, 255, 0.88);
  stroke-width: 0.75;
}

.transparent-basemap {
  pointer-events: none;
}

.multi-menu-note {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.map-label {
  fill: rgba(0, 0, 0, 0.58);
  font-size: 12px;
  font-weight: 500;
}

.state-label {
  fill: rgba(0, 0, 0, 0.62);
  font-size: 10px;
  font-weight: 500;
  pointer-events: none;
  text-anchor: middle;
}

.metro-dot {
  cursor: default;
  stroke: var(--white);
  stroke-width: 1.2;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.metro-dot:hover,
.metro-dot.selected {
  stroke: var(--black);
  stroke-width: 2;
}

.choropleth-shape {
  cursor: default;
}

.choropleth-shape:hover {
  filter: brightness(0.9);
}

.division-group {
  cursor: default;
  filter:
    drop-shadow(0 0 0.45px rgba(0, 0, 0, 0.96))
    drop-shadow(0 0 1px rgba(0, 0, 0, 0.72));
  transition: filter 100ms ease, opacity 100ms ease;
}

.division-state {
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
  transition: filter 100ms ease;
}

.division-layer.has-active-division .division-group:not(.is-active) {
  opacity: 0.34;
}

.division-group.is-active {
  filter:
    drop-shadow(0 0 0.7px rgba(0, 0, 0, 1))
    drop-shadow(0 0 1.9px rgba(0, 0, 0, 0.92));
}

.division-group.is-active .division-state {
  filter: brightness(0.86) saturate(1.08);
}

.division-unassigned {
  opacity: 0.52;
}

.puma-shape {
  cursor: help;
  stroke: rgba(0, 0, 0, 0.22);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.puma-shape:hover {
  stroke: var(--black);
  stroke-width: 1.15;
}

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

.competitor-pin {
  cursor: help;
  pointer-events: auto;
}

.competitor-pin-shape {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.competitor-pin:hover .competitor-pin-shape {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28)) brightness(0.84);
}

.competitor-pin-label {
  font-size: 8px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.competitor-map-legend {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 16px;
  min-height: 34px;
  margin-top: 8px;
  padding: 8px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--black);
  font-size: 11px;
}

.competitor-legend-title {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.competitor-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.competitor-legend-item i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  background: var(--competitor-color);
}


.tooltip {
  position: absolute;
  z-index: 5;
  max-width: 320px;
  padding: 10px 12px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.92);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

.instant-tooltip {
  position: fixed;
  z-index: 20;
}

.detail-panel {
  min-height: 0;
}

.detail-content {
  padding: 16px;
}

.detail-name {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.detail-name span {
  font-weight: 400;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.detail-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.detail-metric {
  position: relative;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--black);
  background: var(--cement);
  cursor: help;
}

.detail-metric.metric-revenue {
  border-color: var(--black);
  color: var(--white);
  background: var(--black);
}

.detail-metric.metric-units {
  border-color: rgba(98, 188, 186, 0.58);
  background: var(--teal);
}

.detail-metric.metric-fee {
  border-color: rgba(248, 211, 50, 0.65);
  background: var(--yellow);
}

.detail-metric.metric-context {
  border-color: var(--line);
  background: var(--cement);
}

.detail-metric.metric-property {
  border-color: var(--metric-border);
  background: var(--metric-bg);
}

.detail-metric.metric-revenue span,
.detail-metric.metric-revenue strong {
  color: var(--white);
}

.detail-metric[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 8px);
  z-index: 10;
  display: none;
  padding: 8px 10px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-transform: none;
  box-shadow: var(--shadow);
}

.detail-metric[data-tooltip]:hover::after {
  display: block;
}

.detail-metric span {
  display: block;
  color: var(--black);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.detail-metric strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  color: var(--black);
}

.caveat-box {
  margin-top: 14px;
  padding: 12px;
  border-left: 4px solid var(--black);
  background: rgba(244, 243, 233, 0.9);
  color: var(--black);
  font-size: 12px;
  line-height: 1.4;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.main-grid:not(.map-expanded) .detail-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-kpi {
  position: relative;
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--black);
  background: var(--cement);
  cursor: help;
}

.detail-kpi.is-primary {
  color: var(--white);
  background: var(--black);
  border-color: var(--black);
}

.detail-kpi span,
.detail-context-metric span {
  display: block;
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.detail-kpi strong {
  display: block;
  margin-top: 7px;
  color: inherit;
  font-size: 18px;
  font-weight: 500;
}

.detail-analysis {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.main-grid:not(.map-expanded) .detail-analysis {
  grid-template-columns: minmax(0, 1fr);
}

.estimate-bridge,
.detail-context,
.detail-property,
.detail-assessment,
.detail-property-mix {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.estimate-bridge,
.detail-context,
.detail-assessment,
.detail-property-mix {
  padding: 12px;
}

.detail-content > .estimate-bridge,
.detail-content > .detail-context,
.detail-assessment,
.detail-property-mix {
  margin-top: 12px;
}

.detail-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-subhead h3 {
  margin: 0;
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
}

.detail-subhead span {
  color: var(--muted);
  font-size: 12px;
}

.detail-subhead h3[data-tooltip] {
  position: relative;
  cursor: help;
}

.detail-subhead h3[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 35;
  display: none;
  width: min(360px, 70vw);
  padding: 8px 10px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: none;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.detail-subhead h3[data-tooltip]:hover::after {
  display: block;
}

.detail-chart-key {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: -2px 0 4px;
  color: var(--muted-strong);
  font-size: 10px;
}

.detail-chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-chart-key i {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 10px;
}

.detail-chart-key i.range::before,
.detail-chart-key i.median::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 16px;
  border-top: 3px solid var(--teal);
}

.detail-chart-key i.median::before {
  top: 0;
  left: 7px;
  width: 0;
  height: 10px;
  border-top: 0;
  border-left: 2px solid var(--black);
}

.detail-chart-key i.average::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--black);
}

#detailAssessmentChart {
  display: block;
  width: 100%;
  min-width: 0;
}

.detail-assessment-grid {
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 1;
}

.detail-assessment-axis,
.detail-assessment-label {
  fill: var(--muted-strong);
  font-size: 10px;
  font-weight: 400;
}

.detail-assessment-label {
  fill: var(--black);
  font-size: 11px;
}

.detail-assessment-range {
  stroke-width: 5;
  stroke-linecap: round;
}

.detail-assessment-median {
  stroke: var(--black);
  stroke-width: 2;
}

.detail-assessment-average {
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 1.5;
}

.detail-assessment-hit {
  fill: transparent;
  cursor: help;
}

.detail-mix-bar {
  position: relative;
  display: flex;
  min-height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cement);
}

.detail-mix-segment {
  display: grid;
  min-width: 0;
  place-items: center;
  color: var(--black);
  background: var(--property-color);
  font-size: 10px;
  font-weight: 500;
  cursor: help;
}

.detail-mix-empty {
  display: grid;
  width: 100%;
  min-height: 28px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.detail-mix-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 10px;
}

.detail-mix-key {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--black);
  font-size: 10px;
  cursor: help;
}

.detail-mix-key i {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--property-color);
}

.detail-mix-key span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-mix-key strong {
  font-weight: 500;
}

.detail-mix-key.is-empty {
  opacity: 0.38;
}

.estimate-bar {
  display: flex;
  height: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cement);
}

.estimate-bar span {
  display: block;
  min-width: 0;
}

.estimate-observed {
  background: var(--teal);
}

.estimate-renter {
  background: var(--yellow);
}

.estimate-vacant {
  background: var(--orange);
}

.estimate-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.estimate-key {
  position: relative;
  min-width: 0;
  padding-left: 8px;
  border-left: 4px solid var(--line);
  cursor: help;
}

.estimate-key.observed {
  border-color: var(--teal);
}

.estimate-key.renter {
  border-color: var(--yellow);
}

.estimate-key.vacant {
  border-color: var(--orange);
}

.estimate-key strong,
.estimate-key span {
  display: block;
}

.estimate-key strong {
  color: var(--black);
  font-size: 15px;
  font-weight: 500;
}

.estimate-key span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.detail-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.detail-context-metric {
  position: relative;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  cursor: help;
}

.detail-context-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--black);
  font-size: 15px;
  font-weight: 500;
}

.detail-property {
  margin-top: 12px;
}

.detail-property > .detail-subhead {
  min-height: 42px;
  margin: 0;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.detail-table-wrap {
  overflow-x: auto;
}

.detail-economics {
  width: 100%;
  min-width: 980px;
}

.detail-economics th,
.detail-economics td {
  padding: 8px 10px;
  text-align: right;
}

.detail-economics th:first-child,
.detail-economics td:first-child {
  text-align: left;
}

.detail-economics th:nth-child(2),
.detail-economics td:nth-child(2) {
  text-align: right;
}

.detail-economics th:first-child::after {
  left: 0;
  transform: none;
}

.detail-economics th:last-child::after {
  right: 0;
  left: auto;
  transform: none;
}

.detail-economics .detail-total-row {
  color: var(--black);
  background: var(--cement);
  font-weight: 500;
}

.detail-economics tr.is-empty {
  opacity: 0.42;
}

.property-row-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.property-row-label i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--property-color);
}

.detail-kpi[data-tooltip]::after,
.estimate-key[data-tooltip]::after,
.detail-context-metric[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 10px;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(260px, 70vw);
  padding: 8px 10px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-transform: none;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.detail-kpi[data-tooltip]:hover::after,
.estimate-key[data-tooltip]:hover::after,
.detail-context-metric[data-tooltip]:hover::after {
  display: block;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.viz-panel {
  min-width: 0;
}

.viz-panel .panel-title {
  height: 44px;
  min-height: 44px;
  padding: 8px 12px;
}

.chart-title-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 300;
  line-height: 1;
  white-space: nowrap;
}

.nav-legend-group .chart-legend {
  flex: 1 1 auto;
  justify-content: flex-start;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.legend-dot {
  border-radius: 50%;
}

.viz-panel svg {
  width: 100%;
  height: 360px;
  display: block;
}

.chart-scroll {
  height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
}

.chart-scroll svg {
  width: 100%;
  height: auto;
  min-height: 360px;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.bar-label,
.mix-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 400;
}

.mix-label {
  paint-order: stroke fill;
  stroke: var(--white);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.value-label {
  fill: var(--muted);
  font-size: 11px;
}

.mix-segment {
  cursor: help;
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 1;
}

.mix-segment-label {
  fill: var(--black);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linejoin: round;
  stroke-width: 2px;
}

.muted-segment-label {
  fill: var(--black);
  stroke: rgba(255, 255, 255, 0.92);
  opacity: 0.62;
}

.muted-row {
  fill: rgba(0, 0, 0, 0.42);
}

.muted-bar {
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 1;
}

.fee-guide {
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 2;
}

.fee-dot {
  stroke: var(--white);
  stroke-width: 1.5;
  cursor: help;
}

.average-fee-dot {
  stroke-width: 2;
}

.table-panel {
  overflow: hidden;
}

.property-economics-panel {
  margin-bottom: 16px;
}

.property-economics-content {
  min-width: 0;
}

.property-economics-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.assumptions-view {
  display: grid;
  gap: 16px;
}

.assumptions-view[hidden] {
  display: none;
}

.assumptions-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-strong);
}

.assumptions-head h2 {
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: 400;
}

.assumptions-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.assumptions-head .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}

.assumptions-status {
  flex: 0 0 360px;
  padding: 10px 12px;
  border-left: 4px solid var(--green);
  background: rgba(79, 191, 117, 0.14);
  line-height: 1.35;
}

.assumptions-toolbar {
  display: grid;
  grid-template-columns: 230px minmax(260px, 1fr) 150px 190px 90px;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.assumption-status-toggle {
  grid-template-columns: repeat(2, 1fr);
}

.assumption-count {
  display: grid;
  align-content: center;
  min-height: 38px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}

.assumption-count span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.assumption-count strong {
  font-size: 16px;
  font-weight: 500;
}

.assumptions-method {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.assumptions-method > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
}

.assumptions-method span {
  color: var(--black);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.assumptions-method p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.assumptions-method a,
#assumptionTable a {
  color: var(--black);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.assumptions-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.assumptions-table-section {
  min-width: 0;
}

.assumptions-table-section > .panel-title {
  padding-right: 0;
  padding-left: 0;
  background: transparent;
}

#assumptionTable {
  min-width: 1440px;
}

#assumptionTable th {
  min-width: 96px;
  white-space: normal;
  vertical-align: bottom;
  cursor: pointer;
  user-select: none;
}

#assumptionTable th:first-child,
#assumptionTable td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  background: var(--white);
  text-align: left;
  white-space: normal;
}

#assumptionTable th:first-child {
  z-index: 3;
  background: var(--panel-soft);
}

#assumptionTable th:nth-child(2),
#assumptionTable td:nth-child(2),
#assumptionTable th:nth-child(3),
#assumptionTable td:nth-child(3),
#assumptionTable th:nth-child(4),
#assumptionTable td:nth-child(4) {
  text-align: left;
}

#assumptionTable th:nth-child(3),
#assumptionTable td:nth-child(3) {
  min-width: 170px;
}

#assumptionTable th:nth-child(4),
#assumptionTable td:nth-child(4) {
  min-width: 230px;
  white-space: normal;
}

#assumptionTable tbody tr:hover td:first-child {
  background: #eef8f7;
}

.assumption-rate {
  font-variant-numeric: tabular-nums;
}

.assumption-na {
  color: var(--muted);
}

.assumption-empty {
  padding: 28px 16px;
  color: var(--muted);
  text-align: left;
}

.assessments-view {
  display: grid;
  gap: 16px;
}

.assessments-view[hidden] {
  display: none;
}

.assessments-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-strong);
}

.assessments-head h2 {
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: 400;
}

.assessments-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.assessments-head .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}

.assessments-status {
  flex: 0 0 420px;
  padding: 10px 12px;
  border-left: 4px solid var(--teal);
  background: rgba(98, 188, 186, 0.14);
  line-height: 1.35;
}

.assessments-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1.2fr) minmax(250px, 1fr) 270px 210px auto 80px;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.assessment-geography-toggle {
  grid-template-columns: repeat(2, 1fr);
}

.assessment-reset {
  height: 38px;
  padding: 0 16px;
  border-color: var(--black);
}

.assessment-count {
  display: grid;
  align-content: center;
  min-height: 38px;
  padding: 0 10px;
  border-left: 1px solid var(--line);
}

.assessment-count span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.assessment-count strong {
  font-size: 16px;
  font-weight: 500;
}

.assessments-method {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 32px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.assessments-method > div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
}

.assessments-method span {
  color: var(--black);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.assessments-method p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.assessment-surface {
  min-width: 0;
  padding: 0;
  background: transparent;
}

.assessment-surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line-strong);
}

.assessment-surface-head > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.assessment-surface-head span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 500;
}

.assessment-workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1.35fr) minmax(560px, 1fr);
  align-items: start;
  min-width: 1180px;
  background: var(--white);
}

.assessment-chart-area,
.assessment-metrics-area {
  min-width: 0;
}

.assessment-chart-area {
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.assessment-metrics-area {
  padding-left: 10px;
}

#assessmentChart {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
}

.assessment-panel-bg {
  fill: var(--white);
}

.assessment-row-band {
  fill: rgba(244, 243, 233, 0.48);
}

.assessment-grid-line {
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 1;
}

.assessment-axis-label,
.assessment-geo-label,
.assessment-property-label {
  fill: var(--muted-strong);
  font-size: 11px;
  font-weight: 400;
}

.assessment-property-label {
  fill: var(--black);
  font-size: 12px;
  font-weight: 500;
}

.assessment-range {
  stroke-width: 5;
  stroke-linecap: round;
}

.assessment-median {
  stroke: var(--black);
  stroke-width: 2;
}

.assessment-average {
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 1.5;
}

.assessment-hit {
  fill: transparent;
  cursor: help;
}

.assessment-empty-label {
  fill: var(--muted);
  font-size: 13px;
}

#assessmentTable {
  width: 100%;
  min-width: 550px;
  table-layout: fixed;
}

#assessmentTable th {
  position: static;
  height: 78px;
  padding: 0 5px 14px;
  vertical-align: bottom;
  cursor: pointer;
  user-select: none;
  white-space: normal;
  line-height: 1.15;
}

#assessmentTable th,
#assessmentTable td {
  text-align: right;
}

#assessmentTable th:last-child,
#assessmentTable td:last-child {
  text-align: left;
}

#assessmentTable tbody tr {
  height: 30px;
}

#assessmentTable tbody tr:nth-child(odd) {
  background: rgba(244, 243, 233, 0.48);
}

#assessmentTable td {
  height: 30px;
  padding: 0 5px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

#assessmentTable td:nth-child(-n+6) {
  font-variant-numeric: tabular-nums;
}

#assessmentTable th:nth-child(1),
#assessmentTable th:nth-child(2),
#assessmentTable th:nth-child(3),
#assessmentTable th:nth-child(4) {
  width: 13%;
}

#assessmentTable th:nth-child(5) {
  width: 13%;
}

#assessmentTable th:nth-child(6) {
  width: 18%;
}

#assessmentTable th:nth-child(7) {
  width: 17%;
}

#assessmentTable .confidence-high {
  color: #19733c;
}

#assessmentTable .confidence-medium {
  color: #8a6500;
}

#assessmentTable .confidence-low {
  color: #a62c3d;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.note-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.note-panel h2 {
  margin-bottom: 10px;
}

.note-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 300;
}

.note-panel p:last-child {
  margin-bottom: 0;
}

.note-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 300;
}

.note-panel li {
  margin-bottom: 6px;
}

.note-panel li:last-child {
  margin-bottom: 0;
}

.faq-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.faq-grid {
  column-count: 3;
  column-gap: 14px;
  padding: 16px;
}

.faq-grid details {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  break-inside: avoid;
}

.faq-grid summary {
  position: relative;
  display: block;
  min-height: 22px;
  padding-right: 22px;
  margin: 0;
  color: var(--black);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

.faq-grid summary::-webkit-details-marker {
  display: none;
}

.faq-grid summary::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 0;
  color: var(--black);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.faq-grid details[open] summary {
  margin-bottom: 8px;
}

.faq-grid details[open] summary::after {
  content: "-";
}

.faq-grid p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.45;
}

.faq-grid p:last-child {
  margin-bottom: 0;
}

button {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--black);
  color: var(--black);
}

.icon-button {
  width: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.table-wrap {
  max-height: 460px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: right;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-soft);
  color: rgba(0, 0, 0, 0.68);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 500;
}

th[data-tooltip] {
  cursor: help;
}

th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}

th[data-assessment-sort] {
  cursor: pointer;
  user-select: none;
}

.sort-indicator {
  display: inline-block;
  margin-left: 5px;
  color: var(--black);
  font-size: 10px;
}

th[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: 220px;
  padding: 8px 10px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.94);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  box-shadow: var(--shadow);
  white-space: normal;
  pointer-events: none;
}

th[data-tooltip]:hover::after {
  display: block;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

tbody tr {
  cursor: default;
}

tbody tr:hover {
  background: rgba(98, 188, 186, 0.12);
}

tbody tr.totals-row {
  background: var(--cement);
  font-weight: 500;
}

tbody tr.totals-row:hover {
  background: var(--cement);
}

tbody tr.selected {
  background: rgba(0, 0, 0, 0.06);
}

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

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

  .faq-grid {
    column-count: 2;
  }
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .app-header {
    flex-wrap: wrap;
  }

  .nav-toolbar {
    margin-top: 0;
  }

  .assumptions-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .assessments-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .assumptions-status {
    flex-basis: 100%;
  }

  .assessments-status {
    flex-basis: 100%;
  }

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

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

  .assumption-count {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .assessment-count {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .assumptions-method {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .assessments-method {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .main-grid,
  .viz-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

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

  .faq-grid {
    column-count: 1;
  }

  .nav-legends {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .detail-column {
    display: contents;
  }

  .map-wrap {
    height: 620px;
  }

  #mapWidthToggle {
    display: none;
  }

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

  .detail-analysis {
    grid-template-columns: 1fr;
  }

  .source-note {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 18px 16px 14px;
  }

  .header-brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 120px;
    min-width: 120px;
  }

  .nav-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    justify-content: space-between;
  }

  .view-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .app-shell {
    padding: 16px;
  }

  .sticky-controls {
    width: min(440px, calc(100vw - 36px));
    margin: 0;
    padding: 0;
  }

  .map-wrap {
    height: 440px;
    padding: 8px;
  }

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

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

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

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

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

  .assumptions-method > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .assessments-method > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .assumptions-table-section .panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .controls,
  .control-actions {
    grid-template-columns: 1fr;
  }

  .sticky-controls .controls > *,
  .sticky-controls .control-actions > * {
    grid-column: 1;
  }

  .estimate-keys {
    grid-template-columns: 1fr;
  }

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