:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(13, 25, 24, 0.82);
  --panel-solid: #0d1918;
  --text: #f4f7ef;
  --muted: #a8b7aa;
  --line: rgba(213, 230, 210, 0.14);
  --green: #74d680;
  --yellow: #f4bd4f;
  --red: #ff6a5e;
  --cyan: #67d7d1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(150deg, rgba(12, 43, 38, 0.92), rgba(7, 16, 15, 0.96) 42%, rgba(16, 18, 31, 0.9)),
    radial-gradient(ellipse at 76% 8%, rgba(103, 215, 209, 0.24), transparent 38%),
    radial-gradient(ellipse at 6% 78%, rgba(244, 189, 79, 0.12), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(103, 215, 209, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 214, 128, 0.04) 1px, transparent 1px),
    linear-gradient(118deg, transparent 0 48%, rgba(244, 189, 79, 0.052) 49%, transparent 50% 100%);
  background-size: 58px 58px, 58px 58px, 210px 210px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  animation: drift 24s linear infinite;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid rgba(103, 215, 209, 0.28);
  border-radius: 8px;
  background: rgba(103, 215, 209, 0.09);
  color: var(--text);
  cursor: pointer;
  font-weight: 820;
}

button:hover {
  border-color: rgba(103, 215, 209, 0.52);
  background: rgba(103, 215, 209, 0.14);
}

input,
select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1716;
  color: var(--text);
}

input::placeholder {
  color: rgba(168, 183, 170, 0.62);
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

#fieldCanvas,
.topbar,
.shell {
  position: relative;
  z-index: 1;
}

#fieldCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.66;
  mix-blend-mode: screen;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 0 max(16px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 15, 0.74);
  backdrop-filter: blur(18px);
}

.brand,
.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  color: inherit;
  font-weight: 780;
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(116, 214, 128, 0.42);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(116, 214, 128, 0.22), rgba(103, 215, 209, 0.1));
}

.nav-actions a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
  text-decoration: none;
}

.nav-actions a:hover {
  color: var(--text);
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(103, 215, 209, 0.07), transparent 48%),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 14px;
  min-height: 310px;
  align-content: end;
  padding: clamp(24px, 6vw, 54px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: 0.9;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 840;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-grid,
.auth-gate,
.workspace,
.setup-grid,
.card-grid,
.briefing-grid,
.form-grid,
.location-form,
.button-row {
  display: grid;
  gap: 12px;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.status-grid article,
.metric-card,
.location-card,
.list-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.42);
}

.status-grid span,
.metric-card span,
.list-item span,
.location-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-grid strong,
.metric-card strong,
.list-item strong,
.location-card strong {
  display: block;
  margin-top: 3px;
}

.auth-gate {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 16px;
}

.auth-gate .panel {
  max-width: 980px;
}

/* Visibility: only HIDE the inappropriate state, never force a display value,
   so each element keeps its natural/author display when shown. */
body[data-auth="signed-out"] .signed-in-only {
  display: none;
}

body[data-auth="signed-in"] .signed-out-only {
  display: none;
}

body[data-auth-mode="signin"] .signup-only {
  display: none;
}

body[data-auth-mode="signup"] .signin-only {
  display: none;
}

.workspace {
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  margin-top: 16px;
}

.setup-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  margin-top: 16px;
}

.panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.setup-grid .panel {
  grid-column: span 2;
}

.setup-grid .span-two {
  grid-column: span 4;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.panel h3 {
  margin: 3px 0 0;
}

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

.form-grid,
.button-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.location-form {
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(140px, 0.8fr)) repeat(2, minmax(120px, 0.65fr)) repeat(2, minmax(150px, 0.8fr));
  align-items: end;
}

.map-picker {
  display: grid;
  gap: 10px;
}

.map-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.location-map {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(103, 215, 209, 0.2);
  border-radius: 8px;
  background: #091514;
  cursor: crosshair;
  user-select: none;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  object-fit: cover;
  opacity: 0.92;
}

.map-pin {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 3px solid #07100f;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(244, 189, 79, 0.72), 0 12px 28px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-crosshair {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(244, 189, 79, 0.78);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-crosshair::before,
.map-crosshair::after {
  position: absolute;
  content: "";
  background: rgba(244, 189, 79, 0.78);
}

.map-crosshair::before {
  top: 50%;
  left: -8px;
  right: -8px;
  height: 1px;
}

.map-crosshair::after {
  top: -8px;
  bottom: -8px;
  left: 50%;
  width: 1px;
}

.location-card {
  display: grid;
  gap: 10px;
}

.location-card.active {
  border-color: rgba(103, 215, 209, 0.5);
  background:
    linear-gradient(145deg, rgba(103, 215, 209, 0.12), transparent 58%),
    rgba(7, 16, 15, 0.52);
}

.location-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.note {
  margin: 0;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 8px;
}

.empty {
  padding: 14px;
  border: 1px dashed rgba(213, 230, 210, 0.16);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 1220px) {
  .workspace,
  .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-grid .panel,
  .setup-grid .span-two {
    grid-column: span 2;
  }

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

@media (max-width: 960px) {
  .status-grid,
  .auth-gate,
  .workspace,
  .setup-grid,
  .card-grid,
  .briefing-grid,
  .form-grid,
  .location-form,
  .button-row {
    grid-template-columns: 1fr;
  }

  .setup-grid .panel,
  .setup-grid .span-two {
    grid-column: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 12px;
  }

  .map-search {
    grid-template-columns: 1fr;
  }

  .location-map {
    min-height: 300px;
  }
}

@keyframes drift {
  from {
    background-position: 0 0, 0 0, 0 0;
  }
  to {
    background-position: 58px 116px, 116px 58px, 210px 0;
  }
}

/* ============================================================
   Phase 1 - dashboard-first layout
   ============================================================ */

/* Quieter type voice (was 820/840/760 across the board). */
button { font-weight: 640; }
label { font-weight: 600; letter-spacing: 0.02em; }
.eyebrow { font-weight: 700; letter-spacing: 0.04em; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.muted { color: var(--muted); margin: 0; }

.primary {
  border-color: rgba(116, 214, 128, 0.5);
  background: linear-gradient(145deg, rgba(116, 214, 128, 0.22), rgba(103, 215, 209, 0.12));
}

.ghost-button {
  min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(7, 16, 15, 0.4); color: var(--muted); font-weight: 600;
}
.ghost-button:hover { color: var(--text); border-color: rgba(103, 215, 209, 0.4); }
.ghost-button.danger:hover { color: var(--red); border-color: rgba(255, 106, 94, 0.5); }

.topbar-status { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Auth gate */
.auth-panel { max-width: 560px; margin: 24px auto 0; }
.auth-panel h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.4rem); }
.auth-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 16, 15, 0.4); }
.auth-tab { min-height: 32px; border: none; background: transparent; color: var(--muted); }
body[data-auth-mode="signin"] #authSignInTab,
body[data-auth-mode="signup"] #authSignUpTab { background: rgba(103, 215, 209, 0.16); color: var(--text); }

/* Dashboard shell */
.dashboard { display: grid; gap: 18px; }
.hero { min-height: auto; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.status-strip { display: flex; gap: 22px; flex-wrap: wrap; }
.status-strip.column { flex-direction: column; gap: 10px; }
.status-strip > div { display: grid; gap: 2px; }
.status-strip strong { font-size: 1.05rem; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0; }
.section-heading.compact { margin: 18px 0 8px; }
.section-heading h2, .section-heading h3 { margin: 2px 0 0; }

/* Location tiles */
.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.area-card {
  display: grid; gap: 10px; padding: 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 16, 15, 0.5);
  font-weight: 400; cursor: pointer;
}
.area-card:hover { border-color: rgba(103, 215, 209, 0.4); }
.area-card.active {
  border-color: rgba(103, 215, 209, 0.6);
  background: linear-gradient(145deg, rgba(103, 215, 209, 0.14), transparent 60%), rgba(7, 16, 15, 0.6);
  box-shadow: 0 0 0 1px rgba(103, 215, 209, 0.25);
}
.area-card h2 { margin: 2px 0 0; font-size: 1.15rem; }
.risk-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.area-card-mid { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wind-readout { font-size: 1.9rem; font-weight: 700; }
.condition { text-align: right; color: var(--muted); font-size: 0.82rem; }
.small-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.small-stat { display: grid; gap: 2px; }
.small-stat span { color: var(--muted); font-size: 0.72rem; }
.small-stat strong { font-size: 0.95rem; }
.tile-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }

/* Risk color (single source: green/yellow/red) */
.gust-green { color: var(--green); }
.gust-yellow { color: var(--yellow); }
.gust-red { color: var(--red); }

.risk-badge, .source-badge {
  display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.risk-badge.green { color: var(--green); border-color: rgba(116, 214, 128, 0.4); background: rgba(116, 214, 128, 0.12); }
.risk-badge.yellow { color: var(--yellow); border-color: rgba(244, 189, 79, 0.4); background: rgba(244, 189, 79, 0.12); }
.risk-badge.red { color: var(--red); border-color: rgba(255, 106, 94, 0.45); background: rgba(255, 106, 94, 0.14); }

/* Detail layout */
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr); gap: 18px; align-items: start; }
.detail-primary, .detail-side { min-width: 0; }
.soft-note { color: var(--muted); font-size: 0.85rem; }

/* Decision strip */
.decision-card {
  display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(145deg, rgba(103, 215, 209, 0.06), transparent 55%), rgba(7, 16, 15, 0.5);
}
.decision-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.decision-main h2 { margin: 2px 0; }
.decision-main span { color: var(--muted); font-size: 0.85rem; }
.decision-window { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.decision-window strong { display: block; margin-top: 3px; font-size: 1.05rem; }
.work-window-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.window-chip {
  display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.78rem; background: rgba(7, 16, 15, 0.5);
}
.window-chip.green { border-color: rgba(116, 214, 128, 0.4); }
.window-chip.yellow { border-color: rgba(244, 189, 79, 0.4); }
.window-chip.red { border-color: rgba(255, 106, 94, 0.45); color: var(--red); }

/* Weekly outlook */
.weekly-grid { display: grid; gap: 12px; }
.weekly-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 16, 15, 0.5); }
.weekly-card h3 { margin: 2px 0; }
.daily-wind-list { display: grid; gap: 8px; margin-top: 12px; }
.daily-wind-row { border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 15, 0.4); }
.daily-wind-row summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.daily-wind-row summary::-webkit-details-marker { display: none; }
.daily-wind-row summary > div:first-child strong { display: block; }
.daily-wind-row summary span { color: var(--muted); font-size: 0.8rem; }
.daily-weather-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.daily-wind-value { text-align: right; white-space: nowrap; }
.confidence.high { color: var(--green); }
.confidence.medium { color: var(--yellow); }
.confidence.low { color: var(--red); }

/* Hourly gust timeline */
.gust-timeline { display: grid; gap: 4px; padding: 0 12px 12px; }
.gust-timeline-row { display: grid; grid-template-columns: 56px minmax(60px, 1fr) 64px 36px 44px 44px; align-items: center; gap: 8px; font-size: 0.8rem; }
.gust-time { color: var(--muted); }
.gust-bar-track { height: 8px; border-radius: 999px; background: rgba(213, 230, 210, 0.08); overflow: hidden; }
.gust-bar { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.gust-bar.yellow { background: var(--yellow); }
.gust-bar.red { background: var(--red); }
.gust-threshold-key { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 12px; color: var(--muted); font-size: 0.74rem; }
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 5px; background: var(--green); }
.key-dot.yellow { background: var(--yellow); }
.key-dot.red { background: var(--red); }

/* Chart */
.chart-frame { position: relative; height: 280px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 16, 15, 0.5); }

/* Alerts */
.alerts-list { display: grid; gap: 8px; }
.alert-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 15, 0.5); }
.alert-card.warning { border-color: rgba(244, 189, 79, 0.4); }
.alert-card.danger { border-color: rgba(255, 106, 94, 0.5); }
.alert-top { display: flex; justify-content: space-between; gap: 10px; }
.alert-card p { margin: 6px 0 0; color: var(--muted); font-size: 0.84rem; }

/* Manage list (drawer) */
.manage-list { display: grid; gap: 8px; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 15, 0.4); }
.manage-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill.type-temporary { color: var(--yellow); border-color: rgba(244, 189, 79, 0.35); }
.pill.type-favorite { color: var(--green); border-color: rgba(116, 214, 128, 0.35); }
.pill.type-home { color: var(--cyan); border-color: rgba(103, 215, 209, 0.35); }

/* Drawers */
.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(3, 8, 8, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
body[data-drawer="open"] .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 40; height: 100%; width: min(560px, 100%);
  overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel-solid);
  box-shadow: var(--shadow); transform: translateX(100%); transition: transform 0.24s ease;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: rgba(13, 25, 24, 0.96); backdrop-filter: blur(10px); }
.drawer-head h2 { margin: 0; }
.drawer-body { display: grid; gap: 14px; padding: 18px; }
.drawer-body .location-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawer-body .map-search { grid-template-columns: 1fr; }

/* View switcher + reduce-effects (Phase 3) */
.view-switcher { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(7, 16, 15, 0.4); }
.view-tab { min-height: 30px; padding: 0 12px; border: none; background: transparent; color: var(--muted); font-size: 0.82rem; }
.view-tab.active { background: rgba(103, 215, 209, 0.16); color: var(--text); }

/* View filter: each non-"all" view hides every group that isn't its own (All shows everything). */
body[data-view="weather"] [data-view-group]:not([data-view-group="weather"]),
body[data-view="safety"] [data-view-group]:not([data-view-group="safety"]),
body[data-view="history"] [data-view-group]:not([data-view-group="history"]) { display: none; }

/* Forecast history (Phase 4) */
.history-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.history-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 16, 15, 0.4); }
.history-stat span { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
.history-stat strong { font-size: 1.1rem; }
.history-stat small { color: var(--muted); font-size: 0.74rem; }
.history-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7, 16, 15, 0.35); margin-bottom: 10px; }
.history-card-top h3 { margin: 2px 0 8px; font-size: 1rem; }
.history-site-card { padding: 8px 0; border-top: 1px solid var(--line); }
.history-site-card h4 { margin: 0; font-size: 0.95rem; }
.history-models { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; font-size: 0.82rem; color: var(--text); }
.history-facts { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 0.76rem; }

body.reduced-effects #fieldCanvas { display: none; }
body.reduced-effects::before { animation: none; opacity: 0.4; }
body.reduced-effects .topbar,
body.reduced-effects .drawer-head { backdrop-filter: none; }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

.source-toggle { border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 15, 0.4); padding: 10px 12px; }
.source-toggle summary { cursor: pointer; color: var(--muted); }
.source-list { display: grid; gap: 6px; margin-top: 10px; }
.source-list a { color: var(--cyan); text-decoration: none; font-size: 0.86rem; }
.source-list a:hover { text-decoration: underline; }

/* Safety: air quality + fire (Phase 2) */
.safety-list { display: grid; gap: 8px; }
.safety-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 16, 15, 0.5); display: grid; gap: 10px; }
.safety-card h3 { margin: 2px 0 0; }
.safety-card p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.aqi-value { font-size: 1.8rem; }
.trip-facts { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.76rem; }
.trip-facts span { padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; }

.aqi-badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; border: 1px solid var(--line); }
.aqi-good, .aqi-badge.aqi-good { color: var(--green); border-color: rgba(116, 214, 128, 0.4); }
.aqi-moderate, .aqi-badge.aqi-moderate { color: var(--yellow); border-color: rgba(244, 189, 79, 0.4); }
.aqi-usg, .aqi-badge.aqi-usg { color: #ffa94d; border-color: rgba(255, 169, 77, 0.45); }
.aqi-unhealthy, .aqi-badge.aqi-unhealthy { color: var(--red); border-color: rgba(255, 106, 94, 0.45); }
.aqi-very-unhealthy, .aqi-badge.aqi-very-unhealthy { color: #c07cf0; border-color: rgba(192, 124, 240, 0.45); }
.aqi-hazardous, .aqi-badge.aqi-hazardous { color: #e0607a; border-color: rgba(224, 96, 122, 0.5); }
.aqi-unknown, .aqi-badge.aqi-unknown { color: var(--muted); }

@media (max-width: 980px) {
  .detail-columns { grid-template-columns: 1fr; }
  .decision-window { grid-template-columns: 1fr; }
  .gust-timeline-row { grid-template-columns: 50px 1fr 56px 32px 40px 40px; }
}
