:root {
  color-scheme: dark;
  --bg: #0b0d16;
  --panel: rgba(20, 22, 36, 0.68);
  --panel-solid: #121522;
  --panel-2: #171a2b;
  --text: #dcd8ff;
  --heading: #ece8ff;
  --muted: #aeb7d6;
  --line: rgba(139, 108, 240, 0.24);
  --green: #4fc08d;
  --yellow: #f4bd4f;
  --red: #ff6a5e;
  --cyan: #65d6ff;
  --violet: #8b6cf0;
  --blue: #4aa3ff;
  --river: #4aa3ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(980px 520px at 80% 0%, rgba(139, 108, 240, 0.13), transparent 62%),
    radial-gradient(760px 430px at 6% 18%, rgba(79, 192, 141, 0.08), transparent 60%),
    radial-gradient(840px 520px at 60% 90%, rgba(74, 163, 255, 0.07), transparent 62%),
    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(139, 108, 240, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 163, 255, 0.035) 1px, transparent 1px);
  background-size: 58px 58px, 58px 58px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  opacity: 0.35;
}

body::after {
  position: fixed;
  inset: -18% -10%;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(118deg, transparent 8%, rgba(101, 214, 255, 0.09) 26%, transparent 48%),
    radial-gradient(760px 480px at 30% 40%, rgba(139, 108, 240, 0.08), transparent 68%);
  filter: blur(28px);
  opacity: 0.22;
  transform: translate3d(0, 0, 0);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: var(--text);
  background-color: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
}

select option {
  background: var(--panel-solid);
  color: var(--text);
}

#leafCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#leafCanvas {
  opacity: 0.92;
  mix-blend-mode: screen;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 22, 0.78);
  backdrop-filter: blur(18px);
}

.nav,
.page-shell {
  width: min(1480px, calc(100% - 32px));
  margin-inline: auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

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

.brand {
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(101, 214, 255, 0.26);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--blue), var(--violet));
  color: #f7fbff;
  font-size: 0.76rem;
  box-shadow: 0 8px 24px rgba(139, 108, 240, 0.28);
}

.brand-text {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  font-size: 1.02rem;
  background: linear-gradient(100deg, var(--blue) 0%, var(--violet) 38%, var(--green) 72%, var(--heading) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 18px rgba(139, 108, 240, 0.18);
}

.brand-text small {
  margin-left: 8px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--muted);
}

.icon-link {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.icon-link:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 215, 209, 0.5);
  background: rgba(103, 215, 209, 0.1);
}

.icon-link svg {
  width: 18px;
  height: 18px;
}

.page-shell {
  position: relative;
  z-index: 1;
  padding: 18px 0 56px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 24px 0 14px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  text-transform: uppercase;
}

.hero-band h1 {
  max-width: 900px;
  margin: 10px 0 0;
  font-size: clamp(2.25rem, 6vw, 6.5rem);
  line-height: 0.95;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.hero-tools {
  display: grid;
  gap: 10px;
}

.dashboard-tabs {
  margin: 16px 0 0;
  justify-content: flex-start;
}

.status-strip div {
  min-width: 0;
  padding: 16px;
  background: rgba(13, 24, 23, 0.86);
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

/* Hero cockpit: live answer for the selected site + the one global site picker. */
.hero-cockpit {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.cockpit-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cockpit-area {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

#globalSiteSelect {
  min-width: 190px;
  height: 42px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  background-color: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
  padding: 0 38px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b6cf0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  cursor: pointer;
}

.cockpit-readout {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
}

.cockpit-tile {
  padding: 16px 18px;
}

.cockpit-tile .label {
  margin-bottom: 10px;
}

.cockpit-wind {
  margin: 0;
  line-height: 1;
}

.cockpit-wind strong {
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  font-weight: 820;
  white-space: nowrap;
}

.cockpit-line {
  margin: 0;
}

.cockpit-line strong {
  font-size: 1.55rem;
  font-weight: 800;
}

.cockpit-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.cockpit-tile.status-green {
  border-left: 4px solid #74d680;
}

.cockpit-tile.status-yellow {
  border-left: 4px solid #f4bd4f;
}

.cockpit-tile.status-red {
  border-left: 4px solid #ef6f6f;
}

/* Site selection is unified in the hero cockpit; hide the old per-section pickers. */
#weeklyWindSelect,
#siteSelect {
  display: none;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-tile,
.cockpit-tile,
.area-card,
.site-card,
.safety-card,
.event-card,
.alert-card,
.trip-panel,
.trip-card,
.section-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  /* Translucent frosted panels so the background shows through while text stays readable. */
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

/* Reduce-effects mode: drop the blur, stop all animation, use more-opaque panels. */
body.reduce-effects {
  --panel: rgba(24, 28, 34, 0.92);
}

body.reduce-effects .metric-tile,
body.reduce-effects .cockpit-tile,
body.reduce-effects .area-card,
body.reduce-effects .site-card,
body.reduce-effects .safety-card,
body.reduce-effects .event-card,
body.reduce-effects .alert-card,
body.reduce-effects .trip-panel,
body.reduce-effects .trip-card,
body.reduce-effects .section-block {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Stop the animated leaf canvas and use static background layers in reduce-effects mode. */
body.reduce-effects #leafCanvas {
  display: none;
}

body.reduce-effects::before,
body.reduce-effects::after {
  animation: none;
}

.icon-link.active {
  border-color: rgba(103, 215, 209, 0.5);
  background: rgba(103, 215, 209, 0.14);
  color: var(--cyan);
}

.metric-tile {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  padding: 18px;
  animation: riseIn 520ms ease both;
}

.area-card {
  display: grid;
  gap: 14px;
  min-height: 210px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(116, 214, 128, 0.08), transparent 45%),
    var(--panel-solid);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  animation: riseIn 560ms ease both;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.area-card:hover,
.area-card.active {
  transform: translateY(-1px);
  border-color: rgba(103, 215, 209, 0.52);
  background:
    linear-gradient(145deg, rgba(103, 215, 209, 0.12), transparent 48%),
    var(--panel-solid);
}

.area-card.active {
  box-shadow:
    0 0 0 1px rgba(103, 215, 209, 0.16),
    0 18px 58px rgba(0, 0, 0, 0.35);
}

.area-card h2 {
  margin: 3px 0 0;
  font-size: 1.24rem;
}

.area-card-mid {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.decision-strip {
  display: grid;
}

.decision-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(103, 215, 209, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(103, 215, 209, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(7, 16, 15, 0.3), rgba(7, 16, 15, 0.64)),
    var(--panel-solid);
  box-shadow: var(--shadow);
  animation: riseIn 520ms ease both;
}

.decision-main,
.decision-window {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.decision-main h2 {
  margin: 3px 0;
  font-size: clamp(1.28rem, 2vw, 1.9rem);
}

.decision-main span:not(.source-badge),
.decision-window .label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.decision-window {
  padding-top: 12px;
  border-top: 1px solid rgba(213, 230, 210, 0.12);
}

.decision-window strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
}

.work-window-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.window-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(213, 230, 210, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.window-chip strong {
  color: var(--text);
}

.window-chip.green {
  border-color: rgba(116, 214, 128, 0.28);
  background: rgba(116, 214, 128, 0.1);
  color: #bff4c3;
}

.window-chip.yellow {
  border-color: rgba(244, 189, 79, 0.28);
  background: rgba(244, 189, 79, 0.11);
  color: #ffe0a0;
}

.window-chip.red {
  border-color: rgba(255, 106, 94, 0.3);
  background: rgba(255, 106, 94, 0.12);
  color: #ffbbb5;
}

.metric-tile::after {
  position: absolute;
  right: -30px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  content: "";
  border: 1px solid rgba(103, 215, 209, 0.24);
  border-radius: 50%;
  opacity: 0.5;
}

.tile-top,
.tile-mid,
.tile-bottom,
.risk-row,
.model-row,
.event-top,
.alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tile-mid {
  align-items: end;
  margin: 18px 0 16px;
}

.temp,
.wind-readout {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 820;
  line-height: 0.88;
  white-space: nowrap;
}

.wind-readout {
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
}

/* Shared wind color grammar (matches the gust timeline + work-window chips). */
.gust-green { color: var(--green); }
.gust-yellow { color: var(--yellow); }
.gust-red { color: var(--red); }

.condition {
  max-width: 160px;
  color: var(--muted);
  text-align: right;
}

.small-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.small-stat {
  min-width: 0;
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.small-stat span,
.model-row span,
.event-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.small-stat strong,
.model-row strong {
  display: block;
  margin-top: 4px;
  white-space: nowrap;
  font-size: 0.94rem;
}

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

.primary-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.section-block {
  min-width: 0;
  padding: 18px;
}

.notice-block {
  margin-top: 0;
}

.notice-block .alerts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.bottom-utilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.footer-status {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading > div:first-child {
  min-width: 0;
}

.section-content {
  display: grid;
  gap: 0;
}

.section-content[hidden] {
  display: none;
}

.section-toggle {
  min-height: 30px;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: none;
}

.section-toggle:hover {
  color: var(--text);
  border-color: rgba(103, 215, 209, 0.45);
}

.section-block[data-collapsed="true"] .section-heading {
  margin-bottom: 0;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.section-freshness {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 10px;
}

.heading-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.heading-controls > * {
  min-width: 0;
  max-width: 100%;
}

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

input,
select {
  padding: 0 34px 0 10px;
}

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

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

.weekly-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.safety-grid,
.safety-card-grid {
  display: grid;
  gap: 12px;
}

.safety-grid {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.safety-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.site-card,
.weekly-card,
.safety-card {
  min-height: 258px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(116, 214, 128, 0.08), transparent 45%),
    var(--panel-solid);
  animation: riseIn 560ms ease both;
}

#forecast.section-block {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(103, 215, 209, 0.075), transparent 240px),
    linear-gradient(145deg, rgba(116, 214, 128, 0.055), rgba(20, 35, 33, 0.72)),
    var(--panel);
}

#forecast .section-heading {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(213, 230, 210, 0.12);
}

#forecast .section-content {
  gap: 14px;
}

#forecast.section-block[data-collapsed="true"] .section-heading {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

#forecast .forecast-key {
  color: #adc4c0;
  overflow-wrap: anywhere;
  white-space: normal;
}

#forecast .weekly-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border-color: rgba(213, 230, 210, 0.16);
  background:
    linear-gradient(180deg, rgba(7, 16, 15, 0.18), rgba(7, 16, 15, 0.42)),
    #0d1817;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

#forecast .weekly-card > .risk-row {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(213, 230, 210, 0.12);
  background:
    linear-gradient(90deg, rgba(103, 215, 209, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.018);
}

#forecast .weekly-card h3 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

#forecast .source-badge {
  border: 1px solid rgba(103, 215, 209, 0.28);
  background: rgba(103, 215, 209, 0.1);
  color: #bff5ef;
}

.site-card h3,
.weekly-card h3,
.safety-card h3,
.event-card h3 {
  margin: 0;
  font-size: 1.12rem;
}

.safety-card {
  min-height: 0;
}

.safety-overview,
.safety-detail {
  border: 1px solid rgba(213, 230, 210, 0.13);
  border-radius: var(--radius);
  background: rgba(7, 16, 15, 0.34);
}

.safety-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
}

.safety-overview h3 {
  margin: 3px 0 6px;
}

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

.safety-detail {
  overflow: hidden;
}

.safety-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.safety-detail summary::-webkit-details-marker {
  display: none;
}

.safety-detail summary::after {
  content: "+";
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(103, 215, 209, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  font-weight: 800;
}

.safety-detail[open] summary::after {
  content: "-";
}

.safety-detail summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.safety-detail summary svg {
  width: 17px;
  height: 17px;
  color: var(--cyan);
}

.safety-detail .safety-card-grid {
  padding: 0 12px 12px;
}

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

.safety-readout {
  display: grid;
  gap: 4px;
  margin: 14px 0;
}

.safety-readout strong {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.9;
}

.safety-readout span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

/* Provenance caption, not a control: plain muted text rather than a bordered pill. */
.forecast-key {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.85;
}

.risk-badge,
.confidence-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

.risk-badge.green,
.confidence-badge.high {
  background: rgba(116, 214, 128, 0.14);
  color: #aff4b5;
}

.risk-badge.yellow,
.confidence-badge.medium {
  background: rgba(244, 189, 79, 0.16);
  color: #ffdc85;
}

.risk-badge.red,
.confidence-badge.low {
  background: rgba(255, 106, 94, 0.18);
  color: #ffaaa3;
}

.site-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.model-stack {
  display: grid;
  gap: 8px;
}

.model-stack.compact {
  gap: 0;
}

.model-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.model-stack.compact .model-row {
  padding: 7px 0;
}

.model-row:last-child {
  border-bottom: 0;
}

.daily-wind-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

#forecast .daily-wind-list {
  margin: 0;
  padding: 14px;
}

.daily-wind-row {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 56%),
    rgba(7, 16, 15, 0.44);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.daily-wind-row:last-child {
  border-bottom: 1px solid rgba(213, 230, 210, 0.12);
}

.daily-wind-row:hover {
  border-color: rgba(103, 215, 209, 0.26);
  background:
    linear-gradient(135deg, rgba(103, 215, 209, 0.07), transparent 58%),
    rgba(7, 16, 15, 0.5);
}

.daily-wind-row[open] {
  border-color: rgba(103, 215, 209, 0.38);
  background:
    linear-gradient(135deg, rgba(103, 215, 209, 0.09), transparent 54%),
    rgba(7, 16, 15, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.daily-wind-row summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, auto) 30px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.daily-wind-row summary > div {
  min-width: 0;
}

.daily-wind-row summary::-webkit-details-marker {
  display: none;
}

.daily-wind-row summary::after {
  content: "+";
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(103, 215, 209, 0.3);
  border-radius: 8px;
  background: rgba(103, 215, 209, 0.06);
  color: var(--cyan);
  font-weight: 800;
  grid-column: 3;
}

.daily-wind-row[open] summary::after {
  content: "-";
}

.daily-wind-row span,
.daily-wind-value span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.daily-wind-row summary > div:first-child > strong {
  display: block;
  font-size: 1.02rem;
}

.daily-wind-row summary > div:first-child > span {
  margin-top: 3px;
  color: #bbcabd;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.daily-weather-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.daily-weather-line span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(213, 230, 210, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #c6d3c9;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.daily-wind-value {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.daily-wind-value > strong {
  font-size: 1.32rem;
  line-height: 1;
  white-space: nowrap;
}

.hourly-empty {
  margin: 0 14px 14px;
}

.gust-timeline {
  display: grid;
  gap: 6px;
  margin: 0 14px 10px;
  padding: 12px;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 16, 15, 0.52), rgba(7, 16, 15, 0.72)),
    rgba(255, 255, 255, 0.025);
}

.gust-timeline-row {
  display: grid;
  grid-template-columns: 62px minmax(130px, 1fr) 70px 46px 46px 46px;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  padding: 3px 6px;
  border-radius: 7px;
}

.gust-timeline-row > * {
  min-width: 0;
}

.gust-timeline-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.gust-time,
.gust-timeline-row span,
.gust-timeline-row strong {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.gust-timeline-row strong {
  color: var(--text);
  text-align: right;
}

.gust-note {
  display: block;
  margin-top: 1px;
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--muted);
}

.ht-bars {
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
}

.gust-bar-track {
  position: relative;
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(116, 214, 128, 0.12) 0%,
      rgba(116, 214, 128, 0.12) var(--thr-g, 44%),
      rgba(244, 189, 79, 0.13) var(--thr-g, 44%),
      rgba(244, 189, 79, 0.13) var(--thr-y, 83%),
      rgba(255, 106, 94, 0.14) var(--thr-y, 83%),
      rgba(255, 106, 94, 0.14) 100%
    ),
    rgba(255, 255, 255, 0.075);
}

.gust-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  box-shadow:
    0 0 16px currentColor,
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.gust-bar.green {
  background: linear-gradient(90deg, rgba(116, 214, 128, 0.48), rgba(116, 214, 128, 0.95));
  color: rgba(116, 214, 128, 0.44);
}

.gust-bar.yellow {
  background: linear-gradient(90deg, rgba(244, 189, 79, 0.42), rgba(244, 189, 79, 0.95));
  color: rgba(244, 189, 79, 0.44);
}

.gust-bar.red {
  background: linear-gradient(90deg, rgba(255, 106, 94, 0.42), rgba(255, 106, 94, 0.95));
  color: rgba(255, 106, 94, 0.44);
}

/* Secondary (gust) bar: a fainter version of the same color so it reads as a
   distinct, lower-emphasis bar beneath the solid sustained-wind bar. */
.gust-fill {
  opacity: 0.5;
  box-shadow: none;
}

.gust-threshold-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 14px 14px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

.gust-threshold-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.key-dot.green {
  background: var(--green);
}

.key-dot.yellow {
  background: var(--yellow);
}

.key-dot.red {
  background: var(--red);
}

.chart-frame {
  height: 330px;
  min-height: 0;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

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

.history-controls 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;
}

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

.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.history-stat,
.history-card {
  min-width: 0;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.42);
}

.history-stat {
  display: grid;
  gap: 3px;
  padding: 12px;
}

.history-stat span,
.history-stat small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.history-stat strong {
  font-size: 1.35rem;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.history-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-card h3,
.history-card p {
  margin: 0;
}

.history-models {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-models span {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #c6d3c9;
  font-size: 0.75rem;
}

.history-models strong {
  color: var(--text);
}

.history-site-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-site-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(103, 215, 209, 0.06), transparent 58%),
    rgba(255, 255, 255, 0.028);
}

.route-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.route-panel,
.trip-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.route-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.route-heading h3 {
  margin: 3px 0 0;
  font-size: 1.24rem;
}

.route-section {
  display: grid;
  gap: 10px;
}

.route-section.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.route-detail {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.28);
}

.route-detail > summary {
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.route-detail > summary::-webkit-details-marker {
  display: none;
}

.route-detail > summary::after {
  margin-left: auto;
  color: var(--cyan);
  content: "+";
  font-size: 1rem;
  font-weight: 900;
}

.route-detail[open] > summary::after {
  content: "-";
}

.route-detail > .trip-list,
.route-detail > .camera-grid {
  padding: 0 10px 10px;
}

.route-subdetails {
  gap: 10px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.panel-title svg {
  width: 18px;
  height: 18px;
  color: var(--yellow);
}

.panel-title h3,
.panel-title h4,
.trip-card h4 {
  margin: 0;
}

.trip-list {
  display: grid;
  gap: 10px;
}

.trip-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: rgba(7, 16, 15, 0.45);
  box-shadow: none;
}

/* Active but stale (not updated recently) - shown, but visually de-emphasized. */
.trip-card.stale {
  opacity: 0.62;
  border-left: 2px solid var(--yellow);
  padding-left: 10px;
}

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

.trip-card-top,
.trip-meta,
.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trip-card-top span:last-child,
.trip-meta span,
.trip-meta strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.trip-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.trip-facts span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.camera-card {
  display: grid;
  gap: 8px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.45);
  text-decoration: none;
}

.camera-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: #0b1716;
  object-fit: cover;
}

.camera-card strong,
.camera-card span {
  display: block;
}

.camera-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.dms-message {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(244, 189, 79, 0.28);
  border-radius: 8px;
  background: rgba(244, 189, 79, 0.08);
}

.dms-message strong,
.dms-message span {
  color: #ffdc85;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filter-tabs,
.view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-switcher {
  justify-content: flex-end;
}

.dashboard-tabs {
  justify-content: flex-start;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tab,
.route-tab,
.view-tab {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.tab.active,
.tab:hover,
.route-tab.active,
.route-tab:hover,
.view-tab.active,
.view-tab:hover {
  border-color: rgba(103, 215, 209, 0.48);
  background: rgba(103, 215, 209, 0.12);
  color: var(--text);
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.event-card {
  display: grid;
  gap: 12px;
  grid-template-rows: 170px auto auto auto 1fr auto;
  min-height: 360px;
  padding: 15px;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 189, 79, 0.44);
  background: rgba(27, 40, 36, 0.9);
}

.event-card p,
.soft-note,
.alert-card p {
  margin: 0;
  color: var(--muted);
}

.event-image {
  min-height: 0;
  height: 100%; /* fill the fixed image row exactly; never overflow into the text */
  border: 1px solid var(--line);
  border-radius: 8px;
  background-position: center;
  /* contain (not cover) so event flyers/posters show in full instead of being
     cropped; the dark fill letterboxes any leftover space. */
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #0b1716;
}

.event-image.placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(244, 189, 79, 0.15), rgba(103, 215, 209, 0.1)),
    #0b1716;
  color: var(--yellow);
}

.event-image svg {
  width: 30px;
  height: 30px;
}

.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-meta strong {
  color: var(--cyan);
}

.event-arrow {
  align-self: end;
  color: var(--yellow);
  font-weight: 800;
}

.alerts-list,
.source-list {
  display: grid;
  gap: 10px;
}

.source-toggle {
  border: 1px solid rgba(213, 230, 210, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.source-toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  list-style: none;
  text-transform: uppercase;
}

.source-toggle summary::-webkit-details-marker {
  display: none;
}

.source-toggle summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 900;
}

.source-toggle[open] summary::after {
  content: "-";
}

.source-toggle .source-list {
  padding: 0 10px 10px;
}

.alert-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.alert-card.warning {
  border-color: rgba(244, 189, 79, 0.42);
}

.alert-card.danger {
  border-color: rgba(255, 106, 94, 0.46);
}

.source-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
}

.source-list a::after {
  content: "Open";
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.6s ease infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero-band,
  .cockpit-readout,
  .summary-row,
  .site-grid,
  .weekly-grid,
  .safety-grid,
  .event-grid,
  .history-controls,
  .history-summary,
  .history-site-grid,
  .bottom-utilities {
    grid-template-columns: 1fr;
  }

  .hero-band h1 {
    font-size: clamp(2.6rem, 15vw, 4.4rem);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-grid,
  .route-section.two-up,
  .camera-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs,
  .view-switcher,
  .heading-controls,
  .route-tabs,
  input,
  select {
    width: 100%;
  }

  .heading-controls {
    justify-content: stretch;
  }

  .view-switcher {
    justify-content: stretch;
  }

  .view-tab,
  .tab,
  .route-tab {
    flex: 1 1 auto;
  }

  .gust-timeline-row {
    grid-template-columns: 58px minmax(96px, 1fr) 64px 42px;
  }

  .gust-timeline-row > span:nth-last-child(-n + 2) {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav,
  .page-shell {
    width: min(100% - 20px, 1480px);
  }

  .brand span:last-child {
    display: none;
  }

  .status-strip,
  .site-stats,
  .trip-facts,
  .small-stat-grid {
    grid-template-columns: 1fr;
  }

  .daily-wind-row summary {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 10px;
  }

  .daily-wind-value {
    justify-items: start;
    margin-top: 8px;
  }

  .daily-wind-row summary::after {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .daily-wind-row summary .daily-wind-value {
    grid-column: 1;
  }

  .gust-timeline {
    margin-inline: 10px;
    padding: 9px;
  }

  .gust-timeline-row {
    grid-template-columns: 42px minmax(52px, 1fr) 60px 30px;
    gap: 6px;
    padding-inline: 2px;
  }
  /* Keep time + wind + direction on phones; the 860px rule still hides temp+precip. */

  .gust-threshold-key {
    margin-inline: 10px;
  }

  .hero-band {
    min-height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

}

/* TripCheck route map (Leaflet) */
.route-map-wrap {
  margin: 12px 0 16px;
}

.route-map {
  position: relative;
  isolation: isolate; /* contain Leaflet's internal z-index so it never covers the sticky header */
  height: 320px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
}

.route-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.route-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.map-dot.home { background: #1c7895; }
.map-dot.destination { background: #b59cff; }
.map-dot.camera { background: #67d7d1; }
.map-dot.incident { background: #ff6a5e; }
.map-dot.rwis { background: #74d680; }
.map-dot.sign { background: #f4bd4f; }
.map-dot.wsdot-camera { background: #5aa0ff; box-shadow: inset 0 0 0 1.5px #e6eeff; }
.map-dot.wsdot-weather { background: #46d6e6; box-shadow: inset 0 0 0 1.5px #e6eeff; }
.map-dot.wsdot-alert { background: #b07cff; box-shadow: inset 0 0 0 1.5px #e6eeff; }

.wa-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(90, 160, 255, 0.22);
  color: #cfe0ff;
  font-size: 0.7rem;
  font-weight: 800;
}

.wsdot-subhead {
  margin: 12px 0 6px;
}

/* ---- Trip planner ---- */
.trip-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.trip-endpoint {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.trip-endpoint label,
.trip-go label {
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
  color: var(--muted);
}

.trip-suggest {
  position: absolute;
  z-index: 20;
  top: 62px;
  left: 0;
  right: 0;
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.trip-suggest-item {
  padding: 8px 10px;
  border: 0;
  background: #0b1716;
  color: var(--text);
  text-align: left;
  font-size: 0.82rem;
  cursor: pointer;
}

.trip-suggest-item:hover {
  background: rgba(103, 215, 209, 0.14);
}

.trip-endpoint-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trip-mini,
.trip-preset {
  height: 32px;
  font-size: 0.74rem;
}

.trip-mini {
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.trip-mini:hover,
.trip-mini.armed {
  color: var(--text);
  border-color: rgba(103, 215, 209, 0.5);
}

.trip-swap {
  align-self: center;
  height: 38px;
  width: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--cyan);
  font-size: 1.1rem;
  cursor: pointer;
}

.trip-go {
  display: grid;
  gap: 6px;
}

.trip-plan {
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(103, 215, 209, 0.5);
  border-radius: 8px;
  background: rgba(103, 215, 209, 0.14);
  color: var(--cyan);
  font-weight: 800;
  cursor: pointer;
}

.trip-plan:hover {
  background: rgba(103, 215, 209, 0.22);
}

.trip-arm-hint {
  margin: 12px 0 8px;
}

.trip-map-wrap {
  margin: 0 0 14px;
}

.trip-result {
  display: grid;
  gap: 14px;
}

.trip-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.trip-summary .label {
  display: block;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
  color: var(--muted);
}

.trip-summary strong {
  font-size: 1.1rem;
}

.trip-weather-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 860px) {
  .nav {
    gap: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand .brand-text {
    display: inline-block;
    font-size: 0;
  }

  .brand-text small {
    margin-left: 0;
    color: var(--heading);
    font-size: 0.72rem;
    -webkit-text-fill-color: var(--heading);
  }

  .nav-actions {
    gap: 8px;
  }

  .icon-link {
    width: 38px;
    height: 38px;
  }

  .trip-form {
    grid-template-columns: 1fr;
  }

  .trip-swap {
    justify-self: start;
  }

  .trip-weather-row {
    grid-template-columns: 1fr;
  }
}

.map-line {
  display: inline-block;
  width: 16px;
  height: 0;
  border-top-width: 3px;
  border-top-style: solid;
}

.map-line.route { border-top-color: #4f46e5; }
.map-line.crossing {
  border-top-color: #b59cff;
  border-top-style: dashed;
}

.leaflet-container {
  font: inherit;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .route-map {
    height: 260px;
  }
}

/* ---- US AQI 6-level EPA color scale ---- */
.aqi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.28);
}

/* Badge backgrounds use the official EPA colors with readable text. */
.aqi-badge.aqi-good { background: #00e400; color: #08260c; }
.aqi-badge.aqi-moderate { background: #ffd21f; color: #2a2300; }
.aqi-badge.aqi-usg { background: #ff7e00; color: #2a1500; }
.aqi-badge.aqi-unhealthy { background: #ff2a2a; color: #fff; }
.aqi-badge.aqi-very-unhealthy { background: #8f3f97; color: #fff; }
.aqi-badge.aqi-hazardous { background: #7e0023; color: #fff; }
.aqi-badge.aqi-unknown { background: rgba(213, 230, 210, 0.18); color: var(--text); }

/* Left accent on each AQI card. */
.aqi-card { border-left: 3px solid transparent; }
.aqi-card.aqi-good { border-left-color: #00e400; }
.aqi-card.aqi-moderate { border-left-color: #ffd21f; }
.aqi-card.aqi-usg { border-left-color: #ff7e00; }
.aqi-card.aqi-unhealthy { border-left-color: #ff2a2a; }
.aqi-card.aqi-very-unhealthy { border-left-color: #b06bb8; }
.aqi-card.aqi-hazardous { border-left-color: #c0294a; }

/* Big AQI number, tinted for legibility on the dark panel. */
.aqi-value.aqi-good { color: #5fd86b; }
.aqi-value.aqi-moderate { color: #e9c93a; }
.aqi-value.aqi-usg { color: #ff9d3c; }
.aqi-value.aqi-unhealthy { color: #ff6a5e; }
.aqi-value.aqi-very-unhealthy { color: #c08ad0; }
.aqi-value.aqi-hazardous { color: #ff7a8f; }

.aqi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

@media (max-width: 560px) {
  .brand span:last-child,
  .brand .brand-text {
    display: inline-block !important;
    font-size: 0;
  }

  .brand .brand-text small {
    display: inline;
    margin-left: 0;
    color: var(--heading);
    font-size: 0.72rem;
    -webkit-text-fill-color: var(--heading);
  }
}

/* ---- KentrixTechnologies visual system bridge ---- */
h1,
h2,
h3,
.cockpit-wind,
.wind-readout {
  color: var(--heading);
  text-shadow: 0 0 26px rgba(139, 108, 240, 0.12);
}

.eyebrow {
  color: var(--violet);
  letter-spacing: 0.16em;
}

.label {
  color: var(--muted);
}

.metric-tile,
.cockpit-tile,
.area-card,
.site-card,
.weekly-card,
.safety-card,
.event-card,
.alert-card,
.trip-panel,
.trip-card,
.history-stat,
.history-card,
.history-site-card,
.section-block {
  border-color: rgba(139, 108, 240, 0.24);
  background:
    linear-gradient(145deg, rgba(139, 108, 240, 0.075), transparent 46%),
    rgba(20, 22, 36, 0.68);
}

.section-block {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.status-strip {
  border-color: rgba(139, 108, 240, 0.26);
  background: rgba(139, 108, 240, 0.2);
}

.status-strip div {
  background: rgba(16, 18, 31, 0.88);
}

.area-card:hover,
.area-card.active,
.tab.active,
.tab:hover,
.route-tab.active,
.route-tab:hover,
.view-tab.active,
.view-tab:hover,
.icon-link:hover {
  border-color: rgba(101, 214, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(74, 163, 255, 0.11), rgba(139, 108, 240, 0.08)),
    rgba(20, 22, 36, 0.72);
}

input,
select,
.tab,
.route-tab,
.view-tab,
.icon-link,
.trip-mini,
.trip-plan {
  border-color: rgba(101, 214, 255, 0.22);
  background: rgba(74, 163, 255, 0.045);
  color: #d9e6ff;
}

.trip-plan,
.source-badge {
  background: linear-gradient(145deg, rgba(74, 163, 255, 0.2), rgba(139, 108, 240, 0.16));
  color: var(--cyan);
}

.source-badge,
.risk-badge,
.confidence-badge,
.window-chip,
.forecast-key,
.trip-facts span,
.small-stat {
  border-color: rgba(139, 108, 240, 0.22);
}

.risk-badge.green,
.confidence-badge.high,
.window-chip.green {
  background: rgba(79, 192, 141, 0.14);
  color: #a8f1cf;
}

.risk-badge.yellow,
.confidence-badge.medium,
.window-chip.yellow {
  background: rgba(244, 189, 79, 0.14);
  color: #ffe0a0;
}

.risk-badge.red,
.confidence-badge.low,
.window-chip.red {
  background: rgba(255, 106, 94, 0.16);
  color: #ffbbb5;
}

#forecast.section-block {
  background:
    linear-gradient(180deg, rgba(74, 163, 255, 0.085), transparent 240px),
    linear-gradient(145deg, rgba(79, 192, 141, 0.055), rgba(20, 22, 36, 0.74)),
    var(--panel);
}

#forecast .weekly-card > .risk-row,
.safety-overview,
.safety-detail summary {
  border-color: rgba(139, 108, 240, 0.18);
  background:
    linear-gradient(90deg, rgba(101, 214, 255, 0.09), transparent 58%),
    rgba(255, 255, 255, 0.018);
}

.event-card:hover {
  border-color: rgba(139, 108, 240, 0.5);
  background:
    linear-gradient(135deg, rgba(139, 108, 240, 0.11), rgba(79, 192, 141, 0.07)),
    rgba(20, 22, 36, 0.86);
}

.event-image {
  background:
    linear-gradient(145deg, rgba(139, 108, 240, 0.18), rgba(79, 192, 141, 0.1)),
    #101421;
  color: var(--cyan);
}

.map-dot.home { background: var(--blue); }
.map-dot.destination { background: var(--violet); }
.map-dot.camera { background: var(--cyan); }
.map-dot.rwis { background: var(--green); }
.map-line.route { border-top-color: var(--blue); }
.map-line.crossing { border-top-color: var(--violet); }

/* Glass tuning: let the animated ginkgo/wind backdrop breathe through large
   sections while preserving contrast inside the actual data cards. */
.section-block {
  border-color: rgba(139, 108, 240, 0.2);
  background:
    linear-gradient(145deg, rgba(139, 108, 240, 0.055), rgba(79, 192, 141, 0.028)),
    rgba(11, 13, 22, 0.34);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px) saturate(132%);
  -webkit-backdrop-filter: blur(18px) saturate(132%);
}

.notice-block,
#forecast.section-block {
  background:
    linear-gradient(145deg, rgba(74, 163, 255, 0.07), transparent 54%),
    linear-gradient(180deg, rgba(139, 108, 240, 0.04), rgba(11, 13, 22, 0.24)),
    rgba(11, 13, 22, 0.3);
}

.cockpit-tile,
.metric-tile,
.weekly-card,
.safety-card,
.route-panel,
.event-card,
.history-card,
.history-site-card,
.trip-panel,
.trip-card,
.alert-card {
  border-color: rgba(139, 108, 240, 0.26);
  background:
    linear-gradient(145deg, rgba(139, 108, 240, 0.055), rgba(74, 163, 255, 0.025)),
    rgba(17, 19, 32, 0.62);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px) saturate(122%);
  -webkit-backdrop-filter: blur(14px) saturate(122%);
}

.cockpit-tile,
.alert-card,
.daily-wind-row,
.route-detail,
.source-toggle {
  background:
    linear-gradient(145deg, rgba(139, 108, 240, 0.05), transparent 52%),
    rgba(14, 16, 28, 0.72);
}

.daily-wind-row,
.safety-overview,
.safety-detail summary,
#forecast .weekly-card > .risk-row,
.history-stat,
.history-site-card,
.trip-card,
.trip-panel,
.route-detail,
.source-toggle,
.status-strip div {
  border-color: rgba(139, 108, 240, 0.18);
  background:
    linear-gradient(120deg, rgba(101, 214, 255, 0.04), transparent 58%),
    rgba(9, 13, 24, 0.52);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

.bottom-utilities .section-block,
.footer-status {
  background:
    linear-gradient(145deg, rgba(79, 192, 141, 0.045), rgba(139, 108, 240, 0.03)),
    rgba(11, 13, 22, 0.28);
}

body.reduce-effects .section-block,
body.reduce-effects .cockpit-tile,
body.reduce-effects .metric-tile,
body.reduce-effects .weekly-card,
body.reduce-effects .safety-card,
body.reduce-effects .route-panel,
body.reduce-effects .event-card,
body.reduce-effects .history-card,
body.reduce-effects .history-site-card,
body.reduce-effects .trip-panel,
body.reduce-effects .trip-card,
body.reduce-effects .alert-card,
body.reduce-effects .daily-wind-row {
  background: rgba(18, 20, 34, 0.88);
}
