:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ink: #14251d;
  --muted: #607067;
  --surface: rgba(251, 252, 248, 0.94);
  --surface-solid: #fbfcf8;
  --line: rgba(20, 78, 59, 0.14);
  --green-900: #123d2f;
  --green-700: #1e6b50;
  --green-500: #3e8f6c;
  --green-100: #e4f1e9;
  --orange: #e9793d;
  --shadow: 0 18px 48px rgba(18, 61, 47, 0.16);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: var(--green-900);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(233, 121, 61, 0.45);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

#app {
  display: grid;
  grid-template-rows: calc(68px + var(--safe-top)) minmax(0, 1fr) calc(34px + var(--safe-bottom));
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 68px;
  align-items: center;
  min-width: 0;
  padding: var(--safe-top) 18px 0;
  color: #fff;
  background: linear-gradient(110deg, #123d2f 0%, #1c5c44 100%);
  box-shadow: 0 4px 18px rgba(10, 37, 28, 0.2);
}

.brand,
.topbar-actions,
.status,
.brand-copy,
.panel-topline,
.tour-header,
.tour-actions,
.source-bar {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 11px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--green-900);
  background: #f4d884;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-copy {
  align-items: flex-start;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-actions {
  gap: 9px;
}

.status {
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #f4d884;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(244, 216, 132, 0.13);
}

.status.is-ready .status-dot {
  background: #83d3a7;
}

.status.is-warning .status-dot {
  background: #f4c56b;
}

.status.is-error .status-dot {
  background: #ff8b76;
}

.button,
.view-button,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, opacity 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--green-700);
}

.button-primary:hover {
  background: var(--green-900);
}

.button-secondary {
  color: var(--green-900);
  background: var(--green-100);
}

.button-secondary:hover {
  background: #d6eadd;
}

.button-quiet {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-quiet:hover {
  background: rgba(255, 255, 255, 0.18);
}

.mobile-only {
  display: none;
}

main {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #dce7e2;
}

#map {
  position: absolute;
  inset: 0;
}

.cesium-viewer,
.cesium-viewer * {
  font-family: inherit;
}

.cesium-widget canvas:focus-visible {
  outline: 3px solid rgba(233, 121, 61, 0.58);
  outline-offset: -4px;
}

.cesium-performanceDisplay-default,
.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer {
  display: none !important;
}

.cesium-widget-credits {
  position: absolute;
  bottom: 0;
  left: 0;
  max-width: 100%;
  padding: 2px 6px;
  font-size: 9px;
  line-height: 1.3;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 0 8px 0 0;
  backdrop-filter: blur(6px);
}

.cesium-widget-credits a {
  color: var(--green-900);
}

.cesium-widget-errorPanel {
  font-family: inherit;
}

.loading-overlay {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 38%, #eff5f1 0%, #dbe8e1 58%, #c5d7cc 100%);
  opacity: 1;
  transition: opacity 450ms ease, visibility 450ms ease;
}

body.map-ready .loading-overlay {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  max-width: 330px;
  padding: 30px 34px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.loader-card strong {
  margin-top: 18px;
  font-size: 17px;
}

.loader-card > span:last-child {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.loader-ring {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(30, 107, 80, 0.14);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

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

.panel {
  position: absolute;
  z-index: 10;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px) saturate(120%);
}

.info-panel {
  top: 18px;
  left: 18px;
  width: min(350px, calc(100vw - 36px));
  padding: 16px;
}

.panel-topline {
  justify-content: space-between;
  gap: 12px;
}

.panel-topline h2,
.eyebrow {
  margin: 0;
}

.eyebrow {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-topline h2 {
  margin-top: 4px;
  font-size: 15px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--green-900);
  background: var(--green-100);
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
}

.panel h1 {
  margin: 12px 0 7px;
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.panel-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.info-panel.is-collapsed {
  width: auto;
}

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

.view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 14px 0 9px;
}

.view-button {
  min-height: 36px;
  padding: 7px 9px;
  color: var(--green-900);
  background: rgba(228, 241, 233, 0.65);
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.view-button:hover,
.view-button.is-active {
  background: var(--green-100);
  border-color: rgba(30, 107, 80, 0.25);
}

.view-button:first-child {
  grid-column: 1 / -1;
}

#startTourButton {
  width: 100%;
}

.tour-card {
  top: 18px;
  right: 18px;
  width: 300px;
  margin-top: 0;
  padding: 14px;
  background: #f2f7f3;
  border: 1px solid rgba(30, 107, 80, 0.13);
  border-radius: 15px;
}

.tour-header,
.range-label {
  justify-content: space-between;
  gap: 10px;
}

.tour-header span,
.range-label label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-button {
  padding: 0;
  color: var(--green-700);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.tour-progress {
  height: 4px;
  margin: 9px 0 12px;
  overflow: hidden;
  background: #d8e7dd;
  border-radius: 99px;
}

.tour-progress span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--orange);
  border-radius: inherit;
  transition: width 250ms ease;
}

.tour-card h2 {
  margin: 0 0 5px;
  font-size: 15px;
}

.tour-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.tour-actions {
  gap: 8px;
  margin-top: 12px;
}

.tour-actions .button {
  flex: 1;
}

.panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.panel-actions .button-primary {
  flex: 1;
}

.about-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--surface-solid);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.about-dialog::backdrop {
  background: rgba(9, 26, 20, 0.55);
  backdrop-filter: blur(2px);
}

.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.about-header h2 {
  margin: 0;
  font-size: 16px;
}

.about-header .icon-button {
  color: var(--green-900);
  background: var(--green-100);
}

.about-body {
  padding: 14px 18px 4px;
}

.about-intro {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.about-body h3 {
  margin: 0 0 8px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.about-members {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.about-members li {
  padding: 9px 12px;
  color: var(--ink);
  background: var(--green-100);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}

.about-school {
  margin: 0;
  padding-top: 13px;
  color: var(--green-900);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.about-actions {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 18px;
}

.readout {
  position: absolute;
  z-index: 9;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  overflow: hidden;
  background: rgba(18, 61, 47, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(18, 61, 47, 0.2);
  color: #fff;
  backdrop-filter: blur(12px);
}

.readout > div {
  padding: 9px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.readout > div:last-child {
  border-right: 0;
}

.readout span,
.readout strong {
  display: block;
}

.readout span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.readout strong {
  margin-top: 3px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.map-hint {
  position: absolute;
  z-index: 5;
  bottom: 13px;
  left: 50%;
  padding: 6px 10px;
  color: var(--green-900);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 99px;
  box-shadow: 0 3px 12px rgba(18, 61, 47, 0.1);
  font-size: 9px;
  font-weight: 650;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.map-scale {
  position: absolute;
  z-index: 6;
  bottom: 16px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green-900);
  font-size: 9px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.map-scale i {
  display: block;
  width: 90px;
  height: 6px;
  border: 1px solid var(--green-900);
  border-top: 0;
  transition: width 150ms ease;
}

.map-popup {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  min-width: 190px;
  max-width: 250px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(18, 61, 47, 0.22);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.map-popup span {
  color: var(--green-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-popup strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.map-popup p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.source-bar {
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 0 14px var(--safe-bottom);
  color: rgba(255, 255, 255, 0.68);
  background: #0e3026;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.source-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  #app {
    grid-template-rows: calc(56px + var(--safe-top)) minmax(0, 1fr) calc(29px + var(--safe-bottom));
  }

  .topbar {
    grid-template-rows: 56px;
    padding: var(--safe-top) 10px 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small,
  #statusText,
  #fullscreenButton {
    display: none;
  }

  .status {
    width: 28px;
    min-height: 28px;
    justify-content: center;
    padding: 0;
  }

  .mobile-only {
    display: inline-flex;
  }

  .topbar-actions .button {
    min-height: 32px;
    padding: 0 10px;
  }

  .info-panel {
    top: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100% - 20px);
    padding: 13px;
    overflow-y: auto;
    border-radius: 15px;
  }

  .info-panel h1 {
    margin-top: 9px;
    font-size: 21px;
  }

  .panel-description {
    display: none;
  }

  .view-grid {
    display: flex;
    margin: 10px 0 8px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-grid::-webkit-scrollbar {
    display: none;
  }

  .view-button,
  .view-button:first-child {
    flex: 0 0 auto;
    grid-column: auto;
  }

  .tour-card {
    top: 78px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100% - 190px);
    overflow-y: auto;
  }

  .readout {
    right: 10px;
    bottom: 44px;
    left: 10px;
    grid-template-columns: repeat(3, 1fr);
  }

  .readout > div {
    padding: 7px 9px;
  }

  .map-hint {
    display: none;
  }

  .map-scale {
    bottom: 100px;
    left: 10px;
  }

  .cesium-widget-credits {
    max-width: 60%;
  }

  .source-bar {
    justify-content: center;
    padding: 0 8px;
  }

  .source-bar span:first-child {
    display: none;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .info-panel {
    max-height: calc(100% - 36px);
    overflow-y: auto;
  }

  .panel-description {
    display: none;
  }

  .view-grid {
    margin: 9px 0 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
