:root {
  color-scheme: dark;
  --bg: #06101a;
  --bg2: #091725;
  --panel: rgba(12, 28, 43, .92);
  --panel-2: rgba(18, 38, 57, .9);
  --border: rgba(147, 190, 220, .13);
  --text: #f4f8fb;
  --muted: #8fa6b8;
  --accent: #43d7ff;
  --accent2: #7cf0ff;
  --good: #54e2a1;
  --warn: #ffc85c;
  --danger: #ff6f7f;
  --rain: #5a8dff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .26);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 70% -10%, rgba(23, 128, 174, .22), transparent 34rem),
    radial-gradient(circle at 0% 35%, rgba(34, 82, 130, .15), transparent 32rem),
    linear-gradient(180deg, #07111d 0%, #06101a 100%);
}
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; padding-bottom: 94px; }
.topbar {
  height: 74px; max-width: 1440px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; position: relative; display: grid; place-items: center; }
.brand-mark span { position: absolute; width: 30px; height: 8px; border: 2px solid var(--accent); border-radius: 50%; transform: rotate(-14deg); opacity: .8; }
.brand-mark span:nth-child(2) { width: 22px; transform: rotate(27deg); opacity: .6; }
.brand-mark span:nth-child(3) { width: 10px; height: 10px; background: var(--accent); border: 0; box-shadow: 0 0 18px var(--accent); }
.brand { font-weight: 850; letter-spacing: -.03em; font-size: 21px; }
.brand-sub { font-size: 9px; letter-spacing: .18em; color: var(--muted); margin-top: 2px; }
.icon-btn, .locate-btn, .search-btn, .secondary-btn {
  border: 1px solid var(--border); background: rgba(20, 42, 60, .75); border-radius: 12px; cursor: pointer;
  transition: .2s ease; box-shadow: none;
}
.icon-btn:hover, .locate-btn:hover, .search-btn:hover, .secondary-btn:hover { border-color: rgba(67, 215, 255, .46); background: rgba(26, 57, 80, .9); }
.icon-btn { width: 40px; height: 40px; font-size: 22px; }
.location-bar { max-width: 1440px; margin: 18px auto 0; padding: 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; position: relative; z-index: 10; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 16px; color: var(--muted); font-size: 22px; }
.search-wrap input { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--border); background: rgba(12, 27, 41, .88); color: var(--text); padding: 0 102px 0 48px; outline: none; }
.search-wrap input:focus { border-color: rgba(67, 215, 255, .45); box-shadow: 0 0 0 3px rgba(67, 215, 255, .08); }
.search-btn { position: absolute; right: 5px; height: 38px; padding: 0 14px; }
.locate-btn { height: 48px; padding: 0 16px; white-space: nowrap; }
.search-results { position: absolute; top: 54px; left: 28px; width: calc(100% - 240px); max-width: 760px; background: #0b1a28; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.search-result { padding: 13px 16px; cursor: pointer; border-bottom: 1px solid var(--border); }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: rgba(67, 215, 255, .08); }
.search-result strong { display: block; }
.search-result span { color: var(--muted); font-size: 12px; }
main { max-width: 1440px; margin: 18px auto 0; padding: 0 28px; }
.view { display: none; animation: viewIn .2s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: .5; transform: translateY(4px);} to { opacity: 1; transform: none; } }
.panel { background: linear-gradient(145deg, rgba(13, 31, 47, .96), rgba(10, 25, 39, .92)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { min-height: 300px; padding: 30px 32px; display: grid; grid-template-columns: 1fr 260px; gap: 24px; overflow: hidden; position: relative; }
.hero-card::after { content:""; position:absolute; width:420px; height:420px; right:-180px; top:-210px; border-radius:50%; background: radial-gradient(circle, rgba(67,215,255,.12), transparent 68%); pointer-events:none; }
.eyebrow { font-size: 10px; color: var(--accent2); font-weight: 800; letter-spacing: .15em; display: flex; align-items: center; gap: 7px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
h1 { font-size: clamp(24px, 4vw, 42px); margin: 8px 0 3px; letter-spacing: -.04em; }
h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.02em; }
h3 { margin: 6px 0 0; }
.muted { color: var(--muted); }
.temp-row { display: flex; align-items: center; gap: 30px; margin: 18px 0 4px; }
.current-temp { font-size: clamp(62px, 8vw, 92px); line-height: .9; letter-spacing: -.08em; font-weight: 800; }
.condition-wrap { display:flex; align-items:center; gap:12px; }
.condition-icon { font-size: 35px; color: var(--accent2); filter: drop-shadow(0 0 8px rgba(67,215,255,.25)); }
.condition-text { font-size: 19px; font-weight: 750; }
.rain-headline { display: inline-flex; margin-top: 18px; padding: 10px 13px; border-radius: 11px; background: rgba(65, 123, 255, .09); border: 1px solid rgba(76, 132, 255, .19); color: #c9dcff; font-weight: 650; }
.hero-right { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; border-left:1px solid var(--border); position:relative; z-index:1; }
.confidence-box { text-align:center; }
.confidence-label { color: var(--muted); font-size: 10px; letter-spacing:.13em; font-weight:800; }
.gauge-wrap { width:150px; height:88px; position:relative; margin:10px auto 0; }
.gauge { width:150px; height:88px; overflow:visible; }
.gauge path { fill:none; stroke-width:10; stroke-linecap:round; }
.gauge-bg { stroke:rgba(115,153,179,.13); }
.gauge-fill { stroke:var(--accent); stroke-dasharray: 0 100; filter:drop-shadow(0 0 8px rgba(67,215,255,.5)); transition:stroke-dasharray .5s ease; }
.gauge-number { position:absolute; left:0; right:0; bottom:3px; font-size:34px; font-weight:850; letter-spacing:-.05em; }
.confidence-word { font-weight:850; letter-spacing:.16em; font-size:12px; color:var(--accent2); }
.tiny { font-size:11px; }
.updated-line { font-size:11px; color:var(--muted); margin-top:9px; }
.metric-grid { display:grid; grid-template-columns:repeat(6, 1fr); gap:12px; margin-top:12px; }
.metric { padding:17px 16px; min-height:105px; display:flex; flex-direction:column; justify-content:center; }
.metric span { color:var(--muted); font-size:12px; }
.metric strong { font-size:23px; margin:5px 0 2px; }
.metric small { color:#6f8799; font-size:10px; }
.section-panel { margin-top:12px; padding:24px; }
.section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.legend { color:var(--muted); font-size:11px; display:flex; align-items:center; gap:7px; }
.legend-dot { width:8px; height:8px; display:inline-block; border-radius:50%; }
.legend-dot.temp { background:var(--warn); } .legend-dot.rain { background:var(--rain); margin-left:8px; }
.hourly-strip { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(92px, 1fr); gap:8px; overflow-x:auto; padding-bottom:5px; scrollbar-color:rgba(67,215,255,.25) transparent; }
.hour-card { min-height:135px; border:1px solid var(--border); border-radius:15px; background:rgba(16,36,53,.55); padding:13px 10px; text-align:center; }
.hour-card.now { border-color:rgba(67,215,255,.36); background:rgba(67,215,255,.07); }
.hour-time { color:var(--muted); font-size:11px; }
.hour-icon { font-size:22px; margin:10px 0 7px; }
.hour-temp { font-weight:800; font-size:19px; }
.hour-rain { color:#87aaff; font-size:11px; margin-top:5px; }
.daily-grid { display:grid; grid-template-columns:repeat(7, minmax(120px,1fr)); gap:9px; overflow-x:auto; }
.day-card { padding:15px 13px; border:1px solid var(--border); background:rgba(16,36,53,.48); border-radius:15px; min-width:120px; }
.day-name { font-weight:750; }
.day-icon { font-size:26px; margin:13px 0 9px; }
.day-temp { font-size:18px; font-weight:800; }
.day-low { color:var(--muted); font-size:12px; margin-left:5px; }
.day-rain { color:#8aaaff; font-size:11px; margin-top:7px; }
.change-summary { color:#bfd0dc; line-height:1.65; }
.change-item { display:flex; gap:10px; align-items:flex-start; padding:9px 0; border-bottom:1px solid var(--border); }
.change-item:last-child { border:0; }
.change-item b { color:var(--accent2); min-width:18px; }
.alert-stack { display:grid; gap:8px; margin-bottom:12px; }
.weather-alert { border-radius:14px; border:1px solid rgba(255,111,127,.35); background:rgba(141,34,48,.18); padding:13px 15px; }
.weather-alert strong { display:block; color:#ffd0d5; }
.weather-alert p { margin:4px 0 0; color:#d9aeb3; font-size:12px; line-height:1.4; }
.radar-panel { padding-bottom:18px; }
.radar-actions { display:flex; gap:8px; }
.secondary-btn { padding:9px 12px; font-size:12px; }
.secondary-btn.danger { border-color:rgba(255,111,127,.25); color:#ffb4be; }
.radar-map { height:min(68vh,720px); min-height:460px; border-radius:16px; overflow:hidden; border:1px solid var(--border); background:#07131f; }
.leaflet-container { background:#07131f; }
.radar-controls { margin-top:15px; }
.radar-controls input { width:100%; accent-color:var(--accent); }
.radar-time-row { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); margin-top:5px; }
.radar-time-row strong { color:var(--text); }
.source-note { font-size:10px; color:#688094; margin-top:12px; line-height:1.5; }
.ensemble-card { display:grid; grid-template-columns:1fr auto; gap:30px; padding:21px; border-radius:17px; border:1px solid rgba(67,215,255,.17); background:linear-gradient(130deg, rgba(67,215,255,.08), rgba(18,39,58,.3)); margin-bottom:14px; }
.ensemble-card p { margin:8px 0 0; color:var(--muted); max-width:720px; line-height:1.45; }
.chip { display:inline-flex; padding:4px 8px; border-radius:999px; background:rgba(128,157,177,.11); border:1px solid var(--border); color:#aac0cf; font-size:9px; letter-spacing:.08em; font-weight:800; }
.chip.accent { color:var(--accent2); border-color:rgba(67,215,255,.25); background:rgba(67,215,255,.07); }
.chip.good { color:var(--good); }
.ensemble-numbers { display:flex; gap:25px; align-items:center; }
.ensemble-numbers div { min-width:80px; }
.ensemble-numbers small { display:block; color:var(--muted); font-size:10px; }
.ensemble-numbers strong { display:block; font-size:24px; margin-top:3px; }
.model-table-wrap { overflow-x:auto; }
.model-table { width:100%; border-collapse:collapse; min-width:720px; }
.model-table th { text-align:left; color:#6f899d; font-size:9px; letter-spacing:.12em; padding:10px 12px; border-bottom:1px solid var(--border); }
.model-table td { padding:14px 12px; border-bottom:1px solid var(--border); font-size:13px; }
.model-table tr:last-child td { border-bottom:0; }
.model-name strong { display:block; }
.model-name small { color:var(--muted); }
.model-status { display:inline-flex; gap:5px; align-items:center; font-size:10px; color:var(--good); }
.model-status.fail { color:var(--danger); }
.status-dot { width:6px; height:6px; border-radius:50%; background:currentColor; box-shadow:0 0 6px currentColor; }
.spread-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.spread-card { border:1px solid var(--border); border-radius:14px; background:rgba(16,36,53,.45); padding:16px; }
.spread-card small { color:var(--muted); }
.spread-card strong { display:block; font-size:27px; margin-top:4px; }
.spread-card span { font-size:11px; color:#71899b; }
.accuracy-intro { color:var(--muted); line-height:1.6; max-width:950px; }
.status-banner { border:1px solid rgba(255,200,92,.2); background:rgba(255,200,92,.07); color:#e9c77f; border-radius:13px; padding:13px 15px; margin:16px 0; font-size:12px; }
.method-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.method-grid article { border:1px solid var(--border); border-radius:14px; padding:15px; background:rgba(16,36,53,.42); }
.method-grid p { color:var(--muted); font-size:11px; line-height:1.5; margin-bottom:0; }
.settings-list { display:grid; gap:0; }
.setting-row { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:18px 2px; border-bottom:1px solid var(--border); }
.setting-row:last-child { border:0; }
.setting-row strong { display:block; }
.setting-row small { display:block; color:var(--muted); margin-top:4px; }
.setting-row input[type="checkbox"] { width:20px; height:20px; accent-color:var(--accent); }
.source-list { display:grid; gap:8px; }
.source-list div { display:flex; justify-content:space-between; border:1px solid var(--border); background:rgba(16,36,53,.35); padding:12px 14px; border-radius:12px; }
.source-list span { color:var(--muted); font-size:12px; }
.bottom-nav { position:fixed; z-index:50; bottom:0; left:50%; transform:translateX(-50%); width:min(760px, calc(100% - 24px)); height:70px; padding:7px; display:grid; grid-template-columns:repeat(5,1fr); gap:4px; background:rgba(7,18,29,.93); backdrop-filter:blur(16px); border:1px solid var(--border); border-bottom:0; border-radius:18px 18px 0 0; box-shadow:0 -15px 35px rgba(0,0,0,.25); }
.nav-btn { border:0; background:transparent; color:#70899d; border-radius:12px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; font-size:9px; font-weight:700; }
.nav-btn span { font-size:18px; }
.nav-btn.active { color:var(--accent2); background:rgba(67,215,255,.08); }
.toast { position:fixed; z-index:100; left:50%; bottom:90px; transform:translateX(-50%); background:#10263a; border:1px solid var(--border); border-radius:12px; padding:11px 15px; box-shadow:var(--shadow); font-size:12px; max-width:min(500px,calc(100% - 30px)); text-align:center; }
.loading-overlay { position:fixed; z-index:90; inset:0; background:rgba(3,9,14,.68); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; flex-direction:column; gap:13px; font-size:12px; color:var(--muted); }
.spinner { width:34px; height:34px; border-radius:50%; border:3px solid rgba(67,215,255,.12); border-top-color:var(--accent); animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.hidden { display:none !important; }
.skeleton-block:empty { min-height:110px; background:linear-gradient(100deg, rgba(26,48,66,.28) 20%, rgba(48,73,91,.28) 40%, rgba(26,48,66,.28) 60%); background-size:220% 100%; border-radius:15px; animation:shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x:-220%; } }
.offline { color:var(--danger) !important; }
@media (max-width: 1000px) {
  .metric-grid { grid-template-columns:repeat(3,1fr); }
  .daily-grid { grid-template-columns:repeat(7,130px); }
  .method-grid { grid-template-columns:repeat(2,1fr); }
  .hero-card { grid-template-columns:1fr 220px; }
}
@media (max-width: 720px) {
  .topbar { height:64px; padding:0 15px; }
  .brand-sub { display:none; }
  .location-bar { padding:0 14px; grid-template-columns:1fr; margin-top:12px; }
  .locate-btn { height:42px; }
  .search-results { left:14px; width:calc(100% - 28px); top:50px; }
  main { padding:0 14px; margin-top:12px; }
  .hero-card { grid-template-columns:1fr; padding:23px 20px; }
  .hero-right { border-left:0; border-top:1px solid var(--border); padding-top:18px; flex-direction:row; justify-content:space-around; }
  .gauge-wrap { width:130px; }
  .gauge { width:130px; }
  .current-temp { font-size:70px; }
  .temp-row { gap:18px; }
  .condition-wrap { align-items:flex-start; }
  .condition-icon { display:none; }
  .metric-grid { grid-template-columns:repeat(2,1fr); }
  .metric { min-height:95px; }
  .section-panel { padding:18px 15px; }
  .section-heading { align-items:center; }
  .legend { display:none; }
  .ensemble-card { grid-template-columns:1fr; gap:18px; }
  .ensemble-numbers { justify-content:space-between; gap:8px; }
  .spread-grid { grid-template-columns:1fr; }
  .method-grid { grid-template-columns:1fr; }
  .source-list div { flex-direction:column; gap:4px; }
  .radar-map { min-height:430px; height:62vh; }
  .radar-heading { align-items:flex-start; }
  .radar-actions { flex-direction:column; }
  .bottom-nav { width:100%; border-radius:16px 16px 0 0; }
}

/* ForecastForge V2 additions */
.brand-version { font-size:10px; color:var(--accent2); border:1px solid rgba(67,215,255,.28); border-radius:999px; padding:2px 6px; vertical-align:middle; margin-left:4px; letter-spacing:.08em; }
.accuracy-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.learning-status-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:14px 0 10px; }
.learning-totals { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; margin:10px 0 16px; }
.learning-totals article { border:1px solid var(--border); background:rgba(16,36,53,.42); border-radius:13px; padding:13px 14px; }
.learning-totals small { color:var(--muted); display:block; font-size:10px; }
.learning-totals strong { display:block; font-size:22px; margin-top:4px; }
.adjusted { display:inline-block; color:var(--good); margin-left:4px; font-size:10px; }
.learning-table { min-width:1040px; }
@media (max-width:720px) {
  .learning-totals { grid-template-columns:repeat(2,1fr); }
  .accuracy-actions { width:100%; justify-content:flex-start; }
}
