:root {
  --bg: #f7f7f5;
  --panel-bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e6e6e3;
  --accent: #5e81ac;
  --short: #d08770;
  --shade: #5e81ac;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  width: 340px;
  flex: 0 0 340px;
  overflow-y: auto;
  padding: 24px 20px;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 700;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.panel {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.field span {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}

.field input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.hint {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover { background: #eceae5; }

.stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stats[hidden],
.loading[hidden] {
  display: none;
}

.route-stat {
  border-left: 4px solid var(--stat-color);
  padding-left: 12px;
}

.route-stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--stat-color);
}

.route-stat-length {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  transition: opacity 0.15s ease;
}

.route-stat-sun {
  font-size: 1.05rem;
  color: var(--stat-color);
}

.compare {
  font-size: 1rem;
  margin: 4px 0 0;
  line-height: 1.4;
}

.map-wrap {
  position: relative;
  flex: 1;
}

#map {
  width: 100%;
  height: 100%;
}

.loading {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.85);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 1000;
}

@media (max-width: 720px) {
  .layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    width: 100%;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .map-wrap {
    height: 60vh;
  }
}
