:root {
  --bg: #0e1116;
  --panel: #171c24;
  --panel2: #1f2630;
  --line: #2a323d;
  --text: #e7edf3;
  --muted: #92a0b0;
  --accent: #38bdf8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(14,17,22,.92); backdrop-filter: blur(8px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand .logo { height: 48px; width: 48px; flex: 0 0 auto; border-radius: 50%; }
@media (max-width: 480px) { .brand .logo { height: 38px; } .brand { gap: 9px; } }
.title h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.title .sub { color: var(--muted); font-size: 13px; }
.appname { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
.controls { display: flex; align-items: center; gap: 10px; }

/* site picker */
.sitepick { position: relative; }
.sitebtn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; height: 40px; padding: 0 14px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.sitebtn:hover { background: var(--panel); }
.sitemenu {
  position: absolute; right: 0; top: 46px; z-index: 40; width: 320px; max-width: 86vw;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.sitemenu.hidden { display: none; }
#siteSearch {
  width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 14px; outline: none;
}
#siteSearch:focus { border-color: var(--accent); }
#siteResults { list-style: none; margin: 8px 0 0; padding: 0; max-height: 320px; overflow-y: auto; }
.siteopt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; color: var(--text); padding: 8px 9px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.siteopt:hover { background: var(--panel2); }
.siteopt .so-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.siteopt .so-reg { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
.sb { flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.sb.cur { background: rgba(34,197,94,.18); color: #4ade80; }
.sb.web { background: rgba(96,165,250,.18); color: #93c5fd; }
.sb.pge { background: rgba(245,158,11,.15); color: #fbbf24; }
.sb.none { background: var(--panel2); color: var(--muted); }
.pickhint { color: var(--muted); font-size: 11.5px; padding: 4px 9px 8px; list-style: none; }
.noopt { color: var(--muted); font-size: 12.5px; padding: 8px 9px; list-style: none; }
.siteguide { display: inline-block; margin-top: 3px; font-size: 12px; color: var(--accent); text-decoration: none; }
.siteguide:hover { text-decoration: underline; }
.siteguide.hidden { display: none; }
#refresh {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer;
}
#refresh:hover { background: var(--panel); }

/* verdict legend */
.legendbar {
  border: 1px solid var(--line); background: var(--panel); border-radius: 14px;
  padding: 12px 16px; margin: 4px 0 14px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px;
}
@media (max-width: 560px) { .legendbar { grid-template-columns: 1fr; } }
.lg { display: flex; align-items: baseline; gap: 8px; font-size: 13px; line-height: 1.35; }
.lgdot { flex: none; width: 11px; height: 11px; border-radius: 50%; transform: translateY(1px); }
.lg b { color: var(--text); white-space: nowrap; }
.lgd { color: var(--muted); }

/* nearby airport METAR card — compact one-liner */
.metar { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 13px 16px; margin-bottom: 14px; }
.metar-head { font-size: 13px; color: var(--text); }
.metar-line { font-size: 16px; margin-top: 7px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.metar-line .dot { color: var(--line); margin: 0 8px; }
.metar-raw { margin-top: 9px; }
.metar-raw summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.metar-raw code { display: block; margin-top: 6px; background: var(--panel2); padding: 7px 9px; border-radius: 6px; color: var(--text); font-size: 11.5px; word-break: break-all; }
.metar-foot { font-size: 11.5px; color: #5c6878; margin: 8px 0 0; }
.discname { font-weight: 700; color: var(--muted); margin: 14px 0 2px; font-size: 13px; }
main { max-width: 880px; margin: 0 auto; padding: 20px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

/* ---- NOW banner ---- */
.now {
  border-radius: 16px; padding: 22px; margin-bottom: 14px;
  border: 1px solid var(--line); background: var(--panel);
  position: relative;
}
.now::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--vc, #555); border-radius: 16px 0 0 16px;
}

/* hover/tap glossary tooltips */
.term { border-bottom: 1px dotted currentColor; cursor: help; position: relative; outline: none; }
.term:focus { color: var(--accent); }
.term:hover::after, .term:focus::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: calc(100% + 7px); z-index: 30;
  width: 250px; max-width: 72vw;
  background: #0b0f14; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font: 400 12.5px/1.45 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  letter-spacing: normal; text-transform: none; white-space: normal;
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
}
.now .verdict { font-size: 30px; font-weight: 700; letter-spacing: .3px; }
.now .vsub { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.now .stats { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0 4px; }
.nowbody { display: flex; gap: 16px; align-items: center; margin: 10px 0 4px; }
.nowbody-r { flex: 1; min-width: 0; }
.nowbody .stats { margin: 0; }
.compass { flex: 0 0 auto; line-height: 0; }
.compass .cmp-card { fill: var(--muted); font-size: 11px; font-weight: 600; font-family: inherit; }
.compass .cmp-deg { fill: #fff; font-size: 15px; font-weight: 700; font-family: inherit; }
.compass .cmp-from { fill: var(--muted); font-size: 10px; font-weight: 600; font-family: inherit; }
@media (max-width: 420px) { .nowbody { flex-direction: column; align-items: flex-start; } }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat .v { font-size: 20px; font-weight: 600; }
.reasons { margin: 12px 0 0; padding: 0; list-style: none; }
.reasons li { color: var(--muted); font-size: 14px; padding: 2px 0 2px 18px; position: relative; }
.reasons li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); }
.rating {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel2);
  border: 1px solid var(--line); font-size: 14px;
}
.rating b { color: var(--text); }
.wirecrew { color: #fbbf24; }

.u { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

/* confidence badge */
.conf {
  display: inline-block; font-size: 12px; font-weight: 600; border: 1px solid;
  border-radius: 999px; padding: 3px 10px; margin-bottom: 10px;
}
.conf.small { margin-bottom: 0; padding: 2px 8px; font-size: 11px; }

/* per-model chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; color: var(--muted); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.modelline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px !important; }
.mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.mini i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.headright { display: flex; align-items: center; gap: 8px; }

.legend { font-size: 12px; color: #5c6878; margin: 18px 2px 0; line-height: 1.6; }
.legend b { color: var(--muted); }

/* thermal + aloft stat rows */
.stats.thermal, .stats.aloft { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); align-items: center; }
.aloftflag { font-size: 12px; color: #fbbf24; align-self: center; }
.aloftflag.warn { color: var(--bad); font-weight: 600; margin-left: 8px; }

/* NWS independent source — dashed accent border */
.chip.indep { border-style: dashed; border-color: var(--accent); color: var(--text); }
.mini.indep i { box-shadow: 0 0 0 2px rgba(56,189,248,.4); }

/* criteria panel */
.criteria { margin: 20px 0 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.criteria summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; }
.criteria summary::-webkit-details-marker { display: none; }
.criteria summary:hover { background: var(--panel2); }
.criteria[open] summary { border-bottom: 1px solid var(--line); }
.cbody { padding: 4px 18px 16px; }
.cbody h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); margin: 18px 0 6px; }
.cbody ul { margin: 0; padding-left: 18px; }
.cbody li { font-size: 14px; color: var(--muted); margin: 3px 0; }
.cbody li b { color: var(--text); }
.cnote { font-size: 12.5px; color: #5c6878; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cnote code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; color: var(--text); }

.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .dual { grid-template-columns: 1fr; } }
.dual .now { margin-bottom: 0; }
.tag { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-bottom: 8px; }

/* ---- forecast days ---- */
h2.section { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 26px 0 10px; }
.day {
  border: 1px solid var(--line); background: var(--panel); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
}
.day .head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day .dname { font-weight: 600; }
.day .dsum { font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #06121a; white-space: nowrap; }
.day .dwhy { font-size: 13.5px; color: var(--text); margin-top: 8px; line-height: 1.4; }
.prov { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border-left: 3px solid var(--line); font-size: 13px; }
.prov.web { border-left-color: var(--accent); }
.prov.curated { border-left-color: var(--ok); }
.prov .provnote { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.prov .provsrc { margin: 6px 0 0; font-size: 12px; }
.prov .provsrc a { color: var(--accent); }
.prov .provwarn { margin: 6px 0 0; font-size: 12px; color: var(--warn); }

/* local pilot feedback */
.feedback { margin-top: 18px; }
.fbintro { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.fblist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.fbnote { background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.fbmeta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fbmeta b { color: var(--text); }
.fbkind { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; margin-right: 4px; background: var(--panel); }
.fbkind.tip { color: #4ade80; } .fbkind.inaccuracy { color: var(--warn); } .fbkind.general { color: var(--muted); }
.fbtext { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.fbform { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.fbrow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fbform input, .fbform select, .fbform textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none;
}
.fbform input { flex: 1; min-width: 0; }
.fbform textarea { width: 100%; box-sizing: border-box; resize: vertical; margin-bottom: 8px; }
.fbform input:focus, .fbform select:focus, .fbform textarea:focus { border-color: var(--accent); }
#fbSubmit { background: var(--accent); color: #06121f; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
#fbSubmit:disabled { opacity: .6; cursor: default; }
.fbmsg { font-size: 13px; color: var(--muted); }
.fbhp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fbturnstile { margin-bottom: 8px; }
.fbturnstile:empty { margin: 0; }

/* map home */
.map { height: calc(100vh - 168px); min-height: 380px; width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.mapwrap { position: relative; }
.nearme { position: absolute; top: 10px; left: 10px; z-index: 5; background: rgba(14,17,22,.92); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.nearme:hover { border-color: var(--accent); }
.maphint { color: var(--muted); font-size: 12.5px; margin: 10px 2px 0; }
.mapfallback { padding: 4px 0; }
.mfnote { color: var(--muted); margin: 0 0 12px; }
.mfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.mfsite { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); font-size: 14px; }
.mfsite:hover { background: var(--panel2); border-color: var(--accent); }
.mfsite span { color: var(--muted); font-size: 12px; flex: 0 0 auto; }
/* map pin info box (Google InfoWindow content) */
.iw { font: 14px/1.4 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; color: #16202b; min-width: 170px; }
.iw-name { font-weight: 700; font-size: 15px; }
.iw-sub { color: #5b6b7b; font-size: 12px; margin: 1px 0 7px; }
.iw-now { font-size: 13px; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.iw-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.iw-btn { width: 100%; background: #1e66f5; color: #fff; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.iw-btn:hover { background: #1550d0; }
/* advanced-marker pins (dot + zoom-gated pill label) */
.pin { display: flex; align-items: center; gap: 5px; transform: translateY(50%); cursor: pointer; }
.pin-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #0b1018; box-shadow: 0 1px 3px rgba(0,0,0,.55); flex: 0 0 auto; }
.pin-label { display: none; background: rgba(14,17,22,.88); color: #e7edf3; font: 600 11px/1 -apple-system, "Segoe UI", system-ui, sans-serif; padding: 3px 7px; border-radius: 6px; white-space: nowrap; border: 1px solid #2a323d; }
.pin.show-label .pin-label { display: inline-block; }
/* HTML pill labels (overlay, no Map ID) — name sits just below the dot */
.pinpill { position: absolute; transform: translate(-50%, 11px); background: rgba(14,17,22,.9); color: #e7edf3; font: 600 11px/1 -apple-system, "Segoe UI", system-ui, sans-serif; padding: 3px 7px; border-radius: 6px; white-space: nowrap; border: 1px solid #2a323d; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pinpill:hover { border-color: var(--accent); color: #fff; }
.day .best { font-size: 13px; color: var(--muted); margin-top: 6px; }
.day .best b { color: var(--text); }

/* hourly strip */
.strip { display: flex; gap: 3px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.cell {
  min-width: 38px; text-align: center; border-radius: 8px; padding: 6px 4px;
  background: var(--panel2); border: 1px solid var(--line); font-size: 11px;
}
.cell .ch { color: var(--muted); }
.cell .cbar { height: 5px; border-radius: 3px; margin: 5px 0; }
.cell .cw { font-weight: 600; }
.cell .cd { color: var(--muted); font-size: 10px; }

footer { max-width: 880px; margin: 10px auto 40px; padding: 0 20px; }
.disclaimer { font-size: 12.5px; color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.disclaimer strong { color: var(--text); }
.meta { font-size: 12px; color: #5c6878; text-align: center; margin-top: 14px; }
.tagline { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 12px; letter-spacing: .3px; }
.tagline b { color: var(--accent); letter-spacing: .5px; }
.err { color: #fca5a5; background: #2a1416; border: 1px solid #5b2020; padding: 14px; border-radius: 12px; }
