:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --panel: rgba(14, 18, 23, 0.82);
  --panel-border: rgba(255, 255, 255, 0.14);
  --text: #f3f7fb;
  --muted: #aeb9c5;
  --accent: #4dd4ac;
  --accent-strong: #25b28d;
  --danger: #ffb199;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #090d12;
  color: var(--text);
}

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

.panel {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  width: min(360px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #f7fbff 0 3px, transparent 4px),
    radial-gradient(circle at 55% 58%, #4dd4ac 0 9px, transparent 10px),
    linear-gradient(145deg, #24435d, #0d151f);
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.coord-grid label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
button,
select {
  height: 38px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 212, 172, 0.18);
}

button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

button:hover {
  border-color: rgba(77, 212, 172, 0.55);
  background: rgba(77, 212, 172, 0.16);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.actions button[aria-pressed="true"] {
  border-color: rgba(77, 212, 172, 0.6);
  background: var(--accent-strong);
  color: #06110d;
  font-weight: 700;
}

.status {
  min-height: 36px;
  margin: 12px 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status.error {
  border-color: rgba(255, 177, 153, 0.4);
  color: var(--danger);
}

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

.actions {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.streetview-control {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.section-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

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

.coord-grid label {
  margin: 0;
}

.coord-grid input {
  width: 100%;
  margin-top: 6px;
}

#panoList {
  width: 100%;
  margin-top: 10px;
}

.streetview-panel {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 11;
  display: none;
  width: min(760px, calc(100vw - 410px));
  max-height: calc(100vh - 36px);
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

.streetview-panel.visible {
  display: block;
}

.streetview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.streetview-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.streetview-header p {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.streetview-header button {
  width: 62px;
  flex: 0 0 auto;
}

.view-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

#viewCanvas,
#panoCanvas {
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #10151d;
  object-fit: contain;
}

#viewCanvas {
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 190px);
  cursor: grab;
  touch-action: none;
}

#viewCanvas:active {
  cursor: grabbing;
}

#panoCanvas {
  margin-top: 10px;
  max-height: 112px;
  opacity: 0.72;
}

.help {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: flex;
  max-width: calc(100vw - 36px);
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: rgba(243, 247, 251, 0.76);
  font-size: 12px;
}

.help span {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(14, 18, 23, 0.64);
  backdrop-filter: blur(12px);
}

.cesium-viewer-bottom {
  left: auto;
  right: 8px;
}

@media (max-width: 720px) {
  .panel {
    top: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    padding: 12px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .help {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-content: flex-start;
  }

  .streetview-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 78px;
    width: auto;
    max-height: 46vh;
  }

  .view-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #viewCanvas {
    max-height: calc(46vh - 86px);
  }

  #panoCanvas {
    max-height: 58px;
  }
}
