:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #183342;
  background: #e7eef2;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
button, select, input { font: inherit; }
button { cursor: pointer; }
.app-shell { height: 100dvh; min-height: 610px; display: flex; flex-direction: column; }
.topbar {
  min-height: 56px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 5px 14px; background: #fff; border-bottom: 1px solid #d7e2e9;
}
.brand-mark { width: 32px; height: 32px; flex: none; position: relative; border: 2px solid #2a8de2; border-radius: 50%; }
.brand-mark span { position: absolute; inset: 5px; border: 1px solid #2a8de2; border-radius: 50%; }
.brand-mark span:nth-child(2) { inset: 11px; }
.brand-mark span:nth-child(3) { inset: auto; left: 13px; top: 13px; width: 3px; height: 3px; background: #3189d1; border: 0; }
.title-block h1 { margin: 0; font-size: 17px; line-height: 22px; font-weight: 700; }
.title-block p { margin: 2px 0 0; }
.time-label { display: flex; align-items: center; gap: 7px; color: #557182; font-size: 11px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3189d1; }
.field-choices { display: flex; flex: 0 1 auto; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; margin-left: auto; margin-right: 18px; }
.field-choice { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: #234554; font-size: 11px; cursor: pointer; }
.field-choice input { width: 13px; height: 13px; margin: 0; accent-color: #168adb; cursor: pointer; }
.field-choice:has(input:disabled) { cursor: default; }
.field-choice input:disabled { cursor: default; opacity: .75; }
.toolbar {
  flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; gap: 8px 13px;
}
.select-control, .opacity-control { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.control-label { color: #627e8e; font-size: 12px; }
.custom-select { position: relative; display: inline-flex; }
.custom-select select { display: none; }
.select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 104px; height: 30px; padding: 0 9px; border: 1px solid #cad9e1; border-radius: 4px; background: #fff; color: #234554; font-size: 12px; white-space: nowrap; }
.select-trigger::after { content: ''; width: 6px; height: 6px; flex: none; border-right: 1.5px solid #557888; border-bottom: 1.5px solid #557888; transform: translateY(-2px) rotate(45deg); }
.select-trigger:focus-visible { outline: 2px solid #2a8de2; outline-offset: 2px; }
.select-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 2000; min-width: 100%; padding: 3px; border: 1px solid #b8cbd5; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(20,45,58,.18); }
.select-menu[hidden] { display: none; }
.select-option { display: block; width: 100%; min-height: 29px; padding: 4px 9px; border: 0; border-radius: 2px; background: transparent; color: #234554; font-size: 12px; text-align: left; white-space: nowrap; }
.select-option:hover, .select-option:focus-visible { background: #e8f3f7; outline: none; }
.select-option[aria-selected="true"] { color: #2583d1; font-weight: 700; }
.toolbar .separator { width: 1px; height: 19px; background: #dae4e9; }
.opacity-control input { width: 110px; accent-color: #2a8de2; }
.opacity-control output { min-width: 31px; color: #476372; font-size: 12px; }
.icon-button, .time-button {
  display: grid; place-items: center; width: 31px; height: 31px; flex: none;
  background: #fff; border: 1px solid #cad9e1; border-radius: 4px; color: #416679;
}
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.help-button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 31px; flex: none; padding: 0 10px; background: #fff; border: 1px solid #cad9e1; border-radius: 4px; color: #315b70; font-size: 11px; }
.help-icon { display: grid; place-items: center; width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 750; line-height: 1; }
.comparison { flex: 1; min-height: 0; background: #afc2ce; }
.map-rows { width: 100%; height: 100%; display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; }
.compare-row { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0,1fr); overflow: hidden; background: #fff; }
.row-viewport { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.map-grid { height: 100%; min-width: max(100%, calc(var(--columns) * 250px)); display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 1px; background: #c7d5dc; }
.panel { position: relative; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; background: #e6edf0; }
.panel-head { position: absolute; top: 0; left: 0; right: 0; z-index: 600; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 6px; pointer-events: none; }
.panel-title { display: flex; align-items: center; gap: 3px; min-width: 0; flex: none; font-size: 11px; white-space: nowrap; }
.panel-title strong { overflow: hidden; text-overflow: ellipsis; padding: 1px 3px; border-radius: 2px; background: rgba(38,137,232,.78); color: #fff; font-weight: 800; line-height: 16px; text-shadow: 0 1px 1px rgba(16,64,112,.45); }
.panel-source { min-width: 35px; padding: 2px 4px; background: #2b9a5d; border-radius: 2px; color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
.panel-source.dbt { background: #b96543; }
.panel-metrics { position: absolute; left: 6px; top: 25px; z-index: 600; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 12px); height: 16px; overflow: hidden; white-space: nowrap; color: #111; font-size: 9px; font-weight: 400; line-height: 16px; pointer-events: none; text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; }
.panel-metrics strong { color: #111; font-weight: 400; }
.map-wrap { position: absolute; inset: 0; }
.map { width: 100%; height: 100%; background: #edf3f6; }
.district-name { display: grid; place-items: center; width: 68px !important; height: 18px !important; border: 0; background: transparent; color: #164c79; font-size: 10px; font-weight: 700; white-space: nowrap; pointer-events: none; text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff, 0 0 3px #fff; }
.leaflet-tile-pane { filter: saturate(.83); }
.leaflet-top .leaflet-control-zoom { margin-top: 52px; }
.leaflet-control-zoom a { color: #315a6a !important; }
.map-probe { position: absolute; bottom: -1px; right: 2px; z-index: 600; display: flex; align-items: center; height: 16px; max-width: calc(100% - 4px); color: #142d3a; font-size: 10px; line-height: 16px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; }
.map-probe.is-hidden { display: none; }
.probe-crosshair { border: 0; background: transparent; pointer-events: none; }
.probe-crosshair::before, .probe-crosshair::after { content: ''; position: absolute; background: #203b49; box-shadow: 0 0 0 1px #fff; }
.probe-crosshair::before { top: 8px; left: 0; width: 18px; height: 1px; }
.probe-crosshair::after { top: 0; left: 8px; width: 1px; height: 18px; }
.leaflet-tooltip.probe-value-tip { padding: 4px 6px; border: 1px solid #b8cad3; border-radius: 3px; background: rgba(255,255,255,.94); box-shadow: 0 2px 7px rgba(21,48,62,.2); color: #203b49; font: 10px/1.35 Inter, "PingFang SC", "Microsoft YaHei", sans-serif; pointer-events: none; }
.probe-value-tip span { display: block; color: #526c79; }
.probe-value-tip strong { display: block; color: #153745; font-size: 12px; }
.legend-strip { flex: none; display: flex; align-items: center; justify-content: flex-end; max-width: 100%; margin-left: 8px; }
.legends { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.legend { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.legend-title { padding: 2px 4px; border-radius: 2px; background: rgba(28,55,70,.88); color: #fff; font-size: 9px; font-weight: 650; }
.legend-scale { display: flex; height: 16px; border: 1px solid rgba(79,103,119,.55); border-radius: 2px; overflow: hidden; }
.legend-scale span { display: grid; place-items: center; width: 19px; color: #163847; font-size: 8px; text-shadow: 0 1px 1px rgba(255,255,255,.7); }
.legend-reflectivity .legend-scale span:nth-child(n+10), .legend-count .legend-scale span:first-child, .legend-count .legend-scale span:last-child { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.7); }
.legend-reflectivity .legend-scale span:last-child { color: #233a48; text-shadow: 0 1px 1px rgba(255,255,255,.7); }
.legend-gain .legend-scale span { width: 30px; color: #fff; text-shadow: none; }
.timeline { height: 60px; flex: none; display: flex; align-items: center; gap: 7px; padding: 3px 14px; background: #f8fbfd; border-top: 1px solid #d2dfe6; }
.timeline:has(.legend-count) { height: 66px; }
.date-control { display: flex; align-items: center; gap: 6px; flex: none; }
.date-control .select-trigger { width: 140px; }
.date-control .select-menu { top: auto; bottom: calc(100% + 4px); }
.time-button { font-size: 23px; line-height: 1; }
.time-button:disabled { opacity: .38; cursor: default; }
.timeline-viewport { flex: 1; min-width: 0; height: 50px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.timeline-track { position: relative; min-width: 720px; height: 48px; margin: 0 24px; }
.track-line { position: absolute; left: 0; right: 0; top: 18px; height: 11px; border: 1px solid #bbd9e7; border-radius: 6px; background: linear-gradient(90deg,#e7f5fa,#c5e8f3); }
.hour-tick { position: absolute; top: 17px; height: 29px; transform: translateX(-50%); color: #78909c; font-size: 10px; }
.hour-tick i { display: block; width: 1px; height: 12px; margin: 0 auto 2px; background: #7fa9bd; }
.hour-tick small { font-size: 10px; }
.hour-tick:nth-of-type(2n) small { display: none; }
.time-marker { position: absolute; z-index: 2; top: 2px; transform: translateX(-50%); width: 50px; height: 44px; border: 0; background: transparent; color: #206c9f; font-size: 10px; font-weight: 700; }
.time-marker i { display: block; width: 11px; height: 11px; margin: 12px auto 2px; border: 2px solid #fff; border-radius: 50%; background: #168adb; box-shadow: 0 0 0 2px #168adb; }
.time-marker span { display: inline-block; padding: 2px 5px; border-radius: 3px; background: #e1f1fa; }
.time-marker.active span { background: #168adb; color: #fff; }
.error-screen { margin: auto; padding: 22px; max-width: 500px; border: 1px solid #e3c4bf; border-radius: 4px; background: #fff; color: #a24941; }
.info-dialog { width: min(620px, calc(100vw - 28px)); max-height: min(760px, calc(100dvh - 40px)); padding: 0; border: 1px solid #b9cbd5; border-radius: 6px; box-shadow: 0 20px 70px rgba(20,45,58,.25); color: #203b49; }
.info-dialog::backdrop { background: rgba(16,36,48,.42); }
.info-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 18px; background: #f4f9fb; border-bottom: 1px solid #d9e5eb; }
.info-head h2 { margin: 0; font-size: 16px; }
.info-close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; color: #597382; font-size: 25px; line-height: 1; }
.info-body { padding: 17px 20px 23px; overflow-y: auto; max-height: calc(min(760px, 100dvh - 40px) - 52px); font-size: 12px; line-height: 1.65; }
.info-summary { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid #2a8de2; background: #edf6fc; color: #315869; }
.info-body section + section { margin-top: 18px; }
.info-body h3 { margin: 0 0 7px; font-size: 12px; color: #2583d1; }
.info-body dl { margin: 0; }
.info-body dl div { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; padding: 8px 0; border-top: 1px solid #e6eef1; }
.info-body dt { color: #203b49; font-weight: 700; }
.info-body dd { margin: 0; color: #4d6673; }
.info-body section p { margin: 0; color: #4d6673; }
@media (max-width: 1050px) {
  .topbar { flex-wrap: wrap; gap: 7px 10px; }
  .field-choices { flex: 1; margin-right: 0; }
  .toolbar { flex-basis: 100%; justify-content: flex-start; padding-left: 42px; }
}
@media (max-width: 900px) {
  .topbar, .timeline { padding-left: 10px; padding-right: 10px; }
  .toolbar { gap: 9px; }
  .toolbar .separator { display: none; }
  .map-grid { min-width: calc(var(--columns) * 290px); }
}
@media (max-width: 700px) {
  .topbar { gap: 7px 9px; }
  .title-block h1 { font-size: 14px; }
  .time-label { font-size: 10px; }
  .toolbar { padding-left: 0; gap: 7px 9px; }
  .help-button { width: 31px; padding: 0; }
  .help-label { display: none; }
  .opacity-control input { width: 85px; }
  .legend-strip { width: 100%; margin-left: 0; }
  .legend { gap: 4px; }
  .legend-title { padding: 2px 3px; font-size: 8px; }
  .legend-scale { height: 15px; }
  .legend-scale span { width: 16px; font-size: 7px; }
  .timeline, .timeline:has(.legend-count) { height: auto; min-height: 60px; flex-wrap: wrap; gap: 3px 5px; padding-top: 4px; padding-bottom: 4px; }
  .date-control .control-label { display: none; }
  .date-control .select-trigger { width: 140px; }
}
