@charset "UTF-8";
html,
body {
  height: 100%;
  margin: 0;
}

* {
  box-sizing: border-box;
}

body {
  background: #0f172a;
  color: #0f172a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0f172a;
}

.map-surface {
  position: absolute;
  inset: 0;
}

.app-header {
  pointer-events: none;
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  padding: 20px;
}

.title-panel,
.control-panel,
.status-panel,
.bottom-actions,
.hud-master-toggle,
.loading-panel > div,
.error-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(12px);
}

.hud-master-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 28;
  height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  color: #0f172a;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.app-shell.hud-hidden .hud-master-toggle {
  border-color: #047857;
  background: #047857;
  color: #ffffff;
}

.hud-panel {
  transition: opacity 160ms ease, visibility 160ms ease, width 160ms ease, min-width 160ms ease;
}

.app-shell.hud-hidden .hud-panel {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.panel-collapse-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 0;
  height: 28px;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #475569;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 0 9px;
}

.panel-collapse-button:hover {
  background: #f8fafc;
  color: #0f172a;
}

.hud-panel.is-collapsed {
  min-width: 0;
  width: auto;
  max-width: max-content;
  padding: 4px;
}

.hud-panel.is-collapsed .panel-body {
  display: none;
}

.hud-panel.is-collapsed .panel-collapse-button {
  position: static;
  height: 34px;
  padding: 0 12px;
}

.title-panel {
  pointer-events: auto;
  position: relative;
  max-width: min(35rem, calc(100vw - 1.5rem));
  padding: 14px 68px 14px 16px;
  border-radius: 8px;
}

.title-panel.is-collapsed {
  max-width: max-content;
  padding: 4px;
}

.eyebrow,
.section-label {
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.title-panel h1 {
  margin: 4px 0 0;
  color: #020617;
  font-size: 26px;
  line-height: 1.08;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.control-panel {
  position: absolute;
  top: 150px;
  left: 20px;
  z-index: 20;
  width: min(calc(100vw - 1.5rem), 304px);
  padding: 42px 12px 12px;
  border-radius: 8px;
}

.control-panel.is-collapsed {
  width: auto;
  padding: 4px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.control-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.control-button {
  min-height: 48px;
  padding: 8px 10px;
}

.control-button:hover,
.action-button:hover {
  background: #f8fafc;
}

.control-button.active {
  border-color: #047857;
  background: #047857;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(4, 120, 87, 0.24);
}

.control-button.dark {
  border-color: #0f172a;
  background: #0f172a;
  color: #ffffff;
}

.control-button.muted {
  color: #64748b;
}

.panel-rule {
  height: 1px;
  margin: 13px 0;
  background: #e7e5e4;
}

.status-panel {
  position: absolute;
  top: 20px;
  right: 118px;
  z-index: 20;
  padding: 0;
  min-width: min(430px, calc(100vw - 40px));
  overflow: hidden;
  border-radius: 8px;
}

.status-panel.is-collapsed {
  min-width: 0;
  padding: 4px;
}

.status-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding-right: 58px;
}

.status-body > div {
  min-width: 0;
  padding: 11px 13px;
}

.status-panel span {
  display: block;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-panel strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #0f172a;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-actions {
  position: absolute;
  bottom: 42px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.bottom-actions.is-collapsed {
  padding: 4px;
}

.bottom-actions .panel-collapse-button {
  position: static;
  height: 40px;
}

.bottom-actions-body {
  display: flex;
  gap: 4px;
}

.action-button {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
}

.action-button.primary {
  border-color: #047857;
  background: #047857;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(4, 120, 87, 0.22);
}

.loading-panel {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(4px);
}

.loading-panel.is-hidden {
  display: none;
}

.loading-panel > div {
  border-radius: 8px;
  padding: 12px 16px;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.error-panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 40;
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 5px;
  border-color: #fecaca;
  border-radius: 8px;
  padding: 13px 16px;
  color: #991b1b;
  font-size: 13px;
}

.error-panel[hidden] {
  display: none;
}

.maplibregl-ctrl-group {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: 8px !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18) !important;
  overflow: hidden;
}

.maplibregl-ctrl button {
  width: 34px !important;
  height: 34px !important;
}

.maplibregl-ctrl-attrib a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.maplibregl-popup-content {
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  padding: 12px 13px;
}

.popup-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.popup-type {
  color: #047857;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-top: 3px;
  text-transform: uppercase;
}

.popup-copy {
  color: #475569;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 7px;
  max-width: 230px;
}

@media (max-width: 860px) {
  .app-header {
    padding: 12px;
  }

  .title-panel {
    padding: 12px 58px 12px 13px;
  }

  .title-panel h1 {
    font-size: 19px;
  }

  .source-row {
    font-size: 11px;
  }

  .control-panel {
    top: 128px;
    left: 12px;
    width: min(calc(100vw - 24px), 304px);
  }

  .status-panel {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
  }

  .hud-master-toggle {
    top: 12px;
    right: 12px;
    height: 36px;
    padding: 0 11px;
  }

  .status-body {
    padding-right: 52px;
  }

  .bottom-actions {
    bottom: 92px;
  }

  .action-button {
    height: 38px;
    padding: 0 13px;
    font-size: 12px;
  }
}

@media (max-height: 620px) and (max-width: 900px) {
  .control-panel {
    top: 112px;
  }

  .control-button {
    min-height: 40px;
    padding: 7px 8px;
  }

  .panel-rule {
    margin: 9px 0;
  }

  .status-panel {
    right: 12px;
    left: auto;
    bottom: 12px;
    width: min(360px, calc(100vw - 340px));
    min-width: 0;
  }

  .status-body {
    padding-right: 50px;
  }

  .bottom-actions {
    right: 12px;
    bottom: 82px;
    left: auto;
    transform: none;
  }
}
