/* ============== THEME ============== */
:root {
    --bg: #0d1015;
    --bg-2: #141a22;
    --bg-3: #1b2230;
    --bg-4: #232c3d;
    --panel: rgba(20, 26, 34, 0.92);
    --border: #263042;
    --border-2: #33405a;
    --text: #e7edf5;
    --muted: #8896ab;
    --primary: #4ea8ff;
    --primary-2: #7c5cff;
    --success: #3ddc84;
    --warning: #f5b642;
    --danger: #ff5c5c;
    --shadow: 0 6px 24px rgba(0,0,0,0.45);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
    --radius: 10px;
    --radius-lg: 16px;
}
html[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-2: #ffffff;
    --bg-3: #eef2f9;
    --bg-4: #e3e9f3;
    --panel: rgba(255,255,255,0.94);
    --border: #d5dbe7;
    --border-2: #c3cbdb;
    --text: #1a1f2b;
    --muted: #667085;
    --shadow: 0 6px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
}
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0; height: 100%; width: 100%;
    background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px; overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.muted.small { font-size: 11px; }

/* ============== AUTH PAGES ============== */
.auth-page {
    overflow: auto;
    background:
        radial-gradient(circle at 15% 10%, rgba(78,168,255,0.18), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(124,92,255,0.18), transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(78,168,255,0.06), transparent 60%),
        var(--bg);
    min-height: 100vh;
}
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    gap: 22px;
}
.auth-brand {
    font-weight: 800;
    letter-spacing: 4px;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    display: inline-block;
}
.auth-brand:hover { text-decoration: none; }
.auth-brand span {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.auth-card .auth-sub {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.auth-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
    background: var(--bg-2);
    color: var(--text);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
html[data-theme="light"] .auth-tab.active { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.auth-form { display: flex; flex-direction: column; }
.auth-field { display: block; margin-bottom: 14px; }
.auth-field .auth-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-size: 14px;
}
.auth-field input::placeholder { color: var(--muted); opacity: 0.65; }
.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78,168,255,0.18);
}
.auth-field .hint { color: var(--muted); font-size: 11px; margin-top: 5px; }
.auth-actions { margin-top: 6px; display: flex; flex-direction: column; gap: 10px; }
.auth-error {
    color: var(--danger);
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(255,92,92,0.08);
    border: 1px solid rgba(255,92,92,0.35);
    border-radius: 8px;
    margin-bottom: 12px;
}
.auth-links { margin-top: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-links a { margin-left: 6px; font-weight: 600; }
.auth-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* ============== BUTTONS ============== */
.btn {
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
}
.btn:hover { background: var(--bg-4); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(78,168,255,0.35); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-3); }
.btn.small { padding: 8px 12px; font-size: 12px; }
.btn-block { width: 100%; padding: 13px 16px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn .spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============== WELCOME ============== */
.overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(78,168,255,0.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124,92,255,0.15), transparent 45%),
        var(--bg);
    z-index: 1000;
    overflow: auto;
    padding: 24px 12px;
}
.welcome-card {
    background: var(--bg-2);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-width: 540px;
    width: 100%;
    text-align: center;
    position: relative;
}
.welcome-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.welcome-user { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.welcome-user b { color: var(--text); }
.welcome-card h1 {
    font-size: 26px;
    letter-spacing: 3px;
    margin: 0 0 8px 0;
    font-weight: 800;
}
.welcome-card h1 span {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.welcome-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.welcome-groups { margin-top: 26px; text-align: left; }
.welcome-groups h3 {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 8px;
    font-weight: 700;
}
.groups-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.group-item:hover { border-color: var(--primary); background: var(--bg-4); }
.group-item .gname { font-weight: 600; margin-bottom: 2px; }
.group-item .gmeta { color: var(--muted); font-size: 11px; }
.group-item .gcode {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 12px;
    padding: 4px 8px;
    background: rgba(78,168,255,0.08);
    border-radius: 6px;
}
.welcome-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ============== MODALS ============== */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
    animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.18s;
}
@keyframes popIn {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-box.wide { max-width: 640px; max-height: 82vh; overflow: auto; }
.modal-box h2 { margin: 0 0 14px; font-size: 20px; }
.modal-box h3 { margin-top: 18px; font-size: 14px; }
.modal-box label {
    display: block;
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}
.modal-box input, .modal-box select {
    width: 100%;
    padding: 11px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
}
.modal-box input:focus, .modal-box select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78,168,255,0.18);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.error { color: var(--danger); margin-top: 10px; font-size: 13px; }
.result-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    text-align: center;
}
.join-code {
    font-size: 30px;
    letter-spacing: 5px;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 8px;
    background: rgba(78,168,255,0.08);
    border-radius: 10px;
    border: 1px dashed rgba(78,168,255,0.35);
}
.row { display: flex; gap: 8px; margin-top: 8px; }
kbd {
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

/* ============== APP LAYOUT ============== */
#app {
    display: grid;
    grid-template-columns: 300px 1fr 340px;
    grid-template-rows: 52px 1fr;
    height: 100vh;
    width: 100vw;
    grid-template-areas: "top top top" "left map right";
}
#topbar {
    grid-area: top;
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    z-index: 10;
}
.brand { font-weight: 800; letter-spacing: 2px; }
.brand span { color: var(--primary); }
.status-group { display: flex; gap: 6px; align-items: center; flex: 1; }
.status-pill {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.15s;
}
.status-pill:hover { background: var(--bg-4); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.online { background: var(--success); box-shadow: 0 0 8px rgba(61,220,132,0.7); }
.dot.offline { background: var(--warning); }
.dot.error { background: var(--danger); }
.version-pill {
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: var(--muted);
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
}
.actions { display: flex; gap: 6px; }
.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--bg-3); border-color: var(--border); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(78,168,255,0.35); }
.icon-btn.close { position: absolute; top: 8px; right: 8px; }

#sidebar-left {
    grid-area: left;
    background: var(--panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 12px;
}
#details-panel {
    grid-area: right;
    background: var(--panel);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
    position: relative;
}
#map-wrap { grid-area: map; position: relative; }
#map { position: absolute; inset: 0; background: #0a0d12; }
.map-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(78,168,255,0.95);
    color: #001;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    pointer-events: none;
    box-shadow: var(--shadow);
    z-index: 400;
}
.autosave {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(20,26,34,0.9);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--success);
    transition: opacity 0.3s;
}
.autosave.hidden { display: none; }

.panel-section { margin-bottom: 16px; }
.panel-section h3 {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.tool-btn, .sheet-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin: 6px 0;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}
.tool-btn:hover, .sheet-btn:hover { background: var(--bg-4); border-color: var(--primary); }
.tool-btn.active { border-color: var(--primary); background: rgba(78,168,255,0.15); }
.tool-btn span { display: inline-block; width: 22px; }

.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; color: var(--text); }
.panel-section select, .panel-section input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
}
.panel-section select:focus, .panel-section input[type="text"]:focus { border-color: var(--primary); }
.list-compact { max-height: 160px; overflow-y: auto; }
.list-compact button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.list-compact button:hover { background: var(--bg-3); }
.list-compact .hitem { padding: 6px 8px; color: var(--muted); font-size: 12px; }

.marker-list, .history-list { max-height: 220px; overflow-y: auto; }
.marker-list .item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.marker-list .item:hover { background: var(--bg-3); }
.marker-list .item .ico { font-size: 16px; }
.history-list .hitem {
    padding: 5px 6px;
    font-size: 12px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.history-list .hitem:last-child { border: none; }

/* ============== ACTIVITY LIST ============== */
.activity-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.activity-item {
    padding: 8px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.activity-item:hover { border-color: var(--primary); background: var(--bg-4); }
.activity-item .who { font-weight: 700; color: var(--primary); }
.activity-item .what { color: var(--text); }
.activity-item .when { color: var(--muted); font-size: 10px; margin-top: 2px; }
.activity-item .action-hint {
    color: var(--primary);
    font-size: 10px;
    margin-top: 2px;
    font-weight: 600;
}
.activity-item.unread { border-left: 3px solid var(--primary); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; color: var(--muted); }
.stats b { color: var(--text); display: block; font-size: 15px; }
.group-info { font-size: 12px; color: var(--muted); line-height: 1.7; }
.group-info b { color: var(--text); }
.group-info .code {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
}

/* ============== MAP OVERRIDES ============== */
.leaflet-container { background: #0a0d12; }
.leaflet-control-attribution {
    background: rgba(0,0,0,0.55) !important;
    color: #ccc !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a { color: #9ecbff !important; }

/* ============== MARKER ICON ============== */
.marker-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.75);
}
.marker-pin.selected { outline: 3px solid #fff; outline-offset: 2px; }
.pin-tooltip {
    background: rgba(0,0,0,0.85);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
}

/* ============== DETAILS PANEL ============== */
#details-content h2 { margin: 0 0 4px; font-size: 20px; }
#details-content .type-pill {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
#details-content .desc {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
    white-space: pre-wrap;
}
#details-content .coords {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    background: var(--bg-3);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
#details-content .meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}
#details-content textarea,
#details-content input,
#details-content select {
    width: 100%;
    padding: 9px 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    margin-bottom: 8px;
    resize: vertical;
}
#details-content textarea { min-height: 80px; }
#details-content .btn-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
#details-content .btn-row .btn { flex: 1; }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.type-grid button {
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}
.type-grid button.active { border-color: var(--primary); background: rgba(78,168,255,0.15); }

/* ============== BOTTOM BAR (mobile) ============== */
#bottombar { display: none; }
#mobile-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 14px;
    z-index: 900;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 22px rgba(0,0,0,0.5);
}

/* ============== TOAST ============== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-3);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 1200;
    box-shadow: var(--shadow);
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ============== RESPONSIVE ============== */
@media (max-width: 640px) {
    .auth-card { padding: 24px 20px; }
    .welcome-card { padding: 24px 18px; }
    .welcome-card h1 { font-size: 22px; letter-spacing: 2px; }
    .join-code { font-size: 24px; letter-spacing: 3px; }
}
@media (max-width: 1024px) {
    #app {
        grid-template-columns: 1fr;
        grid-template-rows: 52px 1fr 60px;
        grid-template-areas: "top" "map" "bottom";
    }
    #sidebar-left, #details-panel {
        position: fixed;
        top: 52px;
        bottom: 60px;
        width: min(90vw, 340px);
        z-index: 500;
        transform: translateX(-100%);
        transition: transform 0.25s;
        background: var(--bg-2);
    }
    #sidebar-left { left: 0; }
    #details-panel { left: auto; right: 0; transform: translateX(100%); }
    #sidebar-left.open, #details-panel.open { transform: translateX(0); }

    #bottombar {
        grid-area: bottom;
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: var(--panel);
        border-top: 1px solid var(--border);
        padding: 4px;
    }
    .bbtn {
        background: transparent;
        border: none;
        color: var(--text);
        font-size: 20px;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        cursor: pointer;
    }
    .bbtn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); font-weight: 700; }
    .autosave { bottom: 74px; }
    .toast { bottom: 78px; }
}
@media (min-width: 1025px) {
    #mobile-sheet { display: none !important; }
}