:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #edf3f8;
  --text: #173f8a;
  --muted: #526273;
  --line: #d6e0ea;
  --uc-blue: #173f8a;
  --uc-blue-dark: #0c2d63;
  --uc-light-blue: #0176de;
  --uc-sky: #00a4e4;
  --uc-yellow: #fec60d;
  --uc-orange: #f58220;
  --uc-green: #00aa5b;
  --accent: var(--uc-light-blue);
  --accent-strong: var(--uc-blue);
  --focus: var(--uc-yellow);
  --panel-dark: #071f44;
  --panel-dark-2: #0c2d63;
  --shadow: 0 12px 28px rgba(136, 136, 136, 0.18);
  --button-glow: 0 12px 26px rgba(1, 118, 222, 0.22);
  --button-press: translateY(1px) scale(0.99);
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, Arial, Helvetica, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--uc-blue) 0 42%, var(--uc-light-blue) 42% 72%, var(--uc-yellow) 72% 88%, var(--uc-green) 88% 100%);
}

.panel-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.uc-logo-box {
  width: 124px;
  height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 14px 4px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.uc-logo-box img {
  display: block;
  width: auto;
  height: 56px;
  max-width: none;
  max-height: 56px;
}

.brand h1,
.brand p,
.pane-header h2,
.pane-header p,
.admin-section-header h2,
.admin-section-header p,
.admin-zones h2 {
  margin: 0;
}

.brand h1 {
  font-family: "Roboto Slab", Roboto, Arial, sans-serif;
  font-size: 21px;
  line-height: 1.2;
}

.brand p,
.pane-header p,
.admin-section-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.switch-button,
.secondary-button,
.primary-button,
.icon-button,
.dashboard-tab,
.touch-tool {
  position: relative;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: var(--radius);
  isolation: isolate;
  overflow: hidden;
  transform: translateY(0);
  transition:
    transform 140ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.switch-button::before,
.secondary-button::before,
.primary-button::before,
.icon-button::before,
.dashboard-tab::before,
.touch-tool::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 46%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.switch-button:hover::before,
.secondary-button:hover::before,
.primary-button:hover::before,
.icon-button:hover::before,
.dashboard-tab:hover::before,
.touch-tool:hover::before,
.switch-button.active::before,
.secondary-button.active::before,
.dashboard-tab.active::before,
.touch-tool.active::before {
  opacity: 1;
}

.switch-button:hover,
.secondary-button:hover,
.primary-button:hover,
.icon-button:hover,
.dashboard-tab:hover,
.touch-tool:hover {
  transform: translateY(-1px);
}

.switch-button:active,
.secondary-button:active,
.primary-button:active,
.icon-button:active,
.dashboard-tab:active,
.touch-tool:active {
  transform: var(--button-press);
}

.switch-button:focus-visible,
.secondary-button:focus-visible,
.primary-button:focus-visible,
.icon-button:focus-visible,
.dashboard-tab:focus-visible,
.touch-tool:focus-visible {
  outline: 2px solid rgba(254, 198, 13, 0.92);
  outline-offset: 3px;
}

.switch-button {
  min-height: 52px;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.switch-button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(21, 33, 43, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.switch-button svg,
.secondary-button svg,
.primary-button svg,
.icon-button svg,
.search-box svg {
  width: 17px;
  height: 17px;
}

main {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.view-panel {
  display: none;
  min-height: 100%;
  height: 100%;
}

.view-panel.active {
  display: block;
}

.split-layout {
  min-height: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(520px, 1.08fr);
}

.map-pane {
  position: relative;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  background: #dce5e7;
}

.map-pane::after,
.admin-map-column::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(1, 118, 222, 0.16) 0 2px, transparent 2px 18px);
  filter: blur(10px);
  transform: translateX(-18%);
  transition: opacity 160ms ease;
}

.map-pane.is-map-moving .map,
.admin-map-column.is-map-moving .admin-map {
  filter: saturate(1.06) brightness(1.02);
  transform: translateZ(0);
}

.map-pane.is-map-moving::after,
.admin-map-column.is-map-moving::after {
  opacity: 1;
  animation: motionSweep 720ms ease-in-out infinite;
}

.map,
.admin-map {
  position: absolute;
  inset: 0;
  transition: filter 180ms ease, transform 180ms ease;
}

.pin-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.pin-overlay.is-hidden {
  display: none;
}

.map-toolbar {
  position: absolute;
  z-index: 5;
  top: 26px;
  right: 26px;
  display: flex;
  gap: 8px;
}

.icon-button {
  width: 56px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border: 1px solid rgba(23, 33, 43, 0.12);
  box-shadow: 0 8px 22px rgba(21, 33, 43, 0.16);
}

.icon-button:hover {
  box-shadow: 0 14px 30px rgba(21, 33, 43, 0.2);
}

.icon-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--uc-blue), var(--uc-light-blue));
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 12px 28px rgba(21, 33, 43, 0.26);
}

.map-status {
  position: absolute;
  z-index: 5;
  left: 26px;
  bottom: 26px;
  max-width: calc(100% - 32px);
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--surface);
  background: rgba(7, 31, 68, 0.82);
  font-size: 13px;
}

.data-pane {
  min-height: 100%;
  height: 100%;
  padding: 0;
  overflow: auto;
  scrollbar-width: none;
  background:
    linear-gradient(120deg, rgba(0, 164, 228, 0.16), transparent 42%),
    linear-gradient(180deg, var(--panel-dark), var(--panel-dark-2) 52%, #061a39);
  border-right: 1px solid rgba(0, 164, 228, 0.32);
  color: #f6fbff;
}

.data-pane::-webkit-scrollbar,
#dashboardDataPanel::-webkit-scrollbar {
  display: none;
}

.pane-body {
  padding: 24px;
}

.data-pane .pane-body {
  min-height: calc(100% - 100px);
  display: flex;
  flex-direction: column;
}

.data-pane .topbar,
.admin-form-column .topbar {
  background: rgba(7, 31, 68, 0.92);
  border-bottom: 1px solid rgba(0, 164, 228, 0.28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.data-pane .brand h1,
.admin-form-column .brand h1,
.data-pane .pane-header h2,
.admin-form-column .pane-header h2,
.admin-form-column .admin-zones h2 {
  color: #ffffff;
  font-family: "Roboto Slab", Roboto, Arial, sans-serif;
}

.data-pane .brand p,
.admin-form-column .brand p,
.data-pane .pane-header p,
.admin-form-column .pane-header p {
  color: #c7d8ea;
}

.data-pane .uc-logo-box,
.admin-form-column .uc-logo-box {
  background: rgba(255, 255, 255, 0.04);
}

.data-pane .view-switch,
.admin-form-column .view-switch {
  border-color: rgba(0, 164, 228, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.data-pane .switch-button,
.admin-form-column .switch-button {
  color: #c7d8ea;
}

.data-pane .switch-button.active,
.admin-form-column .switch-button.active {
  color: var(--uc-blue-dark);
  background: linear-gradient(135deg, #ffffff, #dff1ff);
  box-shadow: 0 0 0 1px rgba(254, 198, 13, 0.55), 0 14px 30px rgba(0, 164, 228, 0.2);
}

.pane-header,
.admin-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.public-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.community-rail-controls {
  display: inline-flex;
  gap: 6px;
}

.rail-button {
  width: 46px;
  min-height: 46px;
  padding: 0;
}

.rail-button svg {
  width: 22px;
  height: 22px;
}

.pane-header h2,
.admin-section-header h2,
.admin-zones h2 {
  font-family: "Roboto Slab", Roboto, Arial, sans-serif;
  font-size: 19px;
  line-height: 1.25;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(0, 164, 228, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: #c7d8ea;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
}

.touch-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.touch-filter-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.touch-filter-row:nth-child(3) {
  grid-column: 1 / -1;
}

.touch-filter-heading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: #c7d8ea;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.touch-filter-heading svg {
  width: 17px;
  height: 17px;
  color: var(--uc-sky);
}

.touch-filter-options {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.touch-filter-options::-webkit-scrollbar {
  display: none;
}

.touch-filter-chip {
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(0, 164, 228, 0.28);
  border-radius: var(--radius);
  color: #d9e4ea;
  background: rgba(255, 255, 255, 0.075);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 140ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.touch-filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 164, 228, 0.52);
}

.touch-filter-chip.active {
  color: #ffffff;
  border-color: rgba(254, 198, 13, 0.86);
  background: linear-gradient(135deg, rgba(1, 118, 222, 0.9), rgba(0, 164, 228, 0.78));
  box-shadow: 0 10px 22px rgba(0, 164, 228, 0.2);
}

.filter-clear-button {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: stretch;
  min-height: 88px;
  padding-inline: 14px;
}

.dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.dashboard-tab {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #c7d8ea;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}

.dashboard-tab[data-dashboard-tab="data"] {
  color: #d9f1ff;
  border-color: rgba(0, 164, 228, 0.34);
  background: rgba(0, 164, 228, 0.12);
}

.dashboard-tab[data-dashboard-tab="control"] {
  color: #e7f8ef;
  border-color: rgba(0, 170, 91, 0.34);
  background: rgba(0, 170, 91, 0.12);
}

.dashboard-tab svg {
  width: 20px;
  height: 20px;
}

.dashboard-tab[data-dashboard-tab="data"].active {
  color: #ffffff;
  border-color: rgba(0, 164, 228, 0.82);
  background: linear-gradient(135deg, #0176de, #00a4e4);
  box-shadow: 0 12px 26px rgba(0, 164, 228, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dashboard-tab[data-dashboard-tab="control"].active {
  color: #ffffff;
  border-color: rgba(0, 170, 91, 0.82);
  background: linear-gradient(135deg, #008a53, #00aa5b);
  box-shadow: 0 12px 26px rgba(0, 170, 91, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dashboard-tab-panel {
  display: none;
  min-height: 0;
}

.dashboard-tab-panel.active {
  display: block;
}

#dashboardDataPanel.active {
  position: relative;
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
}

#dashboardControlPanel.active {
  flex: 1;
  overflow: hidden;
}

.map-console {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 164, 228, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.joystick-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  color: #c7d8ea;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.map-joystick {
  position: relative;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(0, 164, 228, 0.32);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(0, 164, 228, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 14px 30px rgba(0, 0, 0, 0.22);
  touch-action: none;
  user-select: none;
}

.joystick-ring {
  position: absolute;
  inset: 20px;
  border: 1px dashed rgba(220, 232, 237, 0.32);
  border-radius: 50%;
}

.joystick-ring::before,
.joystick-ring::after {
  content: "";
  position: absolute;
  background: rgba(220, 232, 237, 0.22);
}

.joystick-ring::before {
  left: 50%;
  top: -10px;
  bottom: -10px;
  width: 1px;
}

.joystick-ring::after {
  top: 50%;
  left: -10px;
  right: -10px;
  height: 1px;
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--uc-light-blue), var(--uc-blue));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.camera-controls {
  display: grid;
  gap: 10px;
}

.camera-slider {
  display: grid;
  gap: 7px;
  color: #dce8ed;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.camera-slider input[type="range"] {
  width: 100%;
  height: 32px;
  accent-color: var(--uc-yellow);
}

.camera-presets {
  display: grid;
  gap: 7px;
  color: #dce8ed;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.pitch-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pitch-preset {
  min-height: 48px;
  font-size: 16px;
}

.camera-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.touch-tool {
  min-height: 56px;
  border: 1px solid rgba(0, 164, 228, 0.28);
  border-radius: var(--radius);
  color: #dce8ed;
  background: rgba(255, 255, 255, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.touch-tool.icon-only {
  padding: 0;
}

.touch-tool svg {
  width: 22px;
  height: 22px;
}

.touch-tool.active {
  color: var(--uc-blue-dark);
  background: linear-gradient(135deg, #ffffff, var(--uc-yellow));
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 14px 32px rgba(0, 0, 0, 0.22);
}

.touch-tool:hover {
  border-color: rgba(0, 164, 228, 0.52);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  contain: layout paint;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  animation: viewerItemIn 520ms cubic-bezier(0.2, 0.85, 0.24, 1) forwards;
  animation-delay: var(--item-delay, 0ms);
}

.summary-card span {
  display: block;
  color: #c7d8ea;
  font-size: 13px;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  color: #f5fbfc;
  font-size: 31px;
  line-height: 1.1;
}

.admin-zone-list {
  display: grid;
  gap: 12px;
}

.zone-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 2px;
  padding: 2px 2px 8px;
  touch-action: pan-x;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.zone-list::-webkit-scrollbar {
  display: none;
}

.zone-card,
.admin-zone-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.zone-card {
  contain: layout paint;
  flex: 0 0 clamp(320px, 48%, 560px);
  min-height: 220px;
  padding: 18px;
  touch-action: manipulation;
  scroll-snap-align: start;
  opacity: 0;
  transform: translateY(12px);
  animation: viewerItemIn 560ms cubic-bezier(0.2, 0.85, 0.24, 1) forwards;
  animation-delay: var(--item-delay, 0ms);
}

.zone-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--zone-color);
}

.zone-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.13) 46%, transparent 58% 100%);
  opacity: 0;
  transform: translateX(-42%);
}

.zone-card:hover,
.zone-card.active,
.admin-zone-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: color-mix(in srgb, var(--zone-color, var(--accent)) 64%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--zone-color) 38%, transparent), 0 18px 42px rgba(0, 0, 0, 0.28);
}

.zone-card.active {
  transform: translateY(-2px) scale(1.01);
}

.zone-card.active::after {
  opacity: 0.18;
  transform: translateX(0);
}

.zone-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-left: 6px;
}

.zone-card h3 {
  margin: 0;
  color: #f5fbfc;
  font-family: "Roboto Slab", Roboto, Arial, sans-serif;
  font-size: 21px;
  line-height: 1.25;
}

.zone-card small {
  color: #c7d8ea;
}

.metric-pill {
  flex: 0 0 auto;
  max-width: 42%;
  align-self: flex-start;
  padding: 7px 9px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--zone-color);
  font-weight: 700;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.zone-card p {
  margin: 10px 0 0 6px;
  color: #c1ccd5;
  line-height: 1.45;
  font-size: 15px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: var(--radius);
  color: #dce8ed;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
}

.zone-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 0 6px;
  padding: 9px 10px;
  border: 1px solid rgba(0, 164, 228, 0.2);
  border-radius: var(--radius);
  color: #dce8ed;
  background: rgba(255, 255, 255, 0.055);
  font-size: 13px;
  font-weight: 800;
}

.zone-card-action > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.zone-stats-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--zone-color) 46%, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius);
  color: #ffffff;
  background: color-mix(in srgb, var(--zone-color) 30%, rgba(255, 255, 255, 0.07));
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.zone-stats-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--zone-color) 72%, rgba(255, 255, 255, 0.28));
  background: color-mix(in srgb, var(--zone-color) 46%, rgba(255, 255, 255, 0.07));
}

.zone-stats-button svg {
  width: 16px;
  height: 16px;
}

.zone-card.active .zone-card-action {
  color: #ffffff;
  background: color-mix(in srgb, var(--zone-color) 34%, rgba(255, 255, 255, 0.06));
  border-color: color-mix(in srgb, var(--zone-color) 62%, rgba(255, 255, 255, 0.12));
}

.zone-dashboard {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: stretch;
  padding: 0;
}

.zone-dashboard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 31, 68, 0.98);
}

.zone-dashboard-panel {
  contain: layout paint;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--zone-color) 42%, rgba(255, 255, 255, 0.16));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--zone-color) 16%, transparent), transparent 42%),
    rgba(14, 39, 80, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  animation: viewerItemIn 360ms cubic-bezier(0.2, 0.85, 0.24, 1) forwards;
}

.zone-dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zone-dashboard-header span,
.zone-focus-card span,
.zone-progress-card span,
.zone-card-title span,
.zone-breakdown-card span {
  display: block;
  color: #c7d8ea;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.zone-dashboard-header h3 {
  margin: 5px 0 0;
  color: #ffffff;
  font-family: "Roboto Slab", Roboto, Arial, sans-serif;
  font-size: 24px;
  line-height: 1.18;
}

.zone-dashboard-header p {
  margin: 5px 0 0;
  color: #d9e4ea;
  font-size: 14px;
}

.zone-dashboard-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.zone-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.95fr) minmax(240px, 1.2fr);
  gap: 12px;
  padding: 14px;
  max-height: calc(100% - 94px);
  overflow: auto;
}

.zone-focus-card,
.zone-progress-card,
.zone-bars-card,
.zone-breakdown-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(7, 31, 68, 0.58);
}

.zone-focus-card {
  padding: 14px;
}

.zone-focus-card strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.zone-focus-card p,
.zone-progress-card p {
  margin: 10px 0 0;
  color: #c1ccd5;
  line-height: 1.45;
}

.zone-progress-card {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.zone-progress-card strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: 23px;
}

.zone-donut {
  width: 112px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #102d5f 0 54%, transparent 55%),
    conic-gradient(var(--zone-color) calc(var(--zone-progress) * 1%), rgba(255, 255, 255, 0.14) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 26px rgba(0, 0, 0, 0.22);
}

.zone-donut span {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  text-transform: none;
}

.zone-bars-card {
  grid-column: span 2;
  padding: 14px;
}

.zone-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.zone-card-title strong {
  color: #ffffff;
  font-size: 22px;
}

.zone-chart-list {
  display: grid;
  gap: 10px;
}

.zone-chart-row {
  contain: layout paint;
  display: grid;
  grid-template-columns: minmax(112px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  animation: viewerItemIn 420ms cubic-bezier(0.2, 0.85, 0.24, 1) forwards;
  animation-delay: var(--item-delay, 0ms);
}

.zone-chart-row strong,
.zone-chart-row span {
  display: block;
}

.zone-chart-row strong {
  color: #ffffff;
  font-size: 14px;
}

.zone-chart-row div > span {
  color: #c7d8ea;
  font-size: 13px;
}

.zone-bar-track {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.zone-bar-track span {
  display: block;
  width: calc(var(--bar-value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--zone-color), var(--uc-yellow));
}

.zone-breakdown-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: rgba(255, 255, 255, 0.11);
}

.zone-breakdown-card > div {
  min-height: 92px;
  padding: 13px;
  background: rgba(7, 31, 68, 0.72);
}

.zone-breakdown-card strong {
  display: block;
  margin-top: 9px;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.admin-layout {
  grid-template-columns: minmax(520px, 0.92fr) minmax(520px, 1.08fr);
  gap: 0;
  min-height: 100%;
  height: 100%;
}

.admin-layout.active {
  display: grid;
}

.admin-map-column {
  position: relative;
  min-height: 100%;
  height: 100%;
  padding: 22px;
  background: #eaf1f8;
}

.admin-map-column .admin-section-header {
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid rgba(0, 164, 228, 0.3);
  border-radius: var(--radius);
  color: #edf7f8;
  background: rgba(7, 31, 68, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.admin-map-column .admin-section-header h2 {
  color: #ffffff;
}

.admin-map-column .admin-section-header p {
  color: #b8c8d3;
}

.admin-map-search {
  flex: 1 1 420px;
  min-width: 320px;
  max-width: 560px;
  display: grid;
  gap: 7px;
}

.admin-map-search label {
  color: #dff1ff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.admin-search-row input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid rgba(0, 164, 228, 0.32);
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  outline: 0;
}

.admin-search-row input::placeholder {
  color: #b5cbe0;
}

.admin-search-row .secondary-button {
  min-height: 40px;
  padding: 0 13px;
  font-size: 13px;
}

.admin-search-results {
  display: grid;
  gap: 6px;
  max-height: 156px;
  overflow: auto;
}

.admin-search-result {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  color: #ecf7f8;
  background: rgba(6, 13, 20, 0.72);
  text-align: left;
  cursor: pointer;
}

.admin-search-result:hover {
  border-color: rgba(254, 198, 13, 0.56);
  background: rgba(1, 118, 222, 0.52);
}

.admin-search-result strong,
.admin-search-result span {
  display: block;
}

.admin-search-result strong {
  font-size: 13px;
  line-height: 1.25;
}

.admin-search-result span,
.admin-search-message {
  color: #b8c8d3;
  font-size: 12px;
  line-height: 1.35;
}

.admin-search-message {
  padding: 8px 10px;
  border: 1px solid rgba(0, 164, 228, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.admin-map-column .secondary-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 164, 228, 0.36);
}

.admin-map-column .secondary-button:hover {
  background: rgba(1, 118, 222, 0.28);
}

.admin-map-column .secondary-button.active {
  color: var(--uc-blue-dark);
  background: linear-gradient(135deg, #ffffff, var(--uc-yellow));
  border-color: rgba(255, 255, 255, 0.34);
}

.admin-map {
  top: 0;
  border-left: 1px solid rgba(0, 164, 228, 0.24);
}

.draw-actions,
.form-actions,
.admin-zone-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-map-column .draw-actions {
  flex: 1 1 100%;
}

.admin-form-column {
  min-height: 100%;
  height: 100%;
  padding: 0;
  overflow: auto;
  background:
    linear-gradient(120deg, rgba(0, 164, 228, 0.14), transparent 38%),
    linear-gradient(180deg, var(--panel-dark), var(--panel-dark-2) 46%, #061a39);
  border-right: 1px solid rgba(0, 164, 228, 0.28);
  color: #edf7f8;
}

.zone-form {
  display: grid;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(0, 164, 228, 0.22);
}

.zone-form label {
  display: grid;
  gap: 7px;
  color: #c9d7df;
  font-size: 14px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.zone-form input,
.zone-form textarea {
  width: 100%;
  border: 1px solid rgba(0, 164, 228, 0.26);
  border-radius: var(--radius);
  color: #f5fbfc;
  background: rgba(255, 255, 255, 0.07);
  padding: 13px 13px;
  outline: 0;
  font-weight: 500;
}

.zone-form input[type="color"] {
  height: 50px;
  padding: 4px;
}

.zone-form input[type="range"] {
  accent-color: var(--accent);
}

.pin-admin {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.pin-admin-header h2,
.pin-admin-header p {
  margin: 0;
}

.pin-admin-header h2 {
  color: #f5fbfc;
  font-size: 16px;
}

.pin-admin-header p {
  margin-top: 4px;
  color: #a8bac8;
  font-size: 12px;
}

.pin-draft-list {
  display: grid;
  gap: 8px;
}

.pin-draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 164, 228, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.pin-draft-card:hover {
  border-color: rgba(0, 164, 228, 0.48);
  background: rgba(255, 255, 255, 0.085);
}

.pin-draft-card.active {
  border-color: rgba(254, 198, 13, 0.86);
  background: rgba(254, 198, 13, 0.14);
  box-shadow: inset 4px 0 0 var(--uc-yellow), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pin-draft-card strong,
.pin-draft-card span {
  display: block;
}

.pin-draft-card strong {
  color: #f5fbfc;
  font-size: 14px;
}

.pin-draft-card span {
  color: #a8bac8;
  font-size: 13px;
}

.pin-draft-card .secondary-button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  flex: 0 0 auto;
}

.pin-update-button {
  justify-content: center;
  min-height: 44px;
  font-size: 14px;
}

.pin-update-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled,
.switch-button:disabled,
.dashboard-tab:disabled,
.touch-tool:disabled {
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.primary-button:disabled::before,
.secondary-button:disabled::before,
.icon-button:disabled::before,
.switch-button:disabled::before,
.dashboard-tab:disabled::before,
.touch-tool:disabled::before {
  opacity: 0;
}

.secondary-button.active {
  color: var(--uc-blue-dark);
  background: linear-gradient(135deg, #ffffff, var(--uc-yellow));
  border-color: rgba(255, 255, 255, 0.4);
}

#deleteVertexButton {
  border-color: rgba(245, 130, 32, 0.44);
}

.empty-state.compact {
  padding: 10px;
  font-size: 13px;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 17px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--uc-blue), var(--uc-light-blue));
  box-shadow: 0 10px 24px rgba(1, 118, 222, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--uc-blue-dark), var(--uc-blue));
  box-shadow: 0 14px 30px rgba(1, 118, 222, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
  box-shadow: 0 8px 18px rgba(21, 33, 43, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.data-pane .secondary-button,
.admin-form-column .secondary-button,
.admin-map-column .secondary-button {
  color: #edf7f8;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 164, 228, 0.26);
}

.data-pane .secondary-button:hover,
.admin-form-column .secondary-button:hover,
.admin-map-column .secondary-button:hover {
  background: rgba(1, 118, 222, 0.2);
  border-color: rgba(0, 164, 228, 0.48);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.admin-map-column .admin-section-header .secondary-button {
  color: #ffffff;
  background: rgba(16, 28, 39, 0.86);
  border-color: rgba(0, 164, 228, 0.42);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.admin-map-column .admin-section-header .secondary-button:hover {
  background: rgba(1, 118, 222, 0.78);
}

.admin-map-column .admin-section-header .secondary-button.active {
  background: linear-gradient(135deg, #ffffff, var(--uc-yellow));
  color: var(--uc-blue-dark);
  border-color: rgba(255, 255, 255, 0.38);
}

.admin-zones {
  padding-top: 20px;
}

.admin-zones h2 {
  margin-bottom: 12px;
}

.admin-zone-card {
  padding: 12px;
  --zone-color: var(--accent);
}

.admin-zone-card h3,
.admin-zone-card p {
  margin: 0;
}

.admin-zone-card h3 {
  color: #f5fbfc;
  font-size: 15px;
}

.admin-zone-card p {
  color: #a8bac8;
  font-size: 13px;
  margin-top: 4px;
}

.admin-zone-actions {
  margin-top: 10px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(0, 164, 228, 0.26);
  border-radius: 8px;
  color: #a8bac8;
  background: rgba(255, 255, 255, 0.06);
}

.maplibregl-popup-content {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-data-pin {
  --pin-color: var(--uc-light-blue);
  --pin-x: 0px;
  --pin-y: 0px;
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 132px;
  transform: translate3d(var(--pin-x), var(--pin-y), 0) translate(-50%, -100%);
  will-change: transform;
  pointer-events: none;
  filter: drop-shadow(0 8px 9px rgba(0, 0, 0, 0.22));
  animation: pinReveal 520ms cubic-bezier(0.2, 0.85, 0.24, 1) both;
}

.pin-stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 7px;
  height: 104px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pin-color) 68%, #2d3840);
  transform: translateX(-50%);
  box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.16), 0 4px 8px rgba(0, 0, 0, 0.18);
}

.pin-stem::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 4px;
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pin-color) 44%, #0f151a);
  transform: translateX(-50%);
}

.pin-ground-anchor {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 24px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--pin-color) 32%, transparent);
  border: 1px solid color-mix(in srgb, var(--pin-color) 56%, rgba(255, 255, 255, 0.42));
  transform: translateX(-50%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pin-color) 28%, transparent);
  animation: pinAnchorPulse 1.8s ease-in-out infinite;
}

.pin-ball {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pin-color);
  border: 1px solid color-mix(in srgb, var(--pin-color) 78%, #ffffff);
  transform: translateX(-50%);
  box-shadow:
    inset -7px -8px 0 rgba(0, 0, 0, 0.14),
    0 0 0 6px color-mix(in srgb, var(--pin-color) 12%, transparent),
    0 10px 18px rgba(0, 0, 0, 0.2);
  animation: pinFloat 2.4s ease-in-out infinite;
}

.pin-ball::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 9px;
  height: 13px;
  border-radius: 0 0 999px 999px;
  background: color-mix(in srgb, var(--pin-color) 74%, #1c1c1c);
  transform: translateX(-50%);
}

.pin-label {
  position: absolute;
  z-index: 3;
  left: 54px;
  top: 3px;
  min-width: 112px;
  max-width: 168px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--pin-color) 42%, rgba(255, 255, 255, 0.28));
  border-radius: 8px;
  color: #ffffff;
  background: rgba(18, 28, 38, 0.88);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  animation: pinLabelIn 480ms cubic-bezier(0.2, 0.85, 0.24, 1) both;
}

.pin-label::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -14px;
  width: 14px;
  height: 2px;
  background: var(--pin-color);
  box-shadow: 0 0 10px var(--pin-color);
}

.pin-label strong,
.pin-label span {
  display: block;
  line-height: 1.1;
}

.pin-label strong {
  font-size: 12px;
  text-transform: uppercase;
}

.pin-label span {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pin-overlay.is-top-down .map-data-pin {
  width: 48px;
  height: 48px;
  transform: translate3d(var(--pin-x), var(--pin-y), 0) translate(-50%, -50%);
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.2));
}

.pin-overlay.is-top-down .pin-stem,
.pin-overlay.is-top-down .pin-ground-anchor,
.pin-overlay.is-top-down .pin-ball::after {
  display: none;
}

.pin-overlay.is-top-down .pin-ball {
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  box-shadow:
    inset -5px -6px 0 rgba(0, 0, 0, 0.13),
    0 0 0 7px color-mix(in srgb, var(--pin-color) 14%, transparent),
    0 8px 15px rgba(0, 0, 0, 0.2);
  animation: none;
}

.pin-overlay.is-top-down .pin-label {
  left: 54px;
  top: 50%;
  transform: translateY(-50%);
  animation: none;
}

.pin-overlay.is-top-down .pin-label::before {
  top: 50%;
}

@keyframes viewerItemIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pinReveal {
  from {
    opacity: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
  }
  to {
    opacity: 1;
    filter: drop-shadow(0 8px 9px rgba(0, 0, 0, 0.22));
  }
}

@keyframes pinFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes pinAnchorPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(-50%) scale(0.92);
  }
  50% {
    opacity: 0.95;
    transform: translateX(-50%) scale(1.14);
  }
}

@keyframes pinLabelIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes motionSweep {
  0% {
    transform: translateX(-35%);
  }
  100% {
    transform: translateX(35%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .switch-button,
  .secondary-button,
  .primary-button,
  .icon-button,
  .dashboard-tab,
  .touch-tool,
  .zone-stats-button,
  .summary-card,
  .zone-card,
  .zone-dashboard-panel,
  .zone-chart-row,
  .zone-card.active,
  .zone-card.active::after,
  .map-data-pin,
  .pin-ball,
  .pin-ground-anchor,
  .pin-label {
    transition: none;
    animation: none;
  }

  .switch-button:hover,
  .secondary-button:hover,
  .primary-button:hover,
  .icon-button:hover,
  .dashboard-tab:hover,
  .touch-tool:hover,
  .zone-stats-button:hover,
  .switch-button:active,
  .secondary-button:active,
  .primary-button:active,
  .icon-button:active,
  .dashboard-tab:active,
  .touch-tool:active,
  .zone-stats-button:active {
    transform: none;
  }

  .summary-card,
  .zone-card,
  .zone-dashboard-panel,
  .zone-chart-row {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch {
    width: 100%;
  }

  .switch-button {
    flex: 1;
  }

  .split-layout,
  .admin-layout.active {
    grid-template-columns: 1fr;
  }

  .map-pane,
  .admin-map-column {
    min-height: 54vh;
  }

  .data-pane,
  .admin-form-column {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .zone-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .zone-bars-card {
    grid-column: auto;
  }
}

@media (orientation: portrait) {
  .app-shell {
    height: 100dvh;
  }

  .split-layout,
  .admin-layout.active {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.7fr) minmax(0, 0.3fr);
    height: 100dvh;
    min-height: 100dvh;
  }

  .map-pane,
  .admin-map-column {
    order: 1;
  }

  .data-pane,
  .admin-form-column {
    order: 2;
  }

  .data-pane,
  .admin-form-column,
  .map-pane,
  .admin-map-column {
    min-height: 0;
    height: auto;
  }

  .data-pane,
  .admin-form-column {
    border-right: 0;
    border-top: 1px solid rgba(0, 164, 228, 0.28);
    border-bottom: 0;
  }

  .map-pane,
  .admin-map-column {
    border-left: 0;
  }

  .topbar {
    min-height: 72px;
    padding: 10px 16px;
  }

  .pane-body {
    padding: 14px 16px 16px;
  }

  .data-pane .pane-body {
    min-height: calc(100% - 72px);
  }

  .pane-header {
    align-items: center;
    margin-bottom: 12px;
  }

  .public-actions {
    gap: 6px;
  }

  .rail-button {
    width: 42px;
    min-height: 42px;
  }

  .pane-header p {
    display: none;
  }

  .search-box {
    height: 48px;
    margin-bottom: 12px;
  }

  .dashboard-tabs {
    margin-bottom: 10px;
  }

  .touch-filter-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .touch-filter-row,
  .touch-filter-row:nth-child(3) {
    grid-column: auto;
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .filter-clear-button {
    grid-row: auto;
    grid-column: auto;
    min-height: 44px;
  }

  .dashboard-tab {
    min-height: 40px;
    font-size: 14px;
  }

  .map-console {
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
    margin-bottom: 10px;
  }

  .map-joystick {
    width: 112px;
    height: 112px;
  }

  .joystick-knob {
    width: 44px;
    height: 44px;
  }

  .camera-controls {
    gap: 7px;
  }

  .camera-slider {
    gap: 3px;
    font-size: 11px;
  }

  .camera-slider input[type="range"] {
    height: 24px;
  }

  .camera-actions {
    gap: 6px;
  }

  .touch-tool {
    min-height: 44px;
    gap: 6px;
    font-size: 13px;
  }

  .touch-tool svg {
    width: 18px;
    height: 18px;
  }

  .summary-grid {
    margin-bottom: 12px;
  }

  .summary-card {
    min-height: 74px;
    padding: 10px 12px;
  }

  .summary-card strong {
    margin-top: 6px;
    font-size: 23px;
  }

  .zone-list {
    gap: 10px;
    padding-bottom: 6px;
  }

  .zone-card {
    flex-basis: min(84vw, 420px);
    min-height: 138px;
    padding: 13px;
  }

  .zone-card p {
    display: none;
  }

  .zone-dashboard {
    place-items: stretch;
    padding: 0;
  }

  .zone-dashboard-header {
    padding: 12px;
  }

  .zone-dashboard-header h3 {
    font-size: 20px;
  }

  .zone-dashboard-grid {
    gap: 9px;
    padding: 10px;
    max-height: calc(100% - 86px);
  }

  .zone-dashboard-panel {
    height: 100%;
    max-height: none;
  }

  .zone-focus-card,
  .zone-progress-card,
  .zone-bars-card {
    padding: 11px;
  }

  .zone-focus-card strong {
    font-size: 22px;
  }

  .zone-progress-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .zone-progress-card p {
    display: none;
  }

  .zone-donut {
    width: 82px;
  }

  .zone-donut span {
    font-size: 18px;
  }

  .zone-chart-row {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 9px;
  }

  .zone-breakdown-card {
    grid-template-columns: 1fr;
  }

  .zone-breakdown-card > div {
    min-height: 68px;
    padding: 10px;
  }

  .zone-breakdown-card strong {
    font-size: 20px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .admin-map-column {
    padding: 18px 14px 12px;
  }

  .admin-map-column {
    padding: 14px;
  }

  .uc-logo-box {
    width: 104px;
    height: 54px;
    padding-left: 0;
  }

  .uc-logo-box img {
    height: 44px;
    max-height: 44px;
    max-width: none;
  }

  .touch-filter-row,
  .touch-filter-row:nth-child(3) {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .touch-filter-heading {
    min-height: 28px;
  }

  .touch-filter-chip {
    min-width: 112px;
  }

  .data-pane,
  .admin-form-column {
    padding: 0;
  }

  .pane-body {
    padding: 14px;
  }

  .pane-header,
  .admin-section-header {
    flex-direction: column;
  }

  .admin-map-search,
  .admin-search-row {
    width: 100%;
    min-width: 0;
  }

  .admin-search-row {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .metric-pill {
    max-width: 100%;
  }

  .zone-card header {
    flex-direction: column;
  }
}

/* Production UX additions shared by viewer and admin */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: #ffffff;
  background: #071f44;
  border: 2px solid var(--uc-yellow);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.viewer-page .panel-topbar {
  justify-content: space-between;
}

.page-badge,
.source-status,
.editor-status,
.map-draft-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 164, 228, 0.32);
  border-radius: var(--radius);
  color: #e9f7ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.source-status {
  align-self: flex-start;
  margin-bottom: 12px;
}

.viewer-search {
  position: relative;
  margin-bottom: 7px;
}

.viewer-search label {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 46px 0 12px;
  border: 1px solid rgba(0, 164, 228, 0.34);
  border-radius: var(--radius);
  color: #d9f1ff;
  background: rgba(255, 255, 255, 0.08);
}

.viewer-search label:focus-within {
  border-color: var(--uc-yellow);
  box-shadow: 0 0 0 2px rgba(254, 198, 13, 0.22);
}

.viewer-search svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.viewer-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
  font-size: 16px;
}

.viewer-search input::placeholder { color: #b9ccdc; opacity: 1; }
.viewer-search .secondary-button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.touch-filter-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.compact-filter-field {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.compact-filter-field svg {
  position: absolute;
  left: 10px;
  z-index: 1;
  width: 16px;
  height: 16px;
  color: var(--uc-sky);
  pointer-events: none;
}

.compact-filter-field select {
  min-width: 150px;
  min-height: 44px;
  padding: 7px 32px 7px 32px;
  border: 1px solid rgba(0, 164, 228, 0.34);
  border-radius: var(--radius);
  color: #ffffff;
  background: #2d4977;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.compact-filter-field:first-child select { min-width: 190px; }
.compact-filter-field select:focus-visible { outline: 3px solid var(--uc-yellow); outline-offset: 1px; }

.filter-clear-button {
  flex: 0 0 auto;
  grid-area: auto;
  min-height: 44px;
  padding: 7px 12px;
}

.community-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
}

.community-rail-header p {
  margin: 0;
  color: #d2e3ee;
  font-size: 13px;
  line-height: 1.35;
}

.zone-list { cursor: grab; }
.zone-list.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.zone-list.is-dragging * { pointer-events: none; }

.source-status.server,
.editor-status.saved {
  color: #dff9e9;
  border-color: rgba(0, 170, 91, 0.65);
  background: rgba(0, 170, 91, 0.18);
}

.source-status.local,
.source-status.demo,
.editor-status.dirty,
.editor-status.error {
  color: #fff6ce;
  border-color: rgba(254, 198, 13, 0.7);
  background: rgba(254, 198, 13, 0.14);
}

.editor-status.saving {
  color: #dff1ff;
  border-color: rgba(0, 164, 228, 0.7);
  background: rgba(0, 164, 228, 0.18);
}

.notification-region {
  position: fixed;
  z-index: 200;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(620px, calc(100% - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.app-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px 10px 16px;
  border: 1px solid #7aa7c9;
  border-left: 5px solid var(--uc-light-blue);
  color: #17324e;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.app-notice.success { border-left-color: #007a44; }
.app-notice.warning { border-left-color: #a86f00; }
.app-notice.error { border-left-color: #b42318; }
.app-notice > button { min-height: 36px; padding: 5px 10px; border: 1px solid #91a8ba; color: #173f8a; background: #edf3f8; font-weight: 800; }
.app-notice .notice-close { width: 36px; padding: 0; font-size: 24px; }

.map-loading,
.map-error {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--uc-blue-dark);
  background: rgba(234, 241, 248, 0.96);
  text-align: center;
}

.map-error p { max-width: 420px; margin: 0; color: #43586b; }
.loading-spinner { width: 42px; height: 42px; border: 4px solid #bed2e4; border-top-color: var(--uc-light-blue); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.logo-fallback::after {
  content: "UC";
  display: grid;
  place-items: center;
  width: 62px;
  height: 48px;
  color: #ffffff;
  background: var(--uc-blue);
  font-family: "Roboto Slab", serif;
  font-size: 22px;
  font-weight: 700;
}

.control-help,
.control-hint {
  margin: 0 0 10px;
  color: #c7d8ea;
  font-size: 13px;
  line-height: 1.4;
}

.control-hint { margin: -5px 0 0; font-size: 12px; }
.map-joystick:focus-visible { outline: 3px solid var(--uc-yellow); outline-offset: 4px; }

.zone-card {
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
}

.zone-card-select {
  width: 100%;
  min-width: 0;
  padding: 18px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.zone-card-select header { display: flex; justify-content: space-between; gap: 12px; }
.zone-card-select h3,
.zone-card-select p { color: #ffffff; }
.zone-card-select small { color: #c7d8ea; }
.zone-card > .zone-stats-button { margin: 0 18px 16px; }
.selection-state { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: #d9f1ff; font-size: 13px; font-weight: 800; }
.selection-state svg { width: 18px; height: 18px; }

.zone-dashboard {
  position: fixed;
  inset: 0;
  z-index: 150;
  place-items: center;
  padding: 24px;
}

.zone-dashboard-panel {
  width: min(780px, 100%);
  height: auto;
  max-height: calc(100dvh - 48px);
}

.touch-filter-options {
  position: relative;
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  padding-right: 22px;
}

.touch-filter-chip:focus-visible,
.zone-card-select:focus-visible,
.zone-stats-button:focus-visible,
.admin-search-result:focus-visible,
.pin-select-button:focus-visible,
.zone-form input:focus-visible,
.zone-form textarea:focus-visible,
.compact-search input:focus-visible,
.admin-search-row input:focus-visible,
a.secondary-button:focus-visible {
  outline: 3px solid var(--uc-yellow);
  outline-offset: 3px;
}

.app-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid #a8bfd2;
  border-radius: var(--radius);
  color: #17324e;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.app-dialog::backdrop { background: rgba(7, 31, 68, 0.72); }
.app-dialog form { padding: 22px; }
.app-dialog h2 { margin: 0; font-family: "Roboto Slab", serif; color: var(--uc-blue); }
.app-dialog p { margin: 12px 0 22px; color: #40576b; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.danger-button { color: #ffffff; background: #b42318; }
.danger-outline { border-color: rgba(229, 91, 70, 0.72) !important; }

/* Admin shell */
.admin-page { min-height: 100dvh; overflow: hidden; background: #071f44; }
.admin-global-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 20px;
  color: #ffffff;
  background: #071f44;
  border-top: 8px solid var(--uc-blue);
  border-bottom: 1px solid rgba(0, 164, 228, 0.32);
}
.admin-global-header .brand h1,
.admin-global-header .brand p { margin: 0; }
.admin-global-header .brand p { color: #c7d8ea; font-size: 13px; }
.admin-global-header .secondary-button { color: #ffffff; border-color: rgba(0, 164, 228, 0.44); background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.admin-page #adminContent { height: calc(100dvh - 88px); min-height: 0; }
.admin-mobile-tabs { display: none; }
.editor-context { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.editor-context span:first-child { display: block; color: #b9cfe0; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.editor-context h2 { margin: 4px 0 0; color: #ffffff; font-family: "Roboto Slab", serif; }
.validation-summary { margin-bottom: 14px; padding: 12px 14px; border: 2px solid #e5a700; color: #fff6ce; background: rgba(77, 52, 0, 0.54); }
.validation-summary ul { margin: 8px 0 0; padding-left: 20px; }
.field-error { min-height: 0; color: #ffd7d2; font-size: 12px; }
.field-error:empty { display: none; }
.zone-form [aria-invalid="true"] { border-color: #ff8c7e; box-shadow: 0 0 0 2px rgba(255, 140, 126, 0.25); }
.sticky-actions { position: sticky; z-index: 4; bottom: 0; padding: 12px 0; background: linear-gradient(180deg, transparent, #092450 24%); }
.admin-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.admin-list-heading h2 { margin: 0; }
.compact-search input { width: min(220px, 100%); min-height: 44px; padding: 9px 11px; border: 1px solid rgba(0, 164, 228, 0.34); color: #ffffff; background: rgba(255, 255, 255, 0.08); }
.admin-zone-card.active { border-color: var(--uc-yellow); box-shadow: inset 5px 0 0 var(--zone-color), 0 0 0 1px rgba(254, 198, 13, 0.5); }
.map-draft-status { margin-top: 8px; }
.pin-draft-card { padding: 0 8px 0 0; }
.pin-select-button { flex: 1; min-width: 0; min-height: 56px; padding: 10px; border: 0; color: inherit; background: transparent; text-align: left; }
.admin-search-message.error { color: #ffd7d2; border-color: rgba(229, 91, 70, 0.65); }

@media (prefers-reduced-motion: reduce) {
  .loading-spinner { animation-duration: 1.6s; }
  html:focus-within { scroll-behavior: auto; }
}

@media (orientation: portrait) and (min-width: 621px) {
  .viewer-page .split-layout {
    grid-template-rows: minmax(0, 0.55fr) minmax(0, 0.45fr);
  }
}

@media (max-width: 980px) {
  .admin-page { overflow: hidden; }
  .admin-global-header { height: 78px; padding: 8px 14px; }
  .admin-global-header .brand p { display: none; }
  .admin-global-header .uc-logo-box { height: 54px; }
  .admin-mobile-tabs { height: 58px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: #092450; }
  .admin-mobile-tabs .dashboard-tab { min-height: 46px; }
  .admin-page #adminContent { display: block; height: calc(100dvh - 136px); }
  .admin-page #adminFormPanel,
  .admin-page #adminMapPanel { display: none; width: 100%; height: 100%; min-height: 0; order: initial; }
  .admin-page #adminFormPanel.mobile-panel-active,
  .admin-page #adminMapPanel.mobile-panel-active { display: block; }
  .admin-page #adminMapPanel.mobile-panel-active { position: relative; padding: 14px; }
  .admin-page .admin-section-header { max-height: 48%; overflow: auto; }
  .admin-page .admin-map { position: absolute; }
}

@media (max-width: 620px) {
  .viewer-page { height: auto; overflow: auto; }
  .viewer-page .app-shell,
  .viewer-page main,
  .viewer-page .view-panel,
  .viewer-page .split-layout { height: auto; min-height: 0; overflow: visible; }
  .viewer-page .split-layout { display: flex; flex-direction: column; }
  .viewer-page .map-pane { order: 1; height: 48svh; min-height: 360px; }
  .viewer-page .data-pane { order: 2; height: auto; min-height: 52svh; overflow: visible; }
  .viewer-page .data-pane .pane-body { min-height: 0; }
  .viewer-page #dashboardDataPanel.active { overflow: visible; }
  .viewer-page .page-badge { display: none; }
  .viewer-search { grid-template-columns: 1fr; }
  .viewer-search .secondary-button { min-height: 44px; }
  .community-rail-header { align-items: flex-start; }
  .community-rail-header p { max-width: calc(100% - 104px); }
  .viewer-page .zone-dashboard { padding: 0; }
  .viewer-page .zone-dashboard-panel { width: 100%; height: 100dvh; max-height: 100dvh; }
  .zone-card-select { padding: 14px; }
  .zone-card > .zone-stats-button { margin: 0 14px 14px; }
  .notification-region { top: 8px; }
  .app-notice { grid-template-columns: 1fr auto; }
  .app-notice > span { grid-column: 1 / -1; }
  .admin-global-header .brand h1 { font-size: 16px; }
  .admin-global-header .uc-logo-box { width: 78px; }
  .admin-global-header .secondary-button { min-height: 44px; padding: 0 10px; font-size: 13px; }
  .admin-page .admin-section-header { padding: 10px; }
  .admin-page .draw-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page .draw-actions .secondary-button { min-height: 46px; padding: 6px 8px; font-size: 13px; }
  .editor-context,
  .admin-list-heading { align-items: stretch; flex-direction: column; }
  .compact-search input { width: 100%; }
  .sticky-actions { display: grid; grid-template-columns: 1fr; }
}

/* Viewer compact console: the map remains the primary visual experience. */
.viewer-page .topbar { min-height: 58px; padding: 9px 12px 7px; gap: 10px; }
.viewer-page .topbar::before { height: 6px; }
.viewer-page .brand { gap: 10px; }
.viewer-page .uc-logo-box { width: 112px; height: 42px; padding: 2px 10px 2px 0; }
.viewer-page .uc-logo-box img { height: 38px; max-height: 38px; }
.viewer-page .brand h1 { font-size: 18px; white-space: nowrap; }
.viewer-page .brand p { display: none; }
.viewer-page .page-badge { min-height: 30px; padding: 4px 8px; }
.viewer-page .pane-body { padding: 8px 10px 10px; }
.viewer-page .data-pane .pane-body { min-height: calc(100% - 58px); }
.viewer-intro { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; margin-bottom: 6px; }
.viewer-intro h2 { margin: 0; color: #fff; font-family: "Roboto Slab", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.1; }
.viewer-page .source-status { align-self: auto; min-height: 26px; margin: 0; padding: 3px 7px; font-size: 10px; }
.viewer-page .viewer-search { margin-bottom: 5px; }
.viewer-page .viewer-search label { min-height: 40px; }
.viewer-page .viewer-search input { font-size: 13px; }
.viewer-page .viewer-search svg { width: 17px; height: 17px; }
.viewer-page .viewer-search .secondary-button { top: 0; right: 0; min-height: 40px; }
.viewer-page .touch-filter-panel { min-height: 46px; margin-bottom: 5px; padding: 2px; border-radius: 4px; }
.viewer-page .compact-filter-field select { min-width: 140px; min-height: 40px; padding-block: 5px; font-size: 11px; }
.viewer-page .compact-filter-field:first-child select { min-width: 165px; }
.viewer-page .filter-clear-button { min-height: 40px; padding: 5px 9px; font-size: 12px; }
.viewer-page .dashboard-tabs { gap: 4px; margin-bottom: 6px; padding: 2px; }
.viewer-page .dashboard-tab { min-height: 36px; gap: 5px; font-size: 12px; }
.viewer-page .dashboard-tab svg { width: 16px; height: 16px; }
.viewer-page .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-bottom: 6px; }
.viewer-page .summary-card { min-height: 48px; padding: 6px 8px; box-shadow: none; }
.viewer-page .summary-card span { font-size: 9px; font-weight: 700; }
.viewer-page .summary-card strong { margin-top: 3px; font-size: 18px; }
.viewer-page .community-rail-header { min-height: 40px; gap: 6px; margin: 0 0 5px; }
.viewer-page .community-rail-header p { overflow: hidden; font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.viewer-page .community-rail-controls { gap: 4px; }
.viewer-page .rail-button { width: 40px; min-height: 40px; }
.viewer-page .zone-list { gap: 7px; padding: 1px 1px 4px; }
.viewer-page .zone-card { flex-basis: min(92%, 390px); min-height: 132px; }
.viewer-page .zone-card-select { padding: 10px 12px 8px; }
.viewer-page .zone-card-select header { gap: 7px; }
.viewer-page .zone-card h3 { font-size: 17px; }
.viewer-page .zone-card small { font-size: 11px; }
.viewer-page .metric-pill { padding: 4px 6px; font-size: 10px; }
.viewer-page .zone-card .tag-row { display: none; }
.viewer-page .selection-state { min-height: 28px; margin-top: 5px; font-size: 11px; }
.viewer-page .selection-state svg { width: 15px; height: 15px; }
.viewer-page .zone-card > .zone-stats-button { min-height: 34px; margin: 0 12px 9px; font-size: 11px; }

/* Territorial statistics are contextual to the selected zone and cover only the map. */
.viewer-page .zone-dashboard { position: absolute; inset: 0; z-index: 20; padding: 16px; }
.viewer-page .zone-dashboard-panel { width: min(780px, calc(100% - 16px)); max-height: calc(100% - 16px); }

@media (min-width: 981px) and (orientation: landscape) {
  .viewer-page .split-layout { grid-template-columns: clamp(370px, 30vw, 460px) minmax(0, 1fr); }
}

@media (orientation: portrait) and (min-width: 621px) {
  .viewer-page .split-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 0.66fr) minmax(0, 0.34fr);
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (max-width: 620px) {
  .viewer-page .map-pane { height: 60svh; min-height: 390px; }
  .viewer-page .data-pane { min-height: 40svh; }
  .viewer-page .topbar { padding: 9px 10px 7px; }
  .viewer-page .brand h1 { font-size: 16px; }
  .viewer-page .uc-logo-box { width: 96px; }
  .viewer-page .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viewer-page .community-rail-header { align-items: center; }
  .viewer-page .community-rail-header p { max-width: none; }
  .viewer-page .zone-dashboard { padding: 0; }
  .viewer-page .zone-dashboard-panel { width: 100%; height: 100%; max-height: 100%; }
  .viewer-page .zone-card-select { padding: 10px 12px 8px; }
  .viewer-page .zone-card > .zone-stats-button { margin: 0 12px 9px; }
}
