:root {
  color-scheme: light;
  --navy-950: #071a30;
  --navy-900: #0c2748;
  --navy-800: #153b62;
  --blue-700: #0d5f91;
  --blue-600: #1672a7;
  --blue-500: #268ab9;
  --blue-100: #dff1f8;
  --blue-050: #f1f9fc;
  --orange-600: #d9582b;
  --orange-100: #fff0e8;
  --teal-700: #176956;
  --teal-100: #e1f3ee;
  --paper: #ffffff;
  --canvas: #f2f6f7;
  --line: #d8e1e5;
  --muted: #657783;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(12, 39, 72, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--navy-950);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  min-height: 44px;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue-700);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(2rem, 7vw, 3.35rem);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 3000;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--navy-900);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  background: var(--navy-900);
  color: white;
}

.active-location-bar {
  position: sticky;
  top: 0;
  z-index: 1100;
  border-bottom: 1px solid #b9d3dc;
  background: rgba(239, 249, 251, 0.97);
  box-shadow: 0 5px 16px rgba(12, 39, 72, 0.1);
  backdrop-filter: blur(10px);
}

.active-location-inner {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  max-width: 1440px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
}

.active-location-icon {
  color: var(--teal-700);
  font-size: 0.7rem;
}

.active-location-copy {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  min-width: 0;
}

.active-location-copy > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.active-location-copy strong {
  overflow: hidden;
  color: var(--navy-900);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-location-copy small,
.active-location-saved {
  color: var(--muted);
  font-size: 0.76rem;
}

.active-location-saved {
  margin-left: auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-700);
  font-weight: 750;
}

.active-location-change {
  min-height: 42px;
  padding: 0.45rem 0.8rem;
  border: 1px solid #9dbbc7;
  border-radius: 10px;
  background: white;
  color: var(--navy-900);
  font-weight: 800;
}

.active-location-change:hover {
  border-color: var(--blue-600);
  background: var(--blue-050);
}

.active-location-change:focus-visible {
  outline: 3px solid rgba(38, 138, 185, 0.35);
  outline-offset: 2px;
}

.header-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  max-width: 1440px;
  margin: auto;
  padding: 2.2rem 1rem 2rem;
}

.header-inner p:last-child {
  margin-bottom: 0;
  color: #c8d9e8;
}

.brand-mark {
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 36px;
  background: white;
  transform-origin: 50% 100%;
}

.brand-mark::before {
  top: 8px;
  transform: translateX(-50%) rotate(38deg);
}

.brand-mark::after {
  top: 8px;
  transform: translateX(-50%) rotate(218deg);
}

.wind-line {
  position: absolute;
  left: 11px;
  top: 22px;
  width: 30px;
  height: 7px;
  border-top: 2px solid #7cd0eb;
  border-radius: 50%;
}

.wind-line.short {
  top: 30px;
  width: 21px;
}

.eyebrow,
.section-number,
.label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.site-header .eyebrow {
  color: #7cd0eb;
}

.app-shell {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem;
}

.map-panel,
.forecast-panel,
.wide-panel,
.summary-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.map-panel {
  scroll-margin-top: 74px;
}

.panel-heading,
.section-heading-row,
.summary-title,
.selected-location,
.dialog-heading,
.collapsible-heading {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
}

.button.primary {
  background: var(--navy-900);
  color: white;
}

.button.secondary {
  border-color: #b9cbd5;
  background: white;
  color: var(--navy-900);
}

.button.ghost {
  border-color: var(--line);
  background: #f8fafb;
  color: var(--navy-800);
}

.button.danger {
  background: var(--orange-600);
  color: white;
}

.button.compact {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #69badb;
  outline-offset: 3px;
}

.preset-scroll {
  display: flex;
  gap: 0.5rem;
  margin: 1rem -1rem 0.75rem;
  padding: 0 1rem 0.3rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.preset-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--navy-800);
  font-weight: 700;
}

.preset-button.active {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: white;
}

#map {
  z-index: 0;
  width: 100%;
  height: clamp(290px, 42vh, 420px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #dbe7e8;
}

.map-help {
  margin: 0.45rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.selected-location {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.selected-location h3 {
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.selected-location p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.favorites-section {
  padding-top: 1rem;
}

.favorites-list,
.point-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.favorite-chip,
.point-chip {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
}

.favorite-chip > button,
.point-chip > button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy-800);
}

.favorite-select {
  padding: 0.45rem 0.7rem;
  font-weight: 700;
}

.favorite-delete {
  width: 42px;
  border-left: 1px solid var(--line) !important;
  font-size: 1.1rem;
}

.point-chip span {
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.muted,
.chart-unit,
.legend-note,
.direction-explanation,
.comparison-meta {
  color: var(--muted);
}

.favorites-list .muted {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.fetch-status {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.85rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 0.79rem;
}

.fetch-status strong {
  color: var(--navy-800);
}

.status-message,
.error-message,
.offline-banner {
  margin: 0.75rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
}

.status-message {
  min-height: 46px;
  background: var(--blue-100);
  color: var(--navy-800);
  font-size: 0.88rem;
}

.status-message:empty {
  display: none;
}

.error-message {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #f2b89e;
  background: var(--orange-100);
}

.error-message p {
  margin: 0.2rem 0 0;
}

.offline-banner {
  display: flex;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
  border: 1px solid #e8c97a;
  background: #fff8df;
  color: #65501f;
}

.day-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.85rem 0;
  overflow-x: auto;
}

.day-tab {
  flex: 1 0 auto;
  min-height: 46px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--navy-800);
  font-weight: 800;
}

.day-tab[aria-selected="true"] {
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: white;
}

.race-window {
  display: grid;
  gap: 0.8rem;
  align-items: end;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafb;
}

.time-selectors {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.time-selectors label {
  flex: 1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.time-selectors select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0 0.6rem;
  border: 1px solid #b9cbd5;
  border-radius: 10px;
  background: white;
  color: var(--navy-900);
  font-weight: 800;
}

.time-selectors > span {
  padding-bottom: 0.65rem;
  color: var(--muted);
}

.field-error {
  margin: 0.4rem 0 0;
  color: #a63b19;
  font-size: 0.87rem;
  font-weight: 700;
}

.summary-card {
  position: relative;
  overflow: hidden;
  border-top: 5px solid var(--navy-900);
}

.condition-pill,
.change-classification {
  padding: 0.35rem 0.65rem;
  border: 1px solid #a8d3e4;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--navy-800);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.summary-primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.summary-stat {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
}

.summary-stat.emphasis {
  background: var(--blue-050);
}

.summary-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.summary-stat strong {
  display: block;
  margin-top: 0.22rem;
  overflow-wrap: anywhere;
  color: var(--navy-950);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  font-variant-numeric: tabular-nums;
}

.race-headline {
  margin: 0.85rem 0 0;
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--blue-500);
  border-radius: 0 10px 10px 0;
  background: var(--blue-050);
  color: var(--navy-900);
  font-size: 1rem;
  font-weight: 800;
}

.gust-allowance {
  margin: 0.7rem 0 0;
  color: var(--teal-700);
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.gust-callout {
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #abd7cb;
  border-radius: 12px;
  background: var(--teal-100);
  color: var(--teal-700);
}

.gust-callout p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.race-insights {
  margin-top: 0.9rem;
}

.race-insights h3 {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.race-insights ul {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--navy-800);
  font-size: 0.84rem;
}

.summary-note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.skeleton,
.skeleton-card {
  position: relative;
  overflow: hidden;
  background: #e5ecef;
}

.skeleton::after,
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.skeleton.tall {
  height: 76px;
  border-radius: 12px;
}

.wide-panel {
  overflow: hidden;
}

.section-heading-row {
  align-items: end;
  margin-bottom: 1rem;
}

.legend-note,
.chart-unit {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
}

.race-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.race-stage {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafb;
}

.race-stage.race-start,
.race-stage.race-end {
  border-width: 2px;
  border-color: var(--blue-500);
  background: var(--blue-050);
}

.race-stage-phase,
.race-stage-weather {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.race-stage-time,
.race-stage-direction,
.race-stage-wind {
  display: block;
  font-variant-numeric: tabular-nums;
}

.race-stage-time {
  margin: 0.1rem 0 0.35rem;
  font-size: 1rem;
}

.race-stage-direction {
  color: var(--blue-700);
  font-size: 1.05rem;
}

.race-stage-wind {
  margin-top: 0.3rem;
  font-size: 1.15rem;
  font-weight: 850;
}

.hourly-changes,
.direction-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.hourly-changes .summary-stat strong,
.direction-summary .summary-stat strong {
  font-size: 0.93rem;
}

.segmented-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #b9cbd5;
  border-radius: 12px;
  background: white;
}

.segment {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--navy-800);
  font-size: 0.82rem;
  font-weight: 800;
}

.segment + .segment {
  border-left: 1px solid #b9cbd5;
}

.segment.active {
  background: var(--navy-900);
  color: white;
}

.chart-wrap,
.direction-chart-wrap {
  position: relative;
  min-height: 280px;
}

.chart-wrap canvas,
.direction-chart-wrap canvas {
  max-height: 360px;
}

.direction-explanation {
  margin: -0.35rem 0 0.7rem;
  font-size: 0.8rem;
}

.direction-standard,
.wind-field-convention {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #b9d9e3;
  border-radius: 11px;
  background: var(--blue-050);
}

.direction-standard > div {
  display: grid;
  gap: 0.08rem;
}

.direction-standard strong,
.wind-field-convention strong {
  color: var(--navy-900);
  font-size: 0.82rem;
}

.direction-standard span:not(.direction-standard-arrow),
.wind-field-convention > span:last-child {
  color: var(--muted);
  font-size: 0.75rem;
}

.direction-standard-arrow {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--navy-900);
  color: white;
  box-shadow: 0 2px 8px rgba(7, 26, 48, 0.18);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.wind-field-convention {
  display: inline-flex;
  margin-top: -0.2rem;
}

.wind-field-view-options {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.wind-field-view-options > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.direction-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.7rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}

.direction-item {
  flex: 0 0 auto;
  min-width: 78px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
}

.direction-item.in-window {
  border: 2px solid var(--blue-500);
  background: var(--blue-100);
  color: var(--navy-800);
}

.direction-item strong {
  display: block;
  color: var(--blue-700);
}

.direction-arrow {
  display: inline-block;
  margin-top: 0.15rem;
  color: var(--navy-800);
  font-size: 1.05rem;
  line-height: 1;
}

.wind-field-status {
  margin: 0 0 0.8rem;
  color: var(--blue-700);
  font-size: 0.84rem;
  font-weight: 750;
}

.wind-field-map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #dbe7e8;
}

#wind-field-map {
  z-index: 0;
  width: 100%;
  height: clamp(430px, 65vh, 650px);
}

.wind-field-canvas {
  pointer-events: none;
}

.wind-field-legend {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 600;
  display: grid;
  grid-template-columns: auto minmax(86px, 140px) auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(12, 39, 72, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy-800);
  box-shadow: 0 3px 12px rgba(7, 26, 48, 0.12);
  font-size: 0.7rem;
  font-weight: 800;
}

.wind-field-gradient {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #dff3f3 0%,
    #82ced5 20%,
    #36a5ba 40%,
    #f1ca62 60%,
    #eb8a4a 80%,
    #c95f50 100%
  );
}

.wind-field-legend.rain-mode .wind-field-gradient {
  background: linear-gradient(
    90deg,
    #edf7f4 0%,
    #c8eef0 15%,
    #76d3e2 32%,
    #3499d0 50%,
    #4361b5 72%,
    #7a3e9d 100%
  );
}

.wind-field-readout {
  position: absolute;
  right: 0.7rem;
  bottom: 1.8rem;
  left: 0.7rem;
  z-index: 600;
  width: fit-content;
  max-width: calc(100% - 1.4rem);
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(12, 39, 72, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy-900);
  box-shadow: 0 3px 12px rgba(7, 26, 48, 0.12);
  font-size: 0.76rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.wind-field-selection {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid #e3ba45;
  border-radius: 12px;
  background: #fff7d9;
}

.wind-field-selection > div {
  display: grid;
  gap: 0.08rem;
}

.wind-field-selection span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wind-field-selection strong {
  color: var(--navy-900);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.wind-field-selection small {
  color: var(--muted);
  font-size: 0.72rem;
}

.wind-field-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.8rem;
}

.wind-field-slider-label {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.wind-field-slider-label strong {
  color: var(--navy-800);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

#wind-field-slider {
  width: 100%;
  min-height: 32px;
  accent-color: var(--blue-700);
}

.wind-field-step {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy-900);
}

.wind-field-step:disabled {
  cursor: default;
  opacity: 0.38;
}

.window-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 0.25rem;
  border: 2px solid var(--blue-500);
  border-radius: 3px;
  background: var(--blue-100);
}

.hourly-heading-row {
  align-items: flex-start;
}

.hourly-heading-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hourly-context {
  display: flex;
  gap: 0.35rem 0.8rem;
  align-items: baseline;
  flex-wrap: wrap;
  margin: -0.35rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.hourly-context strong {
  color: var(--navy-900);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.hourly-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.hour-row {
  position: relative;
  display: grid;
  grid-template-columns: 94px 108px minmax(210px, 1fr) 92px;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 112px;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 6px solid transparent;
  background: #fbfcfc;
  color: var(--navy-950);
  text-align: left;
}

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

.hour-row.before-start-hour {
  background: #f2f9fb;
}

.hour-row.in-window {
  border-left-color: #f4b822;
  background: #fff9e9;
}

.hour-row.start-hour,
.hour-row.end-hour {
  border-left-color: #0b6971;
  background: #edf9fa;
}

.hour-row:hover {
  filter: brightness(0.985);
}

.hour-row.selected-hour {
  outline: 3px solid var(--orange-600);
  outline-offset: -3px;
}

.hour-time-block {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
}

.hour-time-block strong {
  display: inline-grid;
  min-width: 72px;
  min-height: 48px;
  padding: 0.35rem 0.55rem;
  place-items: center;
  border-radius: 999px;
  background: #f4b822;
  color: var(--navy-950);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.hour-row.before-start-hour .hour-time-block strong,
.hour-row.start-hour .hour-time-block strong,
.hour-row.end-hour .hour-time-block strong {
  background: #0b6971;
  color: white;
}

.hour-time-block span {
  width: 100%;
  color: var(--muted);
  text-align: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hour-direction-block {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.hour-wind-arrow {
  display: inline-block;
  color: #0b6971;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  transform-origin: center;
}

.hour-direction {
  display: grid;
  gap: 0.05rem;
  color: var(--navy-800);
}

.hour-direction strong {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}

.hour-direction small {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.hour-wind-block {
  min-width: 0;
}

.wind-main {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.wind-main strong {
  font-size: clamp(1.7rem, 4vw, 2rem);
  line-height: 1;
}

.wind-main span {
  color: var(--navy-900);
  font-size: 0.9rem;
  font-weight: 850;
}

.gust-main {
  display: inline-block;
  margin: 0 0 0.3rem;
  padding: 0.42rem 0.65rem;
  border-radius: 9px;
  background: #dff3f3;
  color: var(--navy-900);
  font-size: 0.82rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.direction-delta {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.hour-weather {
  display: grid;
  gap: 0.12rem;
  justify-items: center;
  text-align: center;
}

.hour-weather-icon {
  color: #f4b822;
  font-size: 1.75rem;
  line-height: 1;
}

.hour-weather.cloudy .hour-weather-icon {
  color: #9abfc7;
}

.hour-weather.rain .hour-weather-icon,
.hour-weather.showers .hour-weather-icon {
  color: var(--blue-600);
}

.hour-weather strong {
  min-width: 66px;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  background: #f4b822;
  color: var(--navy-950);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hour-weather > span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.skeleton-card {
  min-height: 112px;
  border: 0;
  opacity: 1;
}

.change-classification {
  max-width: 320px;
  white-space: normal;
}

.comparison-meta {
  margin: -0.35rem 0 0.8rem;
  font-size: 0.8rem;
}

.forecast-comparison-grid {
  display: grid;
  gap: 0.7rem;
}

.forecast-change-card,
.point-phase-card {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafb;
}

.forecast-change-card h3,
.point-phase-card h3 {
  margin-bottom: 0.6rem;
}

.comparison-metric {
  display: grid;
  grid-template-columns: minmax(68px, 0.55fr) minmax(0, 1.45fr);
  gap: 0.15rem 0.6rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.comparison-metric span {
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.comparison-metric strong {
  font-size: 0.88rem;
}

.comparison-metric small {
  color: var(--blue-700);
  font-weight: 800;
}

.points-section .muted {
  margin: 0.8rem 0;
  font-size: 0.84rem;
}

.points-actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

#point-mode-status {
  color: var(--blue-700);
  font-size: 0.82rem;
  font-weight: 750;
}

.point-comparison {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.point-values {
  display: grid;
  gap: 0.45rem;
}

.point-values div {
  display: grid;
  gap: 0.1rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.point-values span {
  color: var(--muted);
}

.point-phase-card p,
.resolution-note {
  margin: 0.65rem 0 0;
  color: var(--navy-800);
  font-size: 0.8rem;
  font-weight: 700;
}

.resolution-note {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--blue-050);
}

.table-scroll {
  margin-top: 0.9rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

th,
td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr.in-window {
  background: var(--blue-050);
}

.limitations {
  display: flex;
  gap: 0.9rem;
  box-shadow: none;
}

.limitations h2 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.limitations p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.info-icon {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 900;
}

.wind-marker-shell,
.comparison-marker-shell {
  border: 0;
  background: transparent;
}

.wind-marker {
  display: grid;
  width: 62px;
  min-height: 42px;
  padding: 4px 6px;
  place-items: center;
  border: 2px solid white;
  border-radius: 14px 14px 14px 4px;
  background: var(--navy-900);
  color: white;
  box-shadow: 0 4px 12px rgba(7, 26, 48, 0.28);
  transform: rotate(-4deg);
}

.wind-marker > * {
  transform: rotate(4deg);
}

.wind-marker-arrow {
  display: inline-block;
  color: #7cd0eb;
  font-size: 1rem;
  line-height: 1;
}

.wind-marker strong {
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
}

.wind-marker-dot {
  width: 14px;
  height: 14px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--blue-500);
}

.marker-popup {
  display: grid;
  gap: 0.15rem;
  min-width: 150px;
}

.marker-popup span {
  font-size: 0.78rem;
}

.comparison-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--orange-600);
  color: white;
  box-shadow: 0 3px 10px rgba(7, 26, 48, 0.25);
  font-weight: 900;
}

.mobile-race-bar {
  display: none;
}

.site-footer {
  padding: 1.5rem 1rem 2.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

dialog {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(7, 26, 48, 0.28);
}

dialog::backdrop {
  background: rgba(7, 26, 48, 0.58);
}

dialog form {
  padding: 1.2rem;
}

dialog label {
  display: block;
  margin-top: 1rem;
  font-size: 0.86rem;
  font-weight: 800;
}

dialog input {
  width: 100%;
  min-height: 48px;
  margin-top: 0.35rem;
  padding: 0 0.75rem;
  border: 1px solid #aebfc9;
  border-radius: 10px;
}

.icon-button {
  width: 44px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f6;
  color: var(--navy-900);
  font-size: 1.6rem;
}

.dialog-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (min-width: 620px) {
  .summary-primary,
  .direction-summary,
  .hourly-changes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .direction-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .race-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .forecast-comparison-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .header-inner,
  .app-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .map-panel,
  .forecast-panel,
  .wide-panel,
  .summary-card {
    padding: 1.35rem;
  }

  .preset-scroll {
    margin-left: -1.35rem;
    margin-right: -1.35rem;
    padding-left: 1.35rem;
    padding-right: 1.35rem;
  }

  .race-window {
    grid-template-columns: 1fr minmax(260px, 0.8fr);
  }

  .field-error {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1050px) {
  .app-shell {
    grid-template-columns: minmax(420px, 0.86fr) minmax(560px, 1.14fr);
    align-items: start;
  }

  .map-panel {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .controls-panel {
    grid-column: 2;
    grid-row: 1;
  }

  .summary-panel {
    grid-column: 2;
    grid-row: 2;
  }

  .wide-panel {
    grid-column: 1 / -1;
  }

  #map {
    height: 390px;
  }
}

@media (max-width: 719px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .active-location-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 62px;
    padding: 0.4rem 0.65rem;
  }

  .active-location-copy {
    display: block;
    line-height: 1.25;
  }

  .active-location-copy > span,
  .active-location-copy strong,
  .active-location-copy small {
    display: block;
  }

  .active-location-copy > span {
    font-size: 0.62rem;
  }

  .active-location-copy strong {
    font-size: 0.9rem;
  }

  .active-location-copy small {
    font-size: 0.68rem;
  }

  .active-location-saved {
    display: none;
  }

  .active-location-change {
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    font-size: 0.76rem;
  }

  .mobile-race-bar {
    position: fixed;
    right: 0.65rem;
    bottom: calc(0.65rem + env(safe-area-inset-bottom));
    left: 0.65rem;
    z-index: 1600;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.05rem 0.7rem;
    min-height: 56px;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 13px;
    background: rgba(12, 39, 72, 0.97);
    color: white;
    box-shadow: 0 8px 26px rgba(7, 26, 48, 0.3);
    text-align: left;
  }

  .mobile-race-bar strong,
  .mobile-race-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-race-bar strong {
    grid-column: 1;
    font-size: 0.85rem;
  }

  #sticky-window {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.76rem;
    font-weight: 800;
  }

  #sticky-summary {
    grid-column: 1 / -1;
    color: #bfe3f1;
    font-size: 0.76rem;
  }

  .chart-heading-row,
  .collapsible-heading,
  .hourly-heading-row,
  .wind-field-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .wind-field-heading-row .button {
    align-self: flex-start;
  }

  .wind-field-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .wind-field-play {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .wind-field-selection {
    align-items: stretch;
    flex-direction: column;
  }

  .wind-field-view-options {
    align-items: stretch;
    flex-direction: column;
  }

  .hourly-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hourly-heading-actions .segmented-control {
    flex: 1 1 250px;
  }

  .hour-row {
    grid-template-columns: 76px 78px minmax(0, 1fr) 72px;
    gap: 0.45rem;
    min-height: 104px;
    padding: 0.7rem 0.55rem;
    border-left-width: 5px;
  }

  .hour-time-block strong {
    min-width: 64px;
    min-height: 44px;
    padding: 0.3rem 0.4rem;
    font-size: 0.9rem;
  }

  .hour-time-block span {
    font-size: 0.58rem;
  }

  .hour-direction-block {
    gap: 0.3rem;
  }

  .hour-wind-arrow {
    font-size: 1.65rem;
  }

  .hour-direction strong {
    font-size: 0.74rem;
  }

  .hour-direction small {
    font-size: 0.65rem;
  }

  .wind-main {
    gap: 0.25rem;
  }

  .wind-main strong {
    font-size: 1.5rem;
  }

  .wind-main span {
    font-size: 0.76rem;
  }

  .gust-main {
    padding: 0.35rem 0.45rem;
    font-size: 0.7rem;
  }

  .direction-delta {
    font-size: 0.66rem;
  }

  .hour-weather-icon {
    font-size: 1.45rem;
  }

  .hour-weather strong {
    min-width: 58px;
    padding: 0.28rem 0.3rem;
    font-size: 0.85rem;
  }

  .hour-weather > span:last-child {
    font-size: 0.62rem;
  }

  .segmented-control {
    align-self: stretch;
  }

  .segment {
    flex: 1;
  }
}

@media (max-width: 460px) {
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-heading .button {
    align-self: flex-start;
  }

  .summary-title,
  .section-heading-row {
    align-items: flex-start;
  }

  .hourly-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .hourly-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hourly-heading-actions .segmented-control {
    flex-basis: auto;
  }

  .hour-row {
    grid-template-columns: 64px 50px minmax(0, 1fr) 54px;
    gap: 0.3rem;
    min-height: 118px;
    padding: 0.7rem 0.35rem;
  }

  .hour-time-block strong {
    min-width: 58px;
    padding-right: 0.3rem;
    padding-left: 0.3rem;
    font-size: 0.82rem;
  }

  .hour-direction-block {
    align-items: center;
    flex-direction: column;
    gap: 0.08rem;
    text-align: center;
  }

  .hour-wind-arrow {
    font-size: 1.5rem;
  }

  .hour-direction {
    justify-items: center;
  }

  .wind-main {
    flex-wrap: nowrap;
  }

  .wind-main strong {
    font-size: 1.35rem;
  }

  .wind-main span {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .gust-main {
    line-height: 1.25;
  }

  .hour-weather strong {
    min-width: 50px;
    font-size: 0.78rem;
  }

  .condition-pill,
  .change-classification {
    max-width: 46%;
    white-space: normal;
  }

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

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

  .hourly-changes,
  .direction-summary {
    grid-template-columns: 1fr;
  }

  .points-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  #wind-field-map {
    height: 440px;
  }

  .wind-field-legend {
    grid-template-columns: auto 74px auto;
    font-size: 0.64rem;
  }

  .wind-field-readout {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
