/* Regal Navigations V6.0 - Professional Maritime Navigation UI */
/* Copyright 2026 Regal Masters Team. All Rights Reserved. */

:root {
    --navy: #0a2e4d;
    --navy-light: #133d5e;
    --navy-dark: #061e33;
    --gold: #4fc3f7;
    --gold-light: #4fc3f7;
    --gold-dim: rgba(79,195,247,0.12);
    --sea: #1a6b8a;
    --sea-light: #2196a8;
    --danger: #d63031;
    --danger-dark: #b71c1c;
    --success: #27ae60;
    --warn: #f39c12;
    --text: #e8edf2;
    --text-dim: rgba(232,237,242,0.6);
    --text-muted: rgba(232,237,242,0.45);
    --panel-bg: rgba(10,46,77,0.96);
    --glass: rgba(10,46,77,0.85);
    --glass-border: rgba(255,255,255,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --font: Arial, Helvetica, sans-serif;
    --font-brand: Arial, Helvetica, sans-serif;
    --font-mono: Arial, Helvetica, sans-serif;
    --topbar-h: 75px;
    --map-controls-top: calc(var(--topbar-h) + var(--sat) + 5px);
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%; width: 100%;
    font-family: var(--font);
    background: var(--navy-dark);
    color: var(--text);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}
.screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; }
.hidden { display: none !important; }

/* ACTIVATION */
#activation-screen { display: flex; align-items: center; justify-content: center; background: var(--navy-dark); }
.activation-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(26,107,138,0.3) 0%, transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(79,195,247,0.1) 0%, transparent 50%); }
.activation-container { position: relative; z-index: 2; text-align: center; padding: 50px 40px; max-width: 440px; width: 92%; }
.activation-logo { margin-bottom: 16px; }
.activation-logo img { filter: drop-shadow(0 4px 20px rgba(79,195,247,0.3)); }
.brand-title { font-family: var(--font-brand); font-size: 28px; font-weight: 700; color: var(--gold-light); letter-spacing: 2px; text-transform: uppercase; }
.brand-subtitle { font-size: 13px; color: var(--text-dim); letter-spacing: 3px; text-transform: uppercase; margin-top: 6px; }
.license-input { margin: 40px 0 20px; text-align: left; }
.license-input label { display: block; font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.license-input input { width: 100%; padding: 18px 20px; font-size: 20px; font-family: var(--font-mono); letter-spacing: 3px; text-align: center; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.12); border-radius: var(--radius); color: var(--text); text-transform: uppercase; transition: border 0.3s, background 0.3s; }
.license-input input:focus { outline: none; border-color: var(--gold); background: rgba(79,195,247,0.06); }
.license-input input::placeholder { color: var(--text-muted); letter-spacing: 5px; }
.error-message { color: var(--danger); margin-top: 12px; font-size: 14px; }

/* BUTTONS */
.btn-gold { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy-dark); font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; font-family: var(--font); transition: transform 0.15s, box-shadow 0.3s; box-shadow: 0 4px 16px rgba(79,195,247,0.3); text-transform: uppercase; letter-spacing: 1px; }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(79,195,247,0.4); }
.btn-gold:active { transform: translateY(1px); }
.btn-xl { padding: 18px 36px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-md { padding: 12px 24px; font-size: 14px; }
.btn-sm { padding: 4px 12px; font-size: 11px; border-radius: 4px; cursor: pointer; border: none; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,0.08); color: var(--text); font-weight: 600; border: 1px solid var(--glass-border); border-radius: var(--radius); cursor: pointer; font-family: var(--font); transition: all 0.2s; }
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: var(--text); }
.btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--danger); color: white; font-weight: 700; border: none; border-radius: var(--radius-lg); cursor: pointer; font-family: var(--font); padding: 18px 40px; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-muted { background: rgba(255,255,255,0.08); color: var(--text-dim); border: 1px solid rgba(255,255,255,0.08); }
.btn-muted:hover { background: rgba(255,255,255,0.14); color: var(--text); }

/* ====== TOP BAR (new preview_v2 design) ====== */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: calc(4px + var(--sat)) 0 3px;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: calc(70px + var(--sat));
}
.top-row-main { display: flex; align-items: center; padding: 0 8px; }
.top-bar-left { flex: 1; min-width: 0; }
.hud-compass { flex: 0 0 auto; }
.top-bar-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }

/* Status indicator pills */
.status-pill {
    display: flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 4px;
    background: rgba(255,255,255,0.05);
}
.status-led {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s, box-shadow 0.3s;
}
.status-text {
    font-size: 8px; font-weight: 700; letter-spacing: 0.8px;
    color: rgba(255,255,255,0.3); text-transform: uppercase;
    transition: color 0.3s;
}
/* GPS: active = green NAV READY */
.status-pill#gps-status.active .status-led { background: #27ae60; box-shadow: 0 0 4px rgba(39,174,96,0.6); }
.status-pill#gps-status.active .status-text { color: #27ae60; }
/* GPS: error = red */
.status-pill#gps-status.error .status-led { background: #d63031; box-shadow: 0 0 4px rgba(214,48,49,0.6); }
.status-pill#gps-status.error .status-text { color: #d63031; }
/* Connection: active = green ONLINE */
.status-pill#connection-status.active .status-led { background: #27ae60; box-shadow: 0 0 4px rgba(39,174,96,0.6); }
.status-pill#connection-status.active .status-text { color: #27ae60; }
/* Connection: error = red OFFLINE */
.status-pill#connection-status.error .status-led { background: #d63031; box-shadow: 0 0 4px rgba(214,48,49,0.6); }
.status-pill#connection-status.error .status-text { color: #d63031; }

/* HUD Compass (open strip, no box) */
.hud-compass {
    flex: 1; display: flex; align-items: baseline; justify-content: center;
    gap: 3px; overflow: hidden; position: relative; padding: 4px 0;
}
.hud-seg {
    font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.2);
    min-width: 34px; text-align: center;
}
.hud-seg.near { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.45); }
.hud-seg.active { font-size: 24px; font-weight: 900; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.hud-seg.cardinal { color: #4fc3f7; }
.hud-seg.active.cardinal { font-size: 26px; color: #4fc3f7; text-shadow: 0 0 12px rgba(79,195,247,0.5); }
.hud-pointer {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px; background: #ff4444; border-radius: 2px;
    box-shadow: 0 0 6px rgba(255,68,68,0.6);
}
/* Stale COG dim */
.hud-compass.stale { opacity: 0.4; }
.hud-compass.stale .hud-pointer { background: var(--text-muted); box-shadow: none; }
/* V4: Device compass heading — blue pointer */
.hud-compass.compass-src .hud-pointer { background: #4fc3f7; box-shadow: 0 0 6px rgba(79,195,247,0.6); }
/* V4: Live GPS COG — red pointer (default) */
.hud-compass.cog-src .hud-pointer { background: #ff4444; box-shadow: 0 0 6px rgba(255,68,68,0.6); }

/* Coords row */
.top-row-coords { text-align: center; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.5); padding: 2px 0 1px; }

/* ====== MAP ====== */
#map { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }
.leaflet-control-zoom { display: none !important; }
.leaflet-control-attribution { font-size: 9px !important; opacity: 0.5; }
.boat-icon { transition: transform 0.3s ease; }
.boat-icon svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

/* ====== ZOOM BUTTONS ====== */
/* ====== LEFT: Center + Speed + Wind ====== */
.map-left-group {
    position: fixed; top: var(--map-controls-top); left: calc(10px + var(--sal));
    z-index: 50; display: flex; flex-direction: column; gap: 6px;
}
.map-speed {
    background: rgba(0,0,0,0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border-radius: 8px; padding: 6px 22px 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.map-speed-value {
    font-size: 48px; font-weight: 900; color: #fff; line-height: 1.1;
    letter-spacing: -1px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.map-speed-unit { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); letter-spacing: 2px; text-transform: uppercase; margin-top: 1px; }

/* ====== RIGHT: Stop + Layers + Menu ====== */
.map-right-group {
    position: fixed; top: var(--map-controls-top); right: calc(10px + var(--sar));
    z-index: 50; display: flex; flex-direction: column; gap: 6px; align-items: stretch; width: 74px;
}
.map-stop-btn {
    width: 74px; background: #d63031; color: white;
    font-size: 13px; font-weight: 900; letter-spacing: 2px;
    border: 2px solid rgba(255,255,255,0.35); border-radius: 8px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(214,48,49,0.5);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 8px 0;
}
.map-stop-btn .stop-icon { font-size: 18px; line-height: 1; }
.map-stop-btn .stop-label { font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.map-stop-btn:active { transform: scale(0.95); background: #b71c1c; }
.map-stop-btn.hidden { display: none; }

/* Notification badge */
.notif-badge { position: absolute; top: 4px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ef5350; box-shadow: 0 0 6px rgba(239,83,80,0.6); }
.notif-badge.hidden { display: none; }
.map-side-btn { position: relative; }
.map-side-btn {
    width: 74px; height: 48px; background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.map-side-btn:active { transform: scale(0.96); background: rgba(255,255,255,0.1); }
.map-side-btn .side-icon { line-height: 1; }
.map-side-btn .side-label { font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.55); letter-spacing: 1px; text-transform: uppercase; }

/* ── Notification Panel ── */
.notif-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; background: rgba(14,24,42,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 1px solid rgba(255,255,255,0.08); z-index: 300; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); display: flex; flex-direction: column; }
.notif-panel.open { transform: translateX(0); }
.notif-panel.hidden { display: flex; } /* keep flex, hidden only via transform */
.notif-panel-header { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.notif-panel-header h3 { font-size: 14px; font-weight: 700; color: #4fc3f7; letter-spacing: 0.5px; }
.notif-panel-close { background: none; border: none; color: rgba(255,255,255,0.4); font-size: 22px; cursor: pointer; padding: 0; line-height: 1; }
.notif-panel-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; display: flex; flex-direction: column; gap: 0; -webkit-overflow-scrolling: touch; }
.notif-card { border-radius: 10px; position: relative; margin-bottom: 12px; flex-shrink: 0; }
.notif-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 10px 0 0 10px; z-index: 1; }
.notif-card.type-info::before { background: #4fc3f7; }
.notif-card.type-warning::before { background: #ffb74d; }
.notif-card.type-promo::before { background: #66bb6a; }
.notif-card.type-update::before { background: #9575cd; }
.notif-card.type-info { background: rgba(79,195,247,0.06); border: 1px solid rgba(79,195,247,0.12); }
.notif-card.type-warning { background: rgba(255,183,77,0.06); border: 1px solid rgba(255,183,77,0.12); }
.notif-card.type-promo { background: rgba(102,187,106,0.06); border: 1px solid rgba(102,187,106,0.12); }
.notif-card.type-update { background: rgba(149,117,205,0.06); border: 1px solid rgba(149,117,205,0.12); }
.notif-card-img { width: 100%; max-height: 120px; object-fit: contain; display: block; background: rgba(0,0,0,0.3); border-radius: 10px 10px 0 0; }
.notif-card-body { padding: 12px 14px 14px 16px; }
.notif-card-type { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; border-radius: 4px; margin-bottom: 6px; }
.notif-card-type .type-dot { width: 6px; height: 6px; border-radius: 50%; }
.type-info .notif-card-type { background: rgba(79,195,247,0.15); color: #4fc3f7; }
.type-info .type-dot { background: #4fc3f7; }
.type-warning .notif-card-type { background: rgba(255,183,77,0.15); color: #ffb74d; }
.type-warning .type-dot { background: #ffb74d; }
.type-promo .notif-card-type { background: rgba(102,187,106,0.15); color: #66bb6a; }
.type-promo .type-dot { background: #66bb6a; }
.type-update .notif-card-type { background: rgba(149,117,205,0.15); color: #9575cd; }
.type-update .type-dot { background: #9575cd; }
.notif-card-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; word-wrap: break-word; }
.notif-card-msg { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 10px; word-wrap: break-word; }
.notif-card-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px; border-radius: 6px; text-decoration: none; font-size: 11px; font-weight: 700; margin-top: 2px; }
.type-info .notif-card-btn { background: #4fc3f7; color: #0a1628; }
.type-warning .notif-card-btn { background: #ffb74d; color: #3e2723; }
.type-promo .notif-card-btn { background: #66bb6a; color: #0a1628; }
.type-update .notif-card-btn { background: #9575cd; color: #fff; }
.notif-separator { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent); margin: 12px 0; flex-shrink: 0; }
.notif-empty { text-align: center; padding: 40px 20px; color: rgba(255,255,255,0.25); font-size: 12px; }

/* ── Waypoint Action Modal (centered) ── */
.wp-action-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.wp-action-overlay.hidden { display: none; }
.wp-action-modal { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,0.4); min-width: 260px; max-width: 320px; width: 90%; }
.wp-action-header { background: #f8f9fa; padding: 14px 18px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; }
.wp-action-icon { font-size: 22px; }
.wp-action-name { font-size: 16px; font-weight: 700; color: #1a2332; }
.wp-action-dist { font-size: 11px; color: #888; }
.wp-action-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.wp-action-nav-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; background: linear-gradient(135deg,#d4a012,#f2c94c); border: none; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 800; color: #0a2e4d; letter-spacing: 0.8px; box-shadow: 0 3px 12px rgba(212,160,18,0.3); font-family: inherit; }
.wp-action-nav-btn:active { transform: scale(0.97); }
.wp-action-row { display: flex; gap: 8px; }
.wp-action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; background: #f0f4f8; border: 1px solid #e0e4e8; border-radius: 8px; font-size: 12px; font-weight: 600; color: #555; cursor: pointer; font-family: inherit; }
.wp-action-btn:active { background: #e4e8ec; }
.wp-action-btn.wp-del { color: #d63031; border-color: rgba(214,48,49,0.2); }
.wp-action-btn.wp-del:active { background: #fbe9e7; }
@media (max-width:500px) { .notif-panel { width: 100%; } }

/* ====== NAV PANEL ====== */
/* ====== NAV PANEL SLIM V7.1 ====== */
.nav-panel-slim {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: rgba(10,18,32,0.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
}
.nav-toggle {
    cursor: pointer; user-select: none;
    padding: 8px 16px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.nav-toggle-pill { width: 28px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.15); position: absolute; top: 4px; left: 50%; transform: translateX(-50%); }
.nav-toggle-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: rgba(255,255,255,0.35); text-transform: uppercase; }
.nav-panel-slim.nav-active .nav-toggle-label { color: rgba(212,160,18,0.9); }
.nav-toggle-x { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #445; font-size: 13px; cursor: pointer; padding: 4px 8px; display: none; }
.nav-panel-slim.nav-active .nav-toggle-x { display: block; }
.nav-toggle-x:hover { color: #888; }
.nav-grid-wrap { overflow: hidden; max-height: 0; transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1); }
.nav-panel-slim.expanded .nav-grid-wrap { max-height: 70px; }
.nav-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; border-top: 1px solid rgba(255,255,255,0.05); }
.nav-cell { text-align: center; padding: 8px 4px 10px; border-right: 1px solid rgba(255,255,255,0.04); }
.nav-cell:last-child { border-right: none; }
.nav-cell.hl .nav-val { color: #4fc3f7; }
.nav-label-cell { font-size: 8px; font-weight: 700; letter-spacing: 1.2px; color: #556; text-transform: uppercase; margin-bottom: 1px; }
.nav-val { font-size: 20px; font-weight: 800; color: #fff; line-height: 1.1; }
.nav-val .nav-unit { font-size: 9px; font-weight: 600; color: #445; margin-left: 1px; }

/* ====== CENTER BUTTON (left group, matches wind indicator height) ====== */
.map-center-btn {
    background: rgba(0,0,0,0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: border-color 0.2s;
}
.map-center-btn:active { transform: scale(0.96); }
.map-center-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.center-label { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.map-center-btn.center-active { color: #4fc3f7; border-color: rgba(79,195,247,0.3); }
.map-center-btn.center-active svg { fill: #4fc3f7; }
.map-center-btn.center-inactive { color: #ff4444; border-color: rgba(255,68,68,0.3); }
.map-center-btn.center-inactive svg { fill: #ff4444; }

/* ====== TRIAL COUNTDOWN BAR ====== */
#trial-countdown-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 91; transition: bottom 0.3s cubic-bezier(0.4,0,0.2,1);
}
.trial-countdown-inner {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 6px 16px; background: linear-gradient(135deg, rgba(245,158,11,0.9), rgba(217,119,6,0.9));
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    font-size: 13px; font-weight: 600; color: #fff;
}
.trial-icon { font-size: 14px; }
.trial-text { letter-spacing: 0.3px; }
.trial-text strong { font-size: 15px; font-family: 'SF Mono', 'Consolas', monospace; letter-spacing: 1px; }
.trial-upgrade-btn {
    background: #fff; color: #d97706; padding: 3px 12px; border-radius: 4px;
    font-size: 11px; font-weight: 700; text-decoration: none; text-transform: uppercase;
    letter-spacing: 0.5px; white-space: nowrap;
}
.trial-upgrade-btn:active { opacity: 0.8; }
#trial-countdown-bar.trial-expired .trial-countdown-inner {
    background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(185,28,28,0.9));
}

/* ====== SLIDE PANELS ====== */
.slide-panel { position: fixed; top: 0; right: 0; width: 380px; max-width: 92%; height: 100%; background: var(--navy); box-shadow: var(--shadow); z-index: 2002; display: flex; flex-direction: column; animation: slideIn 0.3s ease; }
.slide-panel-sm { width: 360px; max-width: 92%; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--glass-border); }
.panel-header h2 { font-family: var(--font); font-size: 20px; font-weight: 800; color: #ffffff; }
.panel-close { width: 42px; height: 42px; background: rgba(255,255,255,0.08); border: none; color: #ffffff; font-size: 20px; font-weight: 700; border-radius: 50%; cursor: pointer; }
.panel-close:hover { background: rgba(255,255,255,0.15); }
.panel-actions { padding: 16px 20px; }
.panel-list { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

/* Waypoint items */
.wp-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.wp-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }
.wp-item-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; border: 2px solid rgba(255,255,255,0.15); }
.wp-item-info { flex: 1; }
.wp-item-name { font-weight: 600; font-size: 15px; }
.wp-item-pos { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.wp-item-actions { display: flex; gap: 6px; }
.wp-action-btn { padding: 8px 14px; font-size: 12px; font-weight: 700; border: none; border-radius: var(--radius-sm); cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.2s; }
.wp-nav-btn { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--navy-dark); }
.wp-nav-btn:hover { transform: scale(1.05); }
.wp-del-btn { background: rgba(214,48,49,0.15); color: var(--danger); }
.wp-del-btn:hover { background: rgba(214,48,49,0.3); }

/* ====== MODALS ====== */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 3000; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { background: var(--navy); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); width: 480px; max-width: 92%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-sm { width: 380px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--glass-border); }
.modal-header h2 { font-family: var(--font-brand); font-size: 18px; color: var(--gold-light); }
.modal-toprow { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
.modal-toprow-label { flex: 1; font-size: 14px; font-weight: 700; color: var(--gold-light); }
.modal-close { width: 28px; height: 28px; background: rgba(255,255,255,0.06); border: none; color: var(--text-dim); font-size: 14px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.modal-close:hover { background: rgba(255,255,255,0.1); color: #aaa; }
.modal-body { padding: 12px 14px; }
.modal-body.center { text-align: center; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--glass-border); }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 4px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="text"], textarea { width: 100%; padding: 14px 16px; background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 15px; transition: border 0.2s; }
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--gold); }
.input-lg { font-size: 18px; padding: 16px; }
.input-name { color: #4fc3f7; font-weight: 600; font-size: 15px; padding: 10px 12px; }
.input-name::placeholder { color: rgba(255,255,255,0.2); }
#wp-notes { color: #4fc3f7; }
.input-mono { font-family: var(--font-mono); }
textarea { resize: vertical; font-size: 14px; }
.icon-picker { display: flex; gap: 0; width: 100%; }
.icon-btn { flex: 1; aspect-ratio: 1; max-width: 44px; border: 2px solid rgba(255,255,255,0.08); border-radius: 7px; background: rgba(255,255,255,0.03); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0 2px; font-size: 18px; }
.icon-btn:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }
.icon-btn.active { border-color: var(--gold); background: rgba(212,160,18,0.12); box-shadow: 0 0 10px rgba(212,160,18,0.15); }
@media (max-width: 380px) { .icon-btn { font-size: 15px; margin: 0 1px; border-width: 1.5px; } }
.nav-confirm-stats { display: flex; gap: 30px; justify-content: center; margin-top: 20px; }
.stat-block { text-align: center; }
.stat-val { font-family: var(--font-mono); font-size: 32px; font-weight: 700; color: var(--gold-light); }
.stat-unit { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.mono-text { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }

/* ====== MOB OVERLAY ====== */
#mob-overlay { position: fixed; inset: 0; background: rgba(180, 20, 20, 0.95); z-index: 5000; display: flex; flex-direction: column; }
.mob-scroll-area { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: flex-start; justify-content: center; padding-top: 20px; }
.mob-content { text-align: center; color: white; padding: 20px; max-width: 420px; width: 100%; }
.mob-content h2 { font-size: 24px; font-family: var(--font-brand); letter-spacing: 3px; animation: mobFlash 1s infinite; }
@keyframes mobFlash { 0%,100% { opacity:1; } 50% { opacity:0.6; } }
.mob-coords { font-family: var(--font-mono); font-size: 18px; margin: 14px 0; opacity: 0.9; }
.mob-timer { font-family: var(--font-mono); font-size: 52px; font-weight: 700; margin: 14px 0; }
.mob-stats { display: flex; gap: 30px; justify-content: center; margin: 16px 0; }
.mob-stat-label { display: block; font-size: 12px; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }
.mob-stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.mob-cancel-bar { flex-shrink: 0; padding: 16px 20px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: rgba(120, 10, 10, 0.9); text-align: center; border-top: 1px solid rgba(255,255,255,0.15); }
.mob-cancel-bar .btn-danger { width: 100%; max-width: 360px; }
.mob-pulse-ring { position: absolute; top: 40%; left: 50%; width: 200px; height: 200px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; transform: translate(-50%, -50%); animation: mobPulse 2s infinite; pointer-events: none; }
@keyframes mobPulse { 0% { width:100px; height:100px; opacity:0.8; } 100% { width:400px; height:400px; opacity:0; } }

/* ====== SIDE MENU ====== */
.menu-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; }
.menu-drawer { position: fixed; top: 0; right: 0; width: 300px; max-width: 85%; height: 100%; background: var(--navy); border-left: 1px solid var(--glass-border); z-index: 2001; display: flex; flex-direction: column; animation: slideIn 0.25s ease; }
.menu-brand { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--glass-border); }
.menu-brand img { filter: drop-shadow(0 2px 8px rgba(79,195,247,0.3)); }
.menu-brand-name { font-family: var(--font); font-size: 18px; font-weight: 800; color: #ffffff; }
.menu-brand-ver { font-size: 14px; color: var(--text-dim); }
.menu-close-btn { margin-left: auto; width: 42px; height: 42px; background: rgba(255,255,255,0.08); border: none; color: #ffffff; font-size: 20px; font-weight: 700; border-radius: 50%; cursor: pointer; }
.menu-items { flex: 1; overflow-y: auto; padding: 12px 0; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: #ffffff; text-decoration: none; font-size: 15px; font-weight: 500; transition: all 0.2s; }
.menu-item:hover { background: rgba(255,255,255,0.04); }
.menu-item:active { background: rgba(255,255,255,0.08); }
.menu-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; background: rgba(255,255,255,0.06); }
.menu-item-mob { background: rgba(214,48,49,0.08); border: 1px solid rgba(214,48,49,0.2); border-radius: 10px; margin: 8px 12px; }
.menu-item-mob .menu-icon { background: rgba(214,48,49,0.2); }
.menu-item-mob:hover { background: rgba(214,48,49,0.15); }
.menu-divider { height: 1px; margin: 6px 20px; background: rgba(255,255,255,0.06); }
.menu-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 13px; color: var(--text-dim); display: flex; justify-content: space-between; }

/* ====== LAYER CONTROLS ====== */
.layer-section { margin-bottom: 24px; }
.layer-section h3 { font-size: 15px; color: #4fc3f7; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; font-weight: 800; }
.layer-section-header { padding: 12px 14px; color: #4fc3f7; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.basemap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 12px; border-bottom: 1px solid var(--glass-border); }
.basemap-opt { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 14px 10px; cursor: pointer; transition: all 0.2s; text-align: center; }
.basemap-opt:hover { background: rgba(79,195,247,0.06); border-color: rgba(79,195,247,0.3); }
.basemap-opt.selected { background: var(--gold-dim); border-color: var(--gold); box-shadow: 0 0 8px rgba(79,195,247,0.15); }
.basemap-opt .map-icon { font-size: 18px; margin-bottom: 6px; font-weight: 800; color: var(--text-dim); }
.basemap-opt .map-name { color: #ffffff; font-size: 14px; font-weight: 700; }
.basemap-opt.selected .map-name { color: #4fc3f7; }
.basemap-opt .map-detail { color: var(--text-dim); font-size: 11px; margin-top: 3px; }
.overlay-list { padding: 8px 10px; }
.overlay-item { margin-bottom: 6px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.06); transition: border-color 0.2s; overflow: hidden; }
.overlay-item:last-child { margin-bottom: 0; }
.overlay-item.active { border-color: rgba(79,195,247,0.35); background: rgba(79,195,247,0.04); }
.overlay-header { display: flex; align-items: center; gap: 10px; padding: 12px 12px; cursor: pointer; }
.overlay-header input[type="checkbox"] { accent-color: var(--gold); width: 20px; height: 20px; cursor: pointer; flex-shrink: 0; }
.overlay-header label { color: #ffffff; font-size: 15px; font-weight: 700; cursor: pointer; flex: 1; }
.feat-count { background: rgba(39,174,96,0.15); border: 1px solid rgba(39,174,96,0.3); border-radius: 4px; padding: 2px 7px; color: var(--success); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.overlay-detail { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; padding: 0 10px; }
.overlay-item.active .overlay-detail { max-height: 200px; padding: 0 10px 8px 10px; }
.overlay-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; padding-left: 30px; }
.otag { background: rgba(79,195,247,0.08); border: 1px solid rgba(79,195,247,0.2); border-radius: 4px; padding: 3px 8px; color: #4fc3f7; font-size: 12px; font-weight: 600; }
.otag.restriction { background: rgba(214,48,49,0.1); border-color: rgba(214,48,49,0.25); color: #ff6666; }
.otag.hot { background: rgba(255,34,34,0.15); border-color: rgba(255,34,34,0.35); color: #ff4444; }
.opacity-row { display: flex; align-items: center; gap: 8px; padding-left: 30px; }
.opacity-row span { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.opacity-row input[type="range"] { flex: 1; height: 4px; accent-color: var(--gold); cursor: pointer; }
.opacity-val { color: #4fc3f7; font-size: 13px; font-weight: 700; min-width: 32px; text-align: right; }
.mpa-legend { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; padding-left: 30px; }
.mpa-legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim); }
.mpa-legend-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.2); }

/* ====== OFFLINE MAPS ====== */
.offline-section { padding: 8px 12px; }
.offline-info { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); margin-bottom: 10px; border: 1px solid var(--glass-border); }
.offline-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); }
.offline-icon { font-size: 14px; }
.offline-storage { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.offline-save-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 10px; }
.offline-progress { padding: 10px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); border: 1px solid var(--glass-border); margin-bottom: 10px; }
.offline-progress-label { font-size: 12px; font-weight: 600; color: var(--gold-light); margin-bottom: 6px; }
.offline-progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.offline-progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 3px; width: 0%; transition: width 0.3s ease; }
.offline-progress-stats { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.offline-regions { display: flex; flex-direction: column; gap: 6px; }
.offline-region-card { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: rgba(79,195,247,0.06); border: 1px solid rgba(79,195,247,0.15); border-radius: var(--radius-sm); }
.offline-region-info { flex: 1; }
.offline-region-name { font-size: 14px; font-weight: 600; color: var(--text); }
.offline-region-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.offline-region-delete { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: background 0.2s; }
.offline-region-delete:hover { background: rgba(214,48,49,0.15); }
.offline-region-resume { background: none; border: none; color: var(--gold-light); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 4px; transition: background 0.2s; }
.offline-region-resume:hover { background: rgba(79,195,247,0.15); }
.offline-region-card.incomplete { border-color: rgba(255,107,107,0.3); background: rgba(255,107,107,0.05); }
.offline-select-bar { position: fixed; top: calc(var(--topbar-h) + 8px); left: 8px; right: 8px; z-index: 1001; background: var(--panel-bg); backdrop-filter: blur(12px); border: 1.5px solid rgba(79,195,247,0.3); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.offline-select-info { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gold-light); }
.offline-select-icon { font-size: 16px; }
.offline-select-stats { display: flex; gap: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.offline-select-stats span { background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 4px; }
.offline-select-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.polygon-draw-mode { cursor: crosshair !important; }
.polygon-draw-mode .leaflet-interactive { cursor: crosshair !important; }

/* ====== WEATHER ====== */
.weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.weather-card { padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.weather-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.weather-card-icon { font-size: 24px; line-height: 1; }
.weather-card-label { font-size: 15px; color: #81d4fa; text-transform: uppercase; font-weight: 800; letter-spacing: 1px; }
.weather-card-value { font-family: var(--font); font-size: 26px; font-weight: 700; color: #ffffff; }
.weather-card-full { grid-column: 1 / -1; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.weather-card-full .weather-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.weather-card-full .weather-card-value { font-size: 16px; font-weight: 600; color: var(--text); }

/* ====== LOADING ====== */
#loading-overlay { position: fixed; inset: 0; background: var(--navy-dark); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.loading-content { text-align: center; }
.loading-logo { margin-bottom: 24px; animation: loadPulse 2s infinite; }
@keyframes loadPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.7; transform:scale(0.95); } }
.spinner { width: 40px; height: 40px; margin: 0 auto 16px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading-message { font-size: 14px; color: var(--text-dim); }
.loading-inline { display: flex; align-items: center; gap: 12px; color: var(--text-dim); padding: 20px; }
.spinner-sm { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ====== ANCHOR WATCH ====== */
.anchor-setup { padding: 10px 0; }
.anchor-status-card { text-align: center; padding: 20px; background: rgba(39,174,96,0.1); border: 1.5px solid rgba(39,174,96,0.3); border-radius: var(--radius); margin-bottom: 20px; }
.anchor-status-card.alarm { background: rgba(214,48,49,0.15); border-color: rgba(214,48,49,0.5); animation: anchorAlarm 0.5s infinite; }
@keyframes anchorAlarm { 0%,100%{opacity:1} 50%{opacity:0.6} }
.anchor-status-text { font-size: 16px; font-weight: 600; }
.anchor-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.anchor-stat { text-align: center; padding: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.anchor-stat-label { display:block; font-size:12px; color:var(--text-muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:4px; }
.anchor-stat-value { display:block; font-family:var(--font-mono); font-size:18px; font-weight:700; color:var(--gold-light); }
.anchor-pos { text-align: center; font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); padding: 8px 0; }

/* ====== TRACKS ====== */
.track-item { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.track-item:hover { background: rgba(255,255,255,0.06); }
.track-item-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--sea); border: 2px solid rgba(255,255,255,0.15); }
.track-item-info { flex: 1; }
.track-item-name { font-weight: 600; font-size: 14px; }
.track-item-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.track-item-del { width: 32px; height: 32px; border: none; border-radius: 50%; background: rgba(214,48,49,0.1); color: var(--danger); cursor: pointer; font-size: 14px; transition: all 0.2s; }
.track-item-del:hover { background: rgba(214,48,49,0.25); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ====== SETTINGS ====== */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--glass-border); cursor: pointer; font-size: 14px; }
.toggle-row input[type="checkbox"] { display: none; }
.toggle-slider { width: 44px; height: 24px; background: rgba(255,255,255,0.15); border-radius: 12px; position: relative; transition: background 0.2s; }
.toggle-slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform 0.2s; }
.toggle-row input:checked + .toggle-slider { background: var(--gold); }
.toggle-row input:checked + .toggle-slider::after { transform: translateX(20px); }
.toggle-row input[type="radio"] { display: inline-block; width: 16px; height: 16px; accent-color: var(--gold); margin-right: 10px; flex-shrink: 0; }

/* ====== NIGHT MODE ====== */
body.night-mode { --text: #ff4444; --text-dim: rgba(255,68,68,0.5); --text-muted: rgba(255,68,68,0.3); --gold: #ff4444; --gold-light: #ff6666; --gold-dim: rgba(255,68,68,0.1); --panel-bg: rgba(20,0,0,0.96); --navy: #1a0000; --navy-dark: #0a0000; }
body.night-mode .leaflet-tile { filter: brightness(0.3) sepia(0.5) hue-rotate(-30deg); }

/* ====== RESPONSIVE ====== */
@media (orientation: landscape) and (max-height: 500px) {
    :root { --topbar-h: 55px; --map-controls-top: calc(var(--topbar-h) + var(--sat) + 5px); }
    .top-bar { padding: calc(2px + var(--sat)) 0 1px; min-height: calc(50px + var(--sat)); }
    .hud-compass { padding: 2px 0; }
    .top-row-coords { padding: 1px 0 0; font-size: 11px; }
    .hud-pointer { height: 2px; }
    .map-speed-value { font-size: 34px; }
    .map-speed { padding: 4px 14px 5px; }
    .map-stop-btn { width: 60px; height: 60px; font-size: 12px; }
    .map-side-btn { width: 60px; height: 40px; }
    .map-right-group { width: 60px; }
    .nav-val { font-size: 16px; }
    .map-center-btn { padding: 5px 10px; }
}
@media (max-width: 380px) {
    .hud-seg { font-size: 12px; min-width: 26px; }
    .hud-seg.near { font-size: 14px; }
    .hud-seg.active { font-size: 20px; }
    .hud-seg.active.cardinal { font-size: 22px; }
    .map-speed-value { font-size: 38px; }
    .map-speed { padding: 4px 16px 6px; }
    .map-stop-btn { width: 60px; height: 60px; font-size: 11px; }
    .map-side-btn { width: 60px; height: 40px; }
    .map-right-group { width: 60px; }
    .nav-val { font-size: 18px; }
    .map-center-btn { padding: 5px 10px; }
    .center-label { font-size: 9px; }
}
@media (min-width: 700px) and (orientation: portrait) {
    .hud-seg { font-size: 16px; min-width: 44px; }
    .hud-seg.near { font-size: 19px; }
    .hud-seg.active { font-size: 28px; }
    .hud-seg.active.cardinal { font-size: 30px; }
    .top-row-coords { font-size: 15px; }
    .map-speed-value { font-size: 56px; }
    .map-speed { padding: 8px 28px 10px; }
    .map-stop-btn { width: 82px; height: 82px; font-size: 15px; }
    .map-side-btn { width: 82px; height: 52px; }
    .map-right-group { width: 82px; }
    .nav-val { font-size: 26px; }
}
@media (min-width: 900px) and (orientation: landscape) {
    .hud-seg { font-size: 17px; min-width: 50px; }
    .hud-seg.near { font-size: 20px; }
    .hud-seg.active { font-size: 30px; }
    .hud-seg.active.cardinal { font-size: 32px; }
    .top-row-coords { font-size: 15px; }
    .map-speed-value { font-size: 58px; }
    .map-speed { padding: 8px 28px 10px; }
    .map-stop-btn { width: 82px; height: 82px; font-size: 15px; }
    .map-side-btn { width: 82px; height: 52px; }
    .map-right-group { width: 82px; }
    .nav-val { font-size: 28px; }
}

/* ====== WIND INDICATOR ====== */
.wind-indicator {
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 6px 12px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(79,195,247,0.25);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.wind-indicator.hidden { display: none !important; }
.wind-arrow-svg {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
    flex-shrink: 0;
}
.wind-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.wind-speed-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.wind-speed {
    font-size: 18px;
    line-height: 1;
}
.wind-unit {
    font-size: 10px;
    color: var(--text-dim);
}
.wind-dir {
    color: var(--gold);
    font-size: 11px;
    margin-left: 3px;
}
.wind-timestamp {
    font-size: 8px;
    color: var(--text-muted);
}
.wind-indicator.stale .wind-timestamp { color: var(--warn); }
.wind-indicator.offline .wind-timestamp { color: var(--danger); }

/* Water data widget */
.water-widget {
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    border: 1px solid rgba(79,195,247,0.25);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-width: 90px;
}
.water-widget.hidden { display: none !important; }
.water-title {
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}
.water-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    line-height: 1.4;
}
.water-label {
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}
.water-value {
    font-size: 16px;
    font-weight: 900;
    color: #4fc3f7;
    font-family: monospace;
    letter-spacing: -0.5px;
    text-shadow: 0 0 6px rgba(79,195,247,0.4);
}

/* Wind arrows on map */
.wind-arrow {
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
    cursor: pointer;
}
.wind-arrow svg {
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.7));
}
.wind-arrow:hover svg {
    filter: drop-shadow(0 0 4px currentColor) brightness(1.2);
}

/* Wind sub-toggles in layers panel */
.wind-sub-toggles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.toggle-row-sm {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
    cursor: pointer;
}
.toggle-row-sm input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--gold);
}

/* Responsive wind indicator */
@media (max-width: 480px) {
    .wind-indicator {
        padding: 5px 10px;
        gap: 6px;
    }
    .wind-speed { font-size: 16px; }
    .wind-arrow-svg { width: 20px; height: 8px; }
}

/* ====== TRACK LOG / FOOTPRINTS PANEL V7.1 ====== */
.track-section-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #556; padding: 10px 16px 4px; }
.show-all-bar { padding: 4px 16px 8px; display: flex; justify-content: space-between; align-items: center; }
.fp-count { font-size: 10px; color: #556; }
.show-all-btn { background: none; border: 1px solid rgba(255,255,255,0.12); color: #778; padding: 3px 10px; border-radius: 6px; font-size: 10px; cursor: pointer; font-weight: 600; }
.show-all-btn.active { border-color: #2a7; color: #3c9; background: rgba(42,170,100,0.06); }
.fp-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; transition: background 0.15s; }
.fp-item:hover { background: rgba(255,255,255,0.03); }
.fp-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fp-info { flex: 1; min-width: 0; }
.fp-name { font-size: 12px; font-weight: 600; color: #4fc3f7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-meta { font-size: 10px; color: #556; margin-top: 1px; }
.fp-toggle { width: 34px; height: 18px; border-radius: 9px; border: none; background: rgba(255,255,255,0.1); cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.fp-toggle.on { background: #1a6b3a; }
.fp-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #999; transition: transform 0.2s, background 0.2s; }
.fp-toggle.on::after { transform: translateX(16px); background: #3c9; }
.fp-delete { background: none; border: none; color: #444; font-size: 11px; cursor: pointer; padding: 4px; border-radius: 4px; flex-shrink: 0; }
.fp-delete:hover { color: #e74c3c; }
.track-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; }
.track-item:hover { background: rgba(255,255,255,0.03); }
.track-item-icon { font-size: 16px; flex-shrink: 0; }
.track-item-info { flex: 1; min-width: 0; }
.track-item-name { font-size: 12px; font-weight: 600; color: #4fc3f7; }
.track-item-meta { font-size: 10px; color: #556; margin-top: 1px; }
.track-item-del { background: none; border: none; color: #444; font-size: 11px; cursor: pointer; }
.track-item-del:hover { color: #e74c3c; }

/* ====== WAYPOINT LIST V7.1 ====== */
.wp-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); cursor: pointer; }
.wp-item:hover { background: rgba(255,255,255,0.03); }
.wp-item-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0; }
.wp-item-info { flex: 1; min-width: 0; }
.wp-item-name { font-size: 13px; font-weight: 600; color: #4fc3f7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-item-pos { font-size: 9px; color: #556; font-family: var(--font-mono); margin-top: 1px; }
.wp-item-actions { display: flex; gap: 3px; flex-shrink: 0; }
.wp-action-btn { width: 30px; height: 30px; border-radius: 7px; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.wp-nav-btn { background: rgba(212,160,18,0.15); color: #f2c94c; }
.wp-nav-btn:hover { background: rgba(212,160,18,0.3); }
.wp-edit-btn { background: rgba(255,255,255,0.06); color: #888; }
.wp-edit-btn:hover { background: rgba(255,255,255,0.1); color: #bbb; }
.wp-del-btn { background: rgba(231,76,60,0.08); color: #884; }
.wp-del-btn:hover { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* ====== XTE ALERT V7.1 ====== */
.xte-alert { padding: 8px 12px; background: rgba(0,170,255,0.1); border: 2px solid rgba(0,170,255,0.4); border-radius: 8px; margin: 8px 12px 0; font-size: 12px; font-weight: 700; color: #00aaff; text-align: center; animation: xtePulse 1.5s infinite; }
@keyframes xtePulse { 0%,100% { border-color: rgba(0,170,255,0.4); } 50% { border-color: rgba(0,170,255,0.8); } }

/* ============ V8: FEATURE GATING ============ */
.locked-feature { opacity: 0.4 !important; position: relative; }
.locked-feature::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; cursor: not-allowed; }
.menu-item.locked-feature { display: flex !important; align-items: center; }
.basemap-opt.locked-feature { pointer-events: none; }
.overlay-item.locked-feature { pointer-events: none; }
.overlay-item.locked-feature .overlay-header input { pointer-events: none; }

/* Upgrade modal animation */
#upgrade-modal > div { animation: modalIn 0.25s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
