:root {
  --ink: #1b2a34;
  --navy: #003a5d;
  --teal: #00a3a3;
  --sand: #f6f1ea;
  --gold: #d0b77f;
  --panel-bg: rgba(255, 255, 255, 0.96);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--sand);
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

#panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 241, 234, 0.9));
  padding: 14px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 320px;
  width: 30vw;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.panel-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--teal);
}

.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

#panel .brand {
  padding-right: 120px;
}

#panel h1 {
  margin: 8px 0 6px 0;
  font-size: 16px;
  color: var(--navy);
}

.meta {
  font-size: 12px;
  color: #3f4f58;
  margin-bottom: 8px;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.panel-row.wrap {
  flex-wrap: wrap;
}

label {
  font-size: 12px;
  color: #3f4f58;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.controls-row {
  flex-wrap: nowrap;
}

.filters-row {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.mode-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11px;
  color: #3f4f58;
}

.mode-toggle .mode-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.is-hidden {
  display: none;
}

select, input[type="range"] {
  width: 100%;
}

#comparisonSelect {
  max-width: 180px;
}

#speedSelect {
  max-width: 100px;
  width: auto;
}

#calendar {
  background: #efe7dd;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.inline-meta {
  font-size: 12px;
  color: #3f4f58;
  white-space: nowrap;
}

.month-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.month-btn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #3f4f58;
  border-radius: 6px;
  font-size: 11px;
  padding: 6px 4px;
  cursor: pointer;
}

.month-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 11px;
  color: #5b6770;
  text-align: center;
  margin-top: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.day-cell {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  color: #1b2a34;
  border-radius: 6px;
  font-size: 12px;
  padding: 6px 0;
  cursor: pointer;
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.day-cell.unavailable {
  background: #ececec;
  color: #9aa3aa;
  cursor: not-allowed;
}

.day-cell.available:hover {
  border-color: var(--teal);
}

.day-cell.selected {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}

.btn.secondary {
  background: var(--teal);
}

#timeline,
#compareTimeline,
#timeAxis {
  width: 100%;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f8f8f8;
}

#timeAxis {
  height: 28px;
  margin-top: 4px;
  border: none;
  background: transparent;
}

.weather-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  font-size: 10px;
  color: #3f4f58;
}

.weather-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.weather-legend-icon {
  font-size: 12px;
  line-height: 1;
}

.weather-marker {
  --weather-color: #4d8b66;
  --weather-scale: 1;
  pointer-events: auto;
  user-select: none;
}

.weather-marker-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: scale(var(--weather-scale));
  transform-origin: center center;
}

.weather-marker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 54px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--weather-color);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(2px);
}

.weather-marker-icon {
  font-size: 15px;
  line-height: 1;
}

.weather-marker-temp {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #163447;
}

.weather-marker-event {
  max-width: 92px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(22, 52, 71, 0.86);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 4px;
}

.chart-row {
  justify-content: space-between;
}

#modeLegend {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
}

.mode-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

#loadingOverlay {
  position: absolute;
  inset: 0;
  background: rgba(246, 241, 234, 0.92);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--navy);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 58, 93, 0.2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#loadingText {
  font-size: 13px;
}

#loadingError {
  font-size: 12px;
  color: #8a1f1f;
  max-width: 360px;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 52, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal.is-hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.modal-large {
  width: 90vw;
  height: 90vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-close {
  border: none;
  background: var(--navy);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 12px;
  color: #3f4f58;
}

.mode-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #f3f3f3;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.mode-filter .mode-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.dashboard-card {
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 220px;
}

.dashboard-title {
  font-size: 11px;
  font-weight: 600;
  color: #3f4f58;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-canvas {
  width: 100%;
  height: 160px;
  display: block;
  margin: 0;
}

.dashboard-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: rgba(27, 42, 52, 0.92);
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  line-height: 1.35;
  max-width: 220px;
}

.dashboard-tooltip .tooltip-date {
  font-weight: 600;
  margin-bottom: 2px;
}

@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #3f4f58;
}

.checkbox input {
  accent-color: var(--navy);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand img {
  height: 22px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  font-size: 11px;
  color: #5b6770;
}

#clockDock {
  position: absolute;
  right: 18px;
  bottom: 48px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.weather-dock {
  min-width: 180px;
  max-width: 220px;
  background: linear-gradient(145deg, rgba(17, 18, 20, 0.95), rgba(47, 49, 52, 0.92));
  color: #f4f4f4;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.weather-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weather-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.weather-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.weather-label {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weather-place {
  font-size: 9px;
  opacity: 0.72;
}

.weather-temp {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

.weather-meta {
  display: grid;
  gap: 3px;
  font-size: 9px;
  opacity: 0.82;
}

.clock-analog {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.85));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 45%, rgba(0, 0, 0, 0.7) 100%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.32) 0deg 2deg, transparent 2deg 30deg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clock-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(0deg);
  border-radius: 999px;
  background: #f1f1f1;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.clock-hand.hour-hand {
  width: 4px;
  height: 24px;
}

.clock-hand.minute-hand {
  width: 3px;
  height: 34px;
  background: #ffffff;
}

.clock-center {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.clock-card {
  min-width: 160px;
  background: linear-gradient(145deg, #111214, #2f3134);
  color: #f4f4f4;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.clock-header {
  font-size: 10px;
  line-height: 1.1;
}

.clock-period {
  opacity: 0.7;
  margin-top: 2px;
}

.clock-time {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 4px 0 6px;
  font-variant-numeric: tabular-nums;
}

.clock-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 10px;
  opacity: 0.8;
}

.clock-day {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

@media (max-width: 720px) {
  #clockDock {
    right: 12px;
    bottom: 56px;
    gap: 8px;
    transform: scale(0.88);
    transform-origin: bottom right;
  }
}

@media (max-width: 520px) {
  #clockDock {
    transform: scale(0.78);
  }
}
