/* Fatih map experience: restrained cartography, legible controls, honest legends. */
:root {
  --map-ui-ink: #172033;
  --map-ui-muted: #536174;
  --map-ui-subtle: #728096;
  --map-ui-line: #d9e0e8;
  --map-ui-paper: #ffffff;
  --map-ui-soft: #f6f8fb;
  --map-ui-blue: #2563eb;
  --map-ui-blue-dark: #1d4ed8;
  --map-ui-focus: #1d4ed8;
  --map-ui-shadow: 0 8px 24px rgba(15, 23, 42, .12), 0 1px 3px rgba(15, 23, 42, .08);
}

.fatih-map-page {
  min-height: 100vh;
  color: var(--map-ui-ink);
  background: #f8fafc;
  overflow-x: hidden;
}
.fatih-map-page a { color: inherit; }
.fatih-map-page button,
.fatih-map-page input,
.fatih-map-page summary { font-family: var(--sans, system-ui, sans-serif); }
.fatih-map-page button:focus-visible,
.fatih-map-page a:focus-visible,
.fatih-map-page input:focus-visible,
.fatih-map-page summary:focus-visible {
  outline: 3px solid var(--map-ui-focus);
  outline-offset: 2px;
}
.map-app-noise,
.map-grid-overlay,
.map-vignette,
.map-intro-card,
.map-status-rail,
.map-brief { display: none !important; }

.fatih-map-header {
  position: relative;
  z-index: 40;
  height: 64px;
  padding: 0 clamp(14px, 2vw, 28px);
  border-bottom: 1px solid var(--map-ui-line);
  color: var(--map-ui-ink);
  background: var(--map-ui-paper);
}
.fatih-map-header .brand-light,
.fatih-map-header .brand-name { color: var(--map-ui-ink); }
.fatih-map-header .brand-name span { color: var(--map-ui-blue); }
.fatih-map-title { display: grid; gap: 2px; text-align: center; }
.fatih-map-title span,
.fatih-map-title strong { color: var(--map-ui-muted); font-family: var(--sans, system-ui, sans-serif); letter-spacing: 0; }
.fatih-map-title span { font-size: 12px; }
.fatih-map-title strong { font-size: 13px; font-weight: 750; }
.fatih-map-title b { color: var(--map-ui-blue); }
.fatih-map-nav { gap: clamp(10px, 1.5vw, 22px); color: var(--map-ui-ink); font-size: 13px; font-weight: 650; }
.fatih-map-nav a,
.fatih-map-nav a:first-child { display: inline-flex; align-items: center; min-height: 40px; color: var(--map-ui-muted); }
.fatih-map-nav a:hover { color: var(--map-ui-blue); }
.fatih-map-nav span { color: var(--map-ui-blue); }
.fatih-map-main { background: #f8fafc; }
.fatih-map-workspace {
  height: calc(100svh - 64px);
  min-height: 610px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #e9eef4;
}
#fatih-map { position: absolute; inset: 0; z-index: 0; background: #edf1f5; }
#fatih-map.has-map-error { background: #eef2f6; }
#fatih-map .maplibregl-canvas { outline: 0; }

.map-scope-header {
  position: absolute;
  z-index: 8;
  top: 15px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--map-ui-ink);
}
.map-scope-marker {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--map-ui-line);
  border-radius: 10px;
  color: var(--map-ui-blue);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  font-size: 21px;
}
.map-scope-header > span:last-child { display: grid; gap: 2px; }
.map-scope-header strong { font-size: 16px; font-weight: 750; line-height: 1.15; }
.map-scope-header small { color: var(--map-ui-muted); font-size: 12px; line-height: 1.2; }

.map-command-bar {
  position: absolute;
  z-index: 9;
  top: 69px;
  left: 20px;
  width: min(390px, calc(100% - 40px));
  display: grid;
  justify-items: start;
  gap: 7px;
}
.map-search {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 5px 4px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
}
.map-search > span { color: var(--map-ui-blue); font-size: 21px; line-height: 1; }
.map-search input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 6px 2px;
  border: 0;
  outline: 0;
  color: var(--map-ui-ink);
  background: #fff;
  font-size: 14px;
}
.map-search input::placeholder { color: #6b778a; opacity: 1; }
.map-search button {
  min-width: 52px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--map-ui-blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.map-search button:hover { background: var(--map-ui-blue-dark); }
.map-search-feedback {
  min-height: 30px;
  max-width: 390px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid var(--map-ui-line);
  border-radius: 7px;
  color: var(--map-ui-muted);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  font-size: 12px;
  line-height: 1.4;
  text-shadow: none;
}
.map-search-feedback span { color: var(--map-ui-blue); font-weight: 700; }
.map-dimension-controls {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--map-ui-line);
  border-radius: 9px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  backdrop-filter: none;
}
.map-dimension-controls button {
  min-width: 52px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--map-ui-muted);
  background: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  cursor: pointer;
}
.map-dimension-controls button.is-active { color: #fff; background: var(--map-ui-blue); }
.map-dimension-controls button:hover:not(.is-active) { color: var(--map-ui-blue); background: #eff6ff; }
.map-dimension-controls button span { display: none; }

.map-theme-switcher {
  position: absolute;
  z-index: 12;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  width: max-content;
  max-width: min(720px, calc(100% - 475px));
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #d4dce6;
  border-radius: 11px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
  scrollbar-width: thin;
}
.map-theme-switcher button {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #344256;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.map-theme-switcher button > span:first-child { color: var(--map-ui-blue); font-size: 17px; line-height: 1; }
.map-theme-switcher button:hover:not(.is-active) { color: var(--map-ui-blue-dark); background: #f3f7fc; }
.map-theme-switcher button.is-active { color: #fff; background: var(--map-ui-blue); }
.map-theme-switcher button.is-active > span:first-child { color: #fff; }

.map-tools { position: absolute; z-index: 22; top: 14px; right: 20px; color: var(--map-ui-ink); }
.map-tools > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #273449;
  background: #fff;
  box-shadow: var(--map-ui-shadow);
  font-size: 13px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.map-tools > summary::-webkit-details-marker { display: none; }
.map-tools > summary::after { content: '⌄'; color: var(--map-ui-blue); font-size: 17px; }
.map-tools[open] > summary { border-color: #93b4f6; }
.map-tools-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 250px;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--map-ui-line);
  border-radius: 10px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
}
.map-tools-menu button,
.map-tools-menu a {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  color: #28364b;
  background: #fff;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.map-tools-menu button:hover,
.map-tools-menu a:hover { color: var(--map-ui-blue-dark); background: #eff6ff; }
.map-tools-menu button span { color: var(--map-ui-blue); font-size: 17px; }
.map-tools-menu a span { margin-left: auto; color: var(--map-ui-blue); }
.map-tools-menu .map-style-switcher {
  position: static;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  margin-top: 4px;
  padding: 9px 2px 1px;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: none;
}
.map-tools-menu .map-style-switcher p { grid-column: 1 / -1; margin: 0 4px 3px; color: #526176; font-size: 12px; }
.map-tools-menu .map-style-switcher button { justify-content: center; min-height: 40px; padding-inline: 5px; font-size: 12px; }
.map-tools-menu .map-style-switcher i { width: 10px; height: 10px; }

.map-style-switcher {
  position: absolute;
  z-index: 10;
  top: 70px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--map-ui-line);
  border-radius: 9px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
}
.map-style-switcher p { margin: 0 4px 0 6px; color: var(--map-ui-muted); font: 12px var(--sans, system-ui, sans-serif); letter-spacing: 0; }
.map-style-switcher button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: #4b596d;
  background: #fff;
  font: 13px var(--sans, system-ui, sans-serif);
  cursor: pointer;
}
.map-style-switcher button:hover:not(.is-active) { color: var(--map-ui-blue); background: #f3f7fc; }
.map-style-switcher button.is-active { color: #1748a5; background: #eaf1ff; }
.map-style-switcher i { width: 12px; height: 12px; border-color: #95a2b3; border-radius: 3px; }
.swatch-city { background: #e6edf2; }
.swatch-dark { background: #334155; }
.swatch-light { background: #f8fafc; }

.map-live-panel,
.map-poi-drawer,
.map-admin-panel,
.twin-decision-panel,
.map-layer-drawer,
.city-panel {
  position: absolute;
  z-index: 30;
  top: 122px;
  right: 20px;
  bottom: auto;
  left: auto;
  width: min(372px, calc(100% - 40px));
  max-height: calc(100% - 164px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid #d6dee8;
  border-radius: 12px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
  backdrop-filter: none;
  scrollbar-color: #b9c7d8 #f5f7fa;
  scrollbar-width: thin;
}
.map-live-panel.is-closed,
.map-poi-drawer.is-closed,
.map-admin-panel.is-closed,
.twin-decision-panel:not(.is-open),
.map-layer-drawer:not(.is-open),
.city-panel.is-closed,
.city-panel[hidden] { display: none !important; }
.map-admin-panel { transform: none; }
.city-panel { position: absolute; width: min(420px, calc(100% - 40px)); max-height: calc(100% - 164px); }
.twin-decision-panel { transform: none; opacity: 1; pointer-events: auto; transition: none; }
.twin-decision-panel.is-open { transform: none; opacity: 1; pointer-events: auto; }
.map-layer-drawer { transform: none; transition: none; }
.map-layer-drawer.is-open { display: block; transform: none; }
.utility-panel-header,
.twin-panel-head,
.city-panel-head,
.drawer-header { border-color: #e1e6ed; }
.utility-panel-header p,
.twin-panel-head p,
.twin-section-label,
.city-panel-head p,
.drawer-header p { color: #44546a; font: 600 12px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: .035em; }
.utility-panel-header h2,
.twin-panel-head h2,
.city-panel-head h2,
.drawer-header h2 { color: var(--map-ui-ink); font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.utility-panel-header button,
.twin-panel-close,
.city-panel-close,
.drawer-close { min-width: 40px; min-height: 40px; border: 1px solid var(--map-ui-line); border-radius: 7px; color: #334155; background: #fff; cursor: pointer; }
.utility-panel-header button:hover,
.twin-panel-close:hover,
.city-panel-close:hover,
.drawer-close:hover { color: var(--map-ui-blue); background: #eff6ff; }
.utility-note,
.poi-note,
.twin-panel-intro,
.city-note,
.city-panel > p[data-city-summary] { color: #455468; font-size: 14px; line-height: 1.5; }
.utility-panel-link { min-height: 40px; padding: 10px 12px; border: 1px solid #bad0fa; border-radius: 7px; color: #1748a5; background: #eff6ff; font: 600 13px/1.4 var(--sans, system-ui, sans-serif); text-decoration: none; }
.utility-panel-link:hover { background: #e0ecff; }
.utility-panel-anchor { color: #1748a5; }

/* Theme-focused panels retain the existing provider-owned data cards. */
.map-live-panel[data-theme-focus="weather"] .live-layer-switches,
.map-live-panel[data-theme-focus="earthquakes"] .live-layer-switches,
.map-live-panel[data-theme-focus="traffic"] .live-layer-switches,
.map-live-panel[data-theme-focus="weather"] [data-earthquake-card],
.map-live-panel[data-theme-focus="weather"] [data-parking-card],
.map-live-panel[data-theme-focus="weather"] [data-charging-card],
.map-live-panel[data-theme-focus="weather"] [data-transit-card],
.map-live-panel[data-theme-focus="weather"] [data-traffic-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-weather-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-air-quality-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-parking-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-charging-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-transit-card],
.map-live-panel[data-theme-focus="earthquakes"] [data-traffic-card],
.map-live-panel[data-theme-focus="traffic"] [data-weather-card],
.map-live-panel[data-theme-focus="traffic"] [data-air-quality-card],
.map-live-panel[data-theme-focus="traffic"] [data-earthquake-card],
.map-live-panel[data-theme-focus="traffic"] [data-parking-card],
.map-live-panel[data-theme-focus="traffic"] [data-charging-card],
.map-live-panel[data-theme-focus="traffic"] [data-transit-card] { display: none !important; }
.map-live-panel[data-theme-focus="weather"] .utility-panel-link,
.map-live-panel[data-theme-focus="earthquakes"] .utility-panel-link,
.map-live-panel[data-theme-focus="traffic"] .utility-panel-link,
.map-live-panel[data-theme-focus="weather"] > .utility-note:last-child,
.map-live-panel[data-theme-focus="earthquakes"] > .utility-note:last-child,
.map-live-panel[data-theme-focus="traffic"] > .utility-note:last-child { display: none !important; }
.map-live-panel[data-theme-focus="tools"] .live-layer-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weather-readout,
.air-quality-readout,
.earthquake-readout,
.traffic-readout,
.mobility-readout,
.transit-readout { border: 1px solid #e0e6ed; border-radius: 9px; color: var(--map-ui-ink); background: #f9fbfd; }
.weather-head p,
.air-quality-head p,
.earthquake-head p,
.traffic-head p,
.mobility-head p,
.transit-head p { color: #64748b; font: 600 12px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: .025em; }
.weather-head strong,
.air-quality-head strong,
.earthquake-head strong,
.traffic-head strong,
.mobility-head strong,
.transit-head strong { color: var(--map-ui-ink); font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.weather-head > span:first-child { width: 40px; height: 40px; color: #fff; background: var(--map-ui-blue); }
.weather-metrics,
.air-quality-metrics,
.earthquake-stats,
.mobility-stats,
.transit-stats { border-color: #e0e6ed; }
.weather-metrics b,
.air-quality-metrics b,
.earthquake-stats b,
.mobility-stats b,
.transit-stats b { color: #202c3e; font-size: 14px; font-family: var(--sans, system-ui, sans-serif); }
.weather-metrics small,
.air-quality-metrics small,
.earthquake-stats small,
.mobility-stats small,
.transit-stats small { color: #65748b; font: 12px/1.3 var(--sans, system-ui, sans-serif); }
.weather-head .data-badge,
.data-badge { padding: 5px 7px; border: 1px solid #c8d8f7; border-radius: 5px; color: #1748a5; background: #eaf1ff; font: 600 11px/1.2 var(--sans, system-ui, sans-serif); letter-spacing: 0; }
.weather-head .data-badge[data-observation="static"] { color: #78470a; border-color: #eed8ae; background: #fff7e8; }
.weather-head .data-badge[data-observation="error"],
.weather-head .data-badge[data-observation="disabled"] { color: #8d312c; border-color: #f1c6c2; background: #fff2f1; }

.live-layer-switches { gap: 6px; }
.live-layer-switches button,
.map-layer-toggle,
.twin-layer-button { min-height: 44px; border-color: #dce3eb; border-radius: 7px; color: #344256; background: #fff; }
.live-layer-switches button:hover,
.live-layer-switches button.is-on,
.map-layer-toggle:hover,
.map-layer-toggle.is-on,
.twin-layer-button:hover,
.twin-layer-button.is-on { border-color: #a9c4f9; color: #173f91; background: #eff6ff; }
.live-layer-switches strong,
.map-layer-toggle strong,
.twin-layer-button strong { color: inherit; font-size: 14px; }
.live-layer-switches small,
.map-layer-toggle small,
.twin-layer-button small { color: #66758a; font: 12px/1.35 var(--sans, system-ui, sans-serif); letter-spacing: 0; white-space: normal; }
.live-layer-switches b,
.map-layer-toggle b,
.twin-layer-button b { color: #526176; font-size: 13px; }
.layer-key,
.live-key { box-shadow: none; }
.traffic-key { background: #ef4444; }
.weather-key { background: #2563eb; }
.report-key,
.quake-key { background: #c2413a; }
.air-key { background: #7c3aed; }
.parking-key { background: #16855e; }
.charging-key { background: #6d4ad5; }
.transit-key { background: #b45309; }

.traffic-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.traffic-legend span { display: inline-flex; align-items: center; gap: 6px; color: #334155; font-size: 13px; font-weight: 600; }
.traffic-legend i { width: 25px; height: 4px; display: inline-block; border-radius: 4px; }
.traffic-high { background: #dc2626; }
.traffic-medium { background: #d97706; }
.traffic-low { background: #15803d; }
.earthquake-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.earthquake-actions button {
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #bfd0ed;
  border-radius: 7px;
  color: #1d4ed8;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.earthquake-actions button:hover { background: #eff6ff; }
.earthquake-events { display: grid; gap: 5px; margin-top: 10px; }
.earthquake-event { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid #dfe5ec; border-radius: 7px; color: var(--map-ui-ink); background: #fff; text-align: left; cursor: pointer; }
.earthquake-event:hover { border-color: #f1b3a9; background: #fff7f5; }
.earthquake-event-magnitude { min-width: 43px; color: #b9382e; font: 750 14px/1.2 var(--sans, system-ui, sans-serif); }
.earthquake-event-details { min-width: 0; display: grid; gap: 2px; }
.earthquake-event-place { overflow: hidden; color: #2c394c; font-size: 13px; line-height: 1.3; text-overflow: ellipsis; }
.earthquake-event-details small { color: #66758a; font-size: 12px; }
.earthquake-empty { margin: 0; padding: 10px; border: 1px dashed #cbd5e1; border-radius: 7px; color: #526176; background: #fff; font-size: 13px; line-height: 1.45; }

.poi-filters button,
.report-type-grid button,
.twin-choice-grid button,
.transit-filters button,
.city-filter-button { min-height: 40px; border: 1px solid #d5dde7; border-radius: 7px; color: #344256; background: #fff; font: 13px/1.3 var(--sans, system-ui, sans-serif); letter-spacing: 0; }
.poi-filters button.is-active,
.report-type-grid button.is-active,
.twin-choice-grid button.is-active,
.transit-filters button.is-active,
.city-filter-button[aria-pressed="true"] { border-color: #2563eb; color: #fff; background: #2563eb; }
.poi-card { min-height: 54px; border-color: #dfe5ec; border-radius: 8px; color: #1f2937; background: #fff; }
.poi-card:hover { border-color: #aac4f5; background: #f5f8ff; }
.poi-card strong { color: #202c3e; font-size: 14px; }
.poi-card small { color: #5b687b; font-size: 12px; line-height: 1.4; }

.twin-panel-intro,
.twin-density-note { color: #475569; font-size: 14px; line-height: 1.5; }
.twin-density-note { margin: 8px 0 0; }
.twin-source-summary { display: flex; flex-wrap: wrap; gap: 5px; }
.twin-source-chip { border: 1px solid #dce3eb; border-radius: 5px; color: #405066; background: #f7f9fb; font: 12px/1.35 var(--sans, system-ui, sans-serif); }
.twin-layer-grid { gap: 6px; }
.twin-layer-button { min-height: 50px; padding: 8px; }
.twin-layer-button small { font-size: 11px; }
.twin-time-row,
.twin-scenario-card,
.twin-kpis span,
.twin-report-status { border-color: #e0e6ed; color: #334155; background: #f8fafc; }
.twin-scenario-card h3,
.twin-kpis b,
.twin-time-row strong { color: #1f2937; }
.twin-scenario-card p,
.twin-kpis small { color: #56657a; }
.twin-report-status strong { color: #85433e; }
.twin-decision-panel[data-theme-focus="density"] .twin-source-summary,
.twin-decision-panel[data-theme-focus="density"] .twin-layer-group,
.twin-decision-panel[data-theme-focus="density"] .twin-scenario-block { display: none !important; }
.twin-decision-panel[data-theme-focus="density"] .twin-report-block { margin-top: 0; padding-top: 0; border-top: 0; }

.map-data-disclosure { border: 1px solid #dbe2ea; border-radius: 8px; color: #253247; background: #fff; }
.map-data-disclosure > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; color: #243147; font-size: 14px; font-weight: 650; cursor: pointer; }
.map-data-disclosure[open] > summary { border-bottom: 1px solid #e2e8f0; }
.map-data-disclosure > :not(summary) { margin: 10px; }
.city-panel .city-panel-head { background: #fff; }
.city-panel-head p,
.city-panel .city-note { color: #4b5b70; }
.city-panel .city-note a { color: #1748a5; }
.city-panel > p[data-city-summary] { border-color: #2563eb; color: #27364a; background: #eff6ff; }
.city-panel button[data-city-refresh] { min-height: 40px; border: 1px solid #2563eb; border-radius: 7px; color: #fff; background: #2563eb; font: 650 13px/1.3 var(--sans, system-ui, sans-serif); }
.city-panel button[data-city-refresh]:hover:not(:disabled) { color: #fff; background: #1d4ed8; }
.city-source-row,
.city-feature-card,
.city-detail-card,
.city-forecast-day { border-color: #e0e6ed; border-radius: 7px; color: #273449; background: #f9fbfd; }
.city-source-name,
.city-record-select,
.city-record-title { color: #202c3e; }
.city-source-provider,
.city-source-time,
.city-source-fetch-time,
.city-source-note,
.city-source-scope,
.city-source-attribution,
.city-record-mode,
.city-record-provider,
.city-record-time,
.city-record-description,
.city-detail-note,
.city-forecast-disclaimer,
.city-forecast-source-time,
.city-forecast-fetch-time,
.city-forecast-attribution { color: #526176; }
.city-source-mode,
.city-forecast-date { color: #234e9b; }
.city-source-status { color: #1d4ed8; }
.city-feature-afad { border-left-color: #dc2626; }
.city-feature-ispark { border-left-color: #d97706; }
.city-feature-osm { border-left-color: #15803d; }
.city-category-filters { border-color: #e0e6ed; }
.city-filter-button { padding: 7px 10px; }
.city-list-empty,
.city-list-limit,
.city-forecast-empty { border-color: #cbd5e1; color: #526176; background: #f8fafc; }
.city-detail-title,
.city-detail-capacity { color: #7a5014; }
.city-panel a.city-attribution-link,
.city-panel .city-source-credit a,
.city-panel .city-forecast-credit a { color: #1748a5; text-decoration-color: #93b4f6; }

.map-theme-legend {
  position: absolute;
  z-index: 14;
  right: 20px;
  bottom: 19px;
  width: min(320px, calc(100% - 40px));
  max-height: min(42vh, 360px);
  overflow: auto;
  border: 1px solid #d5dde7;
  border-radius: 10px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
  scrollbar-color: #b9c7d8 #f5f7fa;
  scrollbar-width: thin;
}
.map-theme-legend > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: #253247;
  background: #fff;
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}
.map-theme-legend > summary::-webkit-details-marker { display: none; }
.map-theme-legend > summary::after { content: '⌄'; color: var(--map-ui-blue); font-size: 17px; }
.map-theme-legend:not([open]) > summary::after { content: '›'; }
.map-theme-legend > summary strong { font-weight: 750; }
.map-theme-legend > summary span { margin-left: auto; color: #536174; font-size: 13px; font-weight: 600; }
.map-theme-legend-body { display: grid; gap: 8px; padding: 2px 12px 12px; border-top: 1px solid #e3e8ef; }
.map-legend-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 32px; }
.map-legend-symbol { justify-self: center; display: block; }
.legend-symbol-base { width: 12px; height: 12px; border: 2px solid #64748b; border-radius: 50%; background: #fff; }
.legend-symbol-weather { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 1px #1748a5; }
.legend-symbol-air { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #7c3aed; box-shadow: 0 0 0 1px #5b21b6; }
.legend-symbol-quake { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #dc5a4a; box-shadow: 0 0 0 1px #a73228; }
.legend-symbol-traffic-high,
.legend-symbol-traffic-medium,
.legend-symbol-traffic-low { width: 21px; height: 4px; border-radius: 4px; }
.legend-symbol-traffic-high { background: #dc2626; }
.legend-symbol-traffic-medium { background: #d97706; }
.legend-symbol-traffic-low { background: #15803d; }
.legend-symbol-density { width: 18px; height: 10px; border-radius: 8px; background: linear-gradient(90deg, #60a5fa, #f59e0b, #ef4444); }
.map-legend-copy { min-width: 0; display: grid; gap: 2px; }
.map-legend-copy strong { color: #273449; font-size: 13px; font-weight: 700; }
.map-legend-copy small { color: #5b687b; font-size: 12px; line-height: 1.35; }
.map-legend-note { margin: 0; color: #536174; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.map-legend-note strong { color: #344256; font-weight: 700; }

.map-selection-card {
  position: absolute;
  z-index: 25;
  top: 122px;
  right: 20px;
  bottom: auto;
  width: min(340px, calc(100% - 40px));
  max-height: calc(100% - 164px);
  overflow: auto;
  padding: 15px;
  border: 1px solid #d8e0e9;
  border-radius: 10px;
  color: var(--map-ui-ink);
  background: #fff;
  box-shadow: var(--map-ui-shadow);
  backdrop-filter: none;
}
.map-selection-card.is-closed { display: none; }
.map-selection-card > button { min-width: 40px; min-height: 40px; color: #526176; }
.map-selection-card > span { color: #526176; font: 650 12px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: .02em; }
.map-selection-card h2 { color: #1f2937; font-size: 19px; letter-spacing: -.025em; }
.map-selection-card > p { color: #4b5b70; font-size: 14px; line-height: 1.5; }
.map-selection-card dl { border-color: #e1e6ed; }
.map-selection-card dl div { min-height: 28px; }
.map-selection-card dt { color: #66758a; font: 600 11px/1.35 var(--sans, system-ui, sans-serif); }
.map-selection-card dd { color: #344256; font: 13px/1.4 var(--sans, system-ui, sans-serif); }
.map-selection-card .selection-facts span { border-color: #e1e6ed; color: #475569; background: #f8fafc; font: 12px/1.4 var(--sans, system-ui, sans-serif); }
.map-selection-card .selection-media { background: #f1f5f9; }
.map-selection-card .selection-media span { color: #fff; }

.map-reset-view {
  position: absolute;
  z-index: 10;
  left: 20px;
  bottom: 19px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #ccd6e2;
  border-radius: 8px;
  color: #273449;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
  font: 600 13px/1.3 var(--sans, system-ui, sans-serif);
  cursor: pointer;
  backdrop-filter: none;
}
.map-reset-view:hover { border-color: #aac4f5; color: var(--map-ui-blue-dark); background: #f3f7ff; }
.map-reset-view span { color: var(--map-ui-blue); font-size: 17px; }
.map-data-attribution {
  position: absolute;
  z-index: 7;
  right: 10px;
  bottom: 4px;
  padding: 2px 5px;
  border: 1px solid rgba(206, 216, 228, .75);
  border-radius: 4px;
  color: #46546a;
  background: rgba(255,255,255,.94);
  font: 11px/1.35 var(--sans, system-ui, sans-serif);
  text-shadow: none;
}
.map-data-attribution a { color: #1748a5; text-decoration: underline; text-underline-offset: 2px; }
.fatih-map-workspace .maplibregl-ctrl-top-left { top: 158px; left: 20px; }
.fatih-map-workspace .maplibregl-ctrl-top-right { top: 70px; right: 20px; }
.fatih-map-workspace .maplibregl-ctrl-bottom-left { left: 20px; bottom: 70px; }
.fatih-map-workspace .maplibregl-ctrl-bottom-right { right: 338px; bottom: 18px; }
.fatih-map-workspace .maplibregl-ctrl-group { overflow: hidden; border: 1px solid #ccd6e2; border-radius: 8px; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.09); }
.fatih-map-workspace .maplibregl-ctrl-group button { width: 40px; height: 40px; background-color: #fff; }
.fatih-map-workspace .maplibregl-ctrl-group button:hover { background-color: #eff6ff; }
.fatih-map-workspace .maplibregl-ctrl-scale { border-color: #64748b; color: #334155; background: rgba(255,255,255,.92); font: 11px var(--sans, system-ui, sans-serif); }
.fatih-map-workspace .maplibregl-ctrl-attrib { max-width: 220px; border-radius: 5px; color: #46546a; background: rgba(255,255,255,.94); font-size: 11px; }
.map-report-modal { z-index: 45; }
.report-backdrop { background: rgba(15,23,42,.38); backdrop-filter: blur(2px); }
.report-card { border: 1px solid #d8e0e9; border-radius: 12px; color: #1f2937; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.2); }
.report-card .utility-panel-header { border-color: #e1e6ed; }
.report-card .utility-panel-header h2 { color: #1f2937; }
.report-card .utility-note,
.report-card .admin-input-label { color: #4b5b70; font-size: 14px; }
.report-card .admin-input { border-color: #cbd5e1; border-radius: 7px; color: #1f2937; background: #fff; font: 14px/1.45 var(--sans, system-ui, sans-serif); }
.report-card .admin-actions button { min-height: 42px; border-radius: 7px; color: #344256; font: 600 13px/1.3 var(--sans, system-ui, sans-serif); }
.report-card .admin-actions .admin-save { color: #fff; background: var(--map-ui-blue); }
.report-card .admin-feedback { color: #1748a5; font: 13px/1.4 var(--sans, system-ui, sans-serif); }

.map-brief { display: none !important; }
.fatih-map-footer { min-height: 46px; align-items: center; padding: 7px 18px; border-top: 1px solid var(--map-ui-line); color: #66758a; background: #fff; font: 12px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: 0; }
.fatih-map-footer a { color: #1748a5; }

@media (max-width: 1120px) {
  .map-theme-switcher { top: 66px; left: 16px; right: 166px; transform: none; width: auto; max-width: none; justify-content: center; }
  .map-command-bar { top: 126px; left: 16px; width: min(410px, calc(100% - 32px)); }
  .map-tools { top: 14px; right: 16px; }
  .map-style-switcher { top: 122px; right: 16px; }
  .map-live-panel,
  .map-poi-drawer,
  .map-admin-panel,
  .twin-decision-panel,
  .map-layer-drawer,
  .city-panel { top: 172px; right: 16px; max-height: calc(100% - 204px); }
  .map-selection-card { top: 172px; right: 16px; max-height: calc(100% - 204px); }
  .map-theme-legend { right: 16px; bottom: 16px; }
  .map-reset-view { left: 16px; bottom: 16px; }
  .fatih-map-workspace .maplibregl-ctrl-top-left { top: 190px; left: 16px; }
  .fatih-map-workspace .maplibregl-ctrl-bottom-left { left: 16px; bottom: 68px; }
  .fatih-map-workspace .maplibregl-ctrl-bottom-right { right: 332px; bottom: 16px; }
}

@media (max-width: 760px) {
  .fatih-map-header { height: 56px; padding-inline: 12px; }
  .fatih-map-title { display: none; }
  .fatih-map-nav { gap: 8px; font-size: 12px; }
  .fatih-map-nav a { min-height: 40px; }
  .fatih-map-nav a:first-child { display: inline-flex; }
  .fatih-map-nav a[data-auth-link] { display: none; }
  .fatih-map-workspace { height: calc(100svh - 56px); min-height: 620px; }
  .map-scope-header { top: 9px; left: 10px; gap: 7px; }
  .map-scope-marker { width: 34px; height: 34px; }
  .map-scope-header strong { font-size: 15px; }
  .map-scope-header small { font-size: 11px; }
  .map-theme-switcher {
    top: 55px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 3px;
    border-radius: 9px;
    -webkit-overflow-scrolling: touch;
  }
  .map-theme-switcher button { min-height: 40px; padding-inline: 10px; font-size: 13px; }
  .map-command-bar { top: 111px; left: 10px; right: 10px; width: auto; gap: 6px; }
  .map-search { min-height: 46px; border-radius: 8px; }
  .map-search input { font-size: 14px; }
  .map-search-feedback { max-width: min(390px, calc(100vw - 20px)); font-size: 12px; }
  .map-tools { top: 164px; left: 124px; right: auto; }
  .map-tools > summary { min-height: 40px; padding-inline: 10px; }
  .map-tools-menu { left: 0; right: auto; width: min(270px, calc(100vw - 28px)); }
  .map-style-switcher { top: 164px; left: 10px; right: auto; max-width: calc(100% - 250px); overflow-x: auto; }
  .map-style-switcher p { display: none; }
  .map-style-switcher button { min-height: 40px; padding-inline: 8px; }
  .map-style-switcher i { display: block; }
  .map-live-panel,
  .map-poi-drawer,
  .map-admin-panel,
  .twin-decision-panel,
  .map-layer-drawer,
  .city-panel,
  .map-selection-card {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: min(48svh, 430px);
    padding: 13px;
    border-radius: 12px;
  }
  .map-admin-panel { transform: none; }
  .city-panel { max-height: min(72svh, 680px); }
  .map-selection-card { max-height: min(55svh, 500px); }
  .map-theme-legend { right: 8px; bottom: 8px; width: min(285px, calc(100% - 16px)); max-height: 36svh; }
  .map-theme-legend[open] { max-height: min(36svh, 320px); }
  .map-reset-view { left: 10px; bottom: 10px; min-height: 40px; }
  .map-data-attribution { right: 5px; bottom: 2px; max-width: 220px; text-align: right; font-size: 10px; }
  .fatih-map-workspace .maplibregl-ctrl-top-left { top: 213px; left: 10px; }
  .fatih-map-workspace .maplibregl-ctrl-top-right { top: 215px; right: 10px; }
  .fatih-map-workspace .maplibregl-ctrl-bottom-left { display: none; }
  .fatih-map-workspace .maplibregl-ctrl-bottom-right { right: 10px; bottom: 52px; }
  .fatih-map-workspace .maplibregl-ctrl-group button { width: 40px; height: 40px; }
  .fatih-map-footer { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
}

@media (max-width: 420px) {
  .fatih-map-nav a[href="/"] { display: none; }
  .map-theme-switcher button { gap: 5px; padding-inline: 9px; }
  .map-style-switcher button { padding-inline: 7px; }
  .map-style-switcher i { display: none; }
  .map-tools { left: 104px; }
  .map-tools > summary { font-size: 12px; }
  .map-live-panel,
  .map-poi-drawer,
  .map-admin-panel,
  .twin-decision-panel { max-height: 50svh; }
  .live-layer-switches { grid-template-columns: 1fr; }
  .twin-layer-grid { grid-template-columns: 1fr; }
  .map-theme-legend { width: min(270px, calc(100% - 16px)); }
  .map-selection-card dl div { grid-template-columns: 75px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .map-selection-card,
  .map-layer-drawer,
  .map-live-panel,
  .map-poi-drawer,
  .twin-decision-panel { transition: none !important; }
}

/* Keep the focused layer explanation on its own surface, never behind another panel. */
.map-theme-legend.is-panel-legend, .map-theme-legend.is-panel-legend[open] { position: static; inset: auto; width: 100%; max-width: none; max-height: none; margin-top: 14px; box-shadow: none; transform: none; }
.map-live-panel[data-theme-focus="weather"] > .utility-note,
.map-live-panel[data-theme-focus="earthquakes"] > .utility-note,
.map-live-panel[data-theme-focus="traffic"] > .utility-note { display: none; }

.fatih-map-page .fatih-map-footer { display: none; }

.twin-decision-panel[data-theme-focus="density"] > .utility-note { display: none; }
.twin-reports-panel .twin-form-row, .twin-reports-panel .twin-form-row strong { font-size: 13px; line-height: 1.5; }
