/* ─── RESET A ZÁKLAD ─── */
        *, *::before, *::after { box-sizing: border-box; }
        html, body { margin: 0; padding: 0; width: 100%; height: 100%; font-family: 'Segoe UI', sans-serif; overflow: hidden; background: #1a1a1a; position: relative; }
        #map { width: 100%; height: 100vh; z-index: 1; }

        /* ─── LOADING ─── */
        #loading-overlay { position: fixed; inset: 0; background: rgba(8,18,8,0.95); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; transition: opacity 0.4s; }
        .spinner { width: 46px; height: 46px; border: 4px solid rgba(255,255,255,0.18); border-top-color: #4caf50; border-radius: 50%; animation: spin .8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        #load-status { font-size: 14px; color: #ccc; text-align: center; max-width: 300px; line-height: 1.5; }
        #force-close-btn { display: none; margin-top: 20px; padding: 10px 20px; background: #c62828; color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }

        /* ─── HLAVNÍ MENU (HAMBURGER) ─── */
        #menu-toggle-btn { position: absolute; top: 18px; left: 14px; z-index: 2005; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #2e7d32; border: 2px solid #e8f5e9; font-size: 24px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.2); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
        #menu-toggle-btn:hover { transform: scale(1.05); }

        /* ─── ROZBALOVACÍ LUPA ─── */
        #search-wrap { position: absolute; top: 18px; right: 140px; left: auto; transform: none; z-index: 2000; display: flex; height: 46px; background: #fff; border-radius: 23px; box-shadow: 0 3px 14px rgba(0,0,0,.28); overflow: hidden; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 300px; }
        #search-wrap.collapsed { width: 46px; cursor: pointer; }
        #search-wrap.collapsed #search-input, #search-wrap.collapsed #search-btn { display: none; }
        #search-toggle-btn { width: 46px; height: 46px; border: none; background: transparent; font-size: 18px; cursor: pointer; flex-shrink: 0; padding: 0; display: flex; align-items: center; justify-content: center; }
        #search-input { flex: 1; border: none; padding: 0 10px; font-size: 15px; outline: none; background: transparent; }
        #search-btn { border: none; background: #2e7d32; color: #fff; padding: 0 15px; font-weight: bold; cursor: pointer; font-size: 14px; }

        /* ─── METEOROLOGICKÁ STANICE ─── */
        #weather-widget { position: absolute; top: 18px; right: 14px; z-index: 2000; background: rgba(255,255,255,0.95); padding: 8px 16px; border-radius: 22px; box-shadow: 0 3px 12px rgba(0,0,0,.2); font-weight: 800; color: #1565c0; cursor: pointer; display: none; align-items: center; gap: 8px; transition: transform 0.2s, background 0.2s; border: 2px solid #e3f2fd; }
        #weather-widget:hover { transform: scale(1.05); background: #fff; border-color: #bbdefb; }
        .forecast-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 15px; }
        .forecast-row:last-child { border-bottom: none; }
        .fc-date { font-weight: 700; color: #444; width: 80px; }
        .fc-icon { font-size: 20px; width: 30px; text-align: center; }
        .fc-temps { font-weight: 800; color: #1565c0; text-align: right; flex: 1; }
        .fc-temps span { color: #888; font-weight: 600; font-size: 13px; margin-left: 8px; }

        /* ─── ANCHOR TLAČÍTKA ─── */
        #anchors { position: absolute; top: 86px; right: 14px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
        .anchor-btn { background: #2e7d32; color: #fff; border: 2px solid #fff; padding: 9px 16px; border-radius: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.28); transition: 0.2s; }
        .anchor-btn:hover { background: #1b5e20; transform: scale(1.05); }

        /* ─── BOČNÍ MENU (SIDE DRAWER) ─── */
        #sidebar { position: absolute; top: 0; left: 0; z-index: 3000; width: 280px; height: 100vh; max-height: 100vh; background: #fff; border-radius: 0 16px 16px 0; box-shadow: 5px 0 25px rgba(0,0,0,0.3); transform: translateX(-110%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); opacity: 1; pointer-events: auto; display: flex; flex-direction: column; }
        #sidebar.open { transform: translateX(0); }
        .sb-header { width: 100%; height: 56px; background: #2e7d32; color: #fff; font-weight: 700; cursor: pointer; display: flex; align-items: center; flex-shrink: 0; border-bottom: 1px solid #1b5e20; }
        #cat-list { overflow-y: auto; overflow-x: hidden; flex: 1; display: flex; flex-direction: column; }
        #cat-list::-webkit-scrollbar { width: 4px; }
        #cat-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
        .cat-item { width: 100%; min-height: 50px; display: flex; align-items: center; cursor: pointer; border-bottom: 1px solid #f0f0f0; color: #333; flex-shrink: 0; transition: background 0.2s; }
        .cat-item:hover { background: #e8f5e9; }
        .cat-item.active-tool { background: #c8e6c9; border-left: 4px solid #2e7d32; }
        .cat-item.disabled { opacity: .4; pointer-events: none; }
        .cat-icon { width: 60px; text-align: center; font-size: 21px; flex-shrink: 0; }
        .lbl { font-size: 14px; white-space: nowrap; font-weight: 600; opacity: 1; margin-left: 5px; flex: 1; overflow: hidden; text-overflow: ellipsis; }
        .cat-del-btn { opacity: 0; padding: 0 15px; font-size: 15px; transition: opacity 0.2s, transform 0.1s; cursor: pointer; }
        .cat-item:hover .cat-del-btn { opacity: 0.4; }
        .cat-item .cat-del-btn:hover { opacity: 1; transform: scale(1.2); }

        /* ─── ZEN REŽIM (Čistá obrazovka na mobilu) ─── */
        body.zen-mode #menu-toggle-btn, 
        body.zen-mode #bottom-sheet-trigger, 
        body.zen-mode #right-col, 
        body.zen-mode #weather-widget, 
        body.zen-mode #search-wrap, 
        body.zen-mode #anchors,
        body.zen-mode #bulk-action-bar,
        body.zen-mode #tool-badge {
            opacity: 0 !important; pointer-events: none !important; transform: translateY(20px) scale(0.95) !important; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        }

        #menu-toggle-btn, #bottom-sheet-trigger, #right-col, #weather-widget, #search-wrap, #anchors { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

        #zen-btn { position: absolute; bottom: 26px; left: 14px; z-index: 2005; width: 44px; height: 44px; border-radius: 50%; background: #4caf50; color: white; border: 2px solid #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: 0.3s; }
        #zen-btn.zen-active { background: #1565c0; }
        #zen-btn:hover { transform: scale(1.1); }

        /* ─── PANELY ─── */
        #reshape-save-bar { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 2001; background: #1565c0; border-radius: 14px; padding: 14px 20px; box-shadow: 0 5px 25px rgba(0,0,0,.45); display: none; align-items: center; gap: 14px; border: 2px solid #fff; }
        #reshape-save-bar span { color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
        #reshape-save-bar .rs-btn { padding: 10px 20px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; }
        #reshape-save-bar .rs-save { background: #fff; color: #1565c0; }
        #reshape-save-bar .rs-cancel { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.5) !important; }
        #tool-badge { position: absolute; top: 86px; right: 14px; z-index: 2000; background: #c62828; color: #fff; padding: 12px 20px; border-radius: 25px; display: none; cursor: pointer; font-weight: 700; box-shadow: 0 4px 15px rgba(0,0,0,.4); border: 2px solid white; }
        #plot-panel { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 2000; background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 5px 25px rgba(0,0,0,.38); display: none; text-align: center; border-top: 5px solid #2e7d32; width: 90%; max-width: 350px; }
        .area-val { font-size: 28px; font-weight: 900; color: #2e7d32; margin: 10px 0; }
        .btn-save { width: 100%; padding: 12px; background: #f57c00; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 15px; }
        .btn-redraw { width: 100%; margin-top: 10px; padding: 10px; background: transparent; color: #c62828; border: 1px solid #c62828; border-radius: 8px; font-weight: 700; cursor: pointer; }
        #plot-name-input { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; margin-bottom: 10px; outline: none; font-family: inherit; }
        
        /* ─── HROMADNÝ VÝBĚR ─── */
        #bulk-action-bar { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 2001; background: #1565c0; border-radius: 14px; padding: 14px 20px; box-shadow: 0 5px 25px rgba(0,0,0,.45); display: none; align-items: center; gap: 10px; border: 2px solid #fff; white-space: nowrap; }
        #bulk-action-bar span { color: #fff; font-weight: 700; font-size: 14px; margin-right: 6px; }
        .bulk-btn { padding: 9px 14px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 13px; transition: 0.15s; }
        .bulk-btn:hover { transform: scale(1.05); }

        /* ─── SPODNÍ ROLETKA (BOTTOM SHEET) ─── */
        #bottom-sheet-trigger { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2000; background: #1565c0; color: #fff; border: 2px solid #fff; padding: 12px 24px; border-radius: 25px; font-weight: 700; font-size: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); cursor: pointer; transition: 0.2s; }
        #bottom-sheet-trigger:hover { background: #0d47a1; transform: translateX(-50%) scale(1.05); }
        #bottom-sheet { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius: 20px 20px 0 0; box-shadow: 0 -5px 25px rgba(0,0,0,0.2); z-index: 3000; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); padding-bottom: 20px; }
        #bottom-sheet.open { transform: translateY(0); }
        .sheet-header { width: 100%; height: 30px; display: flex; justify-content: center; align-items: center; cursor: pointer; }
        .sheet-handle { width: 40px; height: 5px; background: #ccc; border-radius: 3px; }
        .sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 15px; padding: 10px 20px; }
        .fab-new { display: none; flex-direction: column; align-items: center; justify-content: center; background: transparent; border: none; cursor: pointer; font-size: 24px; gap: 6px; padding: 10px 0; transition: transform 0.15s; }
        .fab-new.visible { display: flex !important; }
        .fab-new span { font-size: 12px; font-weight: 600; color: #444; }
        .fab-new:hover { transform: scale(1.1); }

        /* ─── MODALS ─── */
        .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 3000; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
        .modal-backdrop.open { display: flex; }
        .modal-box { background: #fff; border-radius: 14px; width: 90%; max-width: 450px; display: flex; flex-direction: column; max-height: 85vh; box-shadow: 0 10px 40px rgba(0,0,0,.5); overflow: hidden; }
        .dash-head { background: #1565c0; color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
        .dash-close { background: none; border: none; color: inherit; font-size: 22px; cursor: pointer; opacity: 0.8; padding: 0; }
        .dash-close:hover { opacity: 1; }
        .modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
        .modal-body label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: -6px; }
        .modal-body input:not([type="checkbox"]), .modal-body select { padding: 12px; border: 1px solid #ccc; border-radius: 8px; width: 100%; outline: none; font-size: 15px; }
        .btn-primary { padding: 12px; background: #2e7d32; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 15px; }

        /* ─── ÚKOLY & KALENDÁŘ ─── */
        .task-group-title { font-weight: bold; color: #2e7d32; margin-top: 15px; margin-bottom: 5px; font-size: 15px; border-bottom: 2px solid #e8f5e9; padding-bottom: 5px; }
        .task-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
        .task-row.done { opacity: 0.4; text-decoration: line-through; }
        .task-check { width: 22px !important; height: 22px !important; cursor: pointer; flex-shrink: 0; margin: 0; }
        .cal-month-header { background: #e3f2fd; color: #1565c0; font-weight: bold; padding: 10px 15px; border-radius: 8px; margin-top: 15px; font-size: 16px; }
        .cal-item { padding: 8px 15px; border-bottom: 1px solid #eee; font-size: 14px; color: #444; }

        /* ─── MAP POPUPY ─── */
        .pu { min-width: 230px; font-family: 'Segoe UI', sans-serif; }
        .pu-title { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 2px; }
        .pu-var { font-size: 13px; color: #2e7d32; font-weight: bold; margin-bottom: 6px; }
        .pu-meta { font-size: 12px; color: #888; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
        /* Stats strip v popupu */
        .pu-stats { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
        .pu-stat-chip { background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: #555; white-space: nowrap; }
        .pu-stat-chip.has-data { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
        /* Quick almanach akce */
        .pu-almanac { display: flex; gap: 6px; margin-bottom: 10px; justify-content: center; }
        .pu-alm-btn { border: 1px solid #ddd; background: #fff; border-radius: 20px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: 0.2s; }
        .pu-alm-btn:hover { background: #f0f0f0; transform: scale(1.05); }
        .pu-note { font-size: 14px; color: #444; font-style: italic; background: #f9f9f9; padding: 10px; border-radius: 8px; margin-bottom: 10px; white-space: pre-wrap; border: 1px solid #eee; min-height: 20px; }
        .pu-actions { display: flex; gap: 6px; flex-wrap: wrap; }
        .pu-btn { flex: 1; min-width: 70px; padding: 9px 0; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 12px; }
        .pu-edit    { background: #e8f5e9; color: #2e7d32; }
        .pu-del     { background: #ffebee; color: #c62828; }
        .pu-almanac-btn { background: #e3f2fd; color: #1565c0; }
        .pu-edit-wrap { display: flex; flex-direction: column; gap: 8px; }
        .pu-edit-wrap input:not([type="checkbox"]), .pu-edit-wrap textarea { border: 1px solid #ccc; border-radius: 6px; padding: 10px; width: 100%; font-family: inherit; font-size: 14px; }

        /* ─── ALMANACH MODAL ─── */
        #almanach-modal .modal-box { max-width: 500px; }
        .alm-head { background: linear-gradient(135deg, #1b5e20, #2e7d32); color: #fff; padding: 18px 20px; }
        .alm-head-title { font-size: 18px; font-weight: 800; margin: 0 0 4px 0; }
        .alm-head-sub { font-size: 13px; opacity: 0.8; margin: 0; }
        .alm-head-actions { display: flex; justify-content: space-between; align-items: flex-start; }
        /* Stats bar */
        .alm-stats { display: flex; gap: 8px; padding: 14px 20px; background: #f1f8e9; border-bottom: 1px solid #dcedc8; flex-wrap: wrap; }
        .alm-stat { text-align: center; flex: 1; min-width: 60px; }
        .alm-stat-num { font-size: 22px; font-weight: 900; color: #2e7d32; line-height: 1; }
        .alm-stat-lbl { font-size: 11px; color: #666; margin-top: 2px; }
        .alm-stat-type { font-size: 18px; }
        /* Add entry form */
        .alm-add { padding: 14px 20px; background: #fff; border-bottom: 2px solid #e8f5e9; }
        .alm-add-title { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 10px; }
        .alm-quick-btns { display: flex; gap: 8px; margin-bottom: 10px; }
        .alm-quick-btn { flex: 1; padding: 10px 6px; border: 2px solid #e0e0e0; background: #fff; border-radius: 10px; cursor: pointer; font-size: 18px; transition: 0.15s; text-align: center; }
        .alm-quick-btn:hover { border-color: #2e7d32; background: #e8f5e9; transform: scale(1.05); }
        .alm-quick-btn.selected { border-color: #2e7d32; background: #c8e6c9; }
        .alm-text-row { display: flex; gap: 8px; }
        .alm-text-input { flex: 1; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; outline: none; font-family: inherit; }
        .alm-save-btn { padding: 10px 16px; background: #2e7d32; color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; white-space: nowrap; }
        .alm-save-btn:disabled { opacity: 0.5; cursor: default; }
        /* Timeline */
        .alm-timeline { padding: 16px 20px; overflow-y: auto; flex: 1; }
        .alm-timeline-title { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; margin-bottom: 12px; }
        .alm-entry { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; animation: fadeIn 0.3s ease; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
        .alm-entry-icon { width: 36px; height: 36px; border-radius: 50%; background: #f5f5f5; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; border: 2px solid #e0e0e0; }
        .alm-entry-body { flex: 1; }
        .alm-entry-date { font-size: 11px; color: #aaa; font-weight: 600; margin-bottom: 2px; }
        .alm-entry-text { font-size: 14px; color: #333; }
        .alm-entry-text.empty { color: #bbb; font-style: italic; }
        .alm-empty { text-align: center; padding: 30px 20px; color: #bbb; font-style: italic; }
        /* Měsíční separator v timeline */
        .alm-month-sep { font-size: 11px; font-weight: 700; color: #1565c0; text-transform: uppercase; padding: 12px 0 6px; border-bottom: 1px solid #e3f2fd; margin-bottom: 4px; }
        /* AI Tip */
        .alm-ai-wrap { padding: 14px 20px; background: #fffde7; border-top: 2px solid #fff9c4; }
        .alm-ai-btn { width: 100%; padding: 10px; background: #fff; border: 2px solid #ffd54f; border-radius: 8px; font-weight: 700; cursor: pointer; color: #f57c00; font-size: 14px; transition: 0.2s; }
        .alm-ai-btn:hover { background: #fff9c4; }
        .alm-ai-btn:disabled { opacity: 0.5; cursor: default; }
        .alm-ai-result { margin-top: 10px; padding: 12px; background: #fff; border-radius: 8px; font-size: 14px; line-height: 1.6; color: #333; border: 1px solid #ffe082; white-space: pre-line; }

        /* ─── EXPORT MODAL ─── */
        .exp-option { border: 2px solid #e0e0e0; border-radius: 12px; padding: 18px; cursor: pointer; transition: 0.2s; background: #fff; }
        .exp-option:hover { border-color: #2e7d32; background: #f1f8e9; }
        .exp-option-icon { font-size: 32px; margin-bottom: 8px; }
        .exp-option-title { font-weight: 800; font-size: 16px; color: #1b5e20; margin-bottom: 4px; }
        .exp-option-desc { font-size: 13px; color: #666; line-height: 1.4; }
        .exp-sheet-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
        .exp-sheet-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f9f9f9; border-radius: 8px; border: 1px solid #eee; }
        .exp-sheet-name { font-weight: 700; font-size: 14px; color: #333; }
        .exp-sheet-btn { padding: 6px 14px; background: #2e7d32; color: #fff; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 13px; transition: 0.15s; }
        .exp-sheet-btn:hover { background: #1b5e20; }
        .exp-sheet-btn:disabled { opacity: 0.5; cursor: default; }
        .exp-divider { border: none; border-top: 2px dashed #e0e0e0; margin: 4px 0; }
        .exp-json-btns { display: flex; gap: 8px; margin-top: 10px; }
        .exp-json-btn { flex: 1; padding: 11px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; transition: 0.15s; }
        .exp-json-dl { background: #1565c0; color: #fff; }
        .exp-json-dl:hover { background: #0d47a1; }
        .exp-json-cp { background: #e3f2fd; color: #1565c0; }
        .exp-json-cp:hover { background: #bbdefb; }
        .exp-json-btn:disabled { opacity: 0.5; cursor: default; }
        .exp-status { text-align: center; font-size: 13px; color: #888; font-style: italic; margin-top: 8px; min-height: 20px; }

        /* ─── POLY LABELY ─── */
        .poly-label-wrap { display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; }
        .poly-label { background: rgba(255,255,255,0.95); border: 2px solid #2e7d32; color: #111; font-weight: 700; border-radius: 8px; padding: 6px 12px; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.3); font-size: 14px; cursor: pointer; transform: translate(-50%,-50%); transition: 0.2s; }
        .poly-label:hover { background: #fff; border-color: #1b5e20; transform: translate(-50%,-50%) scale(1.05); }

        /* ─── PŘEPÍNAČ MAP ─── */
        #right-col { position: absolute; bottom: 96px; right: 14px; z-index: 2000; display: flex; flex-direction: column; gap: 4px; align-items: stretch; width: 104px; }
        #basemap-panel { display: flex; flex-direction: column; gap: 4px; }
        #basemap-toggle-btn { width: 100%; background: #1565c0; color: #fff; border: none; border-radius: 10px; padding: 7px 10px; font-size: 11px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 4px; transition: background 0.2s; }
        #basemap-toggle-btn:hover { background: #0d47a1; }
        #basemap-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transition: all 0.2s; }
        #basemap-switcher.collapsed { display: none; }
        .bm-sep { height: 1px; background: #ddd; margin: 2px 0; grid-column: 1 / -1; }
        .bm-btn { width: 48px; height: 48px; border-radius: 8px; border: 2px solid #e0e0e0; background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; box-shadow: 0 2px 8px rgba(0,0,0,.22); transition: border-color .15s, transform .1s, box-shadow .15s; padding: 0; }
        .bm-btn:hover { transform: scale(1.07); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
        .bm-btn.active { border-color: #2e7d32; box-shadow: 0 0 0 3px rgba(46,125,50,0.25), 0 3px 10px rgba(0,0,0,.25); }
        .bm-icon { font-size: 17px; line-height: 1; }
        .bm-label { font-size: 9px; font-weight: 700; color: #444; text-transform: uppercase; letter-spacing: 0.3px; }
        .bm-btn.active .bm-label { color: #2e7d32; }

        /* ─── TOAST ─── */
        #toast { position: fixed; bottom: 20px; right: 20px; z-index: 9999; padding: 14px 20px; border-radius: 10px; background: #333; color: #fff; opacity: 0; transition: opacity .3s; pointer-events: none; font-size: 15px; font-weight: bold; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
        #toast.show    { opacity: 1; }
        #toast.success { background: #2e7d32; }
        #toast.error   { background: #c62828; }

        /* ─── LOGIN SCREEN ─── */
        #login-screen { position: fixed; inset: 0; z-index: 10000; background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #1a237e 100%); display: flex; align-items: center; justify-content: center; }
        .login-box { background: #fff; border-radius: 20px; padding: 40px 36px; width: 90%; max-width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
        .login-logo  { font-size: 56px; margin-bottom: 8px; }
        .login-title { font-size: 26px; font-weight: 900; color: #1b5e20; margin: 0 0 6px; }
        .login-sub   { font-size: 14px; color: #888; margin-bottom: 28px; }
        .login-input { width: 100%; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 16px; outline: none; margin-bottom: 14px; box-sizing: border-box; transition: border 0.2s; }
        .login-input:focus { border-color: #2e7d32; }
        .login-btn { width: 100%; padding: 14px; background: #2e7d32; color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; transition: 0.2s; }
        .login-btn:hover    { background: #1b5e20; }
        .login-btn:disabled { background: #aaa; cursor: default; }
        .login-msg       { margin-top: 16px; font-size: 14px; color: #2e7d32; min-height: 20px; font-weight: 600; }
        .login-msg.error { color: #c62828; }

        /* ─── LEGENDA VRSTEV ─── */
        #legend { background: #fff; border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,0.28); overflow: hidden; display: none; }
        #legend-header { background: #2e7d32; color: #fff; padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 11px; user-select: none; transition: background 0.2s; border-radius: 10px 10px 0 0; }
        #legend-header:hover { background: #1b5e20; }
        #legend-toggle-icon { font-size: 12px; opacity: 0.7; transition: transform 0.25s; }
        #legend-toggle-icon.open { transform: rotate(180deg); }
        #legend-body { display: none; max-height: 200px; overflow-y: auto; }
        #legend-body.expanded { display: block; }
        .leg-row { display: flex; align-items: center; padding: 9px 10px 9px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; gap: 7px; }
        .leg-row:hover { background: #f5f5f5; }
        .leg-row.spotlit { background: #e8f5e9 !important; border-left: 3px solid #2e7d32; padding-left: 9px; }
        .leg-row.hidden-layer .leg-name { text-decoration: line-through; color: #bbb; }
        .leg-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0,0,0,0.18); }
        .leg-icon { font-size: 15px; flex-shrink: 0; }
        .leg-name { font-size: 12px; font-weight: 600; color: #333; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .leg-count { font-size: 11px; color: #999; background: #f0f0f0; border-radius: 10px; padding: 2px 7px; font-weight: 700; flex-shrink: 0; }
        .leg-count.has-items { background: #e8f5e9; color: #2e7d32; }
        .leg-eye { font-size: 13px; cursor: pointer; padding: 3px 5px; border-radius: 4px; flex-shrink: 0; transition: background 0.15s; line-height: 1; }
        .leg-eye:hover { background: #eee; }
        .leg-eye.hidden { opacity: 0.35; }
        .leg-footer { padding: 8px 12px; border-top: 1px solid #f0f0f0; background: #fafafa; }
        .leg-hint { font-size: 11px; color: #aaa; font-style: italic; text-align: center; }
        .leg-clear-btn { width: 100%; padding: 7px; background: #fff3e0; color: #f57c00; border: 1px solid #ffe0b2; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 12px; transition: background 0.15s; }
        .leg-clear-btn:hover { background: #ffe0b2; }

        /* ── Canvas overlay toggle v mapě ── */
        #canvas-overlay-toggle { position: absolute; bottom: 26px; left: 74px; z-index: 2000; background: #7b1fa2; color: #fff; border: 2px solid #fff; padding: 9px 14px; border-radius: 22px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.28); transition: 0.2s; display: none; font-size: 13px; white-space: nowrap; }
        #canvas-overlay-toggle:hover { background: #6a1b9a; transform: scale(1.05); }
        #canvas-overlay-toggle.hidden-overlay { background: #555; border-color: #aaa; }

        /* ══════════════════════════════════════════════════════
           GARDEN CANVAS EDITOR
           ══════════════════════════════════════════════════════ */
        #editor-backdrop { position: fixed; inset: 0; z-index: 4000; background: #1a1a2e; display: none; flex-direction: column; }
        #editor-backdrop.open { display: flex; }
        #editor-topbar { height: 52px; background: #1b5e20; color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
        #editor-topbar h2 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
        .ed-top-btn { height: 34px; padding: 0 14px; border: none; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; transition: 0.15s; white-space: nowrap; }
        .ed-top-btn:hover { filter: brightness(1.12); transform: scale(1.03); }
        .ed-top-btn.primary { background: #f57c00; color: #fff; }
        .ed-top-btn.secondary { background: rgba(255,255,255,0.15); color: #fff; }
        .ed-top-btn.danger { background: rgba(198,40,40,0.85); color: #fff; }
        #ed-undo-btn, #ed-redo-btn { width: 34px; height: 34px; padding: 0; border: none; border-radius: 8px; background: rgba(255,255,255,0.12); color: #fff; font-size: 16px; cursor: pointer; transition: 0.15s; display: flex; align-items: center; justify-content: center; }
        #ed-undo-btn:hover, #ed-redo-btn:hover { background: rgba(255,255,255,0.25); }
        #ed-undo-btn:disabled, #ed-redo-btn:disabled { opacity: 0.3; cursor: default; }
        .ed-sep { width: 1px; height: 26px; background: rgba(255,255,255,0.2); flex-shrink: 0; }
        #ed-scale-info { font-size: 11px; color: rgba(255,255,255,0.6); background: rgba(0,0,0,0.2); border-radius: 6px; padding: 4px 10px; white-space: nowrap; }

        #editor-body { display: flex; flex: 1; overflow: hidden; }
        #editor-left { width: 200px; background: #263238; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
        #ed-tabs { display: flex; flex-shrink: 0; border-bottom: 2px solid rgba(255,255,255,0.1); }
        .ed-tab { flex: 1; padding: 11px 0; text-align: center; font-size: 12px; font-weight: 700; cursor: pointer; color: rgba(255,255,255,0.5); transition: 0.15s; border-bottom: 2px solid transparent; margin-bottom: -2px; }
        .ed-tab.active { color: #fff; border-bottom-color: #4caf50; }
        .ed-tab:hover:not(.active) { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }

        #ed-tools-panel, #ed-assets-panel { flex: 1; overflow-y: auto; display: none; flex-direction: column; }
        #ed-tools-panel.active, #ed-assets-panel.active { display: flex; }
        .ed-section-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.8px; padding: 12px 14px 6px; }
        .ed-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 10px 10px; }
        .ed-tool-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 2px solid transparent; border-radius: 10px; background: rgba(255,255,255,0.07); color: #fff; cursor: pointer; font-size: 11px; font-weight: 600; transition: 0.15s; text-align: center; line-height: 1.2; }
        .ed-tool-btn:hover { background: rgba(255,255,255,0.15); }
        .ed-tool-btn.active { background: #2e7d32; border-color: #4caf50; }
        .ed-tool-btn .t-icon { font-size: 20px; }

        .ed-colors { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px; }
        .ed-color-swatch { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: 0.12s; flex-shrink: 0; }
        .ed-color-swatch:hover { transform: scale(1.15); }
        .ed-color-swatch.active { border-color: #fff; transform: scale(1.1); }
        .ed-stroke-row { display: flex; align-items: center; gap: 8px; padding: 0 10px 12px; }
        .ed-stroke-row input[type=range] { flex: 1; accent-color: #4caf50; }
        .ed-stroke-val { font-size: 12px; color: rgba(255,255,255,0.6); width: 24px; text-align: right; font-weight: 700; }

        .ed-asset-search { margin: 8px 10px; padding: 8px 10px; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; background: rgba(0,0,0,0.2); color: #fff; font-size: 13px; outline: none; width: calc(100% - 20px); }
        .ed-asset-search::placeholder { color: rgba(255,255,255,0.35); }
        .ed-asset-cat-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.8px; padding: 10px 12px 5px; }
        .ed-asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 8px 8px; }
        .ed-asset-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 8px; cursor: pointer; background: rgba(255,255,255,0.06); transition: 0.15s; font-size: 10px; color: rgba(255,255,255,0.6); text-align: center; line-height: 1.2; border: 2px solid transparent; }
        .ed-asset-item:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.2); }
        .ed-asset-item .a-emoji { font-size: 22px; }

        #editor-canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background: #121212; overflow: hidden; position: relative; }
        #garden-canvas { box-shadow: 0 0 40px rgba(0,0,0,0.8); }
        #ed-canvas-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.7); font-size: 12px; padding: 6px 14px; border-radius: 20px; pointer-events: none; white-space: nowrap; }

        #editor-right { width: 180px; background: #263238; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; padding: 14px 12px; gap: 10px; overflow-y: auto; border-left: 1px solid rgba(255,255,255,0.08); }
        .ed-prop-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
        .ed-prop-row { display: flex; flex-direction: column; gap: 4px; }
        .ed-prop-input { padding: 7px 9px; border: 1px solid rgba(255,255,255,0.15); border-radius: 7px; background: rgba(0,0,0,0.25); color: #fff; font-size: 13px; outline: none; width: 100%; }
        .ed-prop-input:focus { border-color: #4caf50; }
        .ed-prop-slider { width: 100%; accent-color: #4caf50; cursor: pointer; }
        .ed-prop-val { font-size: 11px; color: rgba(255,255,255,0.5); text-align: right; }
        .ed-prop-del-btn { width: 100%; padding: 9px; background: rgba(198,40,40,0.7); color: #fff; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 13px; margin-top: 6px; transition: 0.15s; }
        .ed-prop-del-btn:hover { background: #c62828; }
        #ed-no-selection { color: rgba(255,255,255,0.25); font-size: 12px; font-style: italic; text-align: center; padding-top: 20px; }
