.app-shell {
  height: 100dvh;
  min-height: 580px;
  display: grid;
  grid-template-rows: 72px 66px minmax(0, 1fr) 84px 28px;
}
.masthead {
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--line-soft);
  gap: 38px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 29px;
  font-weight: 550;
  letter-spacing: -1.6px;
}
.brand > svg {
  width: 27px;
  height: 28px;
  stroke: var(--accent);
  stroke-width: 2.3;
  fill: none;
}
.brand-period {
  color: var(--accent);
}
.brand-tag {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 400;
  margin: 8px 0 0 1px;
}
.organization {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.8px;
}
.organization small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: var(--faint);
  margin-top: 4px;
}
.org-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-family: serif;
  color: var(--text);
}
.org-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 8px;
}
.workspace-label {
  font-size: 10px;
  color: var(--muted);
}
.masthead-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.live-status {
  color: var(--muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-status .mono {
  font-size: 9px;
  color: var(--faint);
  margin-left: 3px;
}
.avatar {
  height: 29px;
  width: 29px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  font-size: 11px;
}
.command-bar {
  display: flex;
  align-items: center;
  margin: 0 24px;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.breadcrumbs {
  min-width: calc(var(--left) + 8px);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}
.breadcrumbs button {
  font-size: 11px;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumbs button:last-child {
  color: var(--text);
}
.breadcrumbs button:first-child .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}
.breadcrumbs > .separator {
  color: var(--faint);
  font-size: 12px;
}
.command-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.workspace {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) var(--right);
  gap: 0;
  margin: 0 24px;
  position: relative;
  min-height: 0;
}
.left-panel {
  padding: 25px 22px 0 0;
  border-right: 1px solid var(--line-soft);
  overflow: auto;
  scrollbar-width: thin;
}
.city-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.city-heading {
  position: relative;
  z-index: 2;
  padding: 27px 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.city-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 2.2px;
  color: var(--muted);
}
.city-heading h1 {
  font-weight: 500;
  font-size: 29px;
  letter-spacing: 1.5px;
  line-height: 1.4;
  margin-top: 9px;
}
.title-dot {
  color: var(--accent);
  margin-left: 4px;
}
.city-heading p {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.reference-badge {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  white-space: nowrap;
}
.reference-badge > .status-dot {
  margin-top: 5px;
}
.reference-badge time {
  display: block;
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.4px;
}
.headline-kpis {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  position: relative;
  z-index: 2;
  margin: 26px 30px 0;
  pointer-events: none;
}
.headline-kpi {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.headline-kpi:first-child {
  padding-left: 0;
  border-left: 0;
}
.headline-kpi .kpi-label {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi-label small {
  font-size: 8px;
  color: var(--faint);
}
.headline-kpi .kpi-value {
  font-family: var(--number);
  font-size: 29px;
  letter-spacing: -1.8px;
  line-height: 1.5;
  font-weight: 400;
}
.headline-kpi .kpi-value small {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0;
  margin-left: 5px;
  color: var(--muted);
}
.headline-kpi .kpi-foot {
  font-size: 9px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi-foot .positive {
  color: var(--muted);
  font-family: var(--number);
  font-size: 9px;
}
.kpi-foot .attention {
  color: var(--accent);
  font-family: var(--number);
  font-size: 9px;
}
.right-panel {
  border: 1px solid var(--line-soft);
  margin-top: 24px;
  margin-bottom: 22px;
  background: rgba(22, 31, 28, 0.82);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 3px;
  overflow: hidden;
}
.panel-content {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 23px 19px 16px;
  scrollbar-width: thin;
}
.timeline {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  margin: 0 24px;
  gap: 24px;
  padding-right: 16px;
}
.timeline-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: var(--left);
  color: var(--muted);
  font-size: 11px;
}
.timeline-label .icon {
  width: 18px;
  height: 18px;
  color: var(--faint);
}
.timeline-label small {
  display: block;
  font-size: 7px;
  letter-spacing: 1.4px;
  color: var(--faint);
  margin-top: 5px;
}
.timeline-track {
  position: relative;
  flex: 1;
  margin-top: 10px;
  min-width: 0;
}
.timeline-current {
  position: absolute;
  top: -16px;
  left: 0;
  font-family: var(--number);
  font-size: 9px;
  color: var(--accent);
  transform: translateX(-50%);
  white-space: nowrap;
}
.quarter-ticks {
  position: relative;
  height: 17px;
  margin: 5px 7px 0;
}
.quarter-ticks button {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--number);
  font-size: 9px;
  color: var(--faint);
  padding: 3px;
}
.quarter-ticks button:first-child {
  transform: none;
}
.quarter-ticks button:last-child {
  transform: translateX(-100%);
}
.quarter-ticks button.active {
  color: var(--accent);
}
.timeline-end {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 12px;
}
.timeline-date {
  font-family: var(--number);
  font-size: 11px;
  color: var(--text);
}
.status-bar {
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  color: var(--faint);
  letter-spacing: 0.5px;
  border-top: 1px solid var(--line-soft);
}
.status-bar > span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.status-secondary {
  font-size: 7px;
  letter-spacing: 1px;
}
.status-bar i {
  width: 4px;
  height: 4px;
  background: var(--accent);
}
.mobile-panel-button,
.sheet-close,
.sheet-handle {
  display: none;
}
@media (min-width: 1650px) {
  :root {
    --left: 240px;
    --right: 340px;
    --gutter: 32px;
  }
  .city-heading {
    padding: 36px 40px 0;
  }
  .headline-kpis {
    margin: 30px 40px 0;
  }
  .city-heading h1 {
    font-size: 33px;
  }
  .headline-kpi .kpi-value {
    font-size: 36px;
  }
  .panel-content {
    padding: 27px 24px;
  }
  .left-panel {
    padding-top: 34px;
  }
  .district-list {
    gap: 5px !important;
  }
  .district-item {
    min-height: 48px !important;
  }
  .right-panel {
    margin-top: 32px;
  }
  .command-bar {
    gap: 32px;
  }
}
@media (max-width: 1200px) {
  :root {
    --left: 186px;
    --right: 278px;
  }
  .masthead {
    padding: 0 20px;
    gap: 25px;
  }
  .masthead-actions {
    gap: 16px;
  }
  .workspace-label,
  .org-divider,
  .live-status {
    display: none;
  }
  .command-bar {
    gap: 14px;
    margin: 0 18px;
  }
  .command-actions {
    gap: 6px;
  }
  .workspace {
    margin: 0 18px;
  }
  .lens-control button small {
    display: none;
  }
  .city-heading {
    padding: 26px 22px 0;
  }
  .city-heading h1 {
    font-size: 24px;
  }
  .city-heading p {
    font-size: 9px;
  }
  .headline-kpis {
    margin: 24px 22px 0;
  }
  .headline-kpi .kpi-value {
    font-size: 24px;
  }
  .headline-kpi {
    padding-left: 13px;
  }
  .kpi-label small {
    display: none;
  }
  .reference-badge {
    display: none;
  }
  .left-panel {
    padding-right: 15px;
  }
  .panel-content {
    padding: 20px 15px;
  }
  .timeline {
    gap: 18px;
    margin: 0 18px;
  }
  .timeline-label {
    min-width: var(--left);
  }
  .timeline-end {
    gap: 12px;
  }
  .brand-tag {
    display: none;
  }
  .breadcrumbs {
    min-width: var(--left);
  }
  .focus-control select {
    max-width: 155px;
  }
}
@media (max-width: 1020px) {
  :root {
    --left: 175px;
    --right: 0px;
  }
  .right-panel {
    position: fixed;
    right: 18px;
    bottom: 117px;
    top: 154px;
    width: 310px;
    z-index: 12;
    margin: 0;
    background: var(--surface);
    transform: translateX(345px);
    transition: transform 0.3s var(--ease);
    box-shadow: -12px 8px 35px #0a110f70;
  }
  .right-panel.open {
    transform: translateX(0);
  }
  .sheet-close {
    display: flex !important;
    margin-left: auto;
  }
  .mobile-panel-button {
    display: flex;
    position: fixed;
    bottom: 132px;
    right: 35px;
    z-index: 10;
    gap: 10px;
    align-items: center;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 11px 14px;
    color: var(--accent);
    font-size: 11px;
  }
  .right-panel.open ~ .mobile-panel-button {
    display: none;
  }
  .city-panel {
    padding-right: 0;
  }
  .city-heading {
    padding-right: 28px;
  }
  .reference-badge {
    display: flex;
  }
  .headline-kpi .kpi-value {
    font-size: 29px;
  }
  .city-heading h1 {
    font-size: 28px;
  }
  .organization {
    margin-left: auto;
  }
  .masthead-actions {
    margin-left: 0;
  }
  .breadcrumbs {
    min-width: 120px;
  }
  .focus-control select {
    max-width: 150px;
  }
  .timeline-label {
    min-width: 155px;
  }
  .timeline-end {
    gap: 12px;
  }
  .timeline-date {
    display: none;
  }
  .diff-control small {
    display: none;
  }
  .scene-bottom {
    padding-right: 210px !important;
  }
  .lens-control button {
    padding: 8px 12px !important;
  }
}
@media (max-height: 800px) and (min-width: 761px) {
  .app-shell {
    grid-template-rows: 62px 58px minmax(0, 1fr) 74px 24px;
  }
  .city-heading {
    padding-top: 21px;
  }
  .city-heading h1 {
    font-size: 25px;
  }
  .headline-kpis {
    margin-top: 17px;
  }
  .headline-kpi .kpi-value {
    font-size: 26px;
  }
  .city-heading p {
    display: none;
  }
  .left-panel {
    padding-top: 22px;
  }
  .section-title {
    margin-bottom: 14px;
  }
  .district-item {
    min-height: 38px !important;
  }
  .legend {
    margin-top: 22px !important;
  }
  .legend-items {
    gap: 10px !important;
  }
  .spatial-note {
    display: none !important;
  }
  .right-panel {
    margin-top: 20px;
    margin-bottom: 16px;
  }
  .scene-container {
    top: 147px !important;
  }
  .city-caption {
    top: 162px !important;
  }
  .view-tools {
    top: 164px !important;
  }
}
@media (max-width: 760px) {
  html,
  body {
    overflow: hidden;
  }
  .app-shell {
    min-height: 0;
    grid-template-rows: 60px 56px minmax(0, 1fr) 94px 23px;
  }
  .masthead {
    padding: 0 16px;
    gap: 16px;
  }
  .brand {
    font-size: 26px;
    gap: 8px;
  }
  .brand > svg {
    width: 23px;
  }
  .organization {
    font-size: 10px;
    gap: 8px;
  }
  .organization small {
    font-size: 6px;
    letter-spacing: 1px;
  }
  .org-mark {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  .masthead-actions {
    gap: 0;
  }
  .followup-toggle {
    padding: 6px !important;
  }
  .followup-toggle > span:nth-child(2),
  .avatar {
    display: none;
  }
  .brand-tag {
    display: none;
  }
  .command-bar {
    gap: 10px;
    margin: 0 12px;
  }
  .breadcrumbs {
    display: none;
  }
  .lens-control {
    margin-right: auto;
  }
  .lens-control button {
    padding: 7px 10px !important;
    font-size: 11px !important;
    gap: 5px !important;
  }
  .lens-control .icon {
    width: 13px;
    height: 13px;
  }
  .command-actions {
    gap: 4px;
  }
  .focus-control > span {
    display: none;
  }
  .focus-control select {
    font-size: 10px !important;
    max-width: 114px;
    padding: 7px 3px 7px 7px !important;
  }
  .command-actions .icon-button {
    width: 30px;
    height: 32px;
  }
  .command-actions #reset-view {
    display: none;
  }
  .workspace {
    display: block;
    margin: 0;
    min-height: 0;
  }
  .left-panel {
    display: none;
  }
  .city-panel {
    height: 100%;
    width: 100%;
  }
  .city-heading {
    padding: 24px 22px 0;
  }
  .city-heading h1 {
    font-size: 26px;
  }
  .city-heading .eyebrow {
    font-size: 7px;
  }
  .city-heading p {
    font-size: 9px;
  }
  .reference-badge {
    font-size: 8px;
    margin-top: 6px;
  }
  .reference-badge time {
    font-size: 9px;
  }
  .headline-kpis {
    margin: 25px 22px 0;
  }
  .headline-kpi .kpi-value {
    font-size: 24px;
    letter-spacing: -1px;
  }
  .headline-kpi .kpi-label {
    font-size: 9px;
  }
  .headline-kpi .kpi-value small {
    font-size: 9px;
    margin-left: 3px;
  }
  .headline-kpi .kpi-foot {
    font-size: 8px;
  }
  .headline-kpi {
    padding-left: 12px;
  }
  .scene-container {
    top: 197px !important;
    bottom: 42px !important;
  }
  .city-caption {
    top: 201px !important;
    left: 22px !important;
    font-size: 8px !important;
  }
  .view-tools {
    top: auto !important;
    bottom: 46px !important;
    right: 16px !important;
  }
  .scene-bottom {
    bottom: 8px !important;
    left: 20px !important;
    right: 20px !important;
    padding-right: 0 !important;
  }
  .scene-bottom p {
    font-size: 8px !important;
  }
  .scene-bottom .compass {
    width: 28px !important;
    height: 34px !important;
  }
  .scene-bottom .help-button {
    display: none;
  }
  .mobile-panel-button {
    bottom: 130px;
    right: 16px;
    padding: 9px 11px;
    font-size: 10px;
  }
  .right-panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 70dvh;
    z-index: 30;
    transform: translateY(110%);
    border-radius: 16px 16px 0 0;
    border-color: var(--line);
    box-shadow: 0 -20px 80px #0a110fa0;
  }
  .right-panel.open {
    transform: translateY(0);
  }
  .sheet-handle {
    display: block;
    width: 34px;
    height: 3px;
    border-radius: 4px;
    background: var(--surface);
    margin: 9px auto 3px;
  }
  .right-panel .panel-content {
    padding: 24px;
  }
  .panel-tabs {
    padding-left: 20px !important;
  }
  .timeline {
    margin: 0 16px;
    gap: 14px;
    padding: 0 0 8px;
    align-items: center;
    position: relative;
  }
  .timeline-label {
    display: none;
  }
  .timeline-track {
    margin-top: 0;
  }
  .timeline-end {
    position: absolute;
    right: 0;
    bottom: 4px;
    gap: 10px;
    margin: 0;
  }
  .timeline-end .diff-control {
    font-size: 9px;
    gap: 6px;
  }
  .diff-control .switch-track {
    width: 24px;
    height: 14px;
  }
  .diff-control .switch-track:after {
    width: 8px;
    height: 8px;
  }
  .diff-control input:checked + .switch-track:after {
    transform: translateX(10px);
  }
  .timeline-date {
    display: block;
    font-size: 9px;
  }
  .timeline-current {
    top: -14px;
    font-size: 8px;
  }
  .quarter-ticks button {
    font-size: 8px;
  }
  .play-button {
    width: 30px !important;
    height: 30px !important;
    margin-top: -14px;
  }
  .status-bar {
    padding: 0 16px;
    font-size: 7px;
  }
  .status-secondary,
  #render-status {
    display: none !important;
  }
  .status-bar > span {
    gap: 5px;
  }
  .focus-summary {
    top: 182px !important;
    left: 22px !important;
    max-width: calc(100% - 44px);
    font-size: 9px !important;
  }
  .table-view {
    inset: 0 !important;
    padding: 20px 16px !important;
  }
  .table-toolbar {
    flex-wrap: wrap;
    gap: 12px !important;
  }
  .table-toolbar input {
    width: 100% !important;
  }
  .coachmark {
    left: 20px !important;
    bottom: 183px !important;
    width: calc(100% - 40px) !important;
  }
  .city-tooltip {
    max-width: 260px;
  }
  .query-dialog {
    width: calc(100% - 28px) !important;
    padding: 24px !important;
  }
  .query-row {
    grid-template-columns: 1fr 70px 80px 24px !important;
    gap: 6px !important;
  }
  .followup-drawer {
    max-width: 100% !important;
  }
  .headline-kpi .kpi-foot .positive,
  .headline-kpi .kpi-foot .attention {
    font-size: 8px;
  }
}
/* Refinements from the cold-open review: readable controls, balanced columns. */
@media (min-width: 1021px) {
  .breadcrumbs {
    flex: 0 1 var(--left);
    min-width: var(--left);
  }
  .command-bar {
    gap: 24px;
  }
  .command-actions {
    margin-left: auto;
  }
  .command-bar:has(.breadcrumbs button:nth-of-type(3)) .breadcrumbs {
    flex: 1;
  }
  .lens-control button {
    font-size: 12px;
    padding: 8px 17px;
  }
  .focus-control select {
    font-size: 11px;
  }
  .scene-container {
    top: 210px;
  }
  .city-caption {
    top: 214px;
  }
}
.quarter-ticks button {
  white-space: nowrap;
}
.timeline-track:before {
  content: "";
  height: 3px;
  position: absolute;
  top: 0;
  left: 0;
  width: var(--progress, 100%);
  max-width: 100%;
  background: var(--accent);
  pointer-events: none;
}
.headline-kpi .kpi-label {
  font-size: 11px;
}
.city-heading p {
  font-size: 11px;
}
.status-bar {
  font-size: 9px;
}
@media (max-width: 760px) {
  .headline-kpi .kpi-label {
    font-size: 9px;
  }
  .city-heading p {
    font-size: 9px;
  }
  .status-bar {
    font-size: 7px;
  }
  .timeline-track:before {
    top: 0;
  }
}
