        :root {
            --primary: #1a73e8;
            --primary-dark: #0d47a1;
            --secondary: #34a853;
            --warning: #fbbc05;
            --danger: #ea4335;
            --light: #f8f9fa;
            --dark: #202124;
            --gray: #5f6368;
            --border: #dadce0;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #dadada;
            color: var(--dark);
            line-height: 1.6;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            text-align: center;
            margin-bottom: 30px;
            padding: 20px 0;
            border-bottom: 1px solid var(--border);
        }

        header h1 {
            color: var(--primary);
            margin-bottom: 10px;
            font-size: 2.5rem;
        }

        header p {
            color: var(--gray);
            font-size: 1.1rem;
        }

        .search-section {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
            margin-bottom: 30px;
            position: relative;
        }

        .search-form {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            align-items: center;
        }

        .search-input-container {
            flex: 1;
            min-width: 250px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
        }

        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            max-height: 300px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }

        .search-result-item {
            padding: 12px 15px;
            cursor: pointer;
            border-bottom: 1px solid var(--border);
            transition: background-color 0.2s;
        }

        .search-result-item:hover {
            background-color: var(--light);
        }

        .search-result-item:last-child {
            border-bottom: none;
        }

        .airport-code {
            font-weight: bold;
            color: var(--primary);
        }

        .airport-name {
            font-size: 0.9rem;
            color: var(--gray);
        }

        .airport-location {
            font-size: 0.8rem;
            color: var(--gray);
        }

        .btn {
            padding: 12px 20px;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background-color: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background-color: var(--primary-dark);
        }

        .btn-secondary {
            background-color: var(--light);
            color: var(--dark);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background-color: #e8eaed;
        }

/* Stack cards: METAR top, TAF below */
.weather-display{
  display: grid;
  grid-template-columns: 1fr;   /* single column */
  gap: 25px;
}


        .weather-card {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border);
        }

        .card-title {
            font-size: 1.4rem;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .view-controls {
            display: flex;
            gap: 10px;
        }

        .view-toggle {
            background: none;
            border: 1px solid var(--border);
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8rem;
            color: var(--gray);
            transition: all 0.3s;
        }

        .view-toggle:hover {
            background: var(--light);
        }

        .view-toggle.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .airfield-info {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 20px;
        }

        .info-item {
            display: flex;
            flex-direction: column;
        }

        .info-label {
            font-size: 0.85rem;
            color: var(--gray);
            margin-bottom: 5px;
        }

        .info-value {
            font-weight: 600;
            font-size: 1.1rem;
        }

        .weather-data {
            background: var(--light);
            border-radius: 8px;
            padding: 15px;
            margin-top: 15px;
            font-family: monospace;
            white-space: pre-wrap;
            line-height: 1.5;
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .data-table th {
            background: var(--primary);
            color: white;
            padding: 12px 15px;
            text-align: left;
            font-weight: 600;
        }

        .data-table td {
            padding: 12px 15px;
            border-bottom: 1px solid var(--border);
        }

        .data-table tr:last-child td {
            border-bottom: none;
        }

        .data-table tr:hover {
            background: #f8f9fa;
        }

        .property-name {
            font-weight: 600;
            color: var(--dark);
        }

        .property-value {
            color: var(--gray);
        }

        .property-type {
            color: var(--primary);
            font-size: 0.8rem;
            font-style: italic;
        }

        .loading {
            text-align: center;
            padding: 30px;
            color: var(--gray);
        }

        .loading i {
            font-size: 2rem;
            margin-bottom: 15px;
            color: var(--primary);
        }

        .error {
            background: #ffebee;
            color: var(--danger);
            padding: 15px;
            border-radius: 8px;
            margin-top: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .hidden {
            display: none;
        }

        .nearby-section {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border);
        }

        .nearby-airfields {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .nearby-item {
            background: var(--light);
            padding: 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .nearby-item:hover {
            background: #e8f0fe;
        }

        .nearby-code {
            font-weight: bold;
            color: var(--primary);
        }

        .nearby-name {
            font-size: 0.9rem;
            color: var(--gray);
        }

        footer {
            text-align: center;
            margin-top: 40px;
            padding: 20px 0;
            color: var(--gray);
            font-size: 0.9rem;
            border-top: 1px solid var(--border);
        }

        .last-updated {
            font-size: 0.8rem;
            color: var(--gray);
            margin-top: 10px;
            text-align: right;
        }

        .weather-condition {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
            margin-right: 8px;
            margin-bottom: 8px;
        }

        .condition-vfr {
            color: #ffffff;
            background-color: #28a745;
        }

        .condition-mvfr {
            color: #ffffff;
            background-color: #0080f0;
        }

        .condition-ifr {
            color: #ffffff;
            background-color: #c5221f;
        }

        .condition-lifr {
            color: #ffffff;
            background-color: #9722ce;
        }

        .weather-details {
            margin-top: 15px;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 15px;
        }

        .detail-item {
            background: var(--light);
            padding: 12px;
            border-radius: 8px;
            text-align: center;
        }

        .detail-value {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .detail-label {
            font-size: 0.8rem;
            color: var(--gray);
        }

        .success {
            background: #e6f4ea;
            color: #137333;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 0.9rem;
            margin-top: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .warning {
            background: #fff8e1;
            border-left: 4px solid #fbbc05;
            padding: 12px 15px;
            margin: 10px 0;
            border-radius: 4px;
            font-size: 0.9rem;
        }

        .parsed-section {
            margin-top: 15px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid var(--primary);
        }

        .parsed-item {
            margin-bottom: 10px;
            padding: 8px;
            background: white;
            border-radius: 4px;
        }

        .parsed-label {
            font-weight: 600;
            color: var(--primary);
            margin-right: 8px;
        }

        .cloud-item {
            display: inline-block;
            padding: 4px 8px;
            margin: 2px 4px 2px 0;
            background: #e8f0fe;
            border-radius: 4px;
            font-size: 0.85rem;
        }

        .forecast-period {
            margin-bottom: 15px;
            padding: 12px;
            background: white;
            border-radius: 6px;
            border-left: 3px solid var(--secondary);
        }

        .period-header {
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .taf-change-indicator {
            display: inline-block;
            padding: 2px 6px;
            margin-left: 8px;
            border-radius: 3px;
            font-size: 0.7rem;
            font-weight: bold;
        }

        .change-fm {
            background: #e8f0fe;
            color: #1a73e8;
        }

        .change-tempo {
            background: #fff8e1;
            color: #f29900;
        }

        .change-becmg {
            background: #e6f4ea;
            color: #137333;
        }

        .change-prob {
            background: #fce8e6;
            color: #c5221f;
        }

        .flight-category {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
            margin-left: 8px;
        }

        /* ----- Toolbar / chips ----- */
.toolbar {
  display:flex; justify-content:space-between; align-items:center;
  gap:12px; padding:10px 0 6px 0;
}
.toolbar .unit-group { display:flex; align-items:center; gap:6px; }
.toolbar .unit-group label { font-size:.85rem; color:var(--gray); margin-right:2px; }
.chip { border:1px solid var(--border,#e5e7eb); background:var(--card,#fff);
  padding:4px 8px; border-radius:999px; font-size:.85rem; cursor:pointer; }
.chip.toggle.active { background:var(--primary, #0ea5e9); color:#fff; border-color:transparent; }
.chip.select { padding:4px 6px; }
.chip.danger { border-color:#ef4444; color:#ef4444; background:transparent; }
.chip.primary { background:var(--primary,#0ea5e9); color:#fff; border-color:transparent; }
.btn.btn-ghost { background:transparent; border:1px dashed var(--border,#e5e7eb); color:inherit; }
.last-update-small { font-size:.85rem; color:var(--gray); margin-left:8px; }

/* Switch */
.switch { position:relative; display:inline-block; width:42px; height:22px; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background:#d1d5db; transition:.2s; border-radius:999px; }
.slider:before { position:absolute; content:""; height:18px; width:18px; left:2px; bottom:2px; background:white; transition:.2s; border-radius:50%; }
.switch input:checked + .slider { background:#10b981; }
.switch input:checked + .slider:before { transform:translateX(20px); }

/* Favourites */
.favorites { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:8px 0 12px; }
.fav-bar { display:flex; gap:6px; flex-wrap:wrap; }
.chip.fav { background:#fff7ed; border-color:#fdba74; color:#c2410c; }
.chip.fav .chip-x { margin-left:8px; opacity:.7; }
.chip.fav .chip-x:hover { opacity:1; }

/* Weather badges */
.wx-badge { display:inline-block; padding:2px 6px; border-radius:6px; font-size:.78rem; margin:2px 4px 2px 0; color:#fff; }
.wx-fg { background:#6b7280; }  /* Fog */
.wx-br { background:#3b82f6; }  /* Mist */
.wx-hz { background:#f59e0b; }  /* Haze */
.wx-ra { background:#2563eb; }  /* Rain */
.wx-dz { background:#60a5fa; }  /* Drizzle */
.wx-sn { background:#93c5fd; color:#0f172a; } /* Snow */
.wx-ts { background:#7c3aed; }  /* Thunderstorm */
.wx-gr { background:#374151; }  /* Hail */
.wx-sa, .wx-du { background:#a16207; } /* Sand/Dust */
.wx-va { background:#111827; }
.wx-fu { background:#4b5563; }
.wx-generic { background:#6b7280; }

/* Crosswind card */
.xw-summary { margin-bottom:8px; }
.runway-list { display:flex; flex-direction:column; gap:10px; }
.runway-row { display:grid; grid-template-columns: 120px 200px 1fr; align-items:center; gap:12px; padding:8px; border:1px solid var(--border,#e5e7eb); border-radius:12px; background:var(--card,#fff); }
.rwy-sub { font-size:.85rem; color:var(--gray); }
.viz-col { display:flex; justify-content:center; }
.xw-svg { width:180px; height:60px; }
.rwy-bar { fill:#d1d5db; }
.wind-line { stroke:#111827; stroke-width:3; }
.wind-head { fill:#111827; }
.values-col .xw, .values-col .hw { font-size:.95rem; }

/* ===== Runways & Crosswind Gauges (match mock) ===== */
.xw-panel {
  /*background: #165EA8;*/
  background: #303438;
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.xw-gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  justify-items: center;
}
@media (max-width: 900px){ .xw-gauges { grid-template-columns: 1fr; } }

.gauge-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12);
}

.g-title { font-weight: 700; letter-spacing: .2px; }
.gauge { width: 320px; height: 320px; }
@media (min-width: 1200px){ .gauge { width: 360px; height: 360px; } }

.anim-rotate { transition: transform 1.5s cubic-bezier(.2,.7,.3,1); transform-origin: 50% 50%; }

/* ticks / labels */
.tick { stroke: rgba(255,255,255,.55); stroke-width: 2; }
.tick.major { stroke-width: 3; }
.tick.cardinal { stroke: #fff; stroke-width: 3.5; }
.label { fill: rgba(255,255,255,.9); font-size: 12px; font-weight: 600; text-anchor: middle; dominant-baseline: middle; }
.label.card { font-size: 14px; }

/* runway numeral look */
.rwy-num{
  font-family: 'Teko', 'Anton', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 20px;          /* tweak to taste */
  letter-spacing: 1px;      /* small spacing looks more “stenciled” */
  fill: #fff;
  font-variant-numeric: tabular-nums; /* consistent widths for 08/27, etc. */
}


/* wind arrow */
.wind-stem { stroke: #fff; stroke-width: 3; }
.wind-head { fill: #fff; }

/* component badges (compact like mock) */
.component-labels { display:flex; gap:22px; justify-content:center; }
.badge {
  background: transparent; border: none;
  font-variant-numeric: tabular-nums; font-weight: 600;
  display:flex; align-items:center; gap:6px;
}
.badge .arrow { font-size: 14px; opacity: .9; }

/* speedo */
.spd-tick { stroke: rgba(255,255,255,.7); stroke-width: 2; }
.spd-tick.major { stroke-width: 3; }
.spd-label { fill:#fff; font-size: 12px; text-anchor: middle; dominant-baseline: middle; }
.needle-shaft, .needle-cap { fill: #fff; }


/* Runway editor */
.rwy-editor { padding:10px; border:1px dashed var(--border,#e5e7eb); border-radius:12px; background:var(--subtle,#fafafa); }
.rwy-editor.compact { background:transparent; border-style:solid; }
.rwy-editor-title { font-weight:600; margin-bottom:8px; }
.rwy-edit-row { display:grid; grid-template-columns: 1fr 100px auto; gap:8px; margin-bottom:6px; }
.rwy-name-input, .rwy-hdg-input { width:100%; padding:6px 8px; border:1px solid var(--border,#e5e7eb); border-radius:8px; font-size:.95rem; background:#fff; }
.rwy-edit-actions { display:flex; gap:8px; margin-top:6px; }

/* Small tweaks */
.info-row { margin-bottom:10px; }

/* keep strokes crisp */
.gauge * { vector-effect: non-scaling-stroke; }
.wind-stem { stroke-linecap: round; }


/* force the gauge graphics visible even if older rules exist */
#gauge-compass .runway { fill:#0d0d0d !important; }
#gauge-compass .centerline { stroke:#adadad !important; stroke-width:2 !important; stroke-dasharray:12 10 !important; }
#gauge-compass .threshold rect { fill:#adadad !important; }
#gauge-compass .wind-stem { stroke:#fff !important; stroke-width:3 !important; stroke-linecap:round !important; }
#gauge-compass .wind-head { fill:#fff !important; }

/* while we verify, don't clip the SVG */
.gauge { overflow: visible !important; }  /* you can switch back to hidden after it’s working */


/* Keep the gauge graphics inside the circle */
.gauge { overflow: hidden !important; }

/* subtle glow so arcs pop on dark blue */
.spd-segments { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }


/* ===== TAF Hourly Timeline ===== */
.taf-timeline { overflow-x: auto; }
.taf-hourly {
  width: max(720px, 100%);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.taf-hourly thead th {
  position: sticky; top: 0;
  background: #1f2937; color: #fff;
  font-weight: 600; font-size: .85rem;
  padding: 8px 10px; white-space: nowrap;
  z-index: 1;
}
.taf-hourly th.stub {
  position: sticky; left: 0; z-index: 2;
  background: #0f172a; color:#fff; width: 110px;
  text-align: left;
}
.taf-hourly td, .taf-hourly th {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px; text-align: center;
}
.taf-hourly tbody tr:last-child td, .taf-hourly tbody tr:last-child th { border-bottom: none; }
.taf-hourly td { width: 88px; font-size: .9rem; }
.taf-hourly td.wxcell i { opacity: .9; font-size: 1rem; margin-right: 4px; }
.taf-chip {
  display: inline-block; margin-left: 4px; padding: 0 6px;
  font-size: .7rem; border-radius: 999px; background:#fff8e1; color:#b45309; border:1px solid #fbbf24;
}

/* category badges reuse your condition-* colors */
.taf-badge {
  display:inline-block; min-width:48px; padding: 2px 8px; border-radius: 6px;
  font-weight: 700; font-size: .8rem; color: #fff;
}
.taf-badge.condition-vfr  { background:#22c55e; }
.taf-badge.condition-mvfr { background:#0ea5e9; }
.taf-badge.condition-ifr  { background:#ef4444; }
.taf-badge.condition-lifr { background:#8b5cf6; }

/* ===== METAR layout like mock ===== */
.metar-headline{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:12px;
}
.metar-title{ font-size:1.3rem; font-weight:700; color:#e5e7eb; }
.metar-right{ display:flex; gap:12px; align-items:center; color:#cbd5e1; font-size:.9rem; }
.metar-icao{ background:#0f172a; padding:4px 8px; border-radius:8px; font-weight:700; }
.metar-age i{ margin-right:4px; }

.metar-stats{
  display:grid; grid-template-columns: repeat(6, minmax(140px,1fr));
  gap:14px; margin-bottom:16px;
}
.stat-tile{
  background:#1f2937; color:#fff; border-radius:12px; padding:12px 14px;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.stat-tile .stat-top{ font-weight:800; font-size:1.15rem; }
.stat-tile .stat-sub{ font-size:.85rem; color:#cbd5e1; }
.stat-tile.condition-vfr{ background:#22c55e; color:#fff; }
.stat-tile.condition-mvfr{ background:#0ea5e9; color:#fff; }
.stat-tile.condition-ifr{ background:#ef4444; color:#fff; }
.stat-tile.condition-lifr{ background:#8b5cf6; color:#fff; }
.stat-tile.stat-ok{ background:#065f46; } /* subtle green tint for “goodish” */

.metar-gauges-grid{
  display:grid; grid-template-columns: 1fr 1fr 1.4fr; gap:18px;
  align-items:start; margin-bottom:14px;
}
.metar-gauges-grid .gauge-col{ background:#1f2937; border-radius:16px; padding:12px; display:grid; justify-items:center; }
.metar-gauges-grid .clouds-col{ background:#1f2937; border-radius:16px; padding:12px; }
.metar-components{ display:flex; gap:16px; margin-top:8px; color:#e5e7eb; font-weight:700; }

.metar-footer{
  display:flex; align-items:center; gap:16px; justify-content:space-between; flex-wrap:wrap;
}
.runway-chip{
  background:#111827; color:#fff; width:46px; height:70px; border-radius:6px;
  display:grid; place-items:center; font-weight:900; font-family:'Teko', ui-sans-serif, system-ui;
  position:relative; overflow:hidden; box-shadow: inset 0 -10px 0 rgba(255,255,255,.12);
}
.runway-chip::before,
.runway-chip::after{
  content:''; position:absolute; left:6px; right:6px; height:8px; background:#fff; bottom:8px;
  box-shadow: 0 0 0 2px #111827 inset;
}
.runway-chip::after{
  left:auto; right:auto; top:8px; bottom:auto;
}
.raw-pill{
  margin-left:auto; background:#0b5ed7; color:#fff; padding:10px 14px; border-radius:12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space:pre-wrap; overflow:auto; max-width:100%;
}

/* METAR middle row: 3/3/6 columns and equal heights */
.metar-gauges-grid{
  display:grid;
  grid-template-columns: 3fr 3fr 6fr;  /* 3 / 3 / 6 */
  gap:18px;
  align-items: stretch;   /* make all three boxes same height */
  margin-bottom:14px;
}
.gauge-col, .clouds-col{
  background:#1f2937; border-radius:16px; padding:12px;
  display:flex; flex-direction:column; justify-content:stretch;
}
.gauge-col .gauge,
.clouds-col svg{
  width:100%;
  height:280px;           /* fixed height so all three match */
}
.rwy-chips{
  margin-top:10px; display:flex; flex-wrap:wrap; gap:6px;
}

/* Chips (re-usable) */
.chip{
  border:1px solid var(--border, #e5e7eb);
  background:var(--card,#fff);
  padding:6px 10px; border-radius:999px; font-size:.85rem; cursor:pointer;
}
.chip.active { background:#0ea5e9; color:#fff; border-color:transparent; }
.chip.fav { background:#fff7ed; border-color:#fdba74; color:#c2410c; }

/* Favourites bar spacing */
.fav-bar, #favoritesBar{ display:flex; gap:6px; flex-wrap:wrap; }

/* ========== THEME TOKENS ========== */
:root {
  /* base brand */
  --primary: #1a73e8;
  --primary-dark: #0d47a1;
  --secondary: #34a853;
  --warning: #fbbc05;
  --danger: #ea4335;

  /* theme surfaces */
  --bg: #f5f7fa;            /* page background */
  --text: #202124;          /* primary text */
  --muted: #5f6368;         /* secondary text */
  --card: #ffffff;          /* cards / sections */
  --panel: #1f2937;         /* dark panels (gauges/clouds) — stay dark in light mode */
  --border: #dadce0;        /* borders */
  --accent: #0b5ed7;        /* pills etc. */
}

.theme-dark {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --secondary: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --bg: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --card: #111827;
  --panel: #111827;         /* keep panels dark; darker than light mode panel */
  --border: #334155;
  --accent: #2563eb;
}

/* ========== THEME-AWARE OVERRIDES (non-destructive) ========== */
body { background: var(--bg); color: var(--text); }

.search-section,
.weather-card,
.nearby-item,
.data-table,
.stat-tile:not(.condition-vfr,.condition-mvfr,.condition-ifr,.condition-lifr,.stat-ok) {
  background: var(--card);
  color: var(--text);
}

.btn-secondary { background: var(--card); border-color: var(--border); color: var(--text); }
.view-toggle { border-color: var(--border); color: var(--muted); }
.view-toggle.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-input { background: var(--card); color: var(--text); border-color: var(--border); }
.search-input::placeholder { color: var(--muted); }
.data-table td, .data-table th { border-color: var(--border); }

/* METAR middle row panels */
.metar-gauges-grid .gauge-col,
.metar-gauges-grid .clouds-col {
  background: var(--panel) !important;
  color: #fff;
}

/* Raw METAR pill */
.raw-pill { background: var(--accent); }

/* Favourites chips */
.chip.fav { background:#fff7ed; border-color:#fdba74; color:#c2410c; }
.theme-dark .chip.fav { background:#2b1d12; border-color:#9a5a24; color:#fbbf24; }

/* ========== THEME TOGGLE SWITCH ========== */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px; height: 26px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  user-select: none;
}
.theme-switch input { display:none; }
.theme-switch .theme-thumb {
  position: relative;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--primary);
  display: grid; place-items: center;
  transition: transform .2s ease;
  color: #fff;
}
.theme-switch .fa-sun { font-size: 12px; }
.theme-switch .fa-moon { font-size: 12px; display:none; }

/* checked = dark mode */
.theme-switch input:checked + .theme-thumb {
  transform: translateX(20px);
}
.theme-switch input:checked + .theme-thumb .fa-sun { display:none; }
.theme-switch input:checked + .theme-thumb .fa-moon { display:inline; }

@keyframes calmPulse {
  0%   { transform: scale(0.94); opacity: .75; }
  50%  { transform: scale(1.00); opacity: 1; }
  100% { transform: scale(0.94); opacity: .75; }
}
.calm-pulse {
  transform-origin: center;
  animation: calmPulse 2.4s ease-in-out infinite;
}
.calm-pulse.slow {
  animation-duration: 3.6s;
}

