﻿:root {
  color-scheme: light;
  --bg: #eef1f4;
  --ink: #171a1f;
  --muted: #69727d;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --line: #d5dce4;
  --accent: #147a63;
  --accent-strong: #0f5e4d;
  --accent-soft: #dcefe9;
  --warn: #a95010;
  --warn-bg: #fff1df;
  --danger: #9b1c31;
  --danger-bg: #ffe7ec;
  --shadow: 0 18px 55px rgba(30, 36, 42, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

.select-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(20, 122, 99, 0.10), transparent 38%),
    linear-gradient(315deg, rgba(198, 83, 33, 0.10), transparent 34%),
    var(--bg);
}

.select-panel {
  width: min(940px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--accent) 0 28%, transparent 30%),
    conic-gradient(from 15deg, transparent 0 20%, #d86528 21% 29%, transparent 30% 100%),
    #cfe7df;
  border: 1px solid rgba(15, 94, 77, 0.30);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.site-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-field,
.opacity-control,
.filter-control {
  display: grid;
  gap: 7px;
  color: #3b444d;
  font-size: 0.86rem;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #c7d0d9;
  border-radius: var(--radius);
  outline: none;
  background: #fbfcfd;
  color: var(--ink);
}

.search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 122, 99, 0.16);
}

.primary-button,
.ghost-button,
.control-button,
.tool-button,
.mini-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  min-height: 48px;
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: #f4f7f8;
  border-color: var(--line);
  color: #26303a;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-line.warn {
  color: var(--warn);
}

.status-line.danger {
  color: var(--danger);
}

.site-list {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  padding-right: 4px;
}

.site-card {
  min-height: 92px;
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  background: #fbfcfd;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-card:hover,
.site-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 122, 99, 0.12);
  outline: none;
}

.site-card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
}

.site-card-id {
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.site-card-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.radar-view {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.map {
  position: absolute;
  inset: 0;
  background: #dce3e8;
}

.location-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.location-crosshair::before,
.location-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(24, 28, 32, 0.72), 0 0 10px rgba(0, 0, 0, 0.35);
}

.location-crosshair::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

.location-crosshair::after {
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

.location-crosshair {
  background:
    radial-gradient(circle at center, transparent 0 6px, rgba(255, 255, 255, 0.92) 7px 8px, transparent 9px);
}

.radar-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 5;
  width: min(410px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--panel-solid);
  border: 1px solid rgba(150, 162, 173, 0.45);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.site-name {
  font-weight: 900;
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.radar-status {
  min-height: 34px;
  padding: 9px 10px;
  color: #24483f;
  background: var(--accent-soft);
  border: 1px solid rgba(20, 122, 99, 0.18);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.radar-status.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: rgba(169, 80, 16, 0.24);
}

.radar-status.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(155, 28, 49, 0.24);
}

.timeline-block {
  display: grid;
  gap: 8px;
}

.frame-slider,
.opacity-control input,
.filter-control input {
  width: 100%;
  accent-color: var(--accent);
}

.filter-control span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.filter-control output {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

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

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

.control-button {
  background: #f7f9fa;
  border-color: #d7dee5;
  color: #20262d;
}

.tool-button {
  min-height: 38px;
  padding: 0 8px;
  background: #eef3f5;
  border-color: #d4dde4;
  color: #26303a;
  font-size: 0.82rem;
  font-weight: 850;
}

.tool-button.is-active {
  color: #fff;
  background: #2f4352;
  border-color: #2f4352;
}

.control-button.is-active {
  color: #fff;
  background: #5d3a1f;
  border-color: #5d3a1f;
}

.control-button.strong {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.control-button:hover,
.tool-button:hover,
.mini-button:hover {
  border-color: var(--accent);
}

.tool-drawer,
.location-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f7f9fa;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
}

.drawer-panel {
  display: grid;
  gap: 10px;
}

.drawer-header,
.location-editor-actions,
.location-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.location-editor-actions {
  justify-content: flex-end;
}

.location-editor-row span {
  min-width: 0;
  line-height: 1.3;
}

.drawer-title {
  color: #25313b;
  font-size: 0.88rem;
  font-weight: 900;
}

.drawer-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  color: #26303a;
  background: #fff;
  border-color: #ccd6df;
  font-size: 0.8rem;
  font-weight: 850;
}

.mini-button.strong {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

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

.map-option {
  min-height: 34px;
  border: 1px solid #ccd6df;
  border-radius: var(--radius);
  background: #fff;
  color: #26303a;
  font-weight: 800;
}

.map-option.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.location-list,
.warning-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.location-row,
.warning-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: var(--radius);
}

.warning-row {
  grid-template-columns: minmax(0, 1fr);
}

.location-row-title,
.warning-row-title {
  overflow: hidden;
  color: #24303a;
  font-size: 0.86rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-row-meta,
.warning-row-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.location-name-field {
  display: grid;
  gap: 6px;
  color: #3b444d;
  font-size: 0.82rem;
  font-weight: 800;
}

.location-name-field input {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #c7d0d9;
  border-radius: var(--radius);
  color: var(--ink);
}

.location-editor-row {
  color: var(--muted);
  font-size: 0.8rem;
}

.ol-zoom {
  top: auto;
  right: 16px;
  bottom: 16px;
  left: auto;
}

.ol-control button {
  background-color: rgba(32, 35, 39, 0.86);
}

.ol-attribution {
  font-size: 0.76rem;
}

@media (max-width: 700px) {
  .select-view {
    padding: 14px;
    place-items: stretch;
  }

  .select-panel {
    min-height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
    padding: 18px;
  }

  .site-actions {
    grid-template-columns: 1fr;
  }

  .site-list {
    grid-template-columns: 1fr;
  }

  .radar-panel {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    gap: 11px;
    padding: 13px;
  }

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

  .tool-grid,
  .map-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ol-zoom {
    right: 12px;
    bottom: auto;
    top: 12px;
  }
}


