:root {
  --bg-a: #f6eee0;
  --bg-b: #f2f7ff;
  --ink: #20283a;
  --ink-soft: #53607a;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(32, 40, 58, 0.16);
  --page-gutter: 16px;
  --vacant: #e377c2;
  --nodata: #17becf;
  --shadow: 0 10px 30px rgba(23, 32, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 227, 186, 0.55), transparent 36%),
    radial-gradient(circle at 100% 20%, rgba(170, 219, 255, 0.5), transparent 42%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
  font-family: "Avenir Next", "Trebuchet MS", "Lucida Sans", sans-serif;
  padding: 1rem var(--page-gutter);
}

.page-header,
.story-presets,
.controls,
.meta,
.timeline-zoom,
.trend-section,
.street-context,
.legend,
.timeline {
  width: 100%;
  margin-inline: auto;
}

.app-shell {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 0.72rem;
  align-items: start;
}

.side-panel {
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  padding: 1.1rem;
  position: sticky;
  top: 0.5rem;
  height: calc(100vh - 1rem);
  max-height: calc(100vh - 1rem);
  overflow: auto;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.side-panel-title {
  margin: 0;
  color: #314d86;
}

.side-panel-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid #c6d3e9;
  border-radius: 8px;
  background: #fff;
  color: #2f4f86;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 140ms ease;
}

.side-panel-toggle.is-open {
  transform: none;
}

.mobile-quick-actions {
  display: inline-flex;
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 120;
  align-items: center;
  gap: 0.35rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mobile-quick-actions.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.survey-desktop-back-to-top {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.survey-desktop-back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mobile-back-to-top,
.mobile-quick-action-btn {
  min-height: 42px;
  padding: 0.45rem 0.72rem;
  border: 1px solid #c6d3e9;
  border-radius: 10px;
  background: #ffffff;
  color: #2f4f86;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1;
}

.mobile-quick-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.42rem 0.6rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .survey-desktop-back-to-top {
    display: none !important;
  }
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon-open,
.btn-icon-close {
  width: 0.72rem;
  height: 1.02rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 0.72;
  font-size: 0.66rem;
  font-weight: 700;
}

.btn-icon-open::before,
.btn-icon-open::after,
.btn-icon-close::before,
.btn-icon-close::after {
  content: "↑";
  display: block;
}

.btn-icon-open::after {
  content: "↓";
}

.btn-icon-close::before {
  content: "↓";
}

.side-panel-body {
  margin-top: 0.48rem;
  display: grid;
  gap: 0.82rem;
}

.side-panel-divider {
  height: 1px;
  background: rgba(32, 40, 58, 0.16);
}

.main-panel {
  min-width: 0;
  display: grid;
  gap: 0.32rem;
  align-content: start;
  grid-auto-rows: max-content;
}

.section-heading-h2 {
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.2;
  color: #314d86;
}

.section-heading-h3 {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.2;
  color: #314d86;
}

.side-panel-title.section-heading-h2,
#explorerSummarySection .section-heading-h2,
#streetContext .section-heading-h2,
#trendSection .section-heading-h2,
.timeline-zoom-title.section-heading-h2 {
  font-size: 1.16rem;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 36px minmax(0, 1fr);
}

.app-shell.is-sidebar-collapsed .side-panel {
  padding: 1.1rem 0.22rem 0.22rem;
  border-radius: 4px;
}

.app-shell.is-sidebar-collapsed .side-panel-header {
  justify-content: flex-end;
}

.app-shell.is-sidebar-collapsed .side-panel-title {
  display: none;
}

.app-shell.is-sidebar-collapsed .side-panel-body {
  display: none;
}

.app-shell.is-sidebar-collapsed .side-panel-toggle {
  height: 30px;
  min-height: 30px;
  border-radius: 8px;
}

.side-panel .story-presets,
.side-panel .controls,
.side-panel .meta {
  margin-top: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

.side-panel .controls {
  position: static;
  top: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.98rem;
}

.side-panel .controls-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.88rem;
}

.side-panel .search-mode-toggle {
  width: fit-content;
  margin-bottom: -0.2rem;
}

.side-panel .search-control,
.side-panel .scope-control,
.side-panel .current-status-control,
.side-panel .change-intensity-control,
.side-panel .age-filter,
.side-panel .timespan-filter {
  width: 100%;
  grid-column: auto;
}

.side-panel .story-presets-control select,
.side-panel .scope-control select,
.side-panel .current-status-control select,
.side-panel .change-intensity-control select {
  width: 100%;
  max-width: none;
}

.side-panel .top-filters {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  border-top: 0;
  padding-top: 0;
  gap: 0.82rem;
}

.side-panel .timespan-slider-row {
  justify-content: stretch;
}

.side-panel .slider-control {
  width: calc(100% - 28px);
  margin-inline: 14px;
  max-width: none;
}

.side-panel .controls label > span,
.side-panel .field-head > span,
.side-panel .filter-head > span {
  font-size: 0.82rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.theme-segmented {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--layout-border-strong);
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  overflow: hidden;
}

.theme-segment-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5e6c84;
  font-family: var(--ds-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
}

.theme-segment-btn.is-active {
  background: var(--ds-selected, #0c66e4);
  color: #fff;
}

.eyebrow {
  font-family: "Baskerville", "Palatino Linotype", serif;
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

h1 {
  font-family: "Baskerville", "Palatino Linotype", serif;
  margin: 0;
  font-size: clamp(1.12rem, 2.08vw, 1.84rem);
}

.heading-tagline {
  margin: 0.18rem 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.credit {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: right;
}

.story-presets {
  margin-top: 0.7rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
}

.story-presets-control {
  display: grid;
  gap: 0.5rem;
}

.story-presets-control select {
  max-width: 390px;
  height: 34px;
  font-size: 0.82rem;
}

.controls {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.85fr 0.82fr 0.92fr 0.92fr 1.2fr 1.2fr;
  align-items: start;
  column-gap: 1rem;
  row-gap: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 6;
}

.controls-main {
  display: contents;
}

.search-control {
  grid-column: 1;
  min-width: 0;
}

.scope-control {
  grid-column: 2;
  min-width: 0;
}

.current-status-control {
  grid-column: 3;
  min-width: 0;
}

.change-intensity-control {
  grid-column: 4;
  min-width: 0;
}

.age-filter {
  grid-column: 5;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.top-filters {
  display: contents;
}

.timespan-filter {
  --timespan-width: 100%;
  display: grid;
  gap: 0.5rem;
  grid-column: 6;
  align-self: start;
  min-width: 0;
}

.filter-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  width: var(--timespan-width);
  gap: 0.5rem;
}

.reset-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #2f5f9b;
  font: inherit;
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  line-height: 1.2;
  vertical-align: baseline;
}

.reset-link:hover {
  color: #1d4b85;
  filter: none;
}

.timespan-slider-row {
  display: flex;
  justify-content: flex-start;
  width: var(--timespan-width);
}

.slider-control {
  position: relative;
  width: min(100%, 250px);
  padding-top: 24px;
  margin-inline: 0;
}

.slider-bubble {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  min-width: 44px;
  text-align: center;
  padding: 0.14rem 0.3rem;
  border: 1px solid #1ba7b2;
  border-radius: 4px;
  background: #fff;
  color: #0d2747;
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(18, 28, 44, 0.08);
}

.slider-stack {
  position: relative;
  --range-start: 0%;
  --range-end: 100%;
  height: 18px;
  width: 100%;
  overflow: hidden;
}

.slider-track-base,
.slider-track-active {
  position: absolute;
  top: 7px;
  height: 5px;
  border-radius: 999px;
}

.slider-track-base {
  left: 0;
  right: 0;
  background: #e2e5e9;
}

.slider-track-active {
  left: var(--range-start);
  right: calc(100% - var(--range-end));
  background: #16a7b1;
  box-shadow: inset 0 0 0 1px rgba(10, 96, 104, 0.2);
}

.slider-stack input[type="range"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider-stack input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
  border-radius: 999px;
}

.slider-stack input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all;
  width: 16px;
  height: 14px;
  margin-top: -5px;
  border-radius: 5px;
  border: 1px solid rgba(145, 152, 160, 0.7);
  background: linear-gradient(#fcfcfc, #eceff2);
  box-shadow: 0 1px 2px rgba(18, 28, 44, 0.22);
}

.slider-stack input[type="range"]::-moz-range-track {
  height: 5px;
  background: transparent;
  border-radius: 999px;
}

.slider-stack input[type="range"]::-moz-range-progress {
  height: 5px;
  background: transparent;
}

.slider-stack input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 16px;
  height: 14px;
  border-radius: 5px;
  border: 1px solid rgba(145, 152, 160, 0.7);
  background: linear-gradient(#fcfcfc, #eceff2);
  box-shadow: 0 1px 2px rgba(18, 28, 44, 0.22);
}

.slider-ticks {
  position: relative;
  height: 16px;
  margin-top: 5px;
}

.slider-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 5px;
  background: rgba(24, 33, 50, 0.12);
  transform: translateX(-0.5px);
}

.slider-tick-label {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  color: #1c2f50;
  font-size: 0.56rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.slider-tick-label.edge-start {
  transform: translateX(0);
}

.slider-tick-label.edge-end {
  transform: translateX(-100%);
}

label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.controls label > span,
.field-head > span,
.filter-head > span,
.toggle-head {
  font-size: 0.74rem;
  line-height: 1.1;
  font-weight: 600;
  color: #364865;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.inline-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: #2f5f9b;
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: underline;
  cursor: pointer;
}

.inline-link:hover {
  color: #1d4b85;
  filter: none;
}

input:not([type="range"]),
textarea,
select,
button {
  border: 1px solid rgba(32, 40, 58, 0.2);
  border-radius: 7px;
  padding: 0.5rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.search-control input,
.scope-control select,
.current-status-control select,
.change-intensity-control select {
  height: 34px;
  font-size: 0.82rem;
}

.scope-control select {
  max-width: 171px;
}

.current-status-control select,
.change-intensity-control select {
  max-width: 188px;
}

.search-control {
  position: relative;
}

.search-tokenizer {
  min-height: 68px;
  border: 1px solid rgba(32, 40, 58, 0.2);
  border-radius: 7px;
  background: #fff;
  padding: 0.25rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: flex-start;
  align-content: flex-start;
  position: relative;
  overflow: visible;
}

.address-tokenizer {
  min-height: 34px;
  align-items: center;
  align-content: center;
}

.search-tokenizer:focus-within {
  border-color: #1ba7b2;
  box-shadow: 0 0 0 2px rgba(27, 167, 178, 0.16);
}

.search-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.66rem;
  line-height: 1.25;
  color: #6a7893;
}

.search-note span {
  display: block;
}

.search-note span + span {
  margin-top: 0.25rem;
}


.search-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  background: var(--pill-bg, #d9d9d9);
  color: var(--pill-fg, #454545);
  border: 1px solid rgba(15, 28, 46, 0.18);
  border-radius: 999px;
  padding: 0.16rem 0.42rem 0.16rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.2;
}

.search-pill.is-muted {
  opacity: 0.45;
}

.search-pill-remove {
  border: 0;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  padding: 0;
  color: var(--pill-fg, #4b5568);
  font-size: 0.7rem;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-pill-remove:hover {
  background: rgba(255, 255, 255, 0.5);
}

#searchTextInput {
  border: 0;
  outline: 0;
  padding: 0;
  min-width: 90px;
  flex: 1;
  min-height: 68px;
  height: 68px;
  max-height: 136px;
  font-size: 0.8rem;
  line-height: 1.2;
  resize: vertical;
  overflow: auto;
  background: transparent;
  font-family: inherit;
  box-sizing: border-box;
}

#addressTextInput {
  border: 0;
  outline: 0;
  padding: 0.08rem 0 0;
  min-width: 90px;
  flex: 1;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  font-size: 0.8rem;
  line-height: 1.15;
  resize: none;
  overflow: hidden;
  background: transparent;
  font-family: inherit;
  box-sizing: border-box;
}

.search-suggestions {
  position: absolute;
  left: -1px;
  right: -1px;
  top: calc(100% + 4px);
  border: 1px solid rgba(32, 40, 58, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 20px rgba(13, 23, 40, 0.12);
  padding: 0.2rem;
  display: none;
  z-index: 12;
  max-height: 190px;
  overflow: auto;
}

.search-suggestions.open {
  display: grid;
  gap: 0.1rem;
}

.search-suggestion {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.24rem 0.35rem;
  border-radius: 5px;
  font-size: 0.76rem;
  color: #233554;
  cursor: pointer;
}

.search-suggestion:hover {
  background: rgba(32, 63, 111, 0.08);
}

.search-suggestion.active {
  background: rgba(47, 104, 200, 0.2);
}

button {
  cursor: pointer;
  align-self: end;
  background: #203f6f;
  color: #fff;
  border-color: #203f6f;
}

button:hover {
  filter: brightness(1.08);
}

.toggle-filter {
  grid-column: 4;
  display: grid;
  gap: 0.28rem;
  align-self: start;
  min-width: 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding-top: 0.22rem;
  white-space: normal;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.toggle input {
  margin: 0;
}

.meta {
  margin-top: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.meta-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.meta-vacancy {
  padding-top: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #3e547e;
}

.meta-vacancy input {
  margin-top: 0;
}

#meta {
  font-weight: 700;
  color: #334766;
}

.zoom-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timeline-zoom {
  margin-top: 0.32rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.mobile-sort {
  display: none;
}

.timeline-zoom-title {
  margin: 0;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin: 0 0 0.2rem;
}

.panel-disclosure {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.08rem 0.12rem 0.08rem 0;
  margin: 0;
  border-radius: 4px;
  cursor: pointer;
}

.panel-disclosure:hover {
  background: rgba(9, 30, 66, 0.06);
}

.panel-disclosure:focus-visible {
  outline: 2px solid rgba(56, 139, 255, 0.3);
  outline-offset: 1px;
}

.panel-disclosure .section-heading-h2 {
  margin: 0;
}

.panel-disclosure-chevron {
  display: inline-block;
  width: 0.8rem;
  text-align: center;
  line-height: 1;
  color: #5e6c84;
  transform: rotate(-90deg);
  transition: transform 140ms ease;
}

.panel-disclosure.is-open .panel-disclosure-chevron {
  transform: rotate(0deg);
}

.panel-internal-summary {
  display: none;
}

.meta-summary {
  margin-top: 0.2rem;
}

.meta-summary-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: #4b5f86;
  line-height: 1.2;
}

.meta-note {
  font-weight: 400;
}

.explorer-summary-section {
  margin-top: 0.18rem;
}

.explorer-summary-details {
  background: var(--layout-surface);
  border: 1px solid var(--layout-border);
  border-radius: 4px;
}

.explorer-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.72rem;
}

.explorer-summary-card {
  min-height: 96px;
  min-width: 0;
}

.dashboard-card-label-row {
  display: block;
  padding-right: 1.5rem;
  min-height: 18px;
}

.kpi-info-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 18px;
  height: 18px;
  border: 1px solid #97a6c3;
  border-radius: 999px;
  background: #f4f7fc;
  color: #4d648f;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.kpi-info-btn:hover,
.kpi-info-btn:focus-visible,
.kpi-info-btn[aria-expanded="true"] {
  background: #e8eef9;
  border-color: #5e7ab4;
  color: #294b86;
}

.explorer-summary-note {
  grid-column: 1 / -1;
  margin: 0.05rem 0 0;
  color: #5e6c84;
  font-size: 0.78rem;
  line-height: 1.35;
}

.timeline-zoom-left {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.timeline-zoom-note {
  margin: 0.12rem 0 0.2rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #5e6c84;
  max-width: 52rem;
}

.timeline-zoom-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.timeline-zoom-main-controls {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.28rem;
}

.timeline-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.timeline-action-btn {
  appearance: none;
  border: 1px solid var(--layout-border-strong);
  border-radius: 6px;
  background: #fff;
  color: #1f5fbf;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  min-height: 32px;
  padding: 0.32rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.26rem;
  white-space: nowrap;
}

.timeline-action-btn .btn-icon {
  font-size: 0.86rem;
}

.timeline-action-btn:hover {
  background: #f3f7ff;
  border-color: #94abd2;
}

.timeline-action-btn:disabled,
.mobile-quick-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timeline-action-btn:disabled:hover,
.mobile-quick-action-btn:disabled:hover {
  background: #fff;
  border-color: var(--layout-border-strong);
}


.trend-section {
  margin-top: 0.32rem;
}

.street-context {
  margin-top: 0.32rem;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
}

.street-context-details {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.street-context-details:not([open]) {
  display: none;
}

.street-context-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #364865;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

.street-context-details > summary::-webkit-details-marker {
  display: none;
}

.street-context-body {
  padding: 0.7rem 0.75rem 1.65rem;
}

.street-context-head {
  display: none;
}

#streetContextSummary {
  font-weight: 600;
  font-size: 0.7rem;
  color: #5a6880;
}

.street-lane {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
}

.street-lane + .street-lane {
  margin-top: 0.6rem;
}

.street-lane-label {
  display: none;
}

.street-lane-cells {
  min-height: 30px;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  background: #eef3fb;
  padding: 5px 2px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  position: relative;
  overflow: visible;
}

.street-cell {
  flex: 1 1 0;
  border: 0;
  border-radius: 4px;
  height: 18px;
  min-width: 0;
  padding: 0;
  font-size: 0.52rem;
  line-height: 1;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: rgba(18, 35, 64, 0.88);
  background: #dce4f2;
  cursor: pointer;
}

.street-cell.is-match {
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.street-cell.is-dim {
  background: #ecf1f8;
  color: rgba(84, 99, 128, 0.55);
}

.street-cell.is-filtered-out {
  background: #edf1f7;
  color: rgba(98, 112, 139, 0.42);
  box-shadow: none;
  opacity: 0.66;
  cursor: default;
}

.street-cell.is-filtered-out:hover {
  outline: none;
}

.street-cell:hover {
  outline: 2px solid rgba(47, 104, 200, 0.5);
  outline-offset: 0;
}

.street-junction-gap {
  flex: 0 0 9px;
  position: relative;
  height: 100%;
  align-self: stretch;
}

.street-junction-flag {
  --street-flag-gap: -1px;
  --street-flag-stem: 8px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + var(--street-flag-gap) + var(--street-flag-stem));
  transform: translateX(-50%);
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  border: 0;
  background: #dbe5f6;
  color: #5f7398;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.street-junction-flag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 5px;
  height: var(--street-flag-stem);
  border-radius: 0 0 2px 2px;
  background: #dbe5f6;
}

.street-junction-flag.south {
  --street-flag-south-extra: 19px;
  bottom: auto;
  top: calc(100% + var(--street-flag-gap) + var(--street-flag-stem) + var(--street-flag-south-extra));
}

.street-junction-flag.south::after {
  top: auto;
  bottom: 100%;
  border-radius: 2px 2px 0 0;
}

.trend-details {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.trend-details:not([open]) {
  display: none;
}

.trend-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #364865;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

.trend-details > summary::-webkit-details-marker {
  display: none;
}

.trend-body {
  padding: 0 0.55rem 0.55rem;
}

.trend-scale-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c8d5ea;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fbff;
  margin: 0.28rem 0 0.3rem;
}

.trend-scale-btn {
  border: 0;
  background: transparent;
  color: #4f6389;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.24rem 0.62rem;
  cursor: pointer;
}

.trend-scale-btn + .trend-scale-btn {
  border-left: 1px solid #d7e1f1;
}

.trend-scale-btn.is-active {
  background: #2f68c8;
  color: #ffffff;
}

.trend-empty {
  font-size: 0.76rem;
  color: #5a6880;
  padding-top: 0.2rem;
}

.trend-chart {
  height: 170px;
}

.trend-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-chart .trend-axis-label {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 0.62rem;
  font-weight: 500;
  fill: var(--ink-soft);
}

.trend-chart .trend-hit {
  cursor: crosshair;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.sort-control select {
  height: 28px;
  min-width: 220px;
  padding: 0.24rem 1.5rem 0.24rem 0.45rem;
  font-size: 0.74rem;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.zoom-control input[type="range"] {
  width: 130px;
}

.zoom-icon {
  width: 18px;
  height: 18px;
  border: 1.5px solid #7f8fae;
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  background: transparent;
}

.zoom-icon::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #7f8fae;
  border-radius: 999px;
}

.zoom-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -5px;
  bottom: -4px;
  transform: rotate(45deg);
  background: #7f8fae;
  border-radius: 999px;
}

.zoom-icon-in {
  background: linear-gradient(#7f8fae, #7f8fae) center/2px 8px no-repeat;
}

#zoomOutValue {
  min-width: 2.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ghost-btn {
  border: 1px solid rgba(32, 40, 58, 0.25);
  background: rgba(255, 255, 255, 0.75);
  color: #203f6f;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 600;
  box-shadow: none;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  filter: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.chip {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.chip-active { background: #4f8fdb; }

.chip-vacant {
  border: 1px solid rgba(32, 40, 58, 0.2);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(120, 128, 142, 0.25) 0,
      rgba(120, 128, 142, 0.25) 4px,
      rgba(236, 239, 244, 0.95) 4px,
      rgba(236, 239, 244, 0.95) 10px
    );
}

.chip-nodata {
  background: var(--nodata);
}

.timeline {
  --label-col-width: 220px;
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.timeline-guide {
  display: grid;
  grid-template-columns: var(--guide-label-col-width, var(--label-col-width)) 1fr;
  align-items: end;
  position: sticky;
  top: 0.2rem;
  z-index: 4;
  background: var(--panel);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(32, 40, 58, 0.12);
  padding-bottom: 0.15rem;
}

.guide-spacer {
  min-height: 1px;
}

.guide-track {
  position: relative;
  height: 34px;
}

.guide-rail-base,
.guide-rail-active {
  position: absolute;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  z-index: 0;
}

.guide-rail-base {
  left: 0;
  right: 0;
  background: rgba(32, 40, 58, 0.18);
}

.guide-rail-active {
  background: #16a7b1;
  box-shadow: inset 0 0 0 1px rgba(10, 96, 104, 0.18);
}

.guide-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 9px;
  background: rgba(32, 40, 58, 0.35);
  transform: translateX(-0.5px);
  z-index: 1;
}

.guide-label {
  position: absolute;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  z-index: 1;
}

.guide-label.edge-start {
  transform: translateX(0);
}

.guide-label.edge-end {
  transform: translateX(-100%);
}

.shop-row {
  display: grid;
  grid-template-columns: var(--label-col-width) 1fr;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
}

.shop-row.share-open {
  overflow: visible;
}

.shop-row.expanded {
  box-shadow: 0 4px 16px rgba(20, 31, 53, 0.12);
}

.shop-label {
  border-right: 1px solid var(--panel-border);
  padding: 0.68rem 0.66rem;
  font-weight: 600;
  font-size: 0.87rem;
  background: rgba(245, 247, 253, 0.9);
}

.label-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.row-toggle {
  border-radius: 4px;
  padding: 0.08rem 0.12rem;
  margin: -0.08rem 0 0 -0.12rem;
  cursor: pointer;
  flex: 1 1 auto;
  max-width: calc(100% - 30px);
}

.row-toggle:hover {
  background: rgba(9, 30, 66, 0.06);
}

.row-toggle.is-disabled {
  cursor: default;
  opacity: 0.58;
}

.row-toggle.is-disabled:hover {
  background: transparent;
}

.row-toggle:focus-visible {
  outline: 2px solid rgba(56, 139, 255, 0.32);
  outline-offset: 1px;
}

.label-id {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 0;
}

.row-disclosure {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5e6c84;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.row-disclosure-icon {
  display: inline-block;
  font-size: 1.95rem;
  transform: rotate(0deg);
  transition: transform 130ms ease;
}

.row-disclosure.is-open .row-disclosure-icon {
  transform: rotate(90deg);
}

.label-change-count {
  font-size: 0.62rem;
  font-weight: 500;
  color: #5e7090;
  white-space: nowrap;
}

.label-number {
  font-weight: 700;
  letter-spacing: 0;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
  margin-left: 0.2rem;
  position: relative;
}

.pin-btn,
.expand-btn {
  padding: 0.1rem 0.38rem;
  font-size: 0.64rem;
  border-radius: 999px;
  border: 1px solid rgba(32, 40, 58, 0.24);
  color: #203f6f;
  background: #fff;
}

.share-btn {
  appearance: none;
  border: 1px solid rgba(32, 40, 58, 0.24);
  border-radius: 999px;
  background: #fff;
  color: #203f6f;
  font-size: 0.64rem;
  line-height: 1;
  padding: 0.22rem 0.45rem;
  min-height: 24px;
}

.share-btn:hover {
  background: #f3f7ff;
  border-color: #94abd2;
}

.share-menu {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  min-width: 132px;
  border: 1px solid var(--layout-border-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(24, 39, 75, 0.16);
  padding: 0.22rem;
  z-index: 40;
}

.share-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #253a62;
  font-size: 0.72rem;
  text-align: left;
  border-radius: 6px;
  padding: 0.32rem 0.42rem;
}

.share-menu-item:hover {
  background: #edf3ff;
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #1f3d72;
  color: #fff;
  border-radius: 999px;
  padding: 0.44rem 0.76rem;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 160;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.share-toast.visible {
  opacity: 1;
}

.pin-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-color: transparent;
}

.pin-btn::before {
  content: "";
  width: 12px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M2 1h8v13l-4-2.5L2 14V1z' fill='none' stroke='%232f5f9b' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.9;
}

.pin-btn[aria-pressed="true"] {
  background: transparent;
  border-color: transparent;
}

.pin-btn[aria-pressed="true"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M2 1h8v13l-4-2.5L2 14V1z' fill='%232f5f9b'/%3E%3C/svg%3E");
  opacity: 1;
}

.shop-row.pinned {
  box-shadow: 0 2px 12px rgba(25, 41, 71, 0.12);
}

.shop-row.pinned .shop-label {
  cursor: grab;
}

.shop-row.pinned.dragging {
  opacity: 0.55;
}

.pinned-divider {
  height: 0;
  border-top: 2px solid rgba(32, 63, 111, 0.32);
  margin: 0.2rem 0 0.1rem;
}

.survey-timeline-pinned-divider {
  position: absolute;
  margin: 0;
  z-index: 2;
}

.survey-mobile-pinned-divider {
  margin: 0.6rem 0 0.45rem;
}

.shop-label small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.12rem;
  font-weight: 500;
}

.current-business-toggle {
  border-radius: 4px;
  padding: 0.08rem 0.12rem;
  margin: 0.06rem 0 0 -0.12rem;
  width: fit-content;
  max-width: 100%;
}

.current-business-toggle:hover {
  background: transparent;
}

.current-business-toggle:focus-visible {
  outline: none;
}

.current-business-link {
  color: #274f8f;
  text-decoration: none;
}

.current-business-link:hover {
  text-decoration: underline;
}

.shop-label small.current-vacant {
  display: inline-block;
  margin-top: 0.26rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #be1e2d;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.66rem;
}

.shop-label small.current-nonshop {
  display: inline-block;
  margin-top: 0.26rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #cfe9ff;
  color: #144a7b;
  font-weight: 600;
  letter-spacing: 0;
  font-size: 0.66rem;
}


.track-wrap {
  position: relative;
  min-height: 50px;
  overflow: hidden;
  background: linear-gradient(to right, #f8fafc, #f3f5fb);
}

.year-axis {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    rgba(21, 28, 39, 0.1) 0,
    rgba(21, 28, 39, 0.1) 1px,
    transparent 1px,
    transparent 8.333%
  );
  opacity: 0.18;
  pointer-events: none;
}

.track {
  position: relative;
  height: 100%;
}

.details {
  display: none;
  grid-column: 1 / -1;
  border-top: 1px solid var(--panel-border);
  background: rgba(252, 253, 255, 0.95);
  padding: 0.45rem 0.6rem 0.55rem;
}

.shop-row.expanded .details {
  display: block;
}

.details-head {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.2rem;
}

.details-foot {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.details-share-wrap {
  position: relative;
}

.details-map-link {
  min-width: 128px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--layout-border-strong);
  background: #ffffff;
  color: #243b64;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0.62rem;
  text-decoration: none;
}

.details-map-link:hover {
  background: #f1f5ff;
  border-color: #9fb0cd;
}

.details-map-link:focus-visible {
  outline: 2px solid rgba(56, 139, 255, 0.32);
  outline-offset: 1px;
}

.details-share-btn {
  min-width: 96px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--layout-border-strong);
  background: #ffffff;
  color: #243b64;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 1.32rem 0 0.62rem;
  position: relative;
}

.details-share-btn::after {
  content: "";
  position: absolute;
  right: 0.52rem;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-35%);
  pointer-events: none;
}

.details-share-btn:hover {
  background: #f1f5ff;
  border-color: #9fb0cd;
}

.details-share-btn:focus-visible {
  outline: 2px solid rgba(56, 139, 255, 0.32);
  outline-offset: 1px;
}

.details-close {
  min-width: 64px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--layout-border-strong);
  background: #ffffff;
  color: #243b64;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 0.62rem;
}

.details-close:hover {
  background: #f1f5ff;
  border-color: #9fb0cd;
  filter: none;
}

.details-close:focus-visible {
  outline: 2px solid rgba(56, 139, 255, 0.32);
  outline-offset: 1px;
}

.details-list {
  display: grid;
  gap: 0.16rem;
}

.detail-item {
  display: grid;
  grid-template-columns: minmax(84px, max-content) minmax(0, 1fr);
  gap: 0.52rem;
  align-items: start;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.detail-item.is-context-muted {
  opacity: 0.48;
}

.detail-years {
  font-variant-numeric: tabular-nums;
  color: #2f3d59;
  font-size: 1em;
}

.detail-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
  font-size: 1em;
}

.detail-name.vacant {
  color: #8c2430;
}

.detail-decade-divider {
  grid-column: 1 / -1;
  width: min(var(--detail-divider-width, 48ch), 95%);
  justify-self: start;
  border-top: 1px solid rgba(86, 111, 154, 0.35);
  margin: 0.04rem 0;
}

.details-source-note {
  grid-column: 1 / -1;
  margin: 0.64rem 0 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #5a6a86;
}

.details-source-note a {
  color: #2f5fa1;
  text-decoration: underline;
}

.details-did-you-know {
  display: none;
}

.details-did-you-know-title {
  margin: 0 0 0.32rem;
  color: #243a62;
}

.details-did-you-know-copy {
  margin: 0 0 0.44rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #425a7f;
}

.details-did-you-know-copy strong {
  color: #1f355c;
  font-weight: 700;
}

.details-did-you-know-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: #2f5fa1;
  text-decoration: underline;
}

.segment {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, outline-color 120ms ease, background-color 120ms ease;
}

.segment.with-label {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: rgba(15, 24, 40, 0.92);
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.segment:hover {
  z-index: 2;
  transform: translateY(-1px);
  outline: 2px solid rgba(35, 73, 138, 0.9);
  outline-offset: -1px;
  filter: saturate(1.2) brightness(1.08);
}

.segment:not(.vacant):hover {
  filter: none;
}

.segment.vacant {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(120, 128, 142, 0.25) 0,
      rgba(120, 128, 142, 0.25) 4px,
      rgba(236, 239, 244, 0.95) 4px,
      rgba(236, 239, 244, 0.95) 10px
    );
}

.segment.dimmed {
  background: #eceff4 !important;
  border-color: transparent;
  box-shadow: none;
  color: rgba(98, 108, 124, 0.85);
}

.segment.dimmed:hover {
  background: #eef2f8 !important;
  outline: 2px solid rgba(120, 132, 151, 0.75);
  outline-offset: -1px;
  filter: none;
}

.segment.search-hit {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.segment.search-hit-muted {
  opacity: 0.38;
}

.no-results {
  border: 1px dashed var(--panel-border);
  border-radius: 10px;
  padding: 1rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.tooltip {
  position: fixed;
  z-index: 60;
  max-width: 330px;
  background: #111c30;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(9, 16, 29, 0.35);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-action-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.86);
  opacity: 0.92;
  letter-spacing: 0;
}

.tooltip-paragraph strong {
  display: block;
  margin-bottom: 0.08rem;
}

.tooltip-paragraph + .tooltip-paragraph {
  margin-top: 0.34rem;
}

.kpi-info-modal[hidden] {
  display: none;
}

.kpi-info-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.kpi-info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 28, 48, 0.5);
  backdrop-filter: blur(2px);
}

.kpi-info-modal-dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: min(80vh, 720px);
  overflow: auto;
  border: 1px solid rgba(151, 166, 195, 0.5);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 22px 48px rgba(17, 28, 48, 0.22);
  padding: 1rem;
}

.kpi-info-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kpi-info-modal-title {
  margin: 0;
}

.kpi-info-modal-close {
  flex: 0 0 auto;
  border: 1px solid #c7d3e9;
  border-radius: 999px;
  background: #f7f9fc;
  color: #314d86;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.kpi-info-modal-body {
  color: #32415f;
  font-size: 0.92rem;
  line-height: 1.55;
}

.kpi-info-modal-body .tooltip-paragraph strong {
  margin-bottom: 0.15rem;
  color: #243c74;
}

/* Modern Flat Reskin */
:root {
  --ink: #243c74;
  --ink-soft: #4e638f;
  --panel: #f5f8fd;
  --panel-border: #d8e0ef;
  --shadow: 0 1px 2px rgba(26, 45, 82, 0.08);
}

body {
  background: #eef2f8;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  padding: 1rem var(--page-gutter);
}

h1 {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 400;
  color: #2b467f;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.heading-tagline {
  color: #5a6f9c;
}

.credit {
  color: #3f5790;
  white-space: nowrap;
}

.controls,
.trend-details,
.street-context,
.street-context-details,
.timeline-guide,
.shop-row,
.story-presets,
.meta {
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.controls {
  background: #f8fbff;
  border-radius: 10px;
  padding: 1rem;
  column-gap: 0.95rem;
}

.meta {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-top: 0.55rem;
  padding-inline: 0.2rem;
}

#meta {
  color: #2f4a84;
}

.trend-details {
  background: #f8fbff;
  border-radius: 10px;
}

.street-context {
  background: transparent;
}

.street-context-details {
  background: #f8fbff;
  border-radius: 10px;
}

.trend-details > summary,
.street-context-details > summary {
  color: #314d86;
}

input:not([type="range"]),
select {
  border: 1px solid #bccbe3;
  background: #fff;
  color: #203761;
  border-radius: 8px;
}

.search-tokenizer {
  border: 1px solid #bccbe3;
  background: #fff;
  border-radius: 8px;
}

.search-tokenizer:focus-within {
  border-color: #3e74cd;
  box-shadow: 0 0 0 2px rgba(62, 116, 205, 0.15);
}

.reset-link,
.inline-link,
.panel-disclosure {
  color: #3a6fc8;
}

.slider-track-base {
  background: #d9e1ef;
}

.slider-track-active {
  background: #2f68c8;
  box-shadow: none;
}

.slider-stack input[type="range"]::-webkit-slider-thumb,
.slider-stack input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 0;
  background: #2f68c8;
  box-shadow: none;
}

.slider-bubble {
  border-color: #b7c7e4;
  color: #2a4479;
  box-shadow: none;
}

.timeline-guide {
  background: #f1f5fc;
  border-radius: 8px;
  border-bottom: 1px solid #d7e0ee;
}

.guide-rail-base {
  background: #d7e0ee;
}

.guide-rail-active {
  background: #2f68c8;
  box-shadow: none;
}

.shop-row {
  background: #ffffff;
  border-radius: 8px;
}

.shop-row.street-target {
  box-shadow: 0 0 0 2px rgba(47, 104, 200, 0.35), var(--shadow);
}

.shop-label {
  background: #ffffff;
  border-right: 1px solid #dbe3f0;
}

.track-wrap {
  background: #f8faff;
}

.year-axis {
  opacity: 0.11;
}

.segment {
  border: 0;
  box-shadow: none;
  border-radius: 4px;
}

.segment.search-hit {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.tooltip {
  background: #253f76;
}

@media (max-width: 760px) {
  .survey-controls {
    justify-content: flex-start;
  }

  .survey-zoom-toggle {
    width: 100%;
  }

  .survey-stage {
    padding: 0.5rem;
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    height: auto;
    max-height: none;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-shell.is-sidebar-collapsed .side-panel {
    padding: 1rem 0.5rem 0.5rem;
  }

  body {
    padding: 1rem;
  }

  .timeline {
    --label-col-width: 132px;
  }

  .guide-track {
    height: 30px;
  }

  .guide-label {
    font-size: 0.62rem;
    bottom: 11px;
  }

  .shop-row {
    grid-template-columns: var(--label-col-width) 1fr;
  }

  .detail-item {
    grid-template-columns: 74px 1fr;
    font-size: 0.68rem;
  }

  .track-wrap {
    min-height: 46px;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .controls-main {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-control,
  .scope-control,
  .current-status-control,
  .change-intensity-control,
  .age-filter {
    width: 100%;
    grid-column: auto;
  }

  .top-filters {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    border-top: 1px solid rgba(32, 40, 58, 0.12);
    padding-top: 0.5rem;
    gap: 0.5rem;
  }

  .timespan-filter {
    --timespan-width: 100%;
    min-width: 0;
    grid-column: auto;
  }

  .timespan-slider-row {
    justify-content: stretch;
  }

  .slider-control {
    width: 100%;
  }

  .toggle {
    padding-top: 0.2rem;
  }

  .toggle-filter {
    grid-column: auto;
    gap: 0.25rem;
  }

  .meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .meta-main {
    width: 100%;
  }

  .timeline-zoom-right {
    justify-content: flex-start;
  }

  .street-lane {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Admin Dashboard Skin */
:root {
  --ink: #273b6a;
  --ink-soft: #7a879f;
  --panel: #ffffff;
  --panel-border: #e5ebf4;
  --shadow: 0 1px 3px rgba(24, 39, 75, 0.08);
}

body {
  background: #f3f5f9;
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
}

h1 {
  color: #2e4376;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.heading-tagline {
  color: #5f7194;
}

.credit {
  color: #6e7f9e;
  font-weight: 500;
}

.controls,
.trend-details,
.street-context-details,
.timeline-guide,
.shop-row {
  background: #fff;
  border: 1px solid #e5ebf4;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(24, 39, 75, 0.08);
}

.side-panel {
  background: #fff;
  border-color: #e5ebf4;
}

.controls {
  column-gap: 1rem;
  padding: 1rem;
}

.meta {
  background: transparent;
  border: 0;
  box-shadow: none;
}

input:not([type="range"]),
select {
  border: 1px solid #c8d4e7;
  border-radius: 8px;
  background: #fff;
  color: #27406f;
}

.search-tokenizer {
  border: 1px solid #c8d4e7;
  border-radius: 8px;
  background: #fff;
}

.search-tokenizer:focus-within {
  border-color: #3f7ee8;
  box-shadow: 0 0 0 2px rgba(63, 126, 232, 0.14);
}

.search-suggestion.active,
.search-suggestion:hover {
  background: #edf3ff;
}

.slider-track-base,
.guide-rail-base {
  background: #dde5f1;
}

.slider-track-active,
.guide-rail-active {
  background: #2f7dee;
}

.slider-stack input[type="range"]::-webkit-slider-thumb,
.slider-stack input[type="range"]::-moz-range-thumb {
  background: #2f7dee;
}

.slider-bubble {
  border-color: #c1d0e8;
  color: #2a4479;
}

.reset-link,
.inline-link,
.panel-disclosure {
  color: #3d77dc;
}

.sort-control select {
  border-color: #c8d4e7;
}

.zoom-icon {
  border-color: #7f8fae;
}

.zoom-icon::before,
.zoom-icon::after {
  background-color: #7f8fae;
}

#meta {
  color: #2f4a84;
}

.shop-label {
  background: #fbfcff;
  border-right-color: #e2e8f2;
}

.track-wrap {
  background: #f7f9fd;
}

.street-lane-cells {
  border-color: #d8e1f0;
  background: #f4f7fc;
}

.street-cell {
  background: #e2e9f4;
  color: rgba(35, 54, 92, 0.82);
}

.street-cell.is-dim {
  background: #eef2f8;
  color: rgba(89, 103, 131, 0.55);
}

.tooltip {
  background: #243a6a;
}

/* Flat Mode: remove all shadows */
*,
*::before,
*::after {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Dark Theme */
html[data-theme="dark"] body {
  background: #171f34;
  color: #d6def0;
}

html[data-theme="dark"] h1 {
  color: #dce6ff;
}

html[data-theme="dark"] .heading-tagline {
  color: #c7d6f2;
}

html[data-theme="dark"] .credit,
html[data-theme="dark"] .credit a {
  color: #c4d3f2;
}

html[data-theme="dark"] .controls,
html[data-theme="dark"] .story-presets,
html[data-theme="dark"] .trend-details,
html[data-theme="dark"] .street-context-details,
html[data-theme="dark"] .timeline-guide,
html[data-theme="dark"] .shop-row {
  background: #222c48;
  border-color: #313d61;
}

html[data-theme="dark"] .side-panel {
  background: #222c48;
  border-color: #313d61;
}

html[data-theme="dark"] .side-panel-toggle {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .mobile-back-to-top {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .mobile-quick-action-btn,
html[data-theme="dark"] .mobile-back-to-top {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .timeline-action-btn {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .side-panel-title {
  color: #f2f6ff;
}

html[data-theme="dark"] .section-heading-h2 {
  color: #f2f6ff;
}

html[data-theme="dark"] .meta-summary-text {
  color: #c7d6f2;
}

html[data-theme="dark"] .side-panel-divider {
  background: rgba(198, 214, 244, 0.22);
}

html[data-theme="dark"] input:not([type="range"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .search-tokenizer {
  background: #1c2540;
  border-color: #3b476a;
  color: #e4ecff;
}

html[data-theme="dark"] .search-tokenizer:focus-within {
  border-color: #2f8cff;
}

html[data-theme="dark"] #searchTextInput::placeholder {
  color: #bdd0f0;
  opacity: 1;
}

html[data-theme="dark"] .search-note {
  color: #aebfdf;
}

html[data-theme="dark"] .search-suggestion {
  color: #1f3a66;
}

html[data-theme="dark"] .search-suggestions {
  background: #f7faff;
  border-color: #8ea7d1;
}

html[data-theme="dark"] .search-suggestion:hover,
html[data-theme="dark"] .search-suggestion.active {
  background: #dfe9fb;
  color: #122b50;
}

html[data-theme="dark"] .slider-track-base,
html[data-theme="dark"] .guide-rail-base {
  background: #3a476d;
}

html[data-theme="dark"] .slider-track-active,
html[data-theme="dark"] .guide-rail-active,
html[data-theme="dark"] .slider-stack input[type="range"]::-webkit-slider-thumb,
html[data-theme="dark"] .slider-stack input[type="range"]::-moz-range-thumb {
  background: #34a6ff;
}

html[data-theme="dark"] .slider-bubble {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .reset-link,
html[data-theme="dark"] .inline-link,
html[data-theme="dark"] .panel-disclosure {
  color: #7ab6ff;
}

html[data-theme="dark"] .trend-scale-toggle {
  border-color: #3b476a;
  background: #1b2440;
}

html[data-theme="dark"] .trend-scale-btn {
  color: #c7d6f2;
}

html[data-theme="dark"] .trend-scale-btn + .trend-scale-btn {
  border-left-color: #3b476a;
}

html[data-theme="dark"] .trend-scale-btn.is-active {
  background: #34a6ff;
  color: #ffffff;
}

html[data-theme="dark"] #meta,
html[data-theme="dark"] .sort-control,
html[data-theme="dark"] .zoom-control,
html[data-theme="dark"] .toggle,
html[data-theme="dark"] .meta-vacancy,
html[data-theme="dark"] .guide-label,
html[data-theme="dark"] .slider-tick-label,
html[data-theme="dark"] .street-lane-label,
html[data-theme="dark"] #streetContextSummary {
  color: #d3e0f8;
}

html[data-theme="dark"] .controls label > span,
html[data-theme="dark"] .filter-head > span,
html[data-theme="dark"] .toggle-head,
html[data-theme="dark"] .field-head > span,
html[data-theme="dark"] .sort-control > span {
  color: #f2f6ff;
}

html[data-theme="dark"] .trend-details > summary,
html[data-theme="dark"] .street-context-details > summary {
  color: #f2f6ff;
}

html[data-theme="dark"] .shop-label {
  background: #1d2743;
  border-right-color: #313d61;
}

html[data-theme="dark"] .shop-label small,
html[data-theme="dark"] .current-business-link {
  color: #edf3ff;
}

html[data-theme="dark"] .label-change-count {
  color: #b9c9e8;
}

html[data-theme="dark"] .current-business-link:hover {
  color: #ffffff;
}

html[data-theme="dark"] .track-wrap {
  background: #1b2440;
}

html[data-theme="dark"] .year-axis {
  opacity: 0.2;
}

html[data-theme="dark"] .segment.dimmed {
  background: #3a4566 !important;
  color: #aebad6;
}

html[data-theme="dark"] .segment:hover {
  outline-color: rgba(183, 215, 255, 0.95);
  filter: saturate(1.18) brightness(1.16);
}

html[data-theme="dark"] .segment.dimmed:hover {
  background: #465375 !important;
  outline-color: rgba(150, 173, 212, 0.9);
}

html[data-theme="dark"] .street-lane-cells {
  background: #1b2440;
  border-color: #313d61;
}

html[data-theme="dark"] .street-cell {
  background: #2b3658;
  color: #c4d2ee;
}

html[data-theme="dark"] .street-cell.is-dim {
  background: #27314f;
  color: #8f9dbf;
}

html[data-theme="dark"] .street-cell.is-filtered-out {
  background: #252f49;
  color: rgba(181, 194, 218, 0.5);
  opacity: 0.6;
}

html[data-theme="dark"] .street-junction-flag,
html[data-theme="dark"] .street-junction-flag::after {
  background: #4a5f8f;
  color: #d9e5ff;
}

html[data-theme="dark"] .zoom-icon {
  border-color: #d2e6ff;
}

html[data-theme="dark"] .zoom-icon::before,
html[data-theme="dark"] .zoom-icon::after {
  background-color: #d2e6ff;
}

html[data-theme="dark"] .zoom-icon-in {
  background-color: transparent;
  background-image: linear-gradient(#d2e6ff, #d2e6ff);
  background-position: center;
  background-size: 2px 8px;
  background-repeat: no-repeat;
}

html[data-theme="dark"] .pin-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M2 1h8v13l-4-2.5L2 14V1z' fill='none' stroke='%23d2e6ff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
  opacity: 1;
  filter: none;
}

html[data-theme="dark"] .pin-btn[aria-pressed="true"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M2 1h8v13l-4-2.5L2 14V1z' fill='%23d2e6ff'/%3E%3C/svg%3E");
}

html[data-theme="dark"] .details-close {
  border-color: var(--layout-border-strong);
  color: #dbe6fa;
  background: #242c38;
}

html[data-theme="dark"] .details-map-link {
  border-color: var(--layout-border-strong);
  color: #dbe6fa;
  background: #242c38;
}

html[data-theme="dark"] .details-share-btn {
  border-color: var(--layout-border-strong);
  color: #dbe6fa;
  background: #242c38;
}

html[data-theme="dark"] .details-close:hover {
  border-color: #6f82a3;
  color: #ffffff;
  background: #2a3444;
}

html[data-theme="dark"] .details-map-link:hover {
  border-color: #6f82a3;
  color: #ffffff;
  background: #2a3444;
}

html[data-theme="dark"] .details-share-btn:hover {
  border-color: #6f82a3;
  color: #ffffff;
  background: #2a3444;
}

html[data-theme="dark"] .details-foot {
  background: rgba(24, 33, 52, 0.96);
}

html[data-theme="dark"] .details-source-note {
  color: #9fb1d4;
}

html[data-theme="dark"] .details-source-note a {
  color: #b8d3ff;
}

html[data-theme="dark"] .details-did-you-know-title {
  color: #d9e7ff;
}

html[data-theme="dark"] .details-did-you-know-copy {
  color: #b8cbe9;
}

html[data-theme="dark"] .details-did-you-know-copy strong {
  color: #e6f0ff;
}

html[data-theme="dark"] .details-did-you-know-link {
  color: #b8d3ff;
}

html[data-theme="dark"] .shop-row.expanded.has-did-you-know .details-did-you-know {
  border-color: var(--layout-border);
  background: rgba(43, 54, 80, 0.52);
}

html[data-theme="dark"] .tooltip {
  background: #0f1529;
  border: 1px solid #3b476a;
  color: #dbe6ff;
}

/* Atlassian-style design token pass (layout-preserving) */
:root {
  --ds-bg: #f4f5f7;
  --ds-surface: #ffffff;
  --ds-surface-muted: #fafbfc;
  --ds-border: #dfe1e6;
  --ds-border-strong: #c1c7d0;
  --ds-text: #172b4d;
  --ds-text-subtle: #5e6c84;
  --ds-link: #0c66e4;
  --ds-link-hover: #0055cc;
  --ds-focus: #388bff;
  --ds-selected: #0c66e4;
  --ds-selected-soft: #e9f2ff;
  --ds-success: #22a06b;
  --ds-danger: #c9372c;
  --ds-radius-sm: 6px;
  --ds-radius-md: 8px;
  --ds-radius-lg: 8px;
  --ds-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

body {
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-font);
}

h1,
.section-heading-h2,
.timeline-zoom-title.section-heading-h2,
.side-panel-title.section-heading-h2 {
  font-family: var(--ds-font);
  color: var(--ds-text);
  letter-spacing: 0;
}

.heading-tagline,
.credit,
.meta-summary-text,
.search-note,
.sort-control,
.zoom-control,
.toggle,
.meta-vacancy,
.label-change-count {
  color: var(--ds-text-subtle);
}

.controls,
.side-panel,
.story-presets,
.trend-details,
.street-context-details,
.timeline-guide,
.shop-row {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
}

.side-panel-divider {
  background: var(--ds-border);
}

input:not([type="range"]),
textarea,
select,
button,
.search-tokenizer {
  font-family: var(--ds-font);
  color: var(--ds-text);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface);
}

input:not([type="range"]):focus,
textarea:focus,
select:focus,
button:focus,
.search-tokenizer:focus-within {
  outline: 2px solid rgba(56, 139, 255, 0.22);
  outline-offset: 0;
  border-color: var(--ds-focus);
  box-shadow: none;
}

.search-tokenizer {
  background: var(--ds-surface);
}

#searchTextInput::placeholder {
  color: #6b778c;
}

.search-suggestions {
  border: 1px solid var(--ds-border-strong);
  background: var(--ds-surface);
}

.search-suggestion {
  color: var(--ds-text);
}

.search-suggestion:hover,
.search-suggestion.active {
  background: var(--ds-selected-soft);
  color: var(--ds-text);
}

.reset-link,
.inline-link,
.panel-disclosure,
.credit a,
.current-business-link {
  color: var(--ds-link);
}

.reset-link:hover,
.inline-link:hover,
.panel-disclosure:hover,
.credit a:hover,
.current-business-link:hover {
  color: var(--ds-link-hover);
}

.slider-track-base,
.guide-rail-base {
  background: #dcdfe4;
}

.slider-track-active,
.guide-rail-active {
  background: var(--ds-selected);
}

.slider-stack input[type="range"]::-webkit-slider-thumb,
.slider-stack input[type="range"]::-moz-range-thumb {
  background: var(--ds-selected);
  border: 0;
}

.slider-bubble {
  border-color: var(--ds-border-strong);
  color: var(--ds-text);
}

.trend-scale-toggle {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface-muted);
  border-radius: var(--ds-radius-sm);
  padding: 2px;
  gap: 0;
  overflow: hidden;
}

.trend-scale-btn {
  appearance: none;
  color: var(--ds-text-subtle);
  font-family: var(--ds-font);
  font-size: 0.76rem;
  border: 0;
  border-radius: 0;
  margin: 0;
  background: transparent;
  line-height: 1.2;
}

.trend-scale-btn:first-child {
  border-radius: calc(var(--ds-radius-sm) - 2px) 0 0 calc(var(--ds-radius-sm) - 2px);
}

.trend-scale-btn:last-child {
  border-radius: 0 calc(var(--ds-radius-sm) - 2px) calc(var(--ds-radius-sm) - 2px) 0;
}

.trend-scale-btn + .trend-scale-btn {
  border-left: 1px solid var(--ds-border);
}

.trend-scale-btn.is-active {
  background: var(--ds-selected);
  color: #fff;
}

.sort-control select,
.scope-control select,
.current-status-control select,
.change-intensity-control select {
  background-color: var(--ds-surface);
}

.sort-control {
  font-weight: 500;
}

.sort-control select {
  height: 34px;
  font-size: 0.82rem;
  font-weight: 400;
  border-radius: var(--ds-radius-md);
}

.zoom-icon {
  border-color: #758195;
}

.zoom-icon::before,
.zoom-icon::after {
  background-color: #758195;
}

.shop-label {
  background: var(--ds-surface);
  border-right-color: var(--ds-border);
}

.track-wrap {
  background: linear-gradient(to right, #fbfcfe, #f8fafd);
}

.tooltip {
  background: #172b4d;
  color: #fff;
  border: 1px solid #253858;
}

html[data-theme="dark"] {
  --ds-bg: #1d2125;
  --ds-surface: #282e33;
  --ds-surface-muted: #22272b;
  --ds-border: #3c434a;
  --ds-border-strong: #4c5866;
  --ds-text: #dee4ea;
  --ds-text-subtle: #b6c2cf;
  --ds-link: #85b8ff;
  --ds-link-hover: #cce0ff;
  --ds-focus: #579dff;
  --ds-selected: #1f6feb;
  --ds-selected-soft: #2c3e5d;
}

html[data-theme="dark"] body {
  background: var(--ds-bg);
  color: var(--ds-text);
}

html[data-theme="dark"] .controls,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .story-presets,
html[data-theme="dark"] .trend-details,
html[data-theme="dark"] .street-context-details,
html[data-theme="dark"] .timeline-guide,
html[data-theme="dark"] .shop-row {
  background: var(--ds-surface);
  border-color: var(--ds-border);
}

html[data-theme="dark"] .theme-segmented {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface-muted);
}

html[data-theme="dark"] .theme-segment-btn {
  color: var(--ds-text-subtle);
}

html[data-theme="dark"] .theme-segment-btn.is-active {
  background: var(--ds-selected);
  color: #fff;
}

html[data-theme="dark"] .section-heading-h2,
html[data-theme="dark"] .timeline-zoom-title.section-heading-h2,
html[data-theme="dark"] .side-panel-title.section-heading-h2,
html[data-theme="dark"] h1,
html[data-theme="dark"] .controls label > span,
html[data-theme="dark"] .field-head > span,
html[data-theme="dark"] .filter-head > span,
html[data-theme="dark"] .toggle-head,
html[data-theme="dark"] .sort-control > span {
  color: var(--ds-text);
}

html[data-theme="dark"] input:not([type="range"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] button,
html[data-theme="dark"] .search-tokenizer {
  background: var(--ds-surface-muted);
  border-color: var(--ds-border-strong);
  color: var(--ds-text);
}

html[data-theme="dark"] #searchTextInput::placeholder {
  color: #9fadbc;
}

html[data-theme="dark"] .search-suggestions {
  background: var(--ds-surface-muted);
  border-color: var(--ds-border-strong);
}

html[data-theme="dark"] .search-suggestion {
  color: var(--ds-text);
}

html[data-theme="dark"] .search-suggestion:hover,
html[data-theme="dark"] .search-suggestion.active {
  background: var(--ds-selected-soft);
  color: #e9f2ff;
}

html[data-theme="dark"] .slider-track-base,
html[data-theme="dark"] .guide-rail-base {
  background: #404954;
}

html[data-theme="dark"] .slider-track-active,
html[data-theme="dark"] .guide-rail-active,
html[data-theme="dark"] .slider-stack input[type="range"]::-webkit-slider-thumb,
html[data-theme="dark"] .slider-stack input[type="range"]::-moz-range-thumb,
html[data-theme="dark"] .trend-scale-btn.is-active {
  background: var(--ds-selected);
}

html[data-theme="dark"] .zoom-icon {
  border-color: #a8b3c5;
}

html[data-theme="dark"] .zoom-icon::before,
html[data-theme="dark"] .zoom-icon::after {
  background-color: #a8b3c5;
}

html[data-theme="dark"] .track-wrap {
  background: linear-gradient(to right, #2a3036, #262c32);
}

html[data-theme="dark"] .panel-disclosure:hover {
  background: rgba(193, 199, 208, 0.12);
}

html[data-theme="dark"] .panel-disclosure-chevron {
  color: #b6c2cf;
}

/* Jira-like main layout skin (structure preserved) */
:root {
  --layout-bg: #ffffff;
  --layout-surface: #ffffff;
  --layout-muted: #f7f8fa;
  --layout-border: #e6eaf0;
  --layout-border-strong: #c6cfdb;
  --layout-title: #172b4d;
  --layout-text: #344563;
}

body {
  background: var(--layout-bg);
  color: var(--layout-text);
  padding: 0 var(--page-gutter) 1rem;
}

.page-header {
  background: #f8fafd;
  border-bottom: 1px solid var(--layout-border);
  padding-top: 0.85rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.2rem;
  border-radius: 4px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.top-nav {
  display: flex;
  align-items: end;
  gap: 0.2rem;
  margin: 0.45rem 0 0;
  border-bottom: 1px solid var(--layout-border);
}

.top-nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5e6c84;
  font-family: var(--ds-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  padding: 0.38rem 0.58rem 0.48rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  width: auto;
  text-align: center;
}

.top-nav-link:hover {
  color: #172b4d;
}

.top-nav-link.is-active {
  color: #0c66e4;
  border-bottom-color: #0c66e4;
}

.view-pane {
  display: none;
}

.view-pane.is-active {
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-view {
  margin-top: 0.58rem;
  max-width: 1160px;
  margin-inline: auto;
}

.dashboard-shell {
  display: grid;
  gap: 1rem;
}

.dashboard-intro-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.dashboard-intro-copy {
  display: grid;
  gap: 0.4rem;
}

.dashboard-intro-copy p {
  margin: 0;
  max-width: 68ch;
}

.survey-view {
  margin-top: 0;
}

.document-view {
  margin-top: 0.58rem;
  max-width: 1160px;
  margin-inline: auto;
}

.about-view {
  margin-top: 0.58rem;
  max-width: 1160px;
  margin-inline: auto;
}

.document-shell {
  display: grid;
}

.about-shell {
  display: grid;
}

.document-card {
  display: grid;
  gap: 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.about-card {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1.1rem;
  align-items: start;
}

.about-copy-column {
  display: grid;
  gap: 0.9rem;
}

.about-copy {
  display: grid;
  gap: 0.3rem;
}

.about-copy p {
  margin: 0.3rem 0 0;
  max-width: 66ch;
  line-height: 1.62;
  color: #32415f;
}

.about-copy-subheading {
  margin: 0.55rem 0 0;
}

.about-media-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  align-content: start;
}

.about-media-card {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(31, 48, 77, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(32, 40, 58, 0.08);
  min-height: 100%;
}

.about-media-card-feature {
  grid-column: 1 / -1;
}

.about-media-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.about-media-title {
  margin: 0.72rem 0.78rem 0;
}

.about-media-caption {
  padding-inline: 0.78rem;
  padding-bottom: 0.78rem;
  color: #52617e;
  line-height: 1.34;
  font-size: 0.9rem;
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.document-copy {
  margin-top: 0.3rem;
}

.document-open-link {
  white-space: nowrap;
}

.document-frame {
  width: 100%;
  min-height: 78vh;
  border: 1px solid rgba(32, 40, 58, 0.14);
  border-radius: 12px;
  background: #ffffff;
}

.document-fallback,
.document-mobile-note {
  margin: 0;
  color: #52617e;
  line-height: 1.5;
}

.document-fallback {
  padding: 1rem;
}

.document-fallback a,
.document-mobile-note a {
  color: #244984;
}

@media (max-width: 760px) {
  .document-card {
    padding: 0.85rem;
  }

  .document-frame {
    min-height: 62vh;
  }
}

.survey-shell {
  display: grid;
  gap: 0;
}

.survey-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
  align-self: stretch;
}

.survey-open-navigator-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
}

.survey-zoom-toggle {
  margin-right: 0.1rem;
}

.survey-zoom-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0;
}

#surveyResetViewBtn {
  align-self: center;
}

.survey-zoom-label {
  white-space: nowrap;
}

.survey-zoom-btn {
  min-width: 94px;
}

.survey-zoom-btn.is-active {
  background: #2f68c8;
  color: #ffffff;
  box-shadow: none;
}

.survey-stage {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.55rem;
}

.survey-stage.is-timeline-mode {
  gap: 0;
}

.survey-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2.4rem;
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0;
  padding: 0.5rem 8rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(32, 40, 58, 0.12);
  backdrop-filter: blur(4px);
}

.survey-photo-count {
  display: inline-block;
  color: #314663;
  white-space: nowrap;
}

.survey-mode-toggle {
  margin-right: 0.1rem;
}

.survey-mode-btn {
  min-width: 112px;
}

.survey-mode-btn.is-active {
  background: #2f68c8;
  color: #ffffff;
  box-shadow: none;
}

.survey-mobile-mode-toggle[hidden] {
  display: none !important;
}

.survey-mobile-mode-btn {
  min-width: 108px;
}

.survey-sort-control {
  padding: 0;
}

.survey-sort-control[hidden] {
  display: none !important;
}

.survey-sort-control select {
  min-width: 220px;
}

#surveyAnnualYearWrap select {
  min-width: 96px;
}

.survey-annual-current-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  user-select: none;
}

.survey-annual-current-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2f68c8;
}

.survey-annual-current-toggle span {
  white-space: nowrap;
}

.survey-annual-current-label {
  color: #364865;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
}

.survey-change-filter-control select {
  min-width: 112px;
}

.survey-viewport {
  position: relative;
  min-height: 72vh;
  max-height: 78vh;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 220ms ease, background-color 220ms ease;
}

.survey-viewport.is-timeline-mode {
  background: #f3f5f9;
  border-top: 0;
}

.survey-stage {
  position: relative;
}

.survey-viewport.is-dragging {
  cursor: grabbing;
}

.survey-viewport.is-zoom-transitioning {
  box-shadow: inset 0 0 0 1px rgba(47, 104, 200, 0.18), 0 10px 28px rgba(47, 104, 200, 0.08);
}

.survey-viewport.is-zoom-transitioning .survey-canvas {
  animation: survey-zoom-settle 280ms ease;
}

.survey-viewport.is-dragging .survey-thumb,
.survey-viewport.is-dragging .survey-address-label,
.survey-viewport.is-dragging .survey-timeline-address {
  pointer-events: none;
}

.survey-canvas {
  position: relative;
}

.survey-canvas-mobile {
  width: 100%;
  padding: 12px;
}

.survey-mobile-list {
  display: grid;
  gap: 8px;
}

.survey-mobile-row {
  position: relative;
}

.survey-mobile-label {
  appearance: none;
  width: 100%;
  border: 0;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}

.survey-mobile-label .row-disclosure {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.survey-mobile-label small {
  margin-top: 4px;
}

.survey-mobile-details {
  padding: 8px 12px 12px;
  background: rgba(252, 253, 255, 0.95);
}

.survey-mobile-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.survey-mobile-year-grid {
  grid-template-columns: 1fr;
}

.survey-mobile-thumb {
  position: relative;
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  min-height: 0;
  height: auto;
  border-radius: 4px;
}

.survey-mobile-thumb img {
  object-fit: cover;
}

.survey-mobile-thumb-label {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #465b7f;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.survey-mobile-thumb.is-mobile-compact-state {
  min-height: 0;
  aspect-ratio: auto;
  height: 64px;
  border-radius: 6px;
}

.survey-mobile-thumb.is-mobile-compact-state .survey-thumb-status {
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 16px);
  padding: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}

.survey-mobile-thumb.is-mobile-compact-state .survey-thumb-status-name {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  text-align: center;
}

.survey-mobile-thumb.is-mobile-compact-state .survey-thumb-status-cta {
  display: none;
}

.survey-mobile-thumb.is-mobile-compact-state .survey-thumb-caption {
  font-size: 0.68rem;
  padding: 0.18rem 0.24rem;
}

.survey-mobile-year-grid .survey-mobile-thumb {
  min-height: 96px;
}

.survey-mobile-year-grid .survey-thumb-caption {
  left: 0;
  right: 0;
}

.survey-canvas-annual {
  width: 100%;
  padding: 1rem;
}

.survey-annual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.5rem;
  align-items: start;
}

.survey-annual-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(195, 208, 228, 0.95);
  border-radius: 2px;
  overflow: hidden;
  background: #eef3fb;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
}

.survey-annual-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.survey-annual-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(180deg, transparent, rgba(10, 17, 30, 0.88));
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.survey-panpad {
  position: relative;
  flex: 0 0 auto;
  align-self: stretch;
  display: grid;
  justify-items: center;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 132px;
  min-height: 132px;
  padding: 0.5rem;
  border: 1px solid rgba(173, 189, 216, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.survey-panpad[hidden] {
  display: none !important;
}

.survey-panpad-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: auto;
}

.survey-pan-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  justify-content: center;
  padding: 0;
  border-color: #274f8f;
  background: #274f8f;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
}

#surveyPanUpBtn,
#surveyPanDownBtn {
  grid-column: 1 / -1;
  width: 36px;
  justify-self: center;
}

.survey-panpad-row .survey-pan-btn {
  width: 36px;
}

.survey-pan-btn:hover {
  background: #1f4277;
  border-color: #1f4277;
}

.survey-canvas-timeline {
  background: transparent;
}

body.survey-lightbox-open {
  overflow: hidden;
}

.survey-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
}

.survey-lightbox[hidden] {
  display: none !important;
}

.survey-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 36, 0.82);
}

.survey-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(94vw, 1400px);
  max-height: 92vh;
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(251, 253, 255, 0.98);
  box-shadow: 0 24px 64px rgba(13, 23, 40, 0.34);
}

.survey-lightbox-toolbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 32px;
  gap: 1rem;
}

.survey-lightbox-actions {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.survey-lightbox-inline-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--layout-border-strong);
  border-radius: 6px;
  background: #fff;
  color: #1f5fbf;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  min-height: 32px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.survey-lightbox-inline-btn:hover {
  background: #f3f7ff;
  border-color: #94abd2;
  text-decoration: none;
}

.survey-lightbox-inline-btn:visited {
  color: #1f5fbf;
  text-decoration: none;
}

.survey-annual-tile.is-non-current {
  filter: grayscale(0.92) saturate(0.35);
  opacity: 0.32;
}

.survey-annual-tile.is-non-current:hover,
.survey-annual-tile.is-non-current:focus-visible {
  opacity: 0.56;
}

.survey-lightbox-address-option:hover {
  background: #edf3ff;
}

.survey-lightbox-close {
  justify-self: end;
  border: 1px solid var(--layout-border-strong);
  border-radius: 8px;
  background: #fff;
  color: #1f5fbf;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.survey-lightbox-close > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform: translateY(-1px);
}

.survey-lightbox-close:hover {
  background: #f3f7ff;
  border-color: #94abd2;
}

.survey-lightbox-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.survey-lightbox-close:disabled:hover {
  background: #fff;
  border-color: var(--layout-border-strong);
}

.survey-lightbox-title-wrap {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(860px, calc(100% - 56px));
  text-align: left;
}

.survey-lightbox-title {
  position: static;
  transform: none;
  text-align: left;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

.survey-lightbox-note {
  color: #657b9f;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
}

.survey-lightbox-timeline-overlay {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-left: 1px solid rgba(188, 203, 227, 0.9);
  background: rgba(253, 254, 255, 0.97);
  backdrop-filter: blur(6px);
  box-shadow: -12px 0 28px rgba(32, 49, 80, 0.12);
  z-index: 2;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 190ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.survey-lightbox-timeline-overlay[hidden] {
  display: none !important;
}

.survey-lightbox-timeline-overlay.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.survey-lightbox-timeline-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.survey-lightbox-timeline-overlay-title {
  letter-spacing: 0.01em;
  text-transform: none;
}

.survey-lightbox-timeline-overlay-list {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  margin-top: 0;
  padding-right: 0.25rem;
  align-content: start;
}

.survey-lightbox-timeline-item {
  outline: none;
  cursor: pointer;
}

.survey-lightbox-timeline-item:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(47, 104, 200, 0.38);
  border-radius: 4px;
}

.survey-lightbox-stage {
  position: relative;
  overflow: auto;
  max-height: calc(92vh - 84px);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(238, 244, 252, 0.94), rgba(247, 250, 255, 0.98));
  display: grid;
  place-items: center;
}

.survey-lightbox-stage img {
  display: block;
  width: 100%;
  height: auto;
  max-width: min(100%, 1200px);
  max-height: calc(92vh - 120px);
  object-fit: contain;
  margin: 0 auto;
}

.survey-lightbox-empty-state {
  width: 100%;
  min-height: calc(92vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.survey-lightbox-empty-state[hidden] {
  display: none !important;
}

.survey-lightbox-empty-state > * {
  max-width: 34rem;
  text-align: center;
}

.survey-lightbox-empty-state {
  flex-direction: column;
  gap: 0.5rem;
}

.survey-lightbox-empty-title {
  margin: 0;
  color: #314d86;
}

.survey-lightbox-empty-body {
  margin: 0;
  color: #5f7194;
  font-size: 0.92rem;
  line-height: 1.45;
}

.survey-lightbox-stage-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.8rem 1rem 0.9rem;
  background: linear-gradient(180deg, rgba(11, 17, 28, 0) 0%, rgba(11, 17, 28, 0.72) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.survey-lightbox-stage-meta-text {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  max-width: min(90%, 48rem);
}

.survey-lightbox-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  border: 1px solid var(--layout-border-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  color: #1f5fbf;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  min-height: 32px;
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.survey-lightbox-side-icon {
  font-size: 1rem;
  line-height: 1;
}

.survey-lightbox-side-btn.prev {
  left: 0.75rem;
}

.survey-lightbox-side-btn.next {
  right: 0.75rem;
}

.survey-lightbox-side-btn:hover {
  background: #f3f7ff;
  border-color: #94abd2;
}

.survey-lightbox-side-btn[hidden] {
  display: none !important;
}

.survey-minimap {
  position: absolute;
  right: 0.85rem;
  top: 4.15rem;
  width: 364px;
  padding: 0.55rem;
  border: 1px solid rgba(185, 198, 221, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(27, 44, 76, 0.16);
  backdrop-filter: blur(8px);
  z-index: 4;
}

.survey-minimap-body {
  margin-top: 0.42rem;
}

.survey-minimap.is-collapsed {
  width: auto;
}

.survey-minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.42rem;
  cursor: move;
  user-select: none;
}

.survey-minimap-title {
  color: #3c5478;
  line-height: 1.2;
}

.survey-minimap-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid var(--layout-border-strong);
  border-radius: 6px;
  background: #fff;
  color: #1f5fbf;
  font-size: 1rem;
  font-weight: 600;
  line-height: 32px;
  cursor: pointer;
}

.survey-minimap-toggle:hover {
  background: #f3f7ff;
  border-color: #94abd2;
}

.survey-minimap-content {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.survey-minimap.is-collapsed .survey-minimap-body {
  margin-top: 0;
}

.survey-minimap.is-collapsed .survey-minimap-header {
  margin-bottom: 0;
}

.survey-minimap-content[hidden] {
  display: none !important;
}

.survey-minimap-canvas {
  flex: 1 1 auto;
  position: relative;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(237, 243, 252, 0.96), rgba(245, 248, 253, 0.98));
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.survey-minimap-canvas:active {
  cursor: grabbing;
}

.survey-minimap-grid {
  position: absolute;
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(118, 138, 173, 0.28) 0,
      rgba(118, 138, 173, 0.28) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(118, 138, 173, 0.22) 0,
      rgba(118, 138, 173, 0.22) 1px,
      transparent 1px,
      transparent 14px
    ),
    linear-gradient(180deg, rgba(209, 220, 238, 0.56), rgba(223, 232, 246, 0.5));
}

.survey-minimap-street {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: #42597b;
  transform: translateY(-50%);
}

.survey-minimap-viewport {
  position: absolute;
  border: 2px solid rgba(179, 93, 0, 0.98);
  background: rgba(255, 179, 0, 0.28);
  border-radius: 4px;
  pointer-events: auto;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(255, 244, 204, 0.8);
  cursor: grab;
}

.survey-street-axis {
  position: absolute;
  left: 140px;
  right: 140px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #25344b, #41597b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.survey-street-axis::before {
  content: "Stoke Newington Church Street";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.survey-year-rail {
  position: absolute;
  pointer-events: none;
}

.survey-year-rail.left {
  left: 1rem;
}

.survey-year-rail.right {
  right: 1rem;
}

.survey-year-pill {
  position: absolute;
  width: 3.1rem;
  padding: 0.14rem 0.3rem;
  border-radius: 999px;
  background: rgba(219, 229, 246, 0.9);
  color: #506481;
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
}

.survey-address-col {
  position: absolute;
  pointer-events: none;
}

.survey-address-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  padding: 0.12rem 0.24rem;
  border-radius: 999px;
  border: 1px solid #c9d6ea;
  background: rgba(255, 255, 255, 0.95);
  color: #233856;
  font-size: 0.58rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(44, 67, 101, 0.08);
  z-index: 2;
  outline: none;
  cursor: pointer;
  pointer-events: auto;
}

.survey-address-col.is-selected .survey-address-label {
  background: #172b4d;
  border-color: #172b4d;
  color: #fff;
}

.survey-address-col.is-filtered-out {
  opacity: 0.28;
}

.survey-address-col.is-filtered-out.is-selected {
  opacity: 1;
}

.survey-address-label.is-loaded {
  border-color: rgba(60, 104, 182, 0.28);
  background: rgba(223, 235, 255, 0.96);
  color: #2c5fb5;
  font-weight: 800;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.survey-stack-address {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(99, 113, 137, 0.9);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.survey-stack-address.north {
  transform: translate(-50%, -100%);
}

.survey-stack-address.south {
  transform: translateX(-50%);
}

.survey-junction-label {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 1.7rem;
  padding: 0;
  color: rgba(70, 88, 118, 0.82);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.05;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-align: center;
  pointer-events: none;
}

.survey-junction-label.north {
  transform: translateX(-50%);
  justify-content: flex-end;
  padding-bottom: 0.9rem;
}

.survey-junction-label.south {
  transform: translateX(-50%);
  justify-content: flex-start;
  padding-top: 0.9rem;
}

.survey-thumb {
  position: absolute;
  width: 48px;
  height: 36px;
  border: 1px solid rgba(195, 208, 228, 0.95);
  border-radius: 5px;
  overflow: hidden;
  background: #dfe7f4;
  box-shadow: 0 4px 14px rgba(39, 56, 85, 0.1);
  cursor: pointer;
  outline: none;
  pointer-events: auto;
}

.survey-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(244, 248, 254, 0.94);
  opacity: 0;
  pointer-events: none;
}

.survey-thumb.is-loading::before {
  opacity: 1;
}

.survey-thumb.is-loaded::before,
.survey-thumb.is-vacant-outline::before {
  display: none;
}

.survey-thumb img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #edf2f8;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.survey-thumb.is-loaded img {
  opacity: 1;
}

.survey-thumb-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  width: calc(100% - 8px);
  padding: 0.16rem 0.14rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  color: rgba(64, 82, 113, 0.92);
  font-size: 0.33rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: pre-line;
  box-shadow: 0 1px 4px rgba(58, 74, 103, 0.08);
  pointer-events: none;
  overflow: hidden;
}

.survey-thumb-loader {
  position: absolute;
  inset: 0.3rem;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.32rem 0.22rem 0.62rem;
  border-radius: 4px;
  background: rgba(248, 251, 255, 0.94);
  color: rgba(59, 79, 111, 0.96);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.survey-thumb-spinner {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  border: 2px solid rgba(90, 118, 163, 0.22);
  border-top-color: rgba(56, 103, 191, 0.9);
  animation: survey-thumb-spin 0.8s linear infinite;
}

.survey-thumb-loader-text {
  font-size: 0.36rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.survey-thumb.is-loading .survey-thumb-loader {
  display: flex;
}

.survey-thumb.is-loading .survey-thumb-status {
  display: none;
}

.survey-thumb.is-loading .survey-thumb-caption {
  display: none;
}

.survey-thumb.is-loading img {
  opacity: 0;
}

.survey-thumb.is-loaded .survey-thumb-status {
  display: none;
}

.survey-thumb.is-selected {
  box-shadow: 0 0 0 2px #172b4d, 0 10px 22px rgba(23, 43, 77, 0.22);
}

.survey-thumb.is-filtered-out {
  opacity: 0.3;
}

.survey-address-col.is-filtered-out .survey-thumb.is-selected {
  opacity: 1;
}

.survey-thumb.is-photo-placeholder {
  background: linear-gradient(180deg, rgba(244, 247, 252, 0.98), rgba(228, 236, 247, 0.98));
}

.survey-thumb.is-text-placeholder {
  background: linear-gradient(180deg, rgba(246, 249, 253, 0.98), rgba(235, 241, 249, 0.98));
  box-shadow: none;
}

.survey-thumb.is-text-placeholder:hover {
  border-width: 2px;
  border-color: #2d5fb5;
  background: linear-gradient(180deg, rgba(48, 96, 184, 0.98), rgba(35, 74, 144, 0.98));
  box-shadow: 0 8px 18px rgba(34, 71, 138, 0.22);
}

.survey-thumb.is-abstract {
  background: linear-gradient(180deg, rgba(230, 237, 247, 0.92), rgba(214, 225, 240, 0.94));
  border-color: rgba(111, 143, 191, 0.72);
  box-shadow: none;
  overflow: hidden;
}

.survey-thumb.is-abstract::before {
  display: none;
}

.survey-thumb-palette {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(17, 27, 42, 0.06)),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--palette-2, #d5e0f0) 82%, white) 0 100%
    );
  opacity: 0.96;
  pointer-events: none;
}

.survey-thumb-palette::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 14%;
  bottom: 24%;
  border-radius: 0;
  background:
    linear-gradient(
      180deg,
      var(--palette-1, #8badd6) 0 22%,
      transparent 22% 24%,
      var(--palette-2, #d5e0f0) 24% 100%
    ),
    linear-gradient(
      90deg,
      transparent 0 24%,
      var(--palette-3, #576f96) 24% 26%,
      transparent 26% 100%
    );
  box-shadow: inset 0 0 0 2px var(--palette-3, #576f96);
}

.survey-thumb-palette::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 36%;
  height: 2px;
  background:
    linear-gradient(90deg, var(--palette-3, #576f96) 0 100%);
}

.survey-thumb-palette > i {
  display: none;
}

.survey-thumb.is-abstract::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(8, 16, 29, 0.72));
  pointer-events: none;
}

.survey-thumb.is-vacant-outline {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(120, 128, 142, 0.25) 0,
      rgba(120, 128, 142, 0.25) 4px,
      rgba(236, 239, 244, 0.95) 4px,
      rgba(236, 239, 244, 0.95) 10px
    );
  border: 1px solid rgba(195, 208, 228, 0.95);
  box-shadow: none;
}

.survey-thumb.is-coming-soon {
  background: linear-gradient(180deg, rgba(241, 245, 251, 0.98), rgba(228, 235, 246, 0.98));
  border: 1px dashed rgba(151, 167, 194, 0.92);
  box-shadow: none;
  cursor: default;
}

.survey-thumb-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.1rem 0.12rem;
  background: linear-gradient(180deg, transparent, rgba(12, 21, 35, 0.76));
  color: #fff;
  font-size: 0.42rem;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.survey-thumb.is-vacant-outline .survey-thumb-caption {
  background: none;
  color: rgba(84, 101, 129, 0.88);
  font-size: 0.44rem;
}

.survey-thumb.is-abstract .survey-thumb-caption {
  background: linear-gradient(180deg, transparent, rgba(8, 16, 29, 0.78));
  color: #fff;
  font-size: 0.44rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.survey-thumb.is-abstract .survey-thumb-status {
  display: none;
}

.survey-thumb.is-text-placeholder .survey-thumb-status {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(58, 76, 106, 0.95);
}

.survey-thumb-status-name,
.survey-thumb-status-cta {
  display: block;
}

.survey-thumb-status-name {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.survey-thumb-status-cta {
  margin-top: 0.28rem;
  padding-top: 0.24rem;
  border-top: 1px solid rgba(136, 155, 188, 0.28);
  color: #2d5fb5;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.survey-thumb.is-text-placeholder:hover .survey-thumb-status {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.survey-thumb.is-text-placeholder:hover .survey-thumb-status-cta {
  border-top-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}

.survey-thumb-vacant-text {
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 3.4em;
  padding: 0.18rem 0.32rem;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(78, 91, 112, 0.96);
  font-weight: 600;
  font-size: 0.56rem;
  line-height: 1.18;
  box-shadow: none;
}

.survey-thumb-coming-soon-text {
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 5.2em;
  padding: 0.18rem 0.32rem;
  background: rgba(255, 255, 255, 0.88);
  color: rgba(82, 97, 123, 0.96);
  font-weight: 600;
  font-size: 0.5rem;
  line-height: 1.15;
  box-shadow: none;
}

.survey-thumb.is-missing-photo {
  background: linear-gradient(180deg, rgba(244, 247, 252, 0.98), rgba(231, 237, 246, 0.98));
  border: 1px dashed rgba(171, 186, 210, 0.95);
  box-shadow: none;
}

.survey-thumb-missing-photo-text {
  background: rgba(255, 255, 255, 0.88);
  color: rgba(71, 88, 115, 0.95);
}

.survey-canvas.zoom-inspect .survey-thumb-loader-text,
.survey-canvas.zoom-detail .survey-thumb-loader-text {
  font-size: 0.48rem;
}

.survey-canvas.zoom-inspect .survey-thumb-spinner,
.survey-canvas.zoom-detail .survey-thumb-spinner {
  width: 0.82rem;
  height: 0.82rem;
}

.survey-canvas.zoom-inspect .survey-thumb-status,
.survey-canvas.zoom-detail .survey-thumb-status {
  width: calc(100% - 12px);
  padding: 0.375rem 0.5rem;
  font-size: 0.74rem;
  line-height: 1.25;
}

.survey-canvas.zoom-inspect .survey-thumb-status-name,
.survey-canvas.zoom-detail .survey-thumb-status-name {
  line-height: 1.2;
}

.survey-canvas.zoom-inspect .survey-thumb-status-cta,
.survey-canvas.zoom-detail .survey-thumb-status-cta {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-size: 0.58rem;
}

.survey-canvas.zoom-inspect .survey-thumb-caption,
.survey-canvas.zoom-inspect .survey-thumb.is-vacant-outline .survey-thumb-caption,
.survey-canvas.zoom-inspect .survey-thumb.is-abstract .survey-thumb-caption,
.survey-canvas.zoom-detail .survey-thumb-caption,
.survey-canvas.zoom-detail .survey-thumb.is-vacant-outline .survey-thumb-caption,
.survey-canvas.zoom-detail .survey-thumb.is-abstract .survey-thumb-caption {
  padding: 0.375rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.1;
}

.survey-canvas.zoom-inspect .survey-thumb-vacant-text,
.survey-canvas.zoom-detail .survey-thumb-vacant-text {
  min-width: 4.4em;
  padding: 0.375rem 0.625rem;
  font-size: 0.74rem;
  line-height: 1.08;
}

.survey-canvas.zoom-inspect .survey-thumb-coming-soon-text,
.survey-canvas.zoom-detail .survey-thumb-coming-soon-text {
  min-width: 6em;
  padding: 0.375rem 0.625rem;
  font-size: 0.68rem;
  line-height: 1.08;
}

.survey-timeline-guide {
  width: 100%;
  top: 0;
  background: #ffffff;
  padding-bottom: 0;
}

.survey-timeline-guide .guide-track {
  height: 42px;
}

.survey-timeline-row {
  position: absolute;
}

.survey-timeline-row.is-selected {
  box-shadow: 0 0 0 2px rgba(47, 104, 200, 0.18);
}

.survey-timeline-row {
  background: transparent !important;
}

.survey-timeline-address {
  appearance: none;
  display: block;
  width: auto;
  min-height: 100%;
  border: 0;
  box-shadow: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  background: transparent;
}

.survey-timeline-address-no {
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1;
}

.survey-timeline-address-name {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-soft);
}

.survey-timeline-address small.current-vacant,
.survey-timeline-address .survey-timeline-address-name.current-vacant {
  display: inline-block;
  margin-top: 0.26rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #be1e2d;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.66rem;
  line-height: 1.2;
}

.survey-timeline-track {
  min-height: 100%;
}

.survey-timeline-guide {
  border-radius: 0;
}

.survey-timeline-track-inner {
  position: relative;
  height: 100%;
}

.survey-timeline-thumb {
  border-radius: 4px;
}

.survey-canvas.zoom-inspect .survey-thumb,
.survey-canvas.zoom-detail .survey-thumb {
  border-width: 0.75px;
}

.survey-canvas.zoom-inspect .survey-thumb.is-vacant-outline,
.survey-canvas.zoom-detail .survey-thumb.is-vacant-outline {
  border-width: 1px;
}

@keyframes survey-tile-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

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

@keyframes survey-zoom-settle {
  0% {
    opacity: 0.84;
    transform: scale(0.985);
    transform-origin: center center;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
  }
}

.dashboard-head {
  margin-bottom: 0.58rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dashboard-cards-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-cards-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.dashboard-cards-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-cards-compact .dashboard-card-value {
  font-size: 1.58rem;
  line-height: 1.08;
}

.dashboard-section + .dashboard-section {
  margin-top: 0.75rem;
}

.dashboard-section-title {
  margin: 0 0 0.5rem;
  color: #253a62;
}

.dashboard-kpi-group {
  padding: 0 0 1.25rem;
}

.dashboard-kpi-group-header {
  display: block;
  margin-bottom: 0.5rem;
}

.dashboard-kpi-group + .dashboard-kpi-group {
  margin-top: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--layout-border);
}

.dashboard-kpi-group-title {
  margin: 0;
  color: #2f466f;
}

.dashboard-section-narrative,
.dashboard-chart-note {
  margin: 0 0 0.75rem;
  color: #5e6c84;
  font-size: 0.92rem;
  line-height: 1.5;
}

.dashboard-kpi-group .dashboard-cards {
  margin-bottom: 0;
}

.dashboard-cards-section {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.dashboard-cards-section .dashboard-card {
  flex: 1 1 180px;
}

.dashboard-kpi-mode {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 0 0.25rem;
}

.dashboard-kpi-mode .theme-segment-btn {
  min-height: 30px;
  padding: 0.25rem 0.5rem;
  font-size: 0.76rem;
}

.dashboard-chart-grid,
.dashboard-series-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-chart-grid-single {
  grid-template-columns: 1fr;
  margin-top: 1rem;
}

.dashboard-section {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0;
  align-items: start;
  width: 100%;
}

.dashboard-chart-card {
  border: 1px solid var(--layout-border);
  background: #fff;
  border-radius: 6px;
  padding: 0.5rem;
}

.dashboard-chart-title {
  margin: 0 0 0.5rem;
  color: #42526e;
}

.dashboard-chart-mobile {
  display: none;
}

.dashboard-empty-inline {
  color: #6b778c;
  font-size: 0.76rem;
  padding: 0.25rem 0;
}

.dashboard-mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  min-height: 114px;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.dashboard-mini-bar-item {
  min-width: 58px;
  text-align: center;
}

.dashboard-mini-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
}

.dashboard-mini-bar-label {
  margin-top: 0.25rem;
  font-size: 0.62rem;
  color: #5e6c84;
  line-height: 1.15;
}

.dashboard-mini-bar-value {
  margin-top: 0;
  font-size: 0.62rem;
  color: #253a62;
  font-weight: 600;
}

.dashboard-series-svg {
  width: 100%;
  height: 170px;
  display: block;
}

.dashboard-series-axis {
  font-family: var(--ds-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif);
  font-size: 10px;
  fill: #5e6c84;
}

.dashboard-histogram {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.25rem;
  min-height: 170px;
  align-items: stretch;
}

.dashboard-histogram-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dashboard-histogram-y-tick {
  position: relative;
  height: 1px;
}

.dashboard-histogram-y-tick span {
  position: absolute;
  right: 3px;
  top: -8px;
  font-size: 0.68rem;
  color: #6b778c;
}

.dashboard-histogram-y-tick i {
  position: absolute;
  left: 100%;
  top: 0;
  width: 6px;
  border-top: 1px solid rgba(9, 30, 66, 0.18);
}

.dashboard-histogram-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 0.25rem;
  align-items: end;
  border-left: 1px solid rgba(9, 30, 66, 0.2);
  border-bottom: 1px solid rgba(9, 30, 66, 0.2);
  padding: 0 0.25rem 0.25rem 0.25rem;
  background-image: linear-gradient(to top, rgba(9, 30, 66, 0.07) 1px, transparent 1px);
  background-size: 100% 33.333%;
}

.dashboard-histogram-item {
  min-width: 0;
}

.dashboard-histogram-bar-wrap {
  height: 120px;
  display: flex;
  align-items: flex-end;
}

.dashboard-histogram-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
}

.dashboard-histogram-value {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  line-height: 1;
  color: #fff;
  font-weight: 700;
}

.dashboard-histogram-label {
  margin-top: 0.25rem;
  text-align: center;
  font-size: 0.67rem;
  color: #42526e;
  line-height: 1.1;
  white-space: nowrap;
}

.dashboard-card,
.dashboard-table-card {
  border: 1px solid var(--layout-border);
  background: #fff;
  border-radius: 6px;
}

.dashboard-card {
  position: relative;
  padding: 1rem;
  min-height: 112px;
}

.dashboard-card-label {
  color: #5e6c84;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  line-height: 1.22;
}

.dashboard-card-note {
  display: block;
  margin-top: 0;
  font-size: 0.68em;
  line-height: 1.25;
  color: #6f809f;
}

.dashboard-card-sentence {
  color: #2b3f64;
  font-size: 0.98rem;
  line-height: 1.28;
  font-weight: 500;
}

.dashboard-card-sentence-value {
  font-size: 1.72rem;
  font-weight: 700;
  color: #172b4d;
  line-height: 1;
  margin-right: 0.2rem;
  white-space: nowrap;
}

.dashboard-card-value {
  color: #172b4d;
  font-size: 2.02rem;
  font-weight: 700;
  line-height: 1.06;
}

.dashboard-empty {
  border: 1px dashed var(--layout-border-strong);
  border-radius: 6px;
  background: #fff;
  color: #5e6c84;
  padding: 0.72rem;
  font-size: 0.82rem;
}

.dashboard-table-card {
  overflow: hidden;
}

.dashboard-table-title {
  margin: 0;
  padding: 0.52rem 0.66rem;
  border-bottom: 1px solid var(--layout-border);
  color: #253a62;
}

.dashboard-table-scroll {
  overflow: auto;
  max-height: 60vh;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.dashboard-table th,
.dashboard-table td {
  border-bottom: 1px solid var(--layout-border);
  padding: 0.36rem 0.52rem;
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  position: sticky;
  top: 0;
  background: #f8fafd;
  color: #42526e;
  font-weight: 600;
}

.dashboard-table td {
  color: #253a62;
}

h1 {
  color: var(--layout-title);
  font-weight: 500;
  font-size: clamp(2.15rem, 4.5vw, 2.9rem);
  line-height: 1.05;
  margin: 0 0 0.3rem;
}

.heading-tagline,
.credit {
  color: #62708a;
}

.heading-tagline {
  font-size: clamp(1.08rem, 2.35vw, 1.38rem);
  line-height: 1.3;
  margin: 0;
}

.app-shell {
  gap: 0.5rem;
  align-items: stretch;
}

.side-panel {
  background: var(--layout-muted);
  border: 1px solid var(--layout-border);
  border-radius: 4px;
}

.side-panel-title.section-heading-h2,
.timeline-zoom-title.section-heading-h2,
.section-heading-h2 {
  color: var(--layout-title);
  font-weight: 500;
}

.side-panel-toggle {
  border-color: var(--layout-border-strong);
  background: #fff;
  color: #6b778c;
}

.story-presets,
.controls {
  border: 0;
  background: transparent;
  padding: 0;
}

.main-panel {
  gap: 0.5rem;
  align-content: start;
  grid-auto-rows: max-content;
}

.meta-summary {
  padding: 0 0.1rem;
}

.meta-summary-text {
  font-size: 0.86rem;
  color: #5e6c84;
}

.trend-details,
.street-context-details,
.timeline-guide {
  background: var(--layout-surface);
  border: 1px solid var(--layout-border);
  border-radius: 4px;
}

.trend-body,
.street-context-body {
  padding-left: 0.63rem;
  padding-right: 0.63rem;
}

.timeline-zoom {
  border-top: 1px solid var(--layout-border);
  padding-top: 0.3rem;
}

.shop-row {
  border: 1px solid #b7c4d8;
  border-radius: 4px;
  background: var(--layout-surface);
}

.shop-row:hover {
  border-color: #96aaca;
}

.shop-label {
  background: #fcfdff;
  border-right: 1px solid var(--layout-border);
}

.track-wrap {
  background: #ffffff;
}

.year-axis {
  opacity: 0.09;
}

input:not([type="range"]),
textarea,
select,
button,
.search-tokenizer {
  border-color: var(--layout-border-strong);
  border-radius: 6px;
}

.search-suggestions {
  border-color: var(--layout-border-strong);
}

.sort-control select,
.scope-control select,
.current-status-control select,
.change-intensity-control select,
.story-presets-control select {
  height: 32px;
}

html[data-theme="dark"] {
  --layout-bg: #161a22;
  --layout-surface: #1f2530;
  --layout-muted: #232a36;
  --layout-border: #313a4a;
  --layout-border-strong: #42506a;
  --layout-title: #e6edf8;
  --layout-text: #c3cde0;
}

html[data-theme="dark"] body {
  background: var(--layout-bg);
  color: var(--layout-text);
}

html[data-theme="dark"] .page-header {
  background: #1b212c;
  border-bottom-color: var(--layout-border);
}

html[data-theme="dark"] .top-nav {
  border-bottom-color: var(--layout-border);
}

html[data-theme="dark"] .top-nav-link {
  color: #b6c2cf;
}

html[data-theme="dark"] .top-nav-link:hover {
  color: #e6edf8;
}

html[data-theme="dark"] .top-nav-link.is-active {
  color: #85b8ff;
  border-bottom-color: #85b8ff;
}

html[data-theme="dark"] .dashboard-subtitle {
  color: #b6c2cf;
}

html[data-theme="dark"] .explorer-summary-details {
  border-color: var(--layout-border);
}


html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .dashboard-table-card,
html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .dashboard-chart-card {
  background: var(--layout-surface);
  border-color: var(--layout-border);
}

html[data-theme="dark"] .dashboard-card-label {
  color: #b6c2cf;
}

html[data-theme="dark"] .kpi-info-btn {
  background: #22314e;
  border-color: #546a92;
  color: #d7e1f2;
}

html[data-theme="dark"] .kpi-info-btn:hover,
html[data-theme="dark"] .kpi-info-btn:focus-visible,
html[data-theme="dark"] .kpi-info-btn[aria-expanded="true"] {
  background: #2d3f63;
  border-color: #7e98c8;
  color: #f5f8ff;
}

html[data-theme="dark"] .dashboard-card-value,
html[data-theme="dark"] .dashboard-table td,
html[data-theme="dark"] .dashboard-table-title,
html[data-theme="dark"] .dashboard-section-title,
html[data-theme="dark"] .dashboard-mini-bar-value {
  color: #e6edf8;
}

html[data-theme="dark"] .dashboard-card-sentence {
  color: #c1d0e8;
}

html[data-theme="dark"] .dashboard-card-sentence-value {
  color: #e6edf8;
}

html[data-theme="dark"] .explorer-summary-note {
  color: #b6c2cf;
}

html[data-theme="dark"] .timeline-zoom-note {
  color: #b6c2cf;
}

html[data-theme="dark"] .mobile-sort .sort-control > span {
  color: #b6c2cf;
}

html[data-theme="dark"] .dashboard-table th {
  background: #222a35;
  color: #c3cde0;
  border-bottom-color: var(--layout-border);
}

html[data-theme="dark"] .dashboard-chart-title,
html[data-theme="dark"] .dashboard-empty-inline,
html[data-theme="dark"] .dashboard-mini-bar-label,
html[data-theme="dark"] .dashboard-series-axis {
  color: #b6c2cf;
  fill: #b6c2cf;
}

html[data-theme="dark"] .dashboard-histogram-y-tick span,
html[data-theme="dark"] .dashboard-histogram-label {
  color: #b6c2cf;
}

html[data-theme="dark"] .dashboard-histogram-y-tick i,
html[data-theme="dark"] .dashboard-histogram-bars {
  border-color: rgba(198, 214, 244, 0.24);
}

html[data-theme="dark"] .dashboard-histogram-bars {
  background-image: linear-gradient(to top, rgba(198, 214, 244, 0.12) 1px, transparent 1px);
}

@media (max-width: 1080px) {
  .survey-intro,
  .survey-stage {
    display: grid;
    grid-template-columns: 1fr;
  }

  .survey-viewport {
    min-height: 65vh;
  }

  .survey-toolbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-cards-two,
  .dashboard-cards-three,
  .dashboard-cards-five,
  .dashboard-cards-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-chart-grid,
  .dashboard-series-grid {
    grid-template-columns: 1fr;
  }

  .explorer-summary-cards {
    grid-template-columns: 1fr 1fr;
  }

  .explorer-summary-section {
    display: none !important;
  }

}

@media (max-width: 720px) {
  .survey-stage.is-mobile-survey .survey-toolbar {
    position: static;
    top: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    align-items: stretch;
    justify-items: stretch;
    gap: 12px;
    padding: 12px;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .survey-stage.is-mobile-survey .survey-toolbar > * {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    box-sizing: border-box;
  }

  .survey-stage.is-mobile-survey .survey-photo-count.section-heading-h2 {
    width: 100%;
    font-size: var(--m-h2);
    line-height: 1.1;
    margin: 0;
    text-align: left;
  }

  .survey-stage.is-mobile-survey .survey-mode-toggle {
    display: none !important;
  }

  .survey-stage.is-mobile-survey .survey-mobile-mode-toggle {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100% !important;
    max-width: none !important;
    min-height: var(--m-touch);
    border-radius: 6px;
    overflow: hidden;
    gap: 0;
  }

  .survey-stage.is-mobile-survey .survey-mobile-mode-toggle .trend-scale-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: var(--m-touch);
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
    font-size: var(--m-body);
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .survey-stage.is-mobile-survey .survey-toolbar .survey-sort-control,
  .survey-stage.is-mobile-survey .survey-toolbar .survey-change-filter-control {
    width: 100% !important;
    max-width: none !important;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
    justify-self: stretch;
  }

  .survey-stage.is-mobile-survey .survey-toolbar .survey-sort-control > span,
  .survey-stage.is-mobile-survey .survey-toolbar .survey-change-filter-control > span {
    font-size: var(--m-label);
    font-weight: 700;
    line-height: 1.2;
    color: #364865;
  }

  .survey-stage.is-mobile-survey .survey-toolbar .survey-sort-control select,
  .survey-stage.is-mobile-survey .survey-toolbar .survey-change-filter-control select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: var(--m-touch);
    font-size: var(--m-body);
    box-sizing: border-box;
    display: block;
  }

  .survey-stage.is-mobile-survey .survey-sort-control select,
  .survey-stage.is-mobile-survey .survey-change-filter-control select {
    min-width: 0 !important;
    max-width: none !important;
  }

  .survey-viewport.is-mobile-mode {
    min-height: auto;
    max-height: none;
    overflow: visible;
    cursor: default;
  }

  .survey-viewport.is-mobile-mode.is-dragging .survey-thumb,
  .survey-viewport.is-mobile-mode.is-dragging .survey-address-label,
  .survey-viewport.is-mobile-mode.is-dragging .survey-timeline-address {
    pointer-events: auto;
  }

  .survey-canvas-mobile {
    padding: 8px 0 16px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .survey-mobile-list {
    gap: 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .survey-mobile-detail-grid {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .survey-mobile-year-grid {
    grid-template-columns: 1fr;
  }

  .survey-mobile-details {
    padding: 8px 8px 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .survey-mobile-thumb {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 180px !important;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 100%;
  }

  .survey-mobile-thumb-label {
    font-size: 1.06rem;
    line-height: 1.25;
    font-weight: 500;
  }

  .survey-mobile-thumb img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    object-fit: cover !important;
  }

  .survey-mobile-thumb .survey-thumb-status,
  .survey-mobile-thumb .survey-thumb-loader,
  .survey-mobile-thumb .survey-thumb-caption {
    z-index: 2;
  }

  .survey-mobile-thumb .survey-thumb-caption {
    font-size: 0.74rem;
    padding-bottom: 8px;
  }

  .survey-mobile-thumb.is-mobile-compact-state {
    height: 72px !important;
    min-height: 72px !important;
  }

  .survey-mobile-thumb.is-mobile-compact-state .survey-thumb-status-name {
    font-size: 1.06rem;
    line-height: 1.25;
    font-weight: 500;
    text-align: center;
  }

  .mobile-quick-actions.is-survey-mobile {
    display: flex;
    align-items: stretch;
    gap: 12px;
    left: 16px !important;
    right: 16px;
    bottom: 16px;
    transform: translateY(8px);
  }

  .mobile-quick-actions.is-survey-mobile.is-visible {
    transform: translateY(0);
  }

  .mobile-quick-actions.is-survey-mobile #mobileOpenAllRowsBtn,
  .mobile-quick-actions.is-survey-mobile #mobileOpenAllRowsBtn {
    display: none;
  }

  .mobile-quick-actions.is-survey-mobile #mobileCloseAllRowsBtn,
  .mobile-quick-actions.is-survey-mobile .mobile-back-to-top {
    display: inline-flex;
    width: calc(50% - 6px);
    justify-content: center;
    align-items: center;
    min-height: var(--m-touch);
    font-size: var(--m-body);
    line-height: 1.1;
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
  }
}

@media (max-width: 1480px) {
  .explorer-summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  .explorer-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html[data-theme="dark"] .side-panel {
  background: var(--layout-muted);
  border-color: var(--layout-border);
}

html[data-theme="dark"] .trend-details,
html[data-theme="dark"] .street-context-details,
html[data-theme="dark"] .timeline-guide,
html[data-theme="dark"] .shop-row {
  background: var(--layout-surface);
  border-color: var(--layout-border);
}

html[data-theme="dark"] .shop-label {
  background: #202733;
  border-right-color: var(--layout-border);
}


html[data-theme="dark"] .track-wrap {
  background: #1e2430;
}

html[data-theme="dark"] .row-toggle:hover {
  background: rgba(193, 199, 208, 0.14);
}

html[data-theme="dark"] .row-disclosure {
  color: #b6c2cf;
}

/* Secondary chrome desaturation pass */
.search-pill {
  border-color: rgba(23, 43, 77, 0.14);
  filter: saturate(0.88);
}

.search-pill-remove {
  background: rgba(255, 255, 255, 0.46);
}

.slider-bubble {
  border-color: #cfd7e3;
  color: #2b3f62;
}

.zoom-icon {
  border-color: #8a94a6;
}

.zoom-icon::before,
.zoom-icon::after {
  background-color: #8a94a6;
}

.street-junction-flag,
.street-junction-flag::after {
  background: #e8edf6;
  color: #5f7191;
}

.panel-disclosure:hover {
  background: rgba(9, 30, 66, 0.045);
}

.reset-link,
.inline-link,
.panel-disclosure {
  color: #1f5fbf;
}

html[data-theme="dark"] .search-pill {
  border-color: rgba(198, 214, 244, 0.24);
  filter: saturate(0.9);
}

html[data-theme="dark"] .search-pill-remove {
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .slider-bubble {
  border-color: #53627d;
  color: #d5def0;
}

html[data-theme="dark"] .zoom-icon {
  border-color: #9eabc2;
}

html[data-theme="dark"] .zoom-icon::before,
html[data-theme="dark"] .zoom-icon::after {
  background-color: #9eabc2;
}

html[data-theme="dark"] .street-junction-flag,
html[data-theme="dark"] .street-junction-flag::after {
  background: #435470;
  color: #d8e4fb;
}

/* Revert recent visual expansions to mobile-only scope */
@media (min-width: 561px) {
  h1 {
    font-size: clamp(1.72rem, 3vw, 2.25rem);
    line-height: 1.1;
    margin: 0 0 0.2rem;
  }

  .heading-tagline {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .label-number {
    font-size: 1.42rem;
    line-height: 1;
    font-weight: 800;
  }

  .details {
    padding: 0.62rem 0.74rem 0.72rem;
  }

  .shop-row.expanded .details {
    display: grid;
    grid-template-areas:
      "actions"
      "list";
  }

  .shop-row.expanded.has-did-you-know .details {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 28%);
    grid-template-areas:
      "actions actions"
      "list didyou";
    column-gap: 1rem;
    align-items: start;
  }

  .details-list {
    grid-area: list;
    gap: 0.34rem;
  }

  .shop-row.expanded.has-did-you-know .details-did-you-know {
    display: block;
    grid-area: didyou;
    border: 1px solid var(--layout-border);
    border-radius: 6px;
    background: rgba(245, 249, 255, 0.72);
    padding: 0.6rem 0.66rem;
    margin-top: 0.02rem;
  }

  .details-foot {
    grid-area: actions;
    justify-content: flex-start;
    margin: 0 0 0.82rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(252, 253, 255, 0.96);
    padding: 0.08rem 0 0.32rem;
  }

  .detail-item {
    font-size: 0.84rem;
    grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
    gap: 0.64rem;
  }

  .detail-years {
    font-size: 0.88rem;
    font-weight: 600;
  }

  .detail-name {
    font-size: 0.88rem;
    line-height: 1.35;
  }
}

/* Bookmark visibility + interaction polish */
.pin-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.shop-label:hover .pin-btn,
.shop-label:focus-within .pin-btn,
.pin-btn[aria-pressed="true"] {
  opacity: 1;
  pointer-events: auto;
}

.pin-btn:hover {
  background: rgba(12, 102, 228, 0.08);
  border-color: rgba(12, 102, 228, 0.22);
}

.pin-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid rgba(56, 139, 255, 0.3);
  outline-offset: 1px;
}

html[data-theme="dark"] .pin-btn:hover {
  background: rgba(133, 184, 255, 0.16);
  border-color: rgba(133, 184, 255, 0.35);
}

html[data-theme="dark"] .share-btn {
  background: #1c2540;
  border-color: #3b476a;
  color: #dce6ff;
}

html[data-theme="dark"] .share-btn:hover {
  background: rgba(133, 184, 255, 0.16);
  border-color: rgba(133, 184, 255, 0.35);
}

html[data-theme="dark"] .share-menu {
  background: #1c2540;
  border-color: #3b476a;
}

html[data-theme="dark"] .share-menu-item {
  color: #dce6ff;
}

html[data-theme="dark"] .share-menu-item:hover {
  background: rgba(133, 184, 255, 0.16);
}

/* Keep actions discoverable on touch devices with no hover */
@media (hover: none) {
  .pin-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Smallest breakpoint mobile layout */
@media (max-width: 560px) {
  .side-panel-toggle.is-open {
    transform: rotate(180deg);
  }

  :root {
    --m-h2: 1.36rem;
    --m-label: 1.06rem;
    --m-body: 1rem;
    --m-note: 0.92rem;
    --m-touch: 44px;
  }

  .side-panel .story-presets,
  .side-panel .side-panel-divider {
    display: none !important;
  }

  .side-panel {
    position: static;
    top: auto;
    z-index: auto;
    max-height: none;
    overflow: visible;
  }

  .side-panel .timespan-filter,
  .side-panel .age-filter {
    display: none !important;
  }

  .app-shell.is-sidebar-collapsed .side-panel {
    padding: 1.1rem;
    border-radius: 12px;
  }

  .app-shell.is-sidebar-collapsed .side-panel-header {
    justify-content: space-between;
  }

  .app-shell.is-sidebar-collapsed .side-panel-title {
    display: block;
  }

  .page-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    align-items: start;
  }

  .top-nav-link {
    min-height: 46px;
    padding: 0.56rem 0.72rem 0.62rem;
    font-size: 0.98rem;
    line-height: 1.1;
    width: 100%;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 0.2rem;
    border-bottom: 1px solid var(--layout-border);
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-copy p {
    max-width: none;
  }

  .about-media-column {
    grid-template-columns: 1fr;
  }

  .header-meta {
    align-items: center;
    text-align: center;
    gap: 0.3rem;
  }

  .header-meta .credit {
    white-space: normal;
    text-align: center;
  }

  /* Remove street view and timeline controls on smallest viewport */
  #streetContext,
  .timeline-zoom,
  .timeline-guide {
    display: none !important;
  }

  .timeline-row-actions {
    display: none !important;
  }

  .mobile-sort {
    display: block;
    margin-top: 0.15rem;
  }

  .mobile-sort .sort-control {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
    font-size: var(--m-note);
  }

  .mobile-sort .sort-control > span {
    font-size: var(--m-label);
    font-weight: 700;
    line-height: 1.2;
    color: #364865;
  }

  .mobile-sort .sort-control select {
    width: 100%;
    min-width: 0;
    height: var(--m-touch);
    font-size: var(--m-body);
  }

  .timeline-zoom-note {
    display: none;
  }

  /* Show address list only; hide timeline bars in rows */
  .timeline {
    margin-top: 0.2rem;
    gap: 0.32rem;
  }

  .shop-row {
    grid-template-columns: 1fr !important;
  }

  .shop-label {
    border-right: 0 !important;
  }

  .label-id {
    gap: 0.5rem;
  }

  .row-disclosure {
    width: var(--m-touch);
    height: var(--m-touch);
  }

  .row-disclosure-icon {
    font-size: 1.95rem;
    line-height: 1;
  }

  .label-number {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 800;
  }

  .label-change-count {
    font-size: 0.86rem;
  }

  .shop-label small,
  .current-business-link {
    font-size: 1.06rem;
    line-height: 1.25;
  }

  .current-business-toggle {
    cursor: pointer;
  }

  .current-business-toggle:hover {
    background: rgba(9, 30, 66, 0.06);
  }

  .current-business-toggle:focus-visible {
    outline: 2px solid rgba(56, 139, 255, 0.32);
    outline-offset: 1px;
  }

  .shop-label small.current-vacant,
  .shop-label small.current-nonshop {
    font-size: 0.84rem;
    padding: 0.18rem 0.5rem;
  }

  .pin-btn {
    width: 34px;
    height: 34px;
  }

  .pin-btn::before {
    width: 18px;
    height: 24px;
  }

  .track-wrap {
    display: none !important;
  }

  /* Larger readable details for mobile */
  .details {
    padding: 0.62rem 0.7rem 0.72rem;
  }

  .shop-row.expanded .details {
    display: flex;
    flex-direction: column;
  }

  .details-list {
    order: 2;
    grid-area: auto;
  }

  .detail-decade-divider {
    display: none;
  }

  .details-source-note {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-top: 0.72rem;
  }

  .detail-item {
    grid-template-columns: 1fr;
    font-size: 1.02rem;
    gap: 0.26rem;
    align-items: start;
  }

  .detail-years {
    font-size: 0.96rem;
    font-weight: 600;
  }

  .detail-name {
    font-size: 1.06rem;
  }

  .details-close {
    min-width: 100px;
    height: var(--m-touch);
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0 0.56rem;
  }

  .details-map-link {
    min-width: 0;
    height: var(--m-touch);
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0 0.56rem;
    flex: 1 1 0;
  }

  .details-share-btn {
    min-width: 0;
    height: var(--m-touch);
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0 1.3rem 0 0.56rem;
    width: 100%;
  }

  .details-share-btn::after {
    right: 0.72rem;
    border-left-width: 5px;
    border-right-width: 5px;
    border-top-width: 6px;
  }

  .details-share-wrap .share-menu {
    min-width: 170px;
  }

  .details-share-wrap .share-menu-item {
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .details-foot {
    order: 1;
    grid-area: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.36rem;
    margin-top: 0;
    margin-bottom: 0.56rem;
  }

  .details-share-wrap {
    flex: 1 1 0;
    min-width: 0;
  }

  .details-close {
    display: none !important;
  }

  .details-map-link {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
  }

  .details-map-link,
  .details-share-btn {
    justify-content: center;
    white-space: nowrap;
  }

  .details-share-wrap {
    width: 100%;
  }

  .details-did-you-know--mobile {
    display: block;
    grid-area: auto;
    border: 1px solid var(--layout-border);
    border-radius: 8px;
    background: rgba(245, 249, 255, 0.72);
    padding: 0.72rem 0.76rem;
    margin-top: 0.56rem;
  }

  /* Touch target sizing for controls */
  .side-panel .story-presets-control select,
  .side-panel .scope-control select,
  .side-panel .current-status-control select,
  .side-panel .change-intensity-control select,
  .side-panel .search-control textarea,
  .side-panel .address-control input,
  .side-panel .search-tokenizer,
  .side-panel .theme-segment-btn,
  .side-panel .side-panel-toggle {
    min-height: var(--m-touch);
  }

  .side-panel .story-presets-control select,
  .side-panel .scope-control select,
  .side-panel .current-status-control select,
  .side-panel .change-intensity-control select {
    height: var(--m-touch);
    font-size: var(--m-body);
  }

  .side-panel .theme-segment-btn {
    min-height: var(--m-touch);
    padding-top: 0.52rem;
    padding-bottom: 0.52rem;
    font-size: var(--m-body);
  }

  .side-panel .search-mode-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .side-panel .search-mode-toggle .theme-segment-btn {
    width: 100%;
    justify-content: center;
  }

  .theme-segmented {
    min-height: var(--m-touch);
  }

  .side-panel .search-tokenizer {
    min-height: 96px;
  }

  .side-panel .address-tokenizer {
    min-height: 54px;
  }

  #searchTextInput {
    min-height: 84px;
    height: 84px;
    max-height: 168px;
    font-size: var(--m-body);
  }

  #addressTextInput {
    min-height: 40px;
    height: 40px;
    max-height: 40px;
    font-size: var(--m-body);
  }

  .side-panel label > span,
  .side-panel .field-head > span,
  .side-panel .filter-head > span {
    font-size: var(--m-label);
    line-height: 1.2;
    font-weight: 700;
    color: #364865;
  }

  .side-panel .scope-control > span,
  .side-panel .current-status-control > span,
  .side-panel .change-intensity-control > span {
    font-size: var(--m-label) !important;
    line-height: 1.2;
    font-weight: 700 !important;
    color: #364865;
  }

  .side-panel .search-control .field-head > span {
    font-size: var(--m-label) !important;
    line-height: 1.2;
    font-weight: 700 !important;
    color: #364865;
  }

  .side-panel .inline-link {
    font-size: var(--m-note);
    line-height: 1.2;
  }

  .trend-scale-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 6px;
    overflow: hidden;
    min-height: var(--m-touch);
  }

  .trend-scale-btn {
    width: 100%;
    min-height: var(--m-touch);
    padding: 0.62rem 0.45rem;
    font-size: var(--m-body);
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .trend-chart {
    height: 206px;
  }

  .trend-chart .trend-axis-label {
    font-size: 0.86rem;
    font-weight: 600;
  }

  .trend-chart .trend-axis-label-y {
    font-size: 0.8rem;
  }

  .side-panel select,
  .side-panel input,
  .side-panel textarea {
    font-size: var(--m-body);
  }

  .search-note {
    margin-top: 0.3rem;
    font-size: var(--m-note);
    line-height: 1.35;
  }

  .search-note span + span {
    margin-top: 0.34rem;
  }

  .search-pill {
    font-size: var(--m-body);
    line-height: 1.2;
    min-height: 40px;
    padding: 0.42rem 0.66rem 0.42rem 0.76rem;
    gap: 0.42rem;
  }

  .search-pill-remove {
    width: 28px;
    height: 28px;
    font-size: 1rem;
    line-height: 28px;
  }

  .meta-summary-text {
    font-size: 1.04rem;
    line-height: 1.35;
  }

  .slider-track-base,
  .slider-track-active {
    height: 8px;
  }

  .slider-control {
    width: 100%;
    padding-top: 28px;
    padding-inline: 12px;
    margin-inline: 0;
  }

  .slider-stack {
    height: 24px;
    overflow: visible;
  }

  .slider-ticks {
    height: 22px;
    margin-top: 6px;
  }

  .slider-tick-label {
    top: 7px;
    font-size: 0.72rem;
    font-weight: 600;
  }

  .slider-stack input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .slider-stack input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .slider-bubble {
    min-width: 46px;
    padding: 0.2rem 0.4rem;
    font-size: 0.86rem;
  }

  .side-panel .side-panel-toggle {
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 1.45rem;
    line-height: 1;
  }

  .app-shell.is-sidebar-collapsed .side-panel-toggle {
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 1.45rem;
    line-height: 1;
  }

  .dashboard-series-grid,
  .dashboard-section .dashboard-chart-card.is-hidden-mobile {
    display: none !important;
  }

  .dashboard-chart-grid,
  .dashboard-section .dashboard-chart-card {
    display: none !important;
  }

  .dashboard-cards,
  .dashboard-cards-two,
  .dashboard-cards-three,
  .dashboard-cards-five,
  .dashboard-cards-six {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .dashboard-section-title {
    font-size: var(--m-h2);
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 0.5rem;
  }

  .dashboard-kpi-mode .theme-segment-btn {
    min-height: 42px;
    font-size: 0.96rem;
    padding: 0.5rem 0.75rem;
  }

  .dashboard-kpi-group {
    padding: 0 0 1rem;
  }

  .dashboard-kpi-group-header {
    margin-bottom: 0.5rem;
  }

  .dashboard-kpi-group + .dashboard-kpi-group {
    margin-top: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--layout-border);
  }

  .dashboard-kpi-group-title {
    font-size: 1.18rem;
    line-height: 1.25;
    margin: 0 0 0.5rem;
    font-weight: 700;
  }

  .dashboard-card {
    padding: 1rem;
  }

  .dashboard-card-label {
    font-size: 1.14rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
    font-weight: 600;
  }

  .dashboard-card-value {
    font-size: 2.12rem;
    line-height: 1.08;
    font-weight: 800;
  }

  .dashboard-card-sentence {
    font-size: 1.12rem;
    line-height: 1.3;
  }

  .dashboard-card-sentence-value {
    font-size: 2.18rem;
  }

  .dashboard-cards-compact .dashboard-card-value {
    font-size: 2.12rem;
    line-height: 1.08;
    font-weight: 800;
  }

  .dashboard-section-narrative {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  /* Explicitly remove "Show Vacant / Not Listed" control at this breakpoint */
  .meta-vacancy {
    display: none !important;
  }
}

/* Book-aligned brand skin */
:root {
  --book-plaque-blue: #3f5fb6;
  --book-plaque-blue-deep: #2f4e9e;
  --book-off-white: #f4f7ff;
  --book-strip-border: #d7dfef;
}

body {
  background: #f7f8fb;
}

.page-header {
  background:
    linear-gradient(rgba(47, 78, 158, 0.58), rgba(47, 78, 158, 0.58)),
    url("./book-strip.jpg") center calc(100% + 22px) / cover no-repeat,
    linear-gradient(145deg, var(--book-plaque-blue), var(--book-plaque-blue-deep));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding-top: 0.7rem;
  padding-bottom: clamp(2.75rem, 7vw, 4.75rem);
  min-height: clamp(120px, 17vw, 194px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
}

.page-header > div:first-child {
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  transform: translateY(24px);
}

.page-header .header-meta {
  align-items: center;
  text-align: center;
  gap: 0.28rem;
  transform: translateY(24px);
}

h1 {
  font-family: "Libre Baskerville", "Times New Roman", "Georgia", serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(8, 15, 34, 0.72);
}

.heading-tagline,
.credit,
.credit a {
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(8, 15, 34, 0.66);
}

.page-header .heading-tagline,
.page-header .credit,
.page-header .credit a {
  color: #ffffff;
}

.page-header .credit a {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.8);
}

.page-header .credit a:hover,
.page-header .credit a:focus-visible {
  color: #f2f6ff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.top-nav {
  margin-top: 0.34rem;
}

@media (max-width: 560px) {
  .page-header {
    background:
      linear-gradient(rgba(47, 78, 158, 0.72), rgba(47, 78, 158, 0.72)),
      url("./book-strip.jpg") var(--mobile-header-strip-x, 50%) 62% / cover no-repeat,
      linear-gradient(145deg, var(--book-plaque-blue), var(--book-plaque-blue-deep));
    border-radius: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    padding-top: 0.7rem;
    padding-bottom: 0.95rem;
    min-height: auto;
    gap: 0.42rem;
  }

  .page-header > div:first-child,
  .page-header .header-meta {
    transform: none;
  }
}

/* Canonical system layer */
:root {
  --sys-font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sys-font-serif: "Libre Baskerville", "Baskerville", "Palatino Linotype", serif;
  --sys-h2-size: clamp(1.08rem, 1vw + 0.92rem, 1.2rem);
  --sys-h3-size: clamp(0.9rem, 0.35vw + 0.84rem, 0.98rem);
  --sys-control-label-size: 0.74rem;
  --sys-group-label-size: 0.82rem;
  --sys-text: #314663;
  --sys-text-muted: #5f6f8d;
  --sys-text-soft: #7b88a2;
  --sys-accent: #2c5fb5;
  --sys-accent-strong: #1f4e9b;
  --sys-accent-soft: #e9f0fc;
  --sys-focus: rgba(44, 95, 181, 0.22);
  --sys-page: #f4f6fa;
  --sys-surface: rgba(255, 255, 255, 0.96);
  --sys-surface-strong: #ffffff;
  --sys-surface-muted: #eef3f9;
  --sys-surface-tint: #f8fbff;
  --sys-border: #d7dfeb;
  --sys-border-strong: #bac7da;
  --sys-shadow-sm: 0 1px 3px rgba(28, 43, 73, 0.08);
  --sys-shadow-md: 0 10px 28px rgba(27, 43, 73, 0.1);
  --sys-shadow-lg: 0 22px 54px rgba(16, 27, 48, 0.18);
  --sys-radius-sm: 8px;
  --sys-radius-md: 12px;
  --sys-radius-lg: 16px;
  --sys-space-1: 0.25rem;
  --sys-space-2: 0.5rem;
  --sys-space-3: 0.75rem;
  --sys-space-4: 1rem;
  --sys-space-5: 1.25rem;
  --sys-space-6: 1.5rem;
  --sys-transition: 160ms ease;
  --ink: var(--sys-text);
  --ink-soft: var(--sys-text-muted);
  --panel: var(--sys-surface);
  --panel-border: var(--sys-border);
  --shadow: var(--sys-shadow-sm);
  --ds-bg: var(--sys-page);
  --ds-surface: var(--sys-surface-strong);
  --ds-surface-muted: var(--sys-surface-muted);
  --ds-border: var(--sys-border);
  --ds-border-strong: var(--sys-border-strong);
  --ds-text: var(--sys-text);
  --ds-text-subtle: var(--sys-text-muted);
  --ds-link: var(--sys-accent);
  --ds-link-hover: var(--sys-accent-strong);
  --ds-focus: #427be0;
  --ds-selected: var(--sys-accent);
  --ds-selected-soft: var(--sys-accent-soft);
  --ds-radius-sm: var(--sys-radius-sm);
  --ds-radius-md: var(--sys-radius-sm);
  --ds-radius-lg: var(--sys-radius-md);
  --ds-font: var(--sys-font-sans);
  --layout-bg: var(--sys-page);
  --layout-surface: var(--sys-surface-strong);
  --layout-muted: var(--sys-surface-muted);
  --layout-border: var(--sys-border);
  --layout-border-strong: var(--sys-border-strong);
  --layout-title: var(--sys-text);
  --layout-text: var(--sys-text-muted);
}

html[data-theme="dark"] {
  --sys-text: #e6edf8;
  --sys-text-muted: #b4c0d3;
  --sys-text-soft: #8f9bb0;
  --sys-accent: #7fb0ff;
  --sys-accent-strong: #b8d2ff;
  --sys-accent-soft: rgba(127, 176, 255, 0.18);
  --sys-focus: rgba(127, 176, 255, 0.28);
  --sys-page: #1a202a;
  --sys-surface: rgba(34, 42, 56, 0.96);
  --sys-surface-strong: #222a38;
  --sys-surface-muted: #1e2531;
  --sys-surface-tint: #263043;
  --sys-border: #344154;
  --sys-border-strong: #51627c;
  --sys-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.28);
  --sys-shadow-md: 0 14px 36px rgba(0, 0, 0, 0.32);
  --sys-shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.42);
}

body {
  background: var(--sys-page);
  color: var(--sys-text);
  font-family: var(--sys-font-sans);
}

h1,
.section-heading-h2,
.timeline-zoom-title.section-heading-h2,
.side-panel-title.section-heading-h2,
.section-heading-h3 {
  letter-spacing: -0.015em;
}

h1 {
  font-family: var(--sys-font-serif);
}

.section-heading-h2,
.timeline-zoom-title.section-heading-h2,
.side-panel-title.section-heading-h2,
.dashboard-section-title,
.dashboard-kpi-group-title,
.dashboard-chart-title,
.survey-lightbox-title,
.document-header .section-heading-h2,
.panel-disclosure .section-heading-h2,
.survey-photo-count.section-heading-h2 {
  font-family: var(--sys-font-sans);
  font-size: var(--sys-h2-size);
  line-height: 1.2;
  font-weight: 650;
}

.section-heading-h3,
.survey-minimap-title,
.survey-lightbox-timeline-overlay-title,
.details-did-you-know-title {
  font-family: var(--sys-font-sans);
  font-size: var(--sys-h3-size);
  line-height: 1.25;
  font-weight: 650;
}

.section-heading-h2,
.timeline-zoom-title.section-heading-h2,
.side-panel-title.section-heading-h2,
.section-heading-h3,
.dashboard-section-title,
.dashboard-kpi-group-title,
.dashboard-chart-title,
.survey-lightbox-title,
.survey-minimap-title,
.survey-lightbox-timeline-overlay-title,
.details-did-you-know-title,
.controls label > span,
.field-head > span,
.filter-head > span,
.sort-control > span,
.survey-photo-count {
  color: var(--sys-text);
}

.heading-tagline,
.credit,
.meta-summary-text,
.search-note,
.survey-annual-current-label,
.survey-lightbox-jump,
.explorer-summary-note,
.street-lane-label,
.sort-control,
.zoom-control,
.toggle,
.meta-vacancy,
.label-change-count {
  color: var(--sys-text-muted);
}

.dashboard-intro-copy p,
.document-copy,
.about-copy p {
  margin: 0;
  max-width: 68ch;
  color: var(--sys-text-muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.document-copy + .document-copy {
  margin-top: 0.75rem;
}

.about-copy p {
  margin-top: 0.3rem;
}

.controls label > span,
.field-head > span,
.sort-control > span,
.survey-zoom-label,
.survey-annual-current-label,
.survey-lightbox-jump {
  font-size: var(--sys-control-label-size);
  line-height: 1.2;
  font-weight: 600;
}

.side-panel .scope-control > span,
.side-panel .current-status-control > span,
.side-panel .change-intensity-control > span,
.side-panel .story-presets-control .field-head > span,
.side-panel .address-control .field-head > span,
.side-panel .timespan-filter .filter-head > span,
.side-panel .age-filter .filter-head > span,
.side-panel .search-control .field-head > span {
  font-size: var(--sys-control-label-size) !important;
  line-height: 1.2;
  font-weight: 600 !important;
}

.app-shell,
.main-panel,
.side-panel-body,
.explorer-summary-cards,
.timeline-zoom-main-controls,
.timeline-zoom-right,
.timeline-row-actions,
.survey-controls,
.survey-toolbar,
.survey-lightbox-actions,
.survey-panpad,
.survey-panpad-row {
  gap: var(--sys-space-3);
}

.side-panel,
.controls,
.story-presets,
.trend-details,
.street-context-details,
.timeline-guide,
.shop-row,
.explorer-summary-details,
.dashboard-card,
.survey-minimap,
.survey-panpad,
.survey-lightbox-dialog {
  background: var(--sys-surface);
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-md);
  box-shadow: var(--sys-shadow-sm);
}

.side-panel {
  padding: var(--sys-space-4);
}

.dashboard-section {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.explorer-summary-details {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.explorer-summary-cards {
  padding: 0;
}

.side-panel-divider {
  background: var(--sys-border);
}

.panel-heading-row {
  margin-bottom: var(--sys-space-1);
}

.panel-disclosure {
  color: var(--sys-text);
  gap: var(--sys-space-2);
  padding: 0.14rem 0.2rem 0.14rem 0;
  border-radius: var(--sys-radius-sm);
  transition: background-color var(--sys-transition), color var(--sys-transition);
}

.panel-disclosure:hover {
  background: var(--sys-accent-soft);
  color: var(--sys-accent-strong);
}

.panel-disclosure:focus-visible,
.top-nav-link:focus-visible,
.theme-segment-btn:focus-visible,
.trend-scale-btn:focus-visible,
.timeline-action-btn:focus-visible,
.survey-lightbox-inline-btn:focus-visible,
.survey-lightbox-close:focus-visible,
.mobile-quick-action-btn:focus-visible,
.mobile-back-to-top:focus-visible,
.side-panel-toggle:focus-visible,
.search-suggestion:focus-visible,
.survey-lightbox-address-option:focus-visible {
  outline: 2px solid var(--sys-focus);
  outline-offset: 2px;
}

.panel-disclosure-chevron {
  color: var(--sys-text-soft);
}

.top-nav {
  gap: var(--sys-space-1);
  margin-top: 0.45rem;
  border-bottom: 1px solid var(--sys-border);
}

.top-nav-more-btn,
.top-nav-more-panel {
  display: none;
}

.top-nav-link {
  color: var(--sys-text-muted);
  font-family: var(--sys-font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.48rem 0.7rem 0.58rem;
  transition: color var(--sys-transition), border-color var(--sys-transition);
}

.top-nav-link:hover {
  color: var(--sys-text);
}

.top-nav-link.is-active {
  color: var(--sys-accent);
  border-bottom-color: var(--sys-accent);
}

input:not([type="range"]),
textarea,
select,
button,
.search-tokenizer {
  font-family: var(--sys-font-sans);
}

input:not([type="range"]),
textarea,
select,
.search-tokenizer {
  border: 1px solid var(--sys-border-strong);
  border-radius: var(--sys-radius-sm);
  background: var(--sys-surface-strong);
  color: var(--sys-text);
  transition:
    border-color var(--sys-transition),
    box-shadow var(--sys-transition),
    background-color var(--sys-transition),
    color var(--sys-transition);
}

input:not([type="range"]):focus,
textarea:focus,
select:focus,
.search-tokenizer:focus-within,
.survey-lightbox-jump input:focus {
  border-color: var(--sys-accent);
  box-shadow: 0 0 0 3px var(--sys-focus);
  outline: none;
}

input:not([type="range"])::placeholder,
textarea::placeholder,
#searchTextInput::placeholder {
  color: var(--sys-text-soft);
}

.search-suggestions,
.survey-lightbox-address-suggestions {
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-sm);
  background: var(--sys-surface-strong);
  box-shadow: var(--sys-shadow-md);
}

.search-suggestion,
.survey-lightbox-address-option {
  color: var(--sys-text);
  border-radius: 6px;
}

.search-suggestion:hover,
.search-suggestion.active,
.survey-lightbox-address-option:hover {
  background: var(--sys-accent-soft);
}

.theme-segmented,
.trend-scale-toggle {
  border: 1px solid var(--sys-border);
  border-radius: var(--sys-radius-sm);
  background: var(--sys-surface-muted);
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.theme-segment-btn,
.trend-scale-btn {
  color: var(--sys-text-muted);
  border-radius: 6px;
  transition:
    background-color var(--sys-transition),
    color var(--sys-transition),
    box-shadow var(--sys-transition);
}

.theme-segment-btn.is-active,
.trend-scale-btn.is-active,
.survey-mode-btn.is-active,
.survey-zoom-btn.is-active {
  background: var(--sys-accent);
  color: #ffffff;
  box-shadow: var(--sys-shadow-sm);
}

.timeline-action-btn,
.survey-lightbox-inline-btn,
.survey-lightbox-close,
.mobile-quick-action-btn,
.mobile-back-to-top,
.side-panel-toggle,
.survey-pan-btn,
.kpi-info-btn {
  appearance: none;
  border: 1px solid var(--sys-border-strong);
  border-radius: var(--sys-radius-sm);
  background: var(--sys-surface-strong);
  color: var(--sys-accent);
  font-family: var(--sys-font-sans);
  font-weight: 700;
  transition:
    background-color var(--sys-transition),
    border-color var(--sys-transition),
    color var(--sys-transition),
    box-shadow var(--sys-transition);
}

.timeline-action-btn:hover,
.survey-lightbox-inline-btn:hover,
.survey-lightbox-close:hover,
.mobile-quick-action-btn:hover,
.mobile-back-to-top:hover,
.side-panel-toggle:hover,
.kpi-info-btn:hover,
.kpi-info-btn:focus-visible,
.kpi-info-btn[aria-expanded="true"] {
  background: var(--sys-accent-soft);
  border-color: color-mix(in srgb, var(--sys-accent) 42%, var(--sys-border));
  color: var(--sys-accent-strong);
}

.survey-pan-btn {
  background: var(--sys-accent);
  border-color: var(--sys-accent);
  color: #ffffff;
  box-shadow: var(--sys-shadow-sm);
}

.survey-pan-btn:hover {
  background: var(--sys-accent-strong);
  border-color: var(--sys-accent-strong);
  color: #ffffff;
}

.timeline-action-btn:disabled,
.mobile-quick-action-btn:disabled,
.survey-lightbox-close:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.timeline-action-btn:disabled:hover,
.mobile-quick-action-btn:disabled:hover,
.survey-lightbox-close:disabled:hover {
  background: var(--sys-surface-strong);
  border-color: var(--sys-border-strong);
  color: var(--sys-accent);
}

.reset-link,
.inline-link,
.credit a,
.current-business-link,
.panel-disclosure,
.survey-lightbox-maps-link {
  color: var(--sys-accent);
}

.reset-link:hover,
.inline-link:hover,
.credit a:hover,
.current-business-link:hover,
.survey-lightbox-maps-link:hover {
  color: var(--sys-accent-strong);
}

.slider-track-base,
.guide-rail-base {
  background: var(--sys-border);
}

.slider-track-active,
.guide-rail-active {
  background: var(--sys-accent);
  box-shadow: none;
}

.slider-stack input[type="range"]::-webkit-slider-thumb,
.slider-stack input[type="range"]::-moz-range-thumb {
  background: var(--sys-accent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.slider-bubble {
  border-color: var(--sys-border-strong);
  background: var(--sys-surface-strong);
  color: var(--sys-text);
}

.shop-label,
.survey-toolbar,
.survey-viewport.is-timeline-mode,
.survey-lightbox-jump input,
.survey-annual-tile,
.street-lane-cells {
  background: var(--sys-surface-strong);
}

.shop-label {
  border-right-color: var(--sys-border);
}

.survey-viewport.is-timeline-mode {
  background: #f3f5f9;
}

.survey-timeline-row .survey-timeline-address {
  background: var(--sys-surface-strong) !important;
}

.track-wrap {
  background: linear-gradient(180deg, var(--sys-surface-tint), var(--sys-surface-muted));
}

.survey-toolbar {
  border-bottom: 1px solid var(--sys-border);
  padding: var(--sys-space-3) max(8rem, 8vw);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.survey-viewport.is-zoom-transitioning {
  box-shadow: inset 0 0 0 1px rgba(44, 95, 181, 0.16), var(--sys-shadow-md);
}

.survey-annual-tile {
  border: 1px solid var(--sys-border);
  border-radius: 4px;
  box-shadow: var(--sys-shadow-sm);
}

.survey-panpad {
  background: var(--sys-surface);
  border-color: var(--sys-border);
  box-shadow: var(--sys-shadow-sm);
}

.survey-lightbox-backdrop {
  background: rgba(14, 22, 35, 0.78);
}

.survey-lightbox-dialog {
  background: var(--sys-surface);
  box-shadow: var(--sys-shadow-lg);
}

.tooltip {
  background: #17253b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: var(--sys-shadow-md);
}

html[data-theme="dark"] body {
  background: var(--sys-page);
  color: var(--sys-text);
}

html[data-theme="dark"] .page-header {
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .heading-tagline,
html[data-theme="dark"] .credit,
html[data-theme="dark"] .credit a {
  color: #f2f6ff;
}

html[data-theme="dark"] .theme-segmented,
html[data-theme="dark"] .trend-scale-toggle,
html[data-theme="dark"] .search-suggestions,
html[data-theme="dark"] .survey-lightbox-address-suggestions {
  box-shadow: none;
}

html[data-theme="dark"] .timeline-action-btn:hover,
html[data-theme="dark"] .survey-lightbox-inline-btn:hover,
html[data-theme="dark"] .survey-lightbox-close:hover,
html[data-theme="dark"] .mobile-quick-action-btn:hover,
html[data-theme="dark"] .mobile-back-to-top:hover,
html[data-theme="dark"] .side-panel-toggle:hover,
html[data-theme="dark"] .panel-disclosure:hover,
html[data-theme="dark"] .search-suggestion:hover,
html[data-theme="dark"] .search-suggestion.active,
html[data-theme="dark"] .survey-lightbox-address-option:hover {
  background: var(--sys-accent-soft);
  color: var(--sys-accent-strong);
}

html[data-theme="dark"] .survey-toolbar,
html[data-theme="dark"] .shop-label,
html[data-theme="dark"] .survey-viewport.is-timeline-mode,
html[data-theme="dark"] .survey-lightbox-jump input,
html[data-theme="dark"] .survey-annual-tile,
html[data-theme="dark"] .street-lane-cells {
  background: var(--sys-surface-strong);
}

html[data-theme="dark"] .track-wrap {
  background: linear-gradient(180deg, #263143, #202836);
}

html[data-theme="dark"] .tooltip {
  background: #0f1522;
  border-color: rgba(127, 176, 255, 0.16);
}

@media (max-width: 560px) {
  .survey-view {
    margin-top: 0.58rem;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    align-items: stretch;
    border-top: 1px solid var(--sys-border);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
  }

  .top-nav-link {
    min-height: 52px;
    padding: 0.72rem 0.42rem;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.12;
    border-bottom-width: 3px;
  }

  .top-nav-link:not(.top-nav-more-btn) {
    border-right: 1px solid rgba(215, 223, 235, 0.72);
  }

  .top-nav-link:last-child {
    border-right: 0;
  }

  .top-nav-link[data-view="book"],
  .top-nav-link[data-view="about"] {
    display: none;
  }

  .top-nav-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0;
    line-height: 1;
    transform: translateY(-2px);
  }

  .top-nav-more-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--sys-border);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--sys-shadow-sm);
  }

  .top-nav-more-panel[hidden] {
    display: none;
  }

  .top-nav-more-link {
    appearance: none;
    min-height: 52px;
    border: 0;
    border-top: 1px solid rgba(215, 223, 235, 0.72);
    border-right: 1px solid rgba(215, 223, 235, 0.72);
    background: transparent;
    color: var(--sys-text-muted);
    font-family: var(--sys-font-sans);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.15;
    padding: 0.7rem 0.55rem;
    text-align: center;
  }

  .top-nav-more-link:last-child {
    border-right: 0;
  }

  .top-nav-more-link.is-active,
  .top-nav-more-btn.is-active {
    color: var(--sys-accent);
    background: var(--sys-accent-soft);
  }

  .top-nav-more-btn.is-open {
    background: var(--sys-accent-soft);
    color: var(--sys-accent);
  }

  .top-nav-more-link:focus-visible {
    outline: 2px solid var(--sys-focus);
    outline-offset: -2px;
  }

  .side-panel .scope-control > span,
  .side-panel .current-status-control > span,
  .side-panel .change-intensity-control > span,
  .side-panel .story-presets-control .field-head > span,
  .side-panel .address-control .field-head > span,
  .side-panel .search-control .field-head > span {
    font-size: var(--m-label) !important;
    font-weight: 700 !important;
  }
}
