:root { --bg:#0b0d10; --panel:#161a20; --line:#3a4350; --fg:#f7f9fb; --mute:#c5ced8; --acc:#ffb000; --ok:#5ee08a; --bad:#ff6b6b; --blue:#8ab4ff;
  --top-h: calc(48px + env(safe-area-inset-top, 0px));
  --nav-safe: max(24px, env(safe-area-inset-bottom, 0px));
  --tab-h: calc(52px + var(--nav-safe));
  --touch: 44px; }
* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: var(--tab-h); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); overflow-x: hidden; }
/* Thin gold outline around the app, matching Far Ridge Ballistics. */
body::after { content:""; pointer-events:none; position:fixed; inset:0; z-index:1000; border:2px solid var(--acc); box-sizing:border-box; }
.top { position:sticky; top:0; z-index:6; background:#000; border-bottom:1px solid var(--acc); padding:0 12px; padding-top: env(safe-area-inset-top, 0px); }
.top-row { display:flex; gap:8px; align-items:center; min-height: var(--touch); }
.top b { color:var(--acc); letter-spacing:.3px; font-size:18px; } .tag { color:var(--mute); font-size:13px; flex:1; }
.proto { font-size:11px; font-weight:800; letter-spacing:.6px; color:#000; background:var(--acc); border-radius:6px; padding:2px 6px; }
main { padding:10px 12px; max-width:720px; margin:0 auto; }
.tabs { position:fixed; bottom:0; left:0; right:0; display:flex; background:#000; border-top:1px solid var(--acc); padding-bottom: var(--nav-safe); z-index:30; }
.tabs a { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; color:var(--mute); text-decoration:none; min-height: var(--touch); padding:6px 0 8px; font-size:11px; font-weight:700; }
.tabs a span { display:block; font-size:20px; line-height:1; } .tabs a.on { color:var(--acc); }
select, input, textarea, button, .btn { font:inherit; font-size:16px; color:var(--fg); background:#0f1318; border:1px solid var(--line); border-radius:10px; padding:10px 12px; min-height: var(--touch); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline:2px solid var(--acc); outline-offset:1px; }
button, .btn { background:#222a34; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
button.primary { background:var(--acc); color:#000; border-color:var(--acc); }
button.sm { padding:8px 12px; font-size:14px; min-width:var(--touch); } button.danger { color:var(--bad); }
.card { background:var(--panel); border:1px solid var(--acc); border-radius:14px; padding:10px 12px; margin:10px 0; }
.card h2 { margin:2px 0 8px; font-size:15px; color:var(--mute); text-transform:uppercase; letter-spacing:.6px; }
.card h3 { margin:10px 0 6px; color:var(--mute); font-size:13px; }
h1 { font-size:20px; margin:8px 0; }
a { color:var(--acc); } a.ext { color:var(--blue); overflow-wrap:anywhere; }
.meta { color:var(--mute); font-size:12px; margin:8px 0; }
.warn { background:#2a1d00; border:1px solid #6b4b00; color:#ffd479; border-radius:10px; padding:8px 10px; font-size:13px; font-weight:600; margin:10px 0; }
.ok { color:var(--ok); } .bad { color:var(--bad); font-weight:700; }
.row { display:flex; flex-wrap:wrap; gap:8px; }
.fld { display:flex; flex-direction:column; gap:3px; flex:1 1 130px; min-width:0; font-size:13px; color:var(--mute); } .fld input, .fld select { width:100%; }
.seg { display:flex; gap:8px; overflow-x:auto; margin:6px 0 10px; padding-bottom:2px; -webkit-overflow-scrolling:touch; }
.seg button { flex:0 0 auto; } .seg button.on { background:var(--acc); color:#000; border-color:var(--acc); }
.seg.segmented { gap:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#0f1318; }
.seg.segmented button { flex:1 1 0; border:0; border-radius:0; border-right:1px solid var(--line); background:transparent; }
.seg.segmented button:last-child { border-right:0; } .seg.segmented button.on { background:var(--acc); color:#000; }

/* chips and badges */
.pend { display:inline-block; font-size:12px; font-weight:800; color:#ffd479; background:#2a1d00; border:1px dashed #b98300; border-radius:8px; padding:2px 8px; white-space:nowrap; }
.ex { display:inline-block; font-size:11px; font-weight:900; letter-spacing:.6px; text-transform:uppercase; color:#000; background:#c9a6ff; border-radius:6px; padding:1px 6px; vertical-align:middle; }
.kind { display:inline-block; font-size:11px; font-weight:800; color:var(--mute); border:1px solid var(--line); border-radius:6px; padding:1px 6px; text-transform:uppercase; letter-spacing:.4px; }
.cd { display:inline-block; font-weight:800; font-size:13px; border-radius:8px; padding:3px 8px; white-space:nowrap; border:1px solid var(--line); color:var(--mute); }
.cd.soon { background:#3a1a1a; border-color:#ff6b6b; color:#ffb4b4; } .cd.near { background:#2a1d00; border-color:var(--acc); color:var(--acc); } .cd.far { background:#102a1a; border-color:#2f8f57; color:var(--ok); } .cd.done { opacity:.7; }
.src { color:var(--mute); font-size:12px; margin-top:4px; } .vd { color:#8fd6a5; margin-left:4px; white-space:nowrap; }

/* hero */
.hero { background:#000; border:2px solid var(--acc); border-radius:16px; padding:14px; margin:10px 0; }
.hero .k { color:var(--acc); font-weight:800; font-size:13px; letter-spacing:.5px; text-transform:uppercase; }
.hero .big { font-size:54px; font-weight:800; line-height:1.05; font-variant-numeric:tabular-nums; margin:2px 0; } .hero .big small { font-size:20px; font-weight:800; color:var(--mute); }
.hero .t { font-size:17px; font-weight:700; } .hero .s { color:var(--mute); font-size:13px; margin-top:4px; }
.brandrow { display:flex; align-items:center; gap:12px; margin:8px 0 2px; } .brandrow img { width:64px; height:64px; border-radius:12px; border:1px solid var(--acc); }
.brandrow h1 { margin:0; font-size:20px; line-height:1.15; } .brandrow p { margin:2px 0 0; color:var(--mute); font-size:13px; }

/* list rows */
.ev { display:flex; gap:10px; padding:10px 0; border-top:1px solid var(--line); } .ev:first-of-type { border-top:0; }
.ev .dt { flex:0 0 52px; text-align:center; background:#0f1318; border:1px solid var(--line); border-radius:10px; padding:4px 0; align-self:flex-start; }
.ev .dt b { display:block; font-size:20px; line-height:1.1; color:var(--acc); } .ev .dt span { font-size:11px; color:var(--mute); text-transform:uppercase; font-weight:700; }
.ev .dt.txt { font-size:11px; padding:6px 2px; color:var(--mute); font-weight:700; }
.ev .bd { flex:1; min-width:0; } .ev .tt { font-weight:700; } .ev .sub { color:var(--mute); font-size:13px; margin-top:2px; } .ev .rt { flex:0 0 auto; text-align:right; }
.ev.past .tt { color:var(--mute); } .ev.pendrow { border:1px dashed #b98300; border-radius:10px; padding:8px; margin-top:8px; background:#1b1400; }
.sthead { display:flex; align-items:center; justify-content:space-between; gap:8px; } .sthead h2 { margin:0; color:var(--acc); font-size:17px; text-transform:none; letter-spacing:0; }
.cyc { font-size:12px; color:var(--mute); text-transform:uppercase; letter-spacing:.5px; font-weight:700; margin:10px 0 0; }

/* tables */
table.t { width:100%; border-collapse:collapse; font-size:14px; } table.t th { text-align:left; color:var(--mute); font-size:12px; padding:6px 4px; border-bottom:1px solid var(--line); }
table.t td { padding:8px 4px; border-bottom:1px solid var(--line); vertical-align:top; } table.t td.n, table.t th.n { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
table.t tr.tot td { font-weight:800; color:var(--acc); border-top:2px solid var(--acc); }
table.t .nt { color:var(--mute); font-size:12px; display:block; font-weight:400; }
.calc { background:#0f1318; border:1px solid var(--line); border-radius:10px; padding:8px 10px; margin-top:8px; font-size:14px; } .calc b { color:var(--acc); }

/* promo */
.promo { display:flex; gap:12px; align-items:flex-start; background:linear-gradient(135deg,#1c1608,#10141a); border:1px solid var(--acc); border-radius:14px; padding:12px; margin:10px 0; }
.promo img { border-radius:10px; flex:0 0 auto; } .promo p { margin:3px 0 8px; font-size:14px; color:var(--mute); } .promo-btn { background:var(--acc); color:#000; border-color:var(--acc); font-size:14px; min-height:40px; padding:8px 12px; }
.promo.mini { align-items:center; padding:8px 10px; margin:8px 0 4px; font-size:13px; color:var(--mute); } .promo.mini b { color:var(--acc); }

/* tiles */
.tiles { display:grid; grid-template-columns:1fr 1fr; gap:8px; } .tile { display:block; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px; text-decoration:none; color:var(--fg); min-height:78px; }
.tile b { color:var(--acc); display:block; font-size:15px; } .tile span { color:var(--mute); font-size:12px; } .tile i { font-style:normal; font-size:22px; display:block; }
.backbar { display:flex; align-items:center; gap:10px; } .backbar a { text-decoration:none; font-size:26px; min-width:var(--touch); min-height:var(--touch); display:flex; align-items:center; justify-content:center; } .backbar h1 { margin:0; }
.statepill { display:inline-block; font-weight:800; border:1px solid var(--acc); border-radius:8px; padding:1px 7px; color:var(--acc); font-size:13px; margin-right:6px; }
ul.plain { margin:6px 0; padding-left:1.2em; } ul.plain li { margin:5px 0; }
.stlist a.stitem { display:flex; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--line); text-decoration:none; color:var(--fg); } .stlist a.stitem:first-child { border-top:0; }
.stitem .code { flex:0 0 44px; text-align:center; font-weight:900; color:var(--acc); border:1px solid var(--acc); border-radius:10px; padding:6px 0; }
.stitem .nm { flex:1; } .stitem .nm small { display:block; color:var(--mute); font-size:12px; }
.pt { display:flex; align-items:center; gap:8px; padding:10px 0; border-top:1px solid var(--line); } .pt:first-of-type { border-top:0; } .pt .bd { flex:1; min-width:0; } .pt .n { font-size:26px; font-weight:800; min-width:34px; text-align:center; color:var(--acc); }
.status { font-size:12px; font-weight:800; border-radius:8px; padding:2px 8px; border:1px solid var(--line); text-transform:uppercase; letter-spacing:.3px; }
.status.drawn { color:var(--ok); border-color:#2f8f57; } .status.not { color:var(--bad); border-color:#8f2f2f; } .status.pending, .status.planned { color:var(--acc); border-color:#8a6200; } .status.applied { color:var(--blue); border-color:#3d5c99; }
.switch { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:var(--touch); border-top:1px solid var(--line); } .switch:first-of-type { border-top:0; }
.switch input { width:24px; height:24px; accent-color:var(--acc); min-height:0; }
.cmp td input { width:100%; min-width:70px; padding:6px 8px; min-height:38px; text-align:right; font-variant-numeric:tabular-nums; }
.lock { color:var(--mute); }
.vcard h3 { color:var(--fg); font-size:16px; margin:0 0 4px; }
footer.foot { text-align:center; color:var(--mute); font-size:12px; margin:16px 0 8px; } footer.foot b { color:var(--acc); }

table.t.fixed { table-layout:fixed; } table.t.fixed th:first-child, table.t.fixed td:first-child { width:36%; }
.cmp td input { min-width:0; }
.glance { display:grid; grid-template-columns:1fr; gap:0; } .glance .g { display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-top:1px solid var(--line); } .glance .g:first-child { border-top:0; }
.glance .g span:first-child { color:var(--mute); font-size:14px; } .glance .g b { text-align:right; } .glance .g b.acc { color:var(--acc); }

.yr { display:inline-block; margin:4px 0 6px; padding:3px 9px; border:1px solid var(--line); border-radius:8px; background:#171b20; color:#e9d9a8; font-size:12.5px; line-height:1.35; }
.txtcell { font-weight:700; }
ol.steps { margin:8px 0 4px 20px; padding:0; } ol.steps li { margin:7px 0; color:var(--fg); font-size:14.5px; line-height:1.4; }

.glance .g b .licyr { display:block; font-size:12px; font-weight:400; color:var(--mute); }

.top-row { padding:4px 0; } .top .brand-mark { width:40px; height:40px; border-radius:6px; flex:none; }
.top b.brandname { flex:1; font-size:15px; line-height:1.2; letter-spacing:.2px; }
.brandrow img { width:92px !important; height:92px !important; border-radius:10px; border:1px solid var(--acc); }
.brandrow h1 { font-size:21px; }

a.promo-btn { display:inline-block; text-decoration:none; text-align:center; font-weight:700; } .promo .promo-sub { margin:6px 0 0; font-size:12px; }
.promo.mini a.promo-link { color:var(--acc); font-weight:700; white-space:normal; }

/* ---- Offline topo map (USGS The National Map) ---- */
.maphead { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.maphead h1 { margin:6px 0; }
a.linkbtn { color:var(--acc); text-decoration:none; font-weight:700; }
.legal { background:#2b2410; border:1px solid var(--acc); color:var(--fg); border-radius:10px; padding:8px 10px; font-size:14px; font-weight:700; margin:6px 0 8px; }
.mapwrap { position:relative; }
.map { height:58vh; min-height:300px; border-radius:12px; overflow:hidden; border:1px solid var(--line); background:#dcd8cc; }
.mapbtns { position:absolute; left:8px; top:8px; display:flex; gap:6px; z-index:5; }
.mapbtns button { background:#fff; color:#111; border:1px solid #888; box-shadow:0 1px 4px rgba(0,0,0,.35); }
.mapbtns button[aria-pressed="true"] { background:#1a73e8; color:#fff; border-color:#1a73e8; }
.drawhint { position:absolute; left:50%; bottom:34px; transform:translateX(-50%); background:rgba(0,0,0,.8); color:#fff; padding:6px 10px; border-radius:8px; font-size:13px; z-index:5; }
.gpsinfo { min-height:20px; }
.est { margin:10px 0; } .est b { color:var(--acc); }
.prog { margin:10px 0; } .prog .bar { height:10px; background:#2a3038; border-radius:6px; overflow:hidden; } .prog .bar i { display:block; height:100%; background:var(--acc); }
.okmsg { margin-top:8px; color:var(--ok); font-weight:700; }
.credit { color:var(--mute); font-size:12px; margin:10px 2px 16px; }
button.stitem.asbtn { width:100%; text-align:left; background:none; border:0; border-bottom:1px solid var(--line); color:var(--fg); display:flex; align-items:center; gap:10px; padding:10px 2px; font:inherit; }
.heading { width:48px; height:48px; pointer-events:none; }
.heading::before { content:''; position:absolute; left:15px; top:0; width:0; height:0; border-left:9px solid transparent; border-right:9px solid transparent; border-bottom:15px solid #1a73e8; filter:drop-shadow(0 0 1.5px #fff); }
.maplibregl-ctrl-attrib { font-size:11px; }
a.pchip { display:inline-flex; align-items:center; gap:4px; text-decoration:none; color:var(--mute); font-size:13px; margin:2px 8px 2px 0; }
.sprow { align-items:flex-end; }
/* trip dope card */
.printcard .cardlogo { width:140px; height:auto; display:block; margin:0 auto 6px; }
@media print {
  html, body { background:#fff !important; color:#000 !important; }
  .printcard h2 { color:#000 !important; }
  body::after, .top, .tabs, .backbar, .warn, .noprint, footer { display:none !important; }
  main { padding:0 !important; }
  .printcard { border:1px solid #000 !important; background:#fff !important; color:#000 !important; }
  .printcard .meta, .printcard table.t td, .printcard table.t th { color:#000 !important; }
}
/* ---------- v5 ---------- */
.splash { position:fixed; inset:0; z-index:2000; background:#000; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:var(--acc); font-weight:800; letter-spacing:.6px; transition:opacity .35s; }
.splash img { width:min(220px, 60vw); height:auto; border-radius:18px; } .splash.gone { opacity:0; pointer-events:none; }
.brandlink { display:flex; gap:8px; align-items:center; text-decoration:none; flex:1; min-width:0; } .brandlink b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.moreicon { color:var(--acc); text-decoration:none; font-size:24px; min-width:var(--touch); min-height:var(--touch); display:inline-flex; align-items:center; justify-content:center; }
.banner { background:#3a1d1d; color:#ffd2d2; border-top:1px solid #6b2b2b; font-size:12px; font-weight:700; text-align:center; padding:3px 6px; margin:0 -12px; }
.pastchip { display:inline-block; font-size:11px; font-weight:800; color:#000; background:#9aa4ae; border-radius:6px; padding:1px 6px; margin-left:6px; vertical-align:middle; }
.warnline { color:#ffd479; } .wide { flex-basis:100%; } button.wide { width:100%; }
button.on, button.sm.on { background:var(--acc); color:#000; border-color:var(--acc); }
.presets { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:8px; margin:8px 0; }
.preset { display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:2px; padding:10px; }
.preset small { color:var(--mute); font-weight:500; font-size:12px; } .preset.on small { color:#000; }
.capmeter { margin:8px 0; font-size:14px; } .capmeter .bar { height:10px; background:#2a3038; border-radius:6px; overflow:hidden; margin-bottom:4px; }
.capmeter .bar i { display:block; height:100%; background:var(--acc); }
.pinmark { width:22px; height:30px; background:var(--acc); border:2px solid #000; border-radius:50% 50% 50% 0; transform:rotate(-45deg); box-shadow:0 1px 4px #000a; }
.wpmark { min-width:28px; height:28px; padding:0 6px; border-radius:14px; background:#000; color:var(--acc); border:2px solid var(--acc); font-size:12px; font-weight:800; display:flex; align-items:center; justify-content:center; white-space:nowrap; }
.big-live { font-size:22px; font-weight:800; color:var(--fg); margin:4px 0 6px; }
.tools .row { margin:6px 0; }
.lightcard { text-align:center; }
.lightbig { font-size:30px; font-weight:900; letter-spacing:1px; margin:4px 0 0; }
.lightbig.open { color:var(--ok); } .lightbig.closed { color:var(--bad); }
.lightsub { font-size:22px; font-weight:800; margin:2px 0 4px; } .lightnote { color:var(--mute); font-size:13px; } .lightline { font-size:14px; }
.hrlink a { margin:0 6px; } .wxsrc { color:var(--mute); font-size:12px; }
.legal.padus { font-weight:500; font-size:13px; }
.feeline { padding:8px 0; border-bottom:1px solid #2a3038; font-size:14px; } .feeline > div { margin-top:3px; color:var(--mute); font-size:12px; }
.feeline .fl-top { display:flex; justify-content:space-between; gap:10px; color:var(--fg); font-size:15px; margin:0; } .feeline .fl-top b { color:var(--acc); text-align:right; max-width:55%; flex:0 0 auto; } .feeline .fl-top span { flex:1 1 auto; min-width:0; }
.radio { display:flex; gap:8px; align-items:center; min-height:var(--touch); font-size:15px; } .radio input { min-height:auto; width:20px; height:20px; }
.gearrow { display:flex; gap:10px; align-items:center; min-height:var(--touch); border-bottom:1px solid #2a3038; } .gearrow input { width:22px; height:22px; min-height:auto; }
.gearrow.packed span { color:var(--mute); text-decoration:line-through; }
.wprow .tt { font-size:16px; } .wpphoto img, #wp-photo-prev img { max-width:160px; max-height:120px; border-radius:8px; border:1px solid var(--line); display:block; margin:6px 0; }
.leftoff { border-color:var(--ok); }
.welcome { max-width:520px; margin:0 auto; } .welcome-logo { display:block; width:140px; height:auto; margin:10px auto; border-radius:14px; }
.wcard { display:flex; gap:12px; align-items:flex-start; } .wnum { flex:0 0 32px; height:32px; border-radius:16px; background:var(--acc); color:#000; font-weight:900; display:flex; align-items:center; justify-content:center; }
body.on-welcome .tabs, body.on-welcome .banner { display:none; }
.lbt { width:100%; border-collapse:collapse; font-size:14px; } .lbt td, .lbt th { border:1px solid #556; padding:4px 6px; text-align:left; }
.lbsketch { width:100%; max-width:420px; height:auto; display:block; margin:8px auto; }
.lbfoot { text-align:center; font-size:16px; margin-top:12px; } .backby { font-size:20px; font-weight:900; }
@media print {
  .banner, .splash, #tabs { display:none !important; }
  #leave-card .lbt td, #leave-card .lbt th { border-color:#000 !important; color:#000 !important; }
  #leave-card, #leave-card * { color:#000 !important; }
}
