:root {
  --bg: #080f0f;
  --surface: #0e1a1a;
  --card: #112020;
  --card-hover: #162828;
  --border: #1c3333;
  --teal: #0d9488;
  --teal-light: #14b8a6;
  --amber: #f59e0b;
  --amber-light: #fcd34d;
  --text: #e8f4f4;
  --text-muted: #7aacac;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

/* Topbar */
.topbar {
  padding: 8px 4px 16px;
}

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

.brand-icon {
  font-size: 28px;
  background: var(--card);
  border: 1px solid var(--teal);
  border-radius: 14px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.brand h1 .accent {
  color: var(--teal-light);
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}

.card-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: inherit;
  padding: 0 0 12px;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.section-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  flex: 1;
}

.section-icon {
  font-size: 16px;
}

.chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.card-header-row[aria-expanded="false"] .chevron {
  transform: rotate(180deg);
}

/* Location card */
.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-pin {
  font-size: 20px;
}

.location-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.location-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.location-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-muted {
  background: var(--surface);
  color: var(--text-muted);
}

.badge-safe {
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-light);
}

.badge-warn {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-light);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.sun-row {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* Map */
.map-view {
  width: 100%;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.map-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.legend-you { background: var(--teal-light); }
.legend-range { background: transparent; border: 2px solid var(--amber); }
.legend-zone { background: var(--danger); }

.zone-warning {
  margin-top: 12px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

/* Drone model select */
.drone-select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
}

.drone-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.drone-specs strong {
  color: var(--teal-light);
}

/* Chip selector */
.chip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 6px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
}

.chip strong {
  color: var(--text);
  font-size: 14px;
}

.chip small {
  font-size: 10px;
}

.chip-selected {
  border-color: var(--teal-light);
  background: rgba(13, 148, 136, 0.12);
}

.chip-selected strong {
  color: var(--teal-light);
}

/* Hourly timeline */
.time-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.time-chip {
  flex: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-family: inherit;
  min-width: 68px;
}

.time-chip strong {
  color: var(--text);
  font-size: 13px;
}

.time-chip small {
  font-size: 11px;
}

.time-chip-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--teal-light);
  letter-spacing: 0.04em;
}

.time-chip-selected {
  border-color: var(--teal-light);
  background: rgba(13, 148, 136, 0.12);
}

.time-chip-selected strong {
  color: var(--teal-light);
}

/* Weather grid */
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.metric-value {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.icon-badge {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-badge-teal { background: rgba(13, 148, 136, 0.18); }
.icon-badge-teal-light { background: rgba(20, 184, 166, 0.18); }
.icon-badge-amber { background: rgba(245, 158, 11, 0.18); }

/* Risk card */
.risk-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-light);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.risk-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.risk-text {
  flex: 1;
}

.risk-text h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--amber-light);
}

.risk-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.risk-ring {
  --pct: 0;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(var(--amber) calc(var(--pct) * 1%), var(--surface) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.risk-ring::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--card);
}

.risk-ring-value {
  position: relative;
  font-size: 24px;
  font-weight: 800;
  color: var(--amber-light);
}

.risk-ring-max {
  position: relative;
  font-size: 10px;
  color: var(--text-muted);
  align-self: flex-end;
  margin: 0 0 8px -2px;
}

.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.detail-icon {
  font-size: 15px;
  line-height: 1.3;
}

.detail-body strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.detail-body span {
  font-size: 12px;
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}
