:root { --primary: #3498db; --secondary: #2ecc71; --warning: #f1c40f; --danger: #e74c3c; --bg: #121212; --card: #1e1e1e; --text: #eeeeee; --dash-column: rgba(255,255,255,0.03); --pill-bg: #111; }

/* DESKTOP APP UI LOCK - EDGE TO EDGE */
html, body { height: 100%; width: 100vw; overflow: hidden; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); display: flex; flex-direction: column; align-items: center; box-sizing: border-box; transition: background 0.3s, color 0.3s; }

.container { position: relative; width: 100%; height: 100%; background: var(--bg); transition: background 0.3s; display: flex; flex-direction: column; overflow: hidden;}

/* --- LIGHT MODE OVERRIDES --- */
body.light-mode { --bg: #e9ecef; --card: #ffffff; --text: #2c3e50; --dash-column: rgba(0,0,0,0.03); --pill-bg: #d1d8e0; }
body.light-mode .control-row { border-bottom-color: #ecf0f1; }
body.light-mode input[type="text"], body.light-mode input[type="number"], body.light-mode select { background: #fff; color: #2c3e50; border-color: #bdc3c7; }
body.light-mode .dashboard { background: #f8f9fa; border-bottom-color: #ecf0f1; }
body.light-mode .data-card { border-left-color: #bdc3c7; }
body.light-mode .data-value { color: #2c3e50; }
body.light-mode .graph-container { background: #fff; border-top-color: #bdc3c7; }
body.light-mode .station-box { background: #f8f9fa; border-color: #d1d8e0; }
body.light-mode .toggle-container { background: #fff; border-color: #bdc3c7; }
body.light-mode .toggle-btn { color: #7f8c8d; }
body.light-mode .toggle-btn.active { background: var(--primary); color: white; }
body.light-mode .tab-btn { color: #7f8c8d; }
body.light-mode .tab-btn.active { background: #fff; color: var(--primary); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
body.light-mode .obstacle-table th { border-bottom-color: #bdc3c7; color: #7f8c8d; }
body.light-mode .obstacle-table td { border-bottom-color: #ecf0f1; color: #2c3e50; }
body.light-mode .obstacle-table tr:hover td { background: #f1f2f6; }
body.light-mode h3, body.light-mode .step-header .tip { color: #2c3e50 !important; }
body.light-mode .status-banner { border-bottom-color: #d1d8e0; }
body.light-mode .modal-content { background: #fff; color: #2c3e50; border: 1px solid #bdc3c7; }
body.light-mode .modal-header { border-bottom: 1px solid #ecf0f1; }
body.light-mode .map-header { background: transparent !important; border-bottom: none !important; }
body.light-mode .dropdown-content { background-color: #fff; border-color: #bdc3c7; }
body.light-mode .dropdown-content a { color: #2c3e50; border-bottom-color: #ecf0f1; }
body.light-mode .dropdown-content a:hover { background-color: #f1f2f6; }
body.light-mode .right-panel { background: rgba(0,0,0,0.03); border-color: #e0e0e0; }
body.light-mode .left-panel { border-right-color: #d1d8e0; background: #fff; }
body.light-mode .dash-col { background: var(--dash-column); }
body.light-mode .app-grid { border-color: #bdc3c7; }
body.light-mode .left-panel::-webkit-scrollbar-thumb { background: #bdc3c7; }
body.light-mode .left-panel::-webkit-scrollbar-thumb:hover { background: #95a5a6; }
body.light-mode .right-panel::-webkit-scrollbar-thumb { background: #bdc3c7; }
body.light-mode .right-panel::-webkit-scrollbar-thumb:hover { background: #95a5a6; }
body.light-mode .ghost-btn { border-color: #bdc3c7; color: #7f8c8d; }
body.light-mode .input-row-merged input { border-color: #bdc3c7; }
body.light-mode .input-row-merged button { border-color: #bdc3c7; border-left-color: #ecf0f1; background: #f8f9fa; color: #2c3e50;}
body.light-mode .input-row-merged button:hover { background: #e9ecef; }
body.light-mode #overview-container, body.light-mode #obstacle-container { background: #fff !important; border-color: #bdc3c7 !important; }
body.light-mode #overview-container h3, body.light-mode #obstacle-container h3 { color: #2c3e50 !important; }
body.light-mode .frame-pill { border-color: #bdc3c7; color: #7f8c8d; background: rgba(255,255,255,0.9); backdrop-filter: blur(4px);}
body.light-mode .frame-pill:hover { color: #111; background: rgba(255,255,255,1); }
body.light-mode .dir-sub-panel { background: rgba(0,0,0,0.03) !important; border-color: #bdc3c7 !important; }
body.light-mode #issueMessage { background: #fff; color: #2c3e50; border-color: #bdc3c7; }
body.light-mode .map-legend-pill { background: rgba(255,255,255,0.9); border-color: #bdc3c7; }

.main-grid { flex-grow: 1; display: grid; grid-template-columns: 460px 1fr; gap: 0; width: 100%; box-sizing: border-box; overflow: hidden; min-height: 0; }

/* INDEPENDENT SCROLLING PANELS */
.left-panel { display: flex; flex-direction: column; gap: 0; width: 100%; border-right: 1px solid #333; padding: 20px 25px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; height: 100%; background: var(--card); z-index: 10; box-shadow: 5px 0 15px rgba(0,0,0,0.2);}
.left-panel::-webkit-scrollbar { width: 6px; }
.left-panel::-webkit-scrollbar-track { background: transparent; }
.left-panel::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.left-panel::-webkit-scrollbar-thumb:hover { background: #555; }

.right-panel { display: flex; flex-direction: column; width: 100%; height: 100%; background: transparent; padding: 20px 25px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; }
.right-panel::-webkit-scrollbar { width: 8px; }
.right-panel::-webkit-scrollbar-track { background: transparent; }
.right-panel::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.right-panel::-webkit-scrollbar-thumb:hover { background: #555; }

/* RE-LOCATED HEADER STYLES */
.app-header-block { padding-bottom: 15px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0;}
.title-block h2 { margin: 0; padding: 0; text-align: left; font-size: 1.4rem; color: var(--text); }
.description { font-size: 0.8rem; color: #aaa; margin: 0; line-height: 1.4; text-align: left; }
.global-utils { display: flex; gap: 8px; align-items: center; justify-content: flex-start; flex-wrap: wrap; margin-top: 5px; }

/* --- V1.1 UI HEADER LAYOUT --- */
.global-settings-container { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; width: 100%; }
.utility-belt { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.theme-icon-btn { background: transparent; border: none; font-size: 1.25rem; cursor: pointer; padding: 0; transition: transform 0.2s ease; display: flex; align-items: center; justify-content: center; }
.theme-icon-btn:hover { transform: scale(1.15); }
.support-action { width: 100%; }
.kofi-pill { background: #ff5e5b; color: white; border: none; padding: 8px 15px; border-radius: 20px; font-weight: bold; font-size: 0.85rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; text-align: center; }
.kofi-pill.full-width { width: 100%; height: 34px; margin-left: 0; font-size: 0.8rem; }
.kofi-pill:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(255, 94, 91, 0.4); }

.step-header { font-size: 1.05rem; font-weight: bold; color: var(--primary); margin: 20px 0 5px 0; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px dashed #444; padding-bottom: 5px; display: flex; justify-content: space-between; align-items: center;}
.step-header .tip { cursor: help; color: var(--primary); }

.station-box { background: transparent; padding: 0; border: none; width: 100%; box-sizing: border-box; transition: transform 0.3s, box-shadow 0.3s; flex-shrink: 0; }

.input-group { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; }
label { font-size: 0.7rem; color: #aaa; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }

input[type="text"], input[type="number"], select { padding: 10px; border-radius: 6px; border: 1px solid #444; background: #1a1a1a; color: white; font-family: monospace; font-size: 0.9rem; transition: border-color 0.2s, background 0.3s, color 0.3s; width: 100%; box-sizing: border-box; }
input:focus, select:focus { outline: none; border-color: var(--primary); }
input[type="text"] { flex-grow: 1; min-width: 120px; font-family: 'Segoe UI', system-ui, sans-serif; }
input[type="number"] { text-align: center; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

input[type="range"] { padding: 0; border: none; background: transparent; height: 38px; width: 100%; cursor: pointer; outline: none; }
input[type="range"]::-webkit-slider-runnable-track { width: 100%; height: 6px; background: #444; border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--primary); margin-top: -5px; box-shadow: 0 0 5px rgba(0,0,0,0.5); }

select { cursor: pointer; padding: 9px; font-family: 'Segoe UI', sans-serif; font-size: 0.8rem; }

button { padding: 8px 12px; border-radius: 6px; border: none; background: var(--primary); color: white; font-weight: bold; cursor: pointer; height: 38px; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all 0.2s ease; }
button:hover { filter: brightness(1.2); transform: scale(1.02); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* V0.8.5 UTILITY ICON MERGE */
.input-row-merged { display: flex; width: 100%; align-items: stretch; }
.input-row-merged input { border-radius: 6px 0 0 6px; border-right: none; }
.input-row-merged button { border-radius: 0; border-left: 1px solid #333; margin: 0; background: #222; color: #aaa; padding: 0 12px;}
.input-row-merged button:hover { background: #333; color: #fff; }
.input-row-merged button:last-child { border-radius: 0 6px 6px 0; }

/* V0.8.5 GHOST BUTTONS FOR ACTION ROW */
.control-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; width: 100%; align-items: center; margin-top: 25px; border-top: 1px dashed #444; padding-top: 20px;}
.ghost-btn { background: transparent; border: 1px solid #444; color: #888; transition: 0.2s; flex-grow: 1; }
.ghost-btn:hover { color: #fff; }
.btn-save:hover { background: var(--secondary); border-color: var(--secondary); color: #111; }
.btn-load:hover { background: #2980b9; border-color: #2980b9; }
.btn-share:hover { background: #e67e22; border-color: #e67e22; }
.btn-export:hover { background: #8e44ad; border-color: #8e44ad; }
.btn-reset { border-color: #552222; color: #e74c3c; }
.btn-reset:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* V0.8.5 MEGA-PILL COVERAGE BUTTON */
.cov-mega-pill { display: flex; align-items: stretch; width: 100%; border-radius: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); margin-top: 10px;}
.cov-btn { background: #8e44ad; color: white; font-size: 1rem; padding: 15px 10px; margin: 0; border: none; font-weight: bold; cursor: pointer; transition: filter 0.2s;}
.cov-btn:hover:not(:disabled) { filter: brightness(1.1); }
.cov-main { border-radius: 24px 0 0 24px; flex-grow: 1; border-right: 1px solid rgba(0,0,0,0.2); transition: 0.3s;}
.cov-drop { border-radius: 0; padding: 0 15px; border-right: 1px solid rgba(0,0,0,0.2); }
.cov-trash { background: #e74c3c; border-radius: 0 24px 24px 0; padding: 0 20px; font-size: 1.2rem; }

.dropdown { position: relative; display: flex; }
.dropdown-content { display: none; position: absolute; bottom: 100%; right: 0; background-color: #222; min-width: 220px; box-shadow: 0px 8px 20px 0px rgba(0,0,0,0.6); z-index: 500; border-radius: 6px; border: 1px solid #444; margin-bottom: 5px; overflow: hidden; }
.dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; font-size: 0.85rem; font-weight: bold; border-bottom: 1px solid #333; text-align: left; }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background-color: #333; color: var(--primary); transform: none; filter: none; }
.show-dropdown { display: block !important; }

/* V0.8.5 PILL UI UNIFICATION */
.toggle-container { display: flex; flex-wrap: nowrap; background: var(--pill-bg); border-radius: 20px; border: 1px solid #333; overflow: hidden; transition: background 0.3s; width: 100%; align-items: stretch; height: 32px; flex-shrink: 0; padding: 2px;}
.toggle-btn { padding: 0 10px; border: none; background: transparent; color: #888; font-size: 0.75rem; cursor: pointer; font-weight: bold; border-radius: 18px; flex-grow: 1; display: flex; align-items: center; justify-content: center; line-height: 1; height: 100%; margin: 0; box-sizing: border-box; transition: 0.2s;}
.toggle-btn:hover:not(.active) { color: #fff; background: rgba(128,128,128,0.1); transform: none; }
body.light-mode .toggle-btn:hover:not(.active) { color: #111; }
.toggle-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

/* V0.8.6 FRAME PILL (For Floating UI) */
.frame-pill { background: rgba(30,30,30,0.9); border: 1px solid #444; color: #ccc; border-radius: 20px; padding: 0 12px; height: 26px; font-size: 0.7rem; font-weight: bold; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); pointer-events: auto;}
.frame-pill:hover { background: rgba(128,128,128,0.2); color: #fff; transform: scale(1.05); }

/* V0.8.5 TAB PILLS */
.tabs-container { display: flex; width: 100%; max-width: 100%; justify-content: flex-start; gap: 4px; border-bottom: none; background: var(--pill-bg); padding: 4px; border-radius: 24px; border: 1px solid #333; overflow-x: auto; scrollbar-width: none; align-items: center; margin-bottom: 10px; flex-shrink: 0;}
.tabs-container::-webkit-scrollbar { display: none; }
.tab-btn { flex-shrink: 0; background: transparent; color: #888; border-radius: 20px; padding: 6px 15px; cursor: pointer; font-size: 0.8rem; border: none; transition: 0.2s; height: 32px; white-space: nowrap; display: flex; align-items: center; user-select: none; margin: 0; }
.tab-btn:hover:not(.active) { background: rgba(128,128,128,0.1); transform: none; color: #fff; }
body.light-mode .tab-btn:hover:not(.active) { color: #111; }
.tab-btn.active { background: #333; color: var(--primary); font-weight: bold; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.tab-btn.drag-over { background: #444 !important; border: 1px dashed var(--primary) !important; opacity: 0.8; }
.tab-btn input[type="checkbox"] { width: auto; margin: 0 6px 0 0; padding: 0; cursor: pointer; }
.tab-add { background: transparent; border: 1px dashed #555; color: #aaa; margin-left: 2px; justify-content: center; }
.tab-add:hover { background: rgba(128,128,128,0.2); color: #fff; border-style: solid; }
.tab-close { color: #e74c3c; margin-left: 8px; opacity: 0.6; transition: 0.2s; font-size: 0.75rem; padding: 0 4px; border-radius: 50%; }
.tab-close:hover { opacity: 1; background: rgba(231, 76, 60, 0.2); transform: scale(1.1); }
.tab-btn span { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }

.tip { position: relative; cursor: help; border-bottom: 1px dashed #666;}
.tip:after { content: attr(data-tip); position: absolute; top: 125%; left: 0; background: #333; color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: normal; font-family: 'Segoe UI', sans-serif; white-space: pre-line; width: max-content; max-width: 250px; z-index: 9999; opacity: 0; visibility: hidden; transition: 0.2s; box-shadow: 0 4px 15px rgba(0,0,0,0.5); pointer-events: none; line-height: 1.5; text-align: left; border: 1px solid #555; }
.tip:hover:after { opacity: 1; visibility: visible; }

/* V0.8.11 CSS GRID FOR ADVANCED SETTINGS */
.adv-drawer { display: none; grid-template-columns: repeat(6, 1fr); gap: 10px; width: 100%; margin-top: 10px; padding-top: 15px; border-top: 1px dashed #444; }
.adv-drawer .span-2 { grid-column: span 2; }
.adv-drawer .span-3 { grid-column: span 3; }

.adv-toggle { font-size: 0.75rem; color: #888; text-decoration: underline; cursor: pointer; margin-top: 5px; display: inline-block; text-align: center; width: 100%; }
.adv-toggle:hover { color: var(--primary); }

/* V0.8.8 DIRECTIONAL SUB-PANEL */
.dir-sub-panel { display: flex; flex-direction: column; gap: 8px; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; border: 1px solid #333; width: 100%; box-sizing: border-box; margin-top: 8px; margin-bottom: 5px; }
.slider-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.slider-row input[type="range"] { flex-grow: 1; height: 26px; }
.slider-row input[type="number"] { width: 55px; padding: 6px; text-align: center; }
.input-row { display: flex; width: 100%; gap: 10px; align-items: center; }

/* ULTRA-COMPACT DASHBOARD CSS */
.status-banner { background: #111; padding: 4px; font-weight: bold; text-align: center; border-bottom: 1px solid #333; transition: background-color 0.3s; letter-spacing: 1px; border-radius: 8px 8px 0 0; flex-shrink: 0; font-size: 0.85rem;}
.status-clear { color: #2ecc71; background: rgba(46, 204, 113, 0.1); }
.status-marginal { color: #f1c40f; background: rgba(241, 196, 15, 0.1); }
.status-obstructed { color: #e67e22; background: rgba(230, 126, 34, 0.1); }
.status-blocked { color: #e74c3c; background: rgba(231, 76, 60, 0.1); }

.dashboard { background: #1f1f1f; display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 0px; border-bottom: 1px solid #333; transition: background 0.3s; border-radius: 0 0 8px 8px; border: 1px solid #333; border-top: none; overflow: hidden; flex-shrink: 0; }
.dash-col { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; background: var(--dash-column); }
.dash-col.path-col { background: transparent; border-left: 1px solid #333; border-right: 1px solid #333; transition: background 0.3s; }

.dash-col-header { font-size: 0.7rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; padding-bottom: 2px; margin-bottom: 0px; border-bottom: 1px solid #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s; text-align: center; color: #aaa;}
.dash-profile-tag { font-size: 0.6rem; color: #777; font-style: italic; text-align: center; margin-top: -2px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}

.data-card { text-align: left; padding: 0; border: none; margin: 0; }
.data-label { font-size: 0.6rem; color: #888; text-transform: uppercase; display: block; margin-bottom: 1px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.data-value { font-size: 0.85rem; font-weight: bold; color: #fff; font-family: monospace; line-height: 1.2; transition: color 0.3s; display: flex; align-items: center; gap: 4px;}
.sub-value { font-size: 0.65rem; color: #aaa; display: block; margin-top: 0px; transition: 0.2s; }

.hero-signal-card { padding: 2px; margin-top: 0px; text-align: center; border-radius: 6px; transition: background 0.3s; display: flex; flex-direction: column; justify-content: center; }

/* V0.8.4 iOS PILL TOGGLE STYLES */
.path-direction-pill { display: flex; width: 100%; background: var(--pill-bg); border-radius: 20px; padding: 2px; box-sizing: border-box; border: 1px solid #333; transition: background 0.3s, border-color 0.3s; margin-bottom: 4px; }
body.light-mode .path-direction-pill { border-color: #ccc; }

.pill-segment { flex: 1; border: none; background: transparent; color: #888; padding: 4px 0; border-radius: 18px; font-size: 0.6rem; font-weight: bold; text-transform: uppercase; cursor: pointer; transition: all 0.2s ease; font-family: 'Segoe UI', sans-serif; height: 20px; line-height: 1; margin: 0; justify-content: center; display: flex; align-items: center; }
.pill-segment:hover:not(.active) { background: rgba(128,128,128,0.1); color: #fff; }
body.light-mode .pill-segment:hover:not(.active) { color: #111; }
.pill-segment.active { color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* --- ENVIRONMENTAL DASHBOARD FOOTER --- */
.env-dashboard-footer {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #333;
    padding: 8px 15px;
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 15px;
}
body.light-mode .env-dashboard-footer {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: #bdc3c7;
}
.env-item { display: flex; gap: 6px; align-items: baseline; font-size: 0.7rem; }
.env-label { color: #888; text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }
.env-val { color: #ccc; font-weight: bold; font-family: monospace; font-size: 0.8rem; }
body.light-mode .env-label { color: #7f8c8d; }
body.light-mode .env-val { color: #2c3e50; }

/* FORCED MAP HEIGHT (Anti-Crush Fix) */
.app-grid { flex-grow: 1; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; min-height: 480px; border-radius: 8px; border: 1px solid #333; margin-top: 10px; position: relative;}
#map-wrapper { flex-grow: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }

/* FLOATING MAP UI UPDATE */
.map-header { position: absolute; top: 15px; left: 15px; right: 15px; z-index: 1000; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; background: transparent; border-bottom: none; padding: 0;}

/* The translucent pill holding the signal dots */
.map-legend-pill { background: rgba(30,30,30,0.9); border: 1px solid #444; border-radius: 6px; padding: 6px 12px; display: flex; gap: 10px; align-items: center; backdrop-filter: blur(4px); pointer-events: auto; transition: background 0.3s, border-color 0.3s;}
.map-header-legend { display: flex; gap: 10px; margin: 0; padding: 0; align-items: center; }
.map-header-legend .legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.65rem; font-weight: bold; color: #ccc; text-transform: uppercase; }
body.light-mode .map-header-legend .legend-item { color: #555; }

#map { flex-grow: 1; width: 100%; z-index: 1; background: #e5e3df; height: 100%; } 

/* Locked Graph container */
.graph-container { flex: 0 0 140px; height: 140px; min-height: 140px; max-height: 140px; display: flex; align-items: center; justify-content: center; position: relative; transition: background 0.3s; background: #0a0a0a; border-top: 1px solid #333; padding: 5px 15px; box-sizing: border-box; }
canvas { max-width: 100%; height: 100%; transition: opacity 0.2s; }

.obstacle-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.85rem; font-family: monospace; }
.obstacle-table th { padding: 10px; border-bottom: 2px solid #444; color: #888; text-transform: uppercase; font-size: 0.7rem; transition: border-color 0.3s; }
.obstacle-table td { padding: 10px; border-bottom: 1px solid #333; color: #eee; transition: background 0.2s, border-color 0.3s, color 0.3s; }
.obstacle-table tr:hover td { background: #2a2a2a; cursor: crosshair; }

.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; position: absolute; transform: rotate(-45deg); left: 50%; top: 50%; margin: -20px 0 0 -15px; border: 2px solid white; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.5); font-family: sans-serif; }
.pin-label { transform: rotate(45deg); color: white; font-weight: bold; font-size: 14px; position: absolute; }

.app-footer { margin-top: 30px; padding-top: 15px; padding-bottom: 15px; border-top: 1px solid #333; text-align: center; color: #777; font-size: 0.75rem; line-height: 1.6; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; box-sizing: border-box; }
.app-footer a { color: var(--primary); text-decoration: none; transition: 0.2s; font-weight: bold; }
.app-footer a:hover { color: #fff; text-decoration: underline; }
body.light-mode .app-footer a:hover { color: #111; }

.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.privacy-badge { color: #888; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.attribution { font-size: 0.65rem; color: #555; margin-top: 4px; text-align: center;}

/* MODAL STYLES FOR CHANGELOG */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 20000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.show { display: flex; opacity: 1; }
.modal-content { background: #222; border: 1px solid #444; padding: 0; border-radius: 12px; max-width: 500px; width: 90%; box-shadow: 0 10px 40px rgba(0,0,0,0.8); overflow: hidden; transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-overlay.show .modal-content { transform: translateY(0); }
.modal-header { padding: 15px 20px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.1rem; color: #fff; }
.modal-close { background: none; border: none; color: #aaa; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
.modal-close:hover { color: #e74c3c; transform: none; filter: none; }
.modal-body { padding: 20px; font-size: 0.85rem; color: #ccc; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
.modal-body h4 { color: var(--primary); margin: 15px 0 5px 0; font-size: 0.95rem; }
.modal-body ul { margin-top: 5px; padding-left: 20px; }
.modal-body li { margin-bottom: 5px; }

/* --- V1.1 FAT FINGER CHECKBOX --- */
.custom-checkbox-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; color: #ccc; margin-top: 5px; }
.hidden-cb { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.brand-checkbox { height: 24px; width: 24px; min-width: 24px; background-color: #111; border: 2px solid #444; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; margin-top: 2px;}
.hidden-cb:checked ~ .brand-checkbox { background-color: var(--primary); border-color: var(--primary); }
.hidden-cb:checked ~ .brand-checkbox::after { content: ''; display: block; width: 6px; height: 12px; border: solid white; border-width: 0 3px 3px 0; transform: rotate(45deg); margin-bottom: 2px;}
.custom-checkbox-label:hover .brand-checkbox { border-color: var(--primary); }

/* --- V1.1 SPOTLIGHT SIDEBAR DIMMER --- */
#sidebar-dimmer { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10000; }

/* V0.8.13 KOFI MODAL CSS OVERRIDE - FLEXIBLE */
#kofiModal .modal-content { width: 90%; max-width: 500px; height: 80vh; max-height: 800px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
#kofiModal .modal-body { padding: 0; overflow-y: auto; flex-grow: 1; display: flex; flex-direction: column; }
#kofiModal iframe { border: none; width: 100%; flex-grow: 1; min-height: 650px; }

/* V0.8.13 INTERACTIVE PATH CSS */
.interactive-path { cursor: pointer; transition: stroke-width 0.2s; }
.interactive-path:hover { stroke-width: 6px !important; }
.path-tooltip { background: rgba(0,0,0,0.8); color: #fff; border: 1px solid var(--primary); border-radius: 4px; font-family: 'Segoe UI', sans-serif; font-size: 0.75rem; text-align: center; }

/* SPOTLIGHT UX STYLES */
@keyframes pulse-spotlight {
    0% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(52, 152, 219, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 152, 219, 0); }
}
.spotlight-active { position: relative; z-index: 10001 !important; border: 2px solid var(--primary) !important; animation: pulse-spotlight 2s infinite; background: #222 !important; }
body.light-mode .spotlight-active { background: #fff !important; }
#spotlight-overlay-bg { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 10000; transition: opacity 0.3s; }

/* MICROWAVE WARNING & PDF EXPORT LOCK CLASSES */
#microwave-warning { display: none; background: rgba(243, 156, 18, 0.1); border: 1px solid var(--warning); border-radius: 6px; padding: 10px; margin-top: 8px; color: var(--warning); font-size: 0.75rem; line-height: 1.4; text-align: left;}
.pdf-export-map { width: 800px !important; height: 500px !important; flex-grow: 0 !important; }
.pdf-export-map .leaflet-overlay-pane svg { clip-path: inset(0); width: 100% !important; height: 100% !important; }
.pdf-export-graph { width: 800px !important; height: 400px !important; flex-shrink: 0 !important; }
.pdf-export-graph canvas { max-height: 400px !important; height: 400px !important; width: 800px !important; }
.pdf-export-map .pin { box-shadow: none !important; }

/* --- MAP DROP PIN MODE --- */
.map-crosshair { cursor: crosshair !important; }
.map-crosshair .leaflet-interactive { cursor: crosshair !important; }
.btn-active-drop { background: var(--primary) !important; color: white !important; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }

/* V0.8.5 TOAST FIX: Anchored to TOP with pointer events to allow manual dismiss */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #333; color: #fff; padding: 12px 24px; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-size: 0.9rem; font-weight: bold; opacity: 0; transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); z-index: 99999; cursor: pointer; pointer-events: auto; text-align: center; border: 1px solid #444; display: flex; align-items: center; gap: 10px;}
.toast::after { content: '×'; font-size: 1.2rem; opacity: 0.5; font-weight: normal; margin-left: 10px; }
.toast:hover::after { opacity: 1; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-bottom: 3px solid var(--secondary); }
.toast.error { border-bottom: 3px solid var(--danger); }
.toast.info { border-bottom: 3px solid var(--primary); }

/* MOBILE SCROLL CUE (Hidden on Desktop) */
.mobile-scroll-cue { display: none; }

@media (max-width: 950px) {
    body, html { height: auto !important; overflow-y: auto !important; overflow-x: hidden !important; width: 100vw !important; }
    
    .main-grid { display: flex; flex-direction: column-reverse !important; height: auto !important; overflow: visible !important; width: 100%; }
    .app-grid { min-height: 0 !important; height: auto !important; }
    .sidebar, .control-panel, .left-panel { height: auto !important; overflow: visible !important; max-height: none !important; width: 100%; box-sizing: border-box; }
    .right-panel { height: auto !important; overflow: visible !important; padding: 10px !important; }
    
    .dashboard { grid-template-columns: 1fr !important; }
    .dash-col { border-bottom: 1px solid #333; padding: 12px 10px !important; }
    .dash-col.path-col { border-left: none !important; border-right: none !important; }
    
    .cov-mega-pill { align-items: stretch !important; height: auto !important; }
    .cov-btn { height: auto !important; min-height: 48px; white-space: normal !important; line-height: 1.2; display: flex; align-items: center; justify-content: center; text-align: center; }
    
    .search-box-row, .input-row-merged { display: flex !important; flex-wrap: nowrap !important; width: 100% !important; box-sizing: border-box; }
    .search-box-row input, .input-row-merged input { flex: 1 1 auto !important; min-width: 0 !important; }
    
    .map-header { flex-wrap: wrap !important; height: auto !important; padding: 10px !important; line-height: 1.8 !important; position: static !important; background: #1f1f1f !important; }
    #map-wrapper { min-height: 40vh !important; max-height: 45vh !important; flex: none !important; } 
    
    .global-utils { flex-wrap: wrap !important; justify-content: center !important; height: auto !important; gap: 8px !important; padding-bottom: 10px; }
    .tabs-container { flex-wrap: wrap !important; height: auto !important; justify-content: center; }

    .mobile-scroll-cue {
        display: flex; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
        background: var(--primary); color: white; border: none; padding: 12px 24px;
        border-radius: 25px; font-weight: bold; font-size: 1rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5); z-index: 9999;
        align-items: center; gap: 8px; cursor: pointer;
        transition: opacity 0.3s, transform 0.3s;
    }
    .mobile-scroll-cue.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }    
}

/* --- BREADCRUMB LINK --- */
.breadcrumb-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: bold;
    transition: color 0.2s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.breadcrumb-link:hover {
    color: #fff;
    text-decoration: underline;
}
body.light-mode .breadcrumb-link {
    color: var(--primary);
}
body.light-mode .breadcrumb-link:hover {
    color: #111;
}

/* --- PHASE 4 OVERRIDES & UI LOCKS --- */
.coverage-running .custom-pin {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.coverage-running .leaflet-interactive {
    cursor: not-allowed !important;
}

#btnCancelCov:hover {
    background: #c0392b !important;
}

#sidebar-dimmer {
    z-index: 10000; /* Guarantee it covers everything on the left panel */
}
/* Utility class to freeze scroll during generation */
.lock-scroll {
    overflow: hidden !important;
}