/* =========================================================================
   GREAT CIRCLE PRO — DESIGN v3 "Approach Plate"
========================================================================= */
:root {
  --bg: #0e1117; --panel: #141920; --panel2: #1a2130; --panel3: #1e2738;
  --border: #2a3a4e; --border2: #334a62; --accent: #2563eb; --accent-lt: #3b82f6;
  --accent2: #f59e0b; --accent3: #10b981; --accent4: #ec4899; --text: #e8edf4;
  --text2: #7a9ab8; --muted: #3d5670; --land: #1a1f2a; --land-stroke: #2a3344;
  --ocean: #0d1117; --graticule: #1a2230; --surround: #090c10;
  --tag-bg: rgba(37, 99, 235, 0.12); --label-size: 11px;
}
body.day {
  --bg: #f7f5f0; --panel: #ffffff; --panel2: #f3f1ec; --panel3: #eae7e0;
  --border: #d4cfc6; --border2: #b8b0a4; --accent: #1a6bff; --accent-lt: #4488ff;
  --accent2: #e87400; --accent3: #00a86b; --accent4: #d92b5a; --text: #1a1a1c;
  --text2: #4a4640; --muted: #8a847a; --land: #d8d0c0; --land-stroke: #bfb5a2;
  --ocean: #eceae4; --graticule: #d0cbc2; --surround: #eceae4;
  --tag-bg: rgba(26, 107, 255, 0.06);
}

/* ================= RESET & BASE ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--surround); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; min-height: 100vh; overflow: hidden; }
body.day .header-inner img, body.day img[alt="Great Circle PRO Logo"] { mix-blend-mode: multiply; }
button, input, select, textarea { font-family: inherit; }

/* ================= UI UTILITIES ================= */
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }

.gap-xs { gap: 4px; } .gap-sm { gap: 8px; } .gap-md { gap: 12px; }
.m-0 { margin: 0 !important; }
.mt-xs { margin-top: 4px; } .mt-sm { margin-top: 8px; } .mt-md { margin-top: 12px; }
.mb-xs { margin-bottom: 4px; } .mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 12px; }
.ml-sm { margin-left: 6px; } .pt-xs { padding-top: 2px; }

.w-100 { width: 100%; }
.text-accent { color: var(--accent); font-weight: 500; }
.text-muted { color: var(--muted); }

.helper-text-box { font-family: 'DM Mono', monospace; font-size: 10.5px; color: var(--text2); line-height: 1.6; background: var(--tag-bg); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 0 4px 4px 0; }
.disabled-zone { pointer-events: none; transition: all 0.25s ease-in-out; }
.disabled-zone .toggle-btn, .disabled-zone .wind-season-btn, .disabled-zone .wind-pct-btn { background: var(--panel2) !important; color: var(--muted) !important; border-color: var(--border) !important; opacity: 0.5 !important; cursor: default !important; }
.disabled-zone .toggle-btn.active, .disabled-zone .wind-season-btn.active, .disabled-zone .wind-pct-btn.active { background: var(--panel2) !important; color: var(--muted) !important; border-color: var(--border) !important; opacity: 0.5 !important; }
.disabled-zone label, .disabled-zone .ft-row label { color: var(--muted) !important; opacity: 0.6 !important; }
.data-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: var(--panel2); border: 1px solid var(--border); color: var(--muted); letter-spacing: 1px; }

/* ================= LAYOUT ================= */
#app { display: flex; height: 100vh; width: 100vw; }
#sidebar { width: 360px; min-width: 360px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 10; }
#header { flex-shrink: 0; border-bottom: 1px solid var(--border); }
.header-inner { padding: 12px 20px 8px; background: var(--panel); }
.header-sub { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 6px; text-align: center; line-height: 1.8; }
.header-links { display: flex; border-top: 1px solid var(--border); }
.header-links a, .header-links button { flex: 1; background: var(--panel2); border: none; border-right: 1px solid var(--border); color: var(--text2); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1px; cursor: pointer; padding: 12px 2px; transition: all 0.15s; text-transform: uppercase; text-decoration: none; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.header-links a:last-child, .header-links button:last-child { border-right: none; }
.header-links a:hover, .header-links button:hover { background: var(--panel3); color: var(--accent); }

#tabs { display: flex; background: var(--panel2); border-bottom: 2px solid var(--border); flex-shrink: 0; padding: 7px 8px; gap: 6px; height: 68px; align-items: stretch; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text2); border: 1px solid var(--border); border-radius: 6px; transition: all 0.15s; -webkit-user-select: none; user-select: none; opacity: 0.5; background: var(--panel3); padding: 0 4px; }
.tab .tab-icon { font-size: 18px; line-height: 1; }
.tab:hover { opacity: 0.85; border-color: var(--accent); color: var(--accent); background: var(--panel); }
.tab.active { color: #fff; background: linear-gradient(135deg, #1a6fff 0%, #0052cc 100%); border-color: #1a6fff; opacity: 1; box-shadow: 0 2px 10px rgba(0, 100, 255, 0.35); }

#panel-content { flex: 1; overflow-y: auto; padding: 10px 16px 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
#panel-content::-webkit-scrollbar { width: 4px; }
#panel-content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
#tab-routes, #tab-range, #tab-etops, #tab-flightplan { display: none; }
#tab-routes.active, #tab-range.active, #tab-etops.active, #tab-flightplan.active { display: block; }

/* ================= COMPONENTS ================= */
.section-label, .etops-step-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; color: var(--text); margin-top: 20px; margin-bottom: 0; padding: 8px 12px; background: var(--panel2); border: 1px solid var(--border); border-bottom: 2px solid var(--accent); border-radius: 5px 5px 0 0; display: flex; align-items: center; gap: 8px; line-height: 1; }
#tab-routes .section-label:first-of-type, #tab-flightplan .section-label:first-of-type, #tab-range .section-label:first-of-type, #tab-etops .etops-step-label:first-of-type { margin-top: 4px; }
.section-body { border: 1px solid var(--border); border-top: none; border-radius: 0 0 5px 5px; padding: 10px 12px; background: var(--panel2); }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* Forms & Inputs - Strict Appearance Overrides */
input[type="text"], input[type="number"], select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 9px 10px; font-family: 'DM Mono', monospace; font-size: 12px; outline: none; transition: border-color 0.15s; border-radius: 4px; appearance: none; -webkit-appearance: none; }
select { background-image: url('data:image/svg+xml;utf8,<svg fill="%237a9ab8" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); background-repeat: no-repeat; background-position: right 4px center; padding-right: 24px; cursor: pointer; }
input[type="text"], input[type="number"], select { text-transform: uppercase; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
input::placeholder, textarea::placeholder { color: var(--muted); text-transform: uppercase; font-size: 11px; }
#bulk-routes::placeholder { text-transform: none; font-size: 11px; line-height: 1.7; }
select option { background: var(--panel); text-transform: none; }

/* Color Picker */
input[type="color"].color-picker-btn { appearance: none; -webkit-appearance: none; width: 40px !important; height: 40px !important; padding: 2px; background: var(--panel); border: 1px solid var(--border); cursor: pointer; border-radius: 4px; display: inline-block; box-sizing: border-box; }
input[type="color"].color-picker-btn::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].color-picker-btn::-webkit-color-swatch { border: none; border-radius: 2px; }

/* Sliders */
input[type="range"] { -webkit-appearance: none; width: 100%; background: transparent; margin: 8px 0; display: block; }
input[type="range"]:focus { outline: none; }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 5px; cursor: pointer; background: var(--border2); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { height: 16px; width: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; -webkit-appearance: none; margin-top: -5.5px; box-shadow: 0 0 0 3px var(--panel2); transition: transform 0.1s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track { width: 100%; height: 5px; cursor: pointer; background: var(--border2); border-radius: 3px; }
input[type="range"]::-moz-range-thumb { height: 16px; width: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 0 3px var(--panel2); border: none; }
.disabled-zone input[type="range"]::-webkit-slider-thumb, .disabled-zone input[type="range"]::-moz-range-thumb { background: var(--muted); }

/* Buttons */
.btn { appearance: none; -webkit-appearance: none; width: 100%; padding: 10px 14px; background: var(--accent); border: 1px solid var(--accent); color: #fff; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; transition: all 0.15s; border-radius: 4px; display: block; }
.btn:hover { background: var(--accent-lt); border-color: var(--accent-lt); }
.btn.danger { background: transparent; border-color: #ef4444; color: #ef4444; }
.btn.danger:hover { background: #ef4444; color: #fff; }
.btn.acc2, .btn.etops-btn { background: transparent; border-color: var(--accent2); color: var(--accent2); }
.btn.acc2:hover, .btn.etops-btn:hover { background: var(--accent2); color: #000; }

/* Segmented Toggles (Off/On, Seasons, ETOPS) */
.toggle-btn, .wind-season-btn, .rating-btn { appearance: none; -webkit-appearance: none; flex: 1; padding: 8px 4px; font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; background: var(--panel3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; border-radius: 4px; transition: all 0.15s; text-align: center; }
.toggle-btn:hover, .wind-season-btn:hover, .rating-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn.active, .wind-season-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.rating-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.rating-btn.active { border-color: var(--accent2) !important; color: var(--accent2) !important; background: rgba(245, 158, 11, 0.1) !important; font-weight: 600; }
.etops-rating-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 6px; }

/* Flight Settings Rows */
.ft-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ft-row label { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text2); white-space: nowrap; min-width: 80px; align-self: center; }
.ft-row input[type="text"], .ft-row select { padding: 8px 10px; font-size: 11px; }
.ft-row input[type="number"] { -moz-appearance: textfield; padding: 8px 10px; font-size: 11px; text-align: center; }
.ft-row input[type="number"]::-webkit-outer-spin-button, .ft-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Tooltips & Info Boxes */
.wind-tooltip { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); background: var(--panel2); border: 1px solid var(--border2); border-radius: 5px; padding: 6px 8px; font-family: 'DM Mono', monospace; font-size: 9px; z-index: 500; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6); }
.wind-info-btn { appearance: none; -webkit-appearance: none; background: var(--panel3); border: 1px solid var(--border); border-radius: 50%; width: 16px; height: 16px; font-size: 9px; color: var(--text2); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: 'DM Mono', monospace; }
.wind-info-btn:hover { color: var(--accent); border-color: var(--accent); }
.wt-row { display: flex; gap: 6px; color: var(--muted); line-height: 1.7; align-items: baseline; }
.wt-row span:first-child { color: var(--text2); width: 68px; flex-shrink: 0; }
.wt-row span:nth-child(2) { color: var(--accent); width: 48px; flex-shrink: 0; font-weight: 500; }
.wt-lat { color: var(--muted); font-size: 8px; white-space: nowrap; }

.etops-info-box { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-bottom: 12px; font-family: 'DM Mono', monospace; font-size: 11px; line-height: 1.8; color: var(--text2); }
.etops-info-box strong { color: var(--accent2); font-size: 9px; display: block; margin-bottom: 6px; letter-spacing: 2px; text-transform: uppercase; }
.etops-info-box span { color: var(--accent2); }
.err { color: #ef4444; font-size: 10px; font-family: 'DM Mono', monospace; margin-top: 4px; padding-bottom: 4px;}


/* ================= CARDS & LISTS ================= */

/* --- ROUTE CARDS --- */
.route-item { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; transition: border-color 0.15s; position: relative; overflow: hidden; }
.route-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--route-accent, var(--accent)); border-radius: 3px 0 0 3px; }
.route-item:hover { border-color: var(--border2); }
.route-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.route-code { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; letter-spacing: 1px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 2px; vertical-align: middle; border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.route-delete { background: var(--panel3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; font-size: 12px; padding: 4px 8px; line-height: 1; border-radius: 4px; transition: all 0.15s; display: flex; align-items: center; justify-content: center; }
.route-delete:hover { color: #fff; background: #ef4444; border-color: #ef4444; }

.route-stats { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.route-stats .rs-dist { color: var(--text2); font-weight: 500; }
.route-stats .rs-hdg { color: var(--accent2); font-weight: 600; margin-left: 6px; }

.route-line-style { display: flex; align-items: center; gap: 8px; margin: 6px 0; background: var(--panel3); padding: 8px; border-radius: 4px; flex-wrap: wrap; border: 1px solid var(--border); }
.rls-label { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.rls-width { flex: 1; min-width: 60px; max-width: 100px; accent-color: var(--accent); cursor: pointer; height: 4px; }
.rls-dash-btn { appearance: none; -webkit-appearance: none; padding: 4px 10px; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600; cursor: pointer; background: var(--panel2); border: 1px solid var(--border); color: var(--text2); border-radius: 3px; transition: all 0.12s; line-height: 1; }
.rls-dash-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.rls-dash-btn.active { background: rgba(245, 158, 11, 0.15); border-color: var(--accent2); color: var(--accent2); }
.rls-w-val { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); min-width: 22px; text-align: right; }

.route-options { display: flex; gap: 6px; margin: 8px 0 2px; flex-wrap: wrap; }
.route-opt-btn { appearance: none; -webkit-appearance: none; padding: 6px 12px; font-size: 9px; font-family: 'DM Mono', monospace; border: 1px solid var(--border); background: var(--panel3); color: var(--text2); cursor: pointer; letter-spacing: 1px; text-transform: uppercase; transition: all 0.15s; border-radius: 4px; }
.route-opt-btn:hover { border-color: var(--accent); color: var(--accent); }
.route-opt-btn.active { border-color: var(--accent); color: var(--accent); background: var(--tag-bg); font-weight: 600; }

/* --- SLEEK MONOCHROMATIC FLIGHT PLAN CARDS --- */
.fp-panel { background: var(--panel3); border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin-top: 10px; font-family: 'DM Mono', monospace; font-size: 11px; line-height: 1.7; }
.fp-panel .fp-head { color: var(--text); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }

.fp-group { background: var(--panel2); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; }
.fp-group-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; font-weight: 700; display: block; color: var(--text2); border-bottom: 1px solid var(--border); padding-bottom: 4px; }

/* Forces neutral colors, overriding ANY app.js colorful injections */
.fp-group.time, .fp-group.sched, .fp-group.fuel, .fp-group.co2 { background: var(--panel2) !important; border-color: var(--border) !important; }
.fp-group.time .fp-group-label, .fp-group.sched .fp-group-label, .fp-group.fuel .fp-group-label, .fp-group.co2 .fp-group-label { color: var(--text2) !important; }

.fp-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; padding: 3px 0; }
.fp-row span:first-child { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.fp-row .fp-val { color: var(--text); font-weight: 500; text-align: right; }

/* Stripping the neon values injected by app.js */
.fp-row.highlight .fp-val, .fp-row.hl-time .fp-val, .fp-row.hl-sched .fp-val, .fp-row.hl-fuel .fp-val, .fp-row.hl-co2 .fp-val { color: var(--text) !important; font-weight: 600 !important; font-size: 11px !important; }

.fp-divider { border-top: 1px dashed var(--border); margin: 6px 0; }
.fp-tz { color: var(--muted); font-size: 9px; font-weight: 400; margin-left: 4px; }
.fp-note { color: var(--muted); font-size: 9px; margin-top: 6px; line-height: 1.5; border-top: 1px solid var(--border); padding-top: 6px; text-align: right; }

/* --- RANGE CIRCLES --- */
.range-item { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 13px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden; }
.range-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent3); border-radius: 3px 0 0 3px; }
.range-info { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text2); }
.range-info .airport { font-size: 14px; letter-spacing: 2px; color: var(--text); font-weight: 600; }

/* --- PIN CARDS --- */
.pin-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; position: relative; overflow: hidden; }
.pin-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pin-accent, #00d4aa); border-radius: 3px 0 0 3px; }
.pin-card:hover { border-color: var(--border2); }
.pin-card-header { display: flex; align-items: center; gap: 8px; }
.pin-color-swatch { appearance: none; -webkit-appearance: none; width: 22px !important; height: 22px !important; padding: 1px; background: var(--panel); border: 1px solid var(--border); cursor: pointer; border-radius: 4px; flex-shrink: 0; }
.pin-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.pin-color-swatch::-webkit-color-swatch { border: none; border-radius: 2px; }
.pin-code { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; color: var(--text); }
.pin-sub { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-delete { background: var(--panel3); border: 1px solid var(--border); color: var(--text2); cursor: pointer; font-size: 11px; padding: 3px 7px; line-height: 1; border-radius: 4px; transition: all 0.15s; margin-left: auto; flex-shrink: 0; }
.pin-delete:hover { color: #fff; background: #ef4444; border-color: #ef4444; }
.pin-sym-row { display: flex; gap: 3px; margin-top: 5px; padding-left: 30px; }
.pin-sym-btn { appearance: none; -webkit-appearance: none; width: 24px; height: 22px; padding: 0; font-size: 11px; line-height: 1; cursor: pointer; background: var(--panel3); border: 1px solid var(--border); color: var(--muted); border-radius: 3px; transition: all 0.12s; display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; text-rendering: geometricPrecision; }
.pin-sym-btn:hover { border-color: var(--accent3); color: var(--accent3); }
.pin-sym-btn.pin-sym-active { border-color: var(--accent3); color: var(--accent3); background: rgba(0, 212, 170, 0.1); }
.pin-coords { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 3px; padding-left: 30px; }

/* --- AIRCRAFT CARDS --- */
.aircraft-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.aircraft-card:hover { border-color: var(--accent2); background: var(--panel3); }
.aircraft-card.selected { border-color: var(--accent2); background: var(--panel3); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15); }
.aircraft-card .ac-name { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.aircraft-card .ac-stats { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text2); line-height: 1.9; }
.aircraft-card .ac-stats span { color: var(--text); font-weight: 500; }

/* --- ETOPS RESULTS --- */
.etops-result { background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-top: 12px; font-family: 'DM Mono', monospace; font-size: 11px; line-height: 1.9; }
.etops-result .ok { color: var(--accent3); font-weight: 600; }
.etops-result .warn { color: var(--accent2); font-weight: 600; }
.etops-result .fail { color: #ef4444; font-weight: 600; }
.etops-result .label { color: var(--muted); font-size: 9px; letter-spacing: 2px; text-transform: uppercase; display: block; margin-top: 10px; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); font-weight: 700; }

/* ================= MAP UI ================= */
#map-container { flex: 1; position: relative; overflow: hidden; background: var(--surround); cursor: crosshair; }
#map-container:active { cursor: grabbing; }

#theme-toggle, #map-fit-btn, .zoom-btn, #map-clear-routes, #map-clear-circles, #map-clear-etops, #style-btn, .proj-btn { appearance: none; -webkit-appearance: none; position: absolute; background: var(--panel); border: 1px solid var(--border); color: var(--text2); font-family: 'DM Mono', monospace; cursor: pointer; z-index: 10; border-radius: 4px; transition: all 0.15s; }

#map-toolbar { position: absolute; top: 14px; right: 14px; display: flex; z-index: 10; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
#map-toolbar button { position: static !important; border: none; border-right: 1px solid var(--border); background: transparent; font-family: 'DM Mono', monospace; font-size: 9px; padding: 7px 12px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; border-radius: 0; font-weight: 500; color: var(--text2); cursor: pointer; transition: all 0.15s; appearance: none; -webkit-appearance: none; display: flex; align-items: center; justify-content: center; width: auto; height: auto; }
#map-toolbar button:last-child { border-right: none; }
#map-toolbar button:hover { color: var(--accent); background: var(--panel2); }
#style-btn { font-size: 15px !important; padding: 7px 10px !important; }
#theme-toggle { padding: 7px 16px !important; }
/* ── Share button (inside zoom-controls column on desktop) ─────────────────── */
#share-btn {
  position: static;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent3);
  border-color: var(--border);
  gap: 0;
  font-size: 0;
}
#share-btn:hover {
  color: var(--accent3);
  border-color: var(--accent3);
  background: rgba(0, 212, 170, 0.12);
}
#share-btn:active { opacity: 0.8; }
#share-btn svg { flex-shrink: 0; }

/* ── Departure Time Slider ─────────────────────────────────────────────── */
.dep-time-row { align-items: flex-start !important; }
.dep-time-wrap { display: flex; flex-direction: column; gap: 5px; }
.dep-time-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 2px 0;
}
.dep-time-value {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 2px;
  line-height: 1;
}
.dep-time-unit {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
}
.dep-time-track-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dep-time-edge {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
input[type="range"].dep-time-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--accent2) 0%,
    var(--accent2) var(--dep-pct, 41.81%),
    var(--border2) var(--dep-pct, 41.81%),
    var(--border2) 100%
  );
}
input[type="range"].dep-time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent2);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245,158,11,0.55), 0 0 0 3px rgba(245,158,11,0.15);
  transition: box-shadow 0.12s;
}
input[type="range"].dep-time-slider:hover::-webkit-slider-thumb {
  box-shadow: 0 0 12px rgba(245,158,11,0.7), 0 0 0 5px rgba(245,158,11,0.2);
}
input[type="range"].dep-time-slider::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent2); cursor: pointer; border: none;
  box-shadow: 0 0 8px rgba(245,158,11,0.55);
}
.dep-time-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: -2px;
}
.dep-time-ticks span {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  color: var(--muted);
  width: 20px;
  text-align: center;
}

#zoom-controls { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 10; }
.zoom-btn { position: static; width: 34px; height: 34px; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; font-weight: 300; }
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--panel2); }

#map-clear-routes, #map-clear-circles, #map-clear-etops { bottom: 38px; background: rgba(20, 20, 30, 0.75); border: 1px solid var(--border); color: var(--muted); font-size: 9px; padding: 7px 11px; letter-spacing: 1.5px; text-transform: uppercase; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border-radius: 0; }
#map-clear-routes { left: 14px; border-radius: 6px 0 0 6px; border-right: none; } #map-clear-circles { left: 134px; border-right: none; } #map-clear-etops { left: 258px; border-radius: 0 6px 6px 0; }
#map-clear-routes:hover, #map-clear-circles:hover, #map-clear-etops:hover { color: var(--text); background: rgba(40, 45, 60, 0.85); border-color: var(--border2); }
body.day #map-clear-routes, body.day #map-clear-circles, body.day #map-clear-etops { background: rgba(255, 255, 255, 0.88); border-color: var(--border); color: var(--muted); }
body.day #map-clear-routes:hover, body.day #map-clear-circles:hover, body.day #map-clear-etops:hover { background: rgba(255, 255, 255, 0.95); color: var(--text2); border-color: var(--border2); }

#proj-bar { position: absolute; bottom: 38px; right: 14px; display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.proj-btn { position: static; border: none; border-right: 1px solid var(--border); background: transparent; font-size: 9px; padding: 7px 11px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; border-radius: 0; font-weight: 500; }
.proj-btn:last-child { border-right: none; }
.proj-btn:hover { color: var(--accent); background: var(--panel2); }
.proj-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

#ortho-hint { position: absolute; top: 170px; left: 14px; font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text2); background: var(--panel); padding: 6px 10px; border: 1px solid var(--border); display: none; pointer-events: none; letter-spacing: 1px; border-radius: 4px; text-transform: uppercase; }
#ortho-hint.show { display: block; }
#hud { position: absolute; top: 54px; right: 14px; font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text2); text-align: right; letter-spacing: 1px; line-height: 1.9; pointer-events: none; background: var(--panel); padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; white-space: nowrap; }
#hud .val { color: var(--accent); font-weight: 600; }

#map-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 12, 20, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);              /* night mode text */
  letter-spacing: 0.8px;
  padding: 5px 16px;
  text-align: center;
  z-index: 5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;             /* no ALL CAPS */
}

/* Daytime footer: lighter bg + darker text */
body.day #map-footer {
  background: rgba(127, 181, 212, 0.92);
  border-top-color: rgba(0, 0, 0, 0.12);
  color: #475569;                   /* darker, not black */
}

#map-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

/* Daytime links match darker text */
body.day #map-footer a {
  color: #2a4060;
}

#map-footer a:hover {
  color: var(--accent);
}


#map-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surround); z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
#map-loading.show { opacity: 1; pointer-events: all; }
#map-loading .ml-spinner { width: 32px; height: 32px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: ml-spin 0.7s linear infinite; margin-bottom: 14px; }
#map-loading .ml-text { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text2); letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
@keyframes ml-spin { to { transform: rotate(360deg); } }

/* ================= CRITICAL: SVG MAP ELEMENTS ================= */
/* Enforce fill: none on all path lines to prevent black fills! */
.great-circle, .great-circle-bg, .rhumb-line, .range-ring, 
.etops-bubble, .etops-bubble-cover, .etops-seg-ok, .etops-seg-gap { fill: none !important; }

.sphere { fill: var(--ocean); }
.land { fill: var(--land); stroke: var(--land-stroke); stroke-width: 0.4; }
.graticule { fill: none; stroke: var(--graticule); stroke-width: 0.4; }

.great-circle { stroke-width: 2.5; stroke-linecap: round; }
.great-circle-bg { stroke-width: 7; stroke-linecap: round; opacity: 0.07; }
.rhumb-line { stroke-width: 1.5; stroke-dasharray: 5, 3; opacity: 0.45; stroke-linecap: round; }
.range-ring { stroke-width: 2.5; stroke-linecap: round; opacity: 0.9; }

.airport-label { font-family: 'DM Mono', monospace; font-size: var(--label-size, 11px); font-weight: 500; letter-spacing: 1px; text-shadow: 0 0 8px var(--bg), 0 0 4px var(--bg); pointer-events: none; }
body.day .airport-label { text-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 0 6px #fff; font-weight: 700; font-size: var(--label-size, 12px); }
body.no-label-glow .airport-label { text-shadow: none; }
body.no-route-glow .great-circle-bg { display: none !important; }

/* ETOPS SVG Classes */
.etops-bubble { stroke: rgba(245, 158, 11, 0.28); stroke-width: 1; stroke-dasharray: 5, 3; }
.etops-bubble-cover { stroke: rgba(16, 185, 129, 0.28); stroke-width: 1; stroke-dasharray: 5, 3; }
.etops-gap-zone { fill: rgba(239, 68, 68, 0.07) !important; stroke: rgba(239, 68, 68, 0.45); stroke-width: 1.5; }
.etops-alt-label { font-family: 'DM Mono', monospace; font-size: 9px; fill: var(--accent2); text-shadow: 0 0 4px var(--bg); pointer-events: none; font-weight: 600; }
.etops-marker-label { font-family: 'DM Mono', monospace; font-size: 9px; fill: var(--accent4); text-shadow: 0 0 4px var(--bg); pointer-events: none; font-weight: 600; }
.etops-seg-ok { stroke: var(--accent3); stroke-width: 3; stroke-linecap: round; opacity: 0.85; }
.etops-seg-gap { stroke: #ef4444; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8, 4; }

/* ================= LEGENDS & PANELS ================= */
#legend { position: absolute; bottom: 75px; left: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text2); line-height: 2.2; display: none; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); transition: all 0.2s ease; z-index: 10; text-transform: uppercase; }
#legend.show { display: block; }
#legend-icon { padding: 6px 10px; font-size: 13px; text-align: center; color: var(--accent); }
#legend-body { display: none; padding: 10px 14px; padding-top: 0; }
#legend.expanded #legend-icon { display: none; }
#legend.expanded #legend-body { display: block; }

#share-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0, 212, 170, 0.95); color: #000; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: 1px; padding: 10px 22px; border-radius: 6px; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; white-space: nowrap; text-transform: uppercase; }
#share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Style Panel */
#style-panel { display: none; position: absolute; top: 52px; right: 14px; left: auto; width: 220px; background: var(--panel); border: 1px solid var(--border); border-top: 2px solid var(--accent2); z-index: 20; font-family: 'DM Mono', monospace; font-size: 10px; color: var(--text2); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35); border-radius: 4px; }
#style-panel.open { display: block; }
.sp-head { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text); font-weight: 700; padding: 10px 12px 6px; border-bottom: 1px solid var(--border); }
.sp-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 10px 12px 8px; border-bottom: 1px solid var(--border); }
.sp-preset { appearance: none; -webkit-appearance: none; padding: 6px 0; font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; text-align: center; background: var(--panel2); border: 1px solid var(--border); cursor: pointer; border-radius: 3px; color: var(--text2); transition: all 0.12s; }
.sp-preset:hover { border-color: var(--accent2); color: var(--accent2); }
.sp-preset.active { border-color: var(--accent2); background: rgba(245, 158, 11, 0.1); color: var(--accent2); }
.sp-pickers { padding: 10px 12px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sp-row label { font-size: 9px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--text2); }
.sp-row input[type="color"] { appearance: none; -webkit-appearance: none; width: 38px; height: 24px; padding: 1px 2px; border: 1px solid var(--border); background: var(--panel2); cursor: pointer; border-radius: 3px; }
.sp-reset { appearance: none; -webkit-appearance: none; width: 100%; padding: 7px 0; font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer; border-radius: 3px; margin-top: 2px; transition: all 0.12s; }
.sp-reset:hover { border-color: var(--accent); color: var(--accent); }

/* ================= MOBILE RESPONSIVENESS ================= */
#sidebar-toggle { display: none; position: fixed; bottom: 18px; left: 18px; z-index: 200; background: var(--accent); color: #fff; border: none; border-radius: 50%; width: 48px; height: 48px; font-size: 20px; cursor: pointer; box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4); }

/* Mobile base — mobile.css overrides most of these with !important.
   Keep only structural rules that mobile.css builds on. */
@media (max-width: 768px) {
  #app { flex-direction: row; height: 100dvh; overflow: hidden; }
  #mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 299; }
  #mobile-overlay.visible { display: block; }
  #share-toast { bottom: 140px; }
}

/* 390px overrides now in mobile.css */
/* ── Payload-Range Modal ────────────────────────────────────────── */
/* Map Tooltip (ETOPS hover info) */
#map-tooltip {
  display: none;
  position: absolute;
  z-index: 800;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  max-width: 280px;
  line-height: 1.5;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.tt-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.tt-sub {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
}
.tt-row span:first-child { color: var(--muted); }
.tt-row span:last-child { color: var(--text); font-weight: 500; text-align: right; }
.tt-warn {
  margin-top: 6px;
  padding: 4px 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 3px;
  color: #ef4444;
  font-size: 10px;
}

#pr-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
#pr-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 18px 22px;
  z-index: 9999;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
@media (max-width: 520px) {
  #pr-modal { width: 95vw; padding: 14px 12px; }
}

/* ── Payload Range Envelope — zone info row & tooltips ─────────────────── */
#pr-zone-row { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border2); }
.pr-zone-info { position: relative; }
.pr-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--panel);
  border: 1px solid;
  border-radius: 6px;
  padding: 12px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  line-height: 1.6;
  z-index: 10000;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.pr-tip.tip-left { left: 0; transform: none; }
.pr-tip.tip-right { left: auto; right: 0; transform: none; }
.pr-zone-info:hover .pr-tip,
.pr-zone-info:focus .pr-tip { display: block; }
