        /* RESET & BASE */
        * { margin: 0; padding: 0; box-sizing: border-box; }
        html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

        button:not(:disabled):active,
        .btn:active,
        a.btn:active,
        .tag-btn:active,
        .sidebar-tab:active,
        .hamburger:active,
        .color-swatch-compact:active,
        .mobile-page-back:active {
            opacity: 0.75;
            transform: scale(0.96);
            transition: all 0.1s ease;
        }
        body {
            font-family: 'Inter', -apple-system, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
            background: var(--bg-body);
            color: var(--text-primary);
            height: 100vh;
            overflow: hidden;
            transition: background 0.2s, color 0.2s;
        }

        :root {
            --bg-body: #050505;
            --bg-surface: #0f0f0f;
            --bg-elevated: #1a1a1a;
            --bg-input: #141414;
            --bg-hover: #262626;
            --bg-modal: #0f0f0f;
            --bg-overlay: #0f0f0f;
            --text-primary: #ffffff;
            --text-secondary: #a3a3a3;
            --text-tertiary: #525252;
            --text-inverse: #000000;
            --border-subtle: rgba(255, 255, 255, 0.08);
            --border-input: rgba(255, 255, 255, 0.12);
            --border-modal: rgba(255, 255, 255, 0.1);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.8);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.9);
            --gradient-overlay: linear-gradient(to bottom, transparent, #0f0f0f);
            --skeleton-base: #1a1a1a;
            --skeleton-shine: #262626;
            --toast-bg: #ffffff;
            --toast-text: #000000;
            --toast-border: rgba(255, 255, 255, 0.1);
        }

        body.theme-dark-low {
            --bg-body: #121212;
            --bg-surface: #1e1e1e;
            --bg-elevated: #2a2a2a;
            --bg-input: #252525;
            --bg-hover: #333333;
            --bg-modal: #1e1e1e;
            --bg-overlay: #1e1e1e;
            --text-primary: #e0e0e0;
            --text-secondary: #aaaaaa;
            --text-tertiary: #777777;
            --text-inverse: #000000;
            --border-subtle: rgba(255, 255, 255, 0.06);
            --border-input: rgba(255, 255, 255, 0.08);
            --border-modal: rgba(255, 255, 255, 0.06);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
            --gradient-overlay: linear-gradient(to bottom, transparent, #1e1e1e);
            --skeleton-base: #2a2a2a;
            --skeleton-shine: #3a3a3a;
            --toast-bg: #e0e0e0;
            --toast-text: #121212;
            --toast-border: rgba(255, 255, 255, 0.05);
        }

        /* LIGHT */
        body.light-theme {
            --bg-body: #ffffff;
            --bg-surface: #f7f7f7;
            --bg-elevated: #ffffff;
            --bg-input: #f0f0f0;
            --bg-hover: #e5e5e5;
            --bg-modal: #ffffff;
            --bg-overlay: #ffffff;
            --text-primary: #0a0a0a;
            --text-secondary: #525252;
            --text-tertiary: #a3a3a3;
            --text-inverse: #ffffff;
            --border-subtle: rgba(0, 0, 0, 0.06);
            --border-input: rgba(0, 0, 0, 0.1);
            --border-modal: rgba(0, 0, 0, 0.08);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
            --gradient-overlay: linear-gradient(to bottom, transparent, #ffffff);
            --skeleton-base: #f0f0f0;
            --skeleton-shine: #e5e5e5;
            --toast-bg: #0a0a0a;
            --toast-text: #ffffff;
            --toast-border: rgba(0, 0, 0, 0.1);
        }

        #map { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; }

        /* SIDEBAR — PC */
        .sidebar {
            position: fixed; top: 0; left: 0; width: var(--sidebar-w, 400px); min-width: 400px; max-width: min(640px, 60vw); height: 100dvh; height: 100vh;
            background: var(--bg-surface); border-right: 1px solid var(--border-subtle); z-index: 10;
            display: flex; flex-direction: column; padding: 16px 20px 12px 20px; gap: 0;
            overflow: hidden;
            transition: transform 0.25s ease, background 0.2s, border-color 0.2s;
            box-shadow: var(--shadow-md); color: var(--text-primary);
        }
        .sidebar.collapsed { transform: translateX(-100%); border-right: none; box-shadow: none; }
        .sidebar::-webkit-scrollbar { width: 3px; }
        .sidebar::-webkit-scrollbar-thumb { background: var(--border-subtle); }

        /* SIDEBAR RESIZE — drag the right edge (PC only) */
        .sidebar-resize-handle {
            position: absolute; top: 0; right: 0; width: 8px; height: 100%;
            cursor: col-resize; z-index: 30; touch-action: none;
        }
        .sidebar-resize-handle::after {
            content: ''; position: absolute; top: 0; right: 0; width: 2px; height: 100%;
            background: transparent; transition: background 0.15s ease;
        }
        .sidebar-resize-handle:hover::after,
        body.sidebar-resizing .sidebar-resize-handle::after { background: var(--accent, #3b82f6); }
        body.sidebar-resizing { user-select: none; -webkit-user-select: none; }
        body.sidebar-resizing * { cursor: col-resize !important; }
        body.sidebar-resizing #userBadge { transition: none; }

        .sidebar-header {
            display: flex; justify-content: space-between; align-items: center;
            padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle);
            margin-bottom: 12px; flex-shrink: 0;
        }
        .logo {
            font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em;
            color: #ffffff; font-family: 'Unbounded', -apple-system, 'SF Pro Display', sans-serif;
        }
        .logo a {
            color: #ffffff;
            text-decoration: none;
        }
        .hamburger {
            background: none; border: none; color: var(--text-secondary); cursor: pointer;
            padding: 4px; border-radius: 4px; transition: background 0.1s, color 0.2s; line-height: 1;
        }
        .hamburger:hover { color: var(--text-primary); background: var(--bg-hover); }
        .hamburger svg { width: 20px; height: 20px; fill: currentColor; }

        .sidebar-tabs {
            display: flex; gap: 4px; flex-shrink: 0; margin-bottom: 12px;
            background: var(--bg-input); border-radius: 8px; padding: 3px;
        }
        .sidebar-tab {
            flex: 1; padding: 7px 8px; border: none; border-radius: 6px;
            background: transparent; color: var(--text-secondary); cursor: pointer;
            font-size: 0.7rem; font-weight: 600; transition: all 0.15s;
            text-align: center; letter-spacing: 0.3px; text-transform: uppercase;
            font-family: inherit;
        }
        .sidebar-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
        .sidebar-tab.active {
            background: var(--text-primary); color: var(--bg-body); box-shadow: 0 1px 4px rgba(0,0,0,0.3);
        }
        .sidebar-tab-icon { margin-right: 4px; }
                .collection-fact-row { display:grid; grid-template-columns:24px 1fr auto; gap:8px; align-items:center; padding:10px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-input); cursor:grab; transition:background .15s,border-color .15s,opacity .15s; }
                .collection-fact-row:hover { background:var(--bg-hover); border-color:var(--border-input); }
                .collection-fact-row.dragging { opacity:.45; }
                .collection-fact-row .drag-handle { color:var(--text-tertiary); font-size:1rem; user-select:none; }
                .collection-fact-row .fact-number { color:var(--text-secondary); font-size:.75rem; font-weight:700; }
                .collection-fact-row .fact-copy { min-width:0; }
                .collection-fact-row .fact-copy strong { display:block; font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
                .collection-fact-row .fact-copy small { display:block; color:var(--text-tertiary); font-size:.65rem; margin-top:2px; }
                .collection-fact-row .remove { margin-left:auto; padding:2px 7px; }
                .collection-editor-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
                .collection-editor-heading h3 { font-size:.95rem; }
                .collection-editor-heading span { color:var(--text-secondary); font-size:.7rem; }
                .collection-field { width:100%; background:var(--bg-input); color:var(--text-primary); border:1px solid var(--border-input); border-radius:8px; padding:9px 10px; font:inherit; font-size:.82rem; outline:none; }
                .collection-field:focus { border-color:var(--text-primary); }
                .collection-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }
                .collection-transition { margin:8px 0; padding:8px 10px; color:var(--text-secondary); font-size:.72rem; text-align:center; border-top:1px solid var(--border-subtle); border-bottom:1px solid var(--border-subtle); }

                .collection-complete { text-align:center; padding:18px 10px; }
                .collection-complete h3 { margin:0 0 8px; font-size:1rem; }
                .collection-complete p { color:var(--text-secondary); font-size:.78rem; line-height:1.45; margin:0 0 14px; }
                .collection-list-item-actions { display:flex; gap:4px; margin-top:6px; }
                .collection-list-item-actions button { padding:2px 8px; font-size:.68rem; cursor:pointer; }
                .collection-transition-input { width:100%; background:var(--bg-input); color:var(--text-primary); border:1px dashed var(--border-input); border-radius:6px; padding:5px 8px; font:inherit; font-size:.7rem; outline:none; }
                .collection-transition-input:focus { border-color:var(--text-primary); }
                .collection-vote-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; align-items:center; margin-bottom:10px; }
                .collection-vote-row button.active { border-color:var(--text-primary); color:var(--text-primary); }
                @media (max-width: 768px) { .collection-tab { display:none; } }

        .sidebar-content {
            padding: 10px;
            flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
            padding-right: 2px;
        }
        .sidebar-content {
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        .sidebar-content::-webkit-scrollbar { display: none; width: 0; height: 0; }

        .tab-panel { display: none; flex-direction: column; gap: 8px; }
        .tab-panel.active { display: flex; }

        .my-facts-list {
            display: flex; flex-direction: column; gap: 4px;
        }
        .my-fact-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 6px 10px; background: var(--bg-input); border-radius: 6px;
            border: 1px solid transparent; transition: background 0.1s, border-color 0.1s;
        }
        .my-fact-item:hover { background: var(--bg-hover); border-color: var(--border-subtle); }
        .my-fact-item .text {
            flex: 1; font-size: 0.8125rem; word-break: break-word; margin-right: 8px;
            color: var(--text-primary); cursor: pointer;
            font-family: inherit;
        }
        .my-fact-item .text:hover { color: var(--text-secondary); text-decoration: underline; }
        .fresh-badge { display: inline-block; margin-left: 6px; background: var(--text-primary); color: var(--bg-body); font-size: 0.6rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.3px; vertical-align: middle; }
        .my-fact-item .actions { display: flex; gap: 4px; flex-shrink: 0; }
        .my-fact-item .actions button {
            background: transparent; border: none; color: var(--text-secondary);
            cursor: pointer; padding: 4px; border-radius: 4px; transition: color 0.1s, background 0.1s;
            display: flex; align-items: center; justify-content: center;
        }
        .my-fact-item .actions button:hover { background: var(--bg-hover); color: var(--text-primary); }
        .my-fact-item .actions button.delete:hover { color: #dc2626; }
        .my-fact-item .actions button.svg { width: 16px; height: 16px; fill: currentColor; }
        .my-facts-empty {
            color: var(--text-secondary); font-size: 0.85rem; text-align: center; padding: 20px 0;
            font-family: inherit;
        }

        .create-section textarea {
            background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 8px;
            padding: 10px 12px; font-size: 0.875rem; color: var(--text-primary); outline: none;
            width: 100%; min-height: 72px; max-height: 120px; resize: vertical;
            line-height: 1.6; transition: border-color 0.1s, background 0.2s, color 0.2s;
            font-family: inherit;
        }
        .create-section textarea:focus { border-color: var(--text-primary); }
        .char-counter { text-align: right; font-size: 0.7rem; color: var(--text-secondary); margin-top: 4px; font-family: inherit; transition: color 0.15s; }
        .char-counter.warn { color: #f59e0b; }
        .char-counter.limit { color: #dc2626; font-weight: 600; }
        .create-section textarea::placeholder { color: var(--text-secondary); }
        .create-section .label {
            font-size: 0.75rem; color: var(--text-secondary); display: block; margin: 16px 0 6px;
            font-weight: 600; font-family: inherit;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .create-section > .label:first-of-type { margin-top: 0; }
        .create-section .color-picker-grid {
            display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 0;
        }
        #colorPicker { grid-template-columns: repeat(8, 1fr); }
        .create-section .color-swatch-compact {
            aspect-ratio: 1; border-radius: 4px; cursor: pointer; border: 2px solid transparent;
            transition: all 0.15s; width: 100%; min-height: 20px; max-height: 24px; position: relative;
        }
        .create-section .color-swatch-compact:hover { transform: scale(1.1); border-color: rgba(255,255,255,0.5); }
        .create-section .color-swatch-compact.selected {
            border-color: var(--text-primary);
            transform: scale(1.1);
        }
        .create-section .color-swatch-compact.selected::after {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
            color: #fff; font-size: 12px; font-weight: 700; font-size: 10px;
        }
        .create-section .color-swatch-compact[data-light="true"].selected::after { color: #333; text-shadow: 0 0 4px rgba(255,255,255,0.5); }
        .create-section .tag-buttons {
            display: flex; flex-wrap: wrap; gap: 8px; margin: 0;
        }
        .create-section .tag-btn {
            background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 20px;
            padding: 4px 12px; font-size: 0.7rem; color: var(--text-secondary); cursor: pointer;
            transition: all 0.1s; line-height: 1.4;
            font-family: inherit;
            font-weight: 500;
        }
        .create-section .tag-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
        .create-section .tag-btn.active { background: var(--text-primary); color: var(--bg-body); border-color: var(--text-primary); }
        .create-section .tag-btn[data-tag="MEMES"] { border-color: #FF6B00; }
        .create-section .tag-btn[data-tag="MEMES"].active { background: #FF6B00; border-color: #FF6B00; color: #fff; }
        .create-section .tag-btn[data-tag="HISTORY"] { border-color: #8B4513; }
        .create-section .tag-btn[data-tag="HISTORY"].active { background: #8B4513; border-color: #8B4513; color: #fff; }
        .create-section .tag-btn[data-tag="GEOGRAPHY"] { border-color: #2ECC40; }
        .create-section .tag-btn[data-tag="GEOGRAPHY"].active { background: #2ECC40; border-color: #2ECC40; color: #fff; }
        .create-section .tag-btn[data-tag="DRAMA"] { border-color: #E6003C; }
        .create-section .tag-btn[data-tag="DRAMA"].active { background: #E6003C; border-color: #E6003C; color: #fff; }
        .create-section .tag-btn[data-tag="SHITPOST"] { border-color: #B500E0; }
        .create-section .tag-btn[data-tag="SHITPOST"].active { background: #B500E0; border-color: #B500E0; color: #fff; }
        .create-section .tag-btn[data-tag="TRUE STORY"] { border-color: #1565C0; }
        .create-section .tag-btn[data-tag="TRUE STORY"].active { background: #1565C0; border-color: #1565C0; color: #fff; }
        .create-section .tag-btn[data-tag="DISCUSS"] { border-color: #4A4A4A; }
        .create-section .tag-btn[data-tag="DISCUSS"].active { background: #4A4A4A; border-color: #4A4A4A; color: #fff; }
        .create-section .tag-btn[data-tag="LOCAL TIPS"] { border-color: #FFD60A; }
        .create-section .tag-btn[data-tag="LOCAL TIPS"].active { background: #FFD60A; border-color: #FFD60A; color: #1a1a1a; }
        .create-section .tag-btn[data-tag="REVIEW"] { border-color: #40E0D0; }
        .create-section .tag-btn[data-tag="REVIEW"].active { background: #40E0D0; border-color: #40E0D0; color: #1a1a1a; }
        .create-section .tag-btn[data-tag="OTHER"] { border-color: #888888; }
        .create-section .tag-btn[data-tag="OTHER"].active { background: #888888; border-color: #888888; color: #fff; }

        .create-section .btn {
            border: none; border-radius: 6px; padding: 8px 16px; font-size: 0.875rem; font-weight: 600;
            cursor: pointer; transition: background 0.1s, color 0.2s, border-color 0.2s;
            width: 100%; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px;
            font-family: inherit;
        }
        .create-section .btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .create-section .btn-outline { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); }
        .create-section .btn-outline:hover:not(:disabled) { background: var(--bg-hover); }
        .create-section .btn-primary { background: var(--text-primary); color: var(--bg-body); }
        .create-section .btn-primary:hover:not(:disabled) { opacity: 0.9; }

        #cancelSelection {
            display: none; background: var(--bg-input); border: 1px solid var(--border-input);
            border-radius: 6px; padding: 8px 16px; font-size: 0.875rem; color: var(--text-secondary);
            cursor: pointer; margin-top: 8px; width: 100%; text-align: center;
            transition: background 0.1s, color 0.2s, border-color 0.2s;
            font-family: inherit;
        }
        #cancelSelection:hover { background: var(--bg-hover); }
        #cancelSelection.visible { display: block; }

        #bannedWarning {
            display: none; background: rgba(220,38,38,0.1); border-left: 3px solid #dc2626;
            padding: 8px 10px; margin-top: 8px; border-radius: 6px;
        }
        #bannedWarning p { margin: 0; font-size: 0.75rem; color: #dc2626; font-family: inherit; }

        .create-section .info-box {
            background: rgba(255,255,255,0.05); border-left: 3px solid var(--text-secondary);
            padding: 8px 10px; margin: 8px 0 0; border-radius: 6px;
        }
        body.light-theme .create-section .info-box { background: rgba(0,0,0,0.03); }
        .create-section .info-box p { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--text-secondary); font-family: inherit; }

        .sidebar-footer {
            border-top: 1px solid var(--border-subtle); padding-top: 10px; margin-top: 6px;
            display: flex; gap: 16px; font-size: 0.75rem; flex-shrink: 0;
            font-family: inherit;
        }
        .sidebar-footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.15s; }
        .sidebar-footer a:hover { color: var(--text-primary); }

        .open-sidebar-btn {
            position: fixed; top: 50%; left: 12px; z-index: 9;
            background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px;
            width: 36px; height: 36px; display: none; align-items: center; justify-content: center;
            color: var(--text-primary); cursor: pointer; box-shadow: var(--shadow-md);
            transition: background 0.1s, color 0.2s, border-color 0.2s;
        }
        .open-sidebar-btn:hover { background: var(--bg-hover); }
        .open-sidebar-btn svg { width: 20px; height: 20px; fill: currentColor; }
        .sidebar.collapsed ~ .open-sidebar-btn { display: flex; }

        .settings-btn {
            position: fixed; top: 16px; right: 16px; z-index: 30;
            background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px;
            width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
            color: var(--text-primary); cursor: pointer; box-shadow: var(--shadow-md);
            transition: background 0.1s, color 0.2s, border-color 0.2s;
        }
        .settings-btn:hover { background: var(--bg-hover); }
        .settings-btn svg { width: 20px; height: 20px; fill: currentColor; }

        /* OVERLAY */
        .overlay {
            position: fixed; top: 0; right: calc(-1 * 400px); width: 400px; height: 100%; max-height: 100vh;
            background: var(--bg-overlay); border-left: 1px solid var(--border-subtle); z-index: 40;
            box-shadow: var(--shadow-lg); transition: right 0.25s ease, background 0.2s, border-color 0.2s;
            padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
            color: var(--text-primary);
        }
        .overlay.show { right: 0; }
        .overlay::-webkit-scrollbar { width: 3px; }
        .overlay::-webkit-scrollbar-thumb { background: var(--border-subtle); }
        .overlay .close-btn { align-self: flex-end; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; transition: color 0.1s; line-height: 1; display: flex; align-items: center; justify-content: center; }
        .overlay .close-btn:hover { color: var(--text-primary); }
        .overlay .close-btn svg { width: 22px; height: 22px; fill: currentColor; }
        .overlay .fact-text { font-size: 1rem; line-height: 1.6; color: var(--text-primary); margin-bottom: 4px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; font-family: inherit; }
        .overlay .vote-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
        .overlay .vote-buttons button {
            background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px;
            padding: 4px 12px; font-size: 0.875rem; color: var(--text-primary); cursor: pointer;
            transition: all 0.1s; display: flex; align-items: center; gap: 4px;
            font-family: inherit;
            font-weight: 500;
        }
        .overlay .vote-buttons button:hover:not(:disabled) { background: var(--bg-hover); }
        .overlay .vote-buttons button:disabled { opacity: 0.5; cursor: not-allowed; }
        .overlay .vote-buttons button.voted { border-color: var(--text-primary); background: rgba(255,255,255,0.1); color: var(--text-primary); }
        body.light-theme .overlay .vote-buttons button.voted { background: rgba(0,0,0,0.05); }

        .overlay .stats {
            font-size: 0.875rem; color: var(--text-secondary); padding: 8px 0;
            border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
            font-family: inherit;
        }
        .overlay .stats span { margin-right: 12px; }
        .overlay-reactions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-subtle); font-size: 0.78rem; color: var(--text-secondary); }
        .overlay-reactions-toggle { background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; color: var(--text-secondary); cursor: pointer; font: inherit; padding: 6px 10px; width: 100%; }
        .overlay-reactions-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
        .overlay-reactions-details { margin-top: 8px; }
        .overlay-reactions-title { color: var(--text-primary); font-weight: 600; margin-bottom: 6px; }
        .overlay-reactions-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; line-height: 1.45; }
        .overlay-reactions-username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .overlay-reactions-mark { font-weight: 700; font-size: 1rem; }
        .overlay-reactions-mark.like { color: #16a34a; }
        .overlay-reactions-mark.dislike { color: #dc2626; }
        .overlay-reactions-loading { color: var(--text-tertiary); }
        .overlay .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
        .overlay .actions-row { display: flex; gap: 8px; width: 100%; }
        .overlay .actions-row.secondary:empty { display: none; }
        .overlay .actions button {
            flex: 1; padding: 8px; border: none; border-radius: 6px; font-size: 0.875rem; font-weight: 600;
            cursor: pointer; transition: background 0.1s; display: flex; align-items: center; justify-content: center; gap: 8px;
            font-family: inherit;
        }
        .overlay .actions-share .card-btn {
            flex: 1 1 100%;
            min-width: 0;
            padding: 10px 8px;
        }
        .overlay .actions .copy-btn { background: var(--text-primary); color: var(--bg-body); }
        .overlay .actions .copy-btn:hover { opacity: 0.9; }
        .overlay .actions .card-btn { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-input); }
        .overlay .actions .card-btn:hover { background: var(--bg-hover); }
        .overlay .actions .card-btn:disabled { opacity: 0.6; cursor: wait; }
        .overlay .actions .delete-btn { background: #dc2626; color: #fff; display: none; }
        .overlay .actions .delete-btn:hover { background: #b91c1c; }
        .overlay .actions .delete-btn.visible { display: flex; }
        .overlay .actions .report-btn { background: #dc2626; color: #fff; display: none; }
        .overlay .actions .report-btn:hover { background: #b91c1c; }
        .overlay .actions .report-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .overlay .actions button svg { width: 16px; height: 16px; fill: currentColor; }

        /* Fact card share sheet */
        .fact-card-sheet {
            display: none; position: fixed; inset: 0; z-index: 12000;
            align-items: center; justify-content: center;
            background: rgba(0,0,0,0.55); padding: 16px; box-sizing: border-box;
        }
        .fact-card-sheet.show { display: flex; }
        .fact-card-sheet-panel {
            width: min(420px, 100%); max-height: min(92vh, 820px);
            background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: 16px; padding: 16px; box-shadow: var(--shadow-lg);
            display: flex; flex-direction: column; gap: 12px;
            font-family: inherit;
        }
        .fact-card-sheet-preview {
            width: 100%; max-height: 55vh; object-fit: contain; border-radius: 10px;
            background: #0c0e14; display: block;
        }
        .fact-card-sheet-actions {
            display: flex; flex-direction: column; align-items: stretch; gap: 10px;
        }
        .fact-card-sheet-actions button {
            width: 100%; padding: 12px 10px; border: none; border-radius: 10px;
            font-size: 0.9rem; font-weight: 600; cursor: pointer;
            font-family: inherit; min-width: 0;
        }
        .fact-card-sheet-actions button[hidden] { display: none !important; }
        .fact-card-sheet-or {
            display: flex; align-items: center; gap: 12px;
            width: 100%; font-size: 0.72rem; font-weight: 500;
            color: var(--text-secondary); opacity: 0.75; letter-spacing: 0.02em;
            user-select: none; text-transform: lowercase;
        }
        .fact-card-sheet-or::before,
        .fact-card-sheet-or::after {
            content: ''; flex: 1; height: 1px;
            background: var(--border-subtle);
        }
        .fact-card-sheet-share { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-input); }
        .fact-card-sheet-save { background: var(--text-primary); color: var(--bg-body); }
        .fact-card-sheet-copy { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input) !important; }
        .fact-card-sheet-close {
            background: transparent; border: none; color: var(--text-secondary);
            align-self: flex-end; cursor: pointer; font-size: 0.85rem; padding: 4px 0;
            font-family: inherit;
        }

        /* SKELETON */
        .skeleton-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; background: var(--skeleton-base); border-radius: 6px; margin-bottom: 4px; height: 44px; }
        .skeleton-item .skeleton-text { flex: 1; height: 14px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; margin-right: 8px; }
        .skeleton-item .skeleton-actions { display: flex; gap: 4px; }
        .skeleton-item .skeleton-action { width: 20px; height: 20px; background: var(--skeleton-shine); border-radius: 4px; animation: shimmer 1.5s infinite; }
        @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
        .skeleton-text-block { width: 100%; min-height: 60px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; margin-bottom: 4px; }
        .skeleton-text-line { width: 100%; height: 18px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; margin-bottom: 8px; }
        .skeleton-text-line.short { width: 60%; }
        .skeleton-vote-buttons { display: flex; gap: 8px; margin: 8px 0; }
        .skeleton-vote-btn { width: 80px; height: 36px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
        .skeleton-stats { display: flex; gap: 20px; padding: 12px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin: 8px 0; }
        .skeleton-stat-item { width: 60px; height: 24px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
        .skeleton-actions { display: flex; gap: 8px; margin-top: 8px; }
        .skeleton-action-btn { flex: 1; height: 40px; background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }

        /* READ MORE */
        .fact-text-wrapper { position: relative; max-height: 150px; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1); border-radius: 4px; }
        .fact-text-wrapper.expanded { max-height: 3000px; }
        .fact-text-wrapper .gradient-overlay { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: var(--gradient-overlay); pointer-events: none; transition: opacity 0.3s ease; }
        .fact-text-wrapper.expanded .gradient-overlay { opacity: 0; }
        .read-more-btn {
            background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 20px;
            color: var(--text-secondary); cursor: pointer; font-size: 0.8125rem; font-weight: 500;
            padding: 8px 18px; margin-top: 6px; transition: all 0.2s ease;
            display: inline-flex; align-items: center; gap: 8px; width: fit-content; user-select: none;
            font-family: inherit;
        }
        .read-more-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-subtle); }
        .read-more-btn .arrow { display: inline-block; transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); font-size: 0.6rem; line-height: 1; }
        .read-more-btn .arrow.rotated { transform: rotate(180deg); }

        /* SPINNER */
        .spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--text-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* MAP LOADER */
        #mapLoader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; background: var(--bg-body); display: flex; align-items: center; justify-content: center; transition: opacity 0.5s ease, background 0.2s; }
        #mapLoader.hidden { opacity: 0; pointer-events: none; }
        #mapLoader .loader-inner { width: 48px; height: 48px; border: 4px solid var(--border-subtle); border-top-color: var(--text-primary); border-radius: 50%; animation: spin 1s linear infinite; }

        /* MOBILE ELEMENTS */
        #locationHint {
            display: none; position: fixed; top: 0; left: 50%; transform: translate(-50%, -100%);
            background: var(--text-primary); color: var(--bg-body); padding: 10px 16px; border-radius: 0 0 12px 12px;
            font-size: 0.9rem; font-weight: 600; z-index: 50;
            border: 1px solid rgba(255,255,255,0.15); border-top: none;
            text-align: center; transition: transform 0.25s ease; max-width: 92%;
            box-shadow: 0 4px 16px rgba(0,0,0,0.4); font-family: inherit;
            align-items: center; gap: 10px;
        }
        #locationHint.show { display: flex; transform: translate(-50%, 0); }
        #locationHint .hint-cancel {
            background: rgba(0,0,0,0.2); border: none; color: var(--bg-body); border-radius: 6px;
            padding: 4px 10px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
            transition: background 0.15s; white-space: nowrap;
            font-family: inherit;
        }
        body.light-theme #locationHint .hint-cancel { background: rgba(255,255,255,0.3); color: #000; }
        #locationHint .hint-cancel:hover { background: rgba(0,0,0,0.3); }

        #mobileCancelSelection { display: none; position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 45; background: rgba(220,38,38,0.9); color: #fff; border: none; border-radius: 30px; padding: 12px 24px; font-size: 0.9rem; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,0.6); backdrop-filter: blur(8px); cursor: pointer; transition: opacity 0.2s; white-space: nowrap; font-family: inherit; }
        #mobileCancelSelection.visible { display: block; }
        #mobileCancelSelection:active { transform: translateX(-50%) scale(0.95); }

        /* Floating chip: returns to the collection editor while picking places on the map */
        .mobile-collection-resume-chip {
            display: none; position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 44;
            align-items: center; gap: 8px;
            background: var(--bg-surface); color: var(--text-primary);
            border: 1px solid var(--border-subtle); border-radius: 30px;
            padding: 12px 20px; font-size: 0.85rem; font-weight: 600; font-family: inherit;
            box-shadow: 0 6px 20px rgba(0,0,0,0.55); cursor: pointer; white-space: nowrap;
            transition: transform 0.15s ease, border-color 0.2s ease;
        }
        .mobile-collection-resume-chip:active { transform: translateX(-50%) scale(0.95); }
        .mobile-collection-resume-chip svg { width: 14px; height: 14px; fill: var(--text-primary); flex-shrink: 0; }
        .mobile-collection-resume-chip b { color: var(--text-tertiary, #888); font-weight: 700; font-size: 0.75rem; }
        @media (min-width: 769px) { .mobile-collection-resume-chip { display: none !important; } }

        /* ---- MOBILE BOTTOM NAV ---- */
        .mobile-nav {
            display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 47;
            background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
            padding: 6px 0 env(safe-area-inset-bottom, 6px) 0;
            justify-content: space-around; align-items: center;
            box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
        }
        .mobile-nav-btn {
            background: none; border: none; color: var(--text-secondary); cursor: pointer;
            display: flex; flex-direction: column; align-items: center; gap: 2px;
            padding: 4px 12px; font-size: 0.55rem; font-weight: 500; transition: color 0.15s;
            font-family: inherit; min-width: 48px;
        }
        .mobile-nav-btn svg { width: 24px; height: 24px; fill: currentColor; transition: fill 0.15s; }
        .mobile-nav-btn.active { color: var(--text-primary); }
        .mobile-nav-btn.active svg { fill: var(--text-primary); }
        .mobile-nav-btn:active { transform: scale(0.92); }

        .mobile-overlay {
            display: none; position: fixed; bottom: 0; left: 0; right: 0; top: 0; z-index: 45;
            background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
            border-radius: 16px 16px 0 0; max-height: 100vh; height: 100vh;
            overflow-y: auto; padding: 16px 20px 20px 20px;
            box-shadow: 0 -8px 24px rgba(0,0,0,0.6);
            transition: transform 0.3s ease, opacity 0.3s ease;
            transform: translateY(100%); opacity: 0; pointer-events: none;
        }
        .mobile-overlay.open {
            transform: translateY(0); opacity: 1; pointer-events: auto;
        }
        .mobile-overlay .handle {
            width: 40px; height: 4px; background: var(--text-tertiary); border-radius: 4px;
            margin: 0 auto 12px auto; cursor: grab;
        }
        .mobile-overlay .close-mobile {
            position: absolute; top: 12px; right: 16px; background: none; border: none;
            color: var(--text-secondary); font-size: 1.4rem; cursor: pointer;
        }
        .mobile-overlay .close-mobile:hover { color: var(--text-primary); }
        .mobile-overlay .panel-title {
            font-size: 1rem; font-weight: 600; margin-bottom: 12px; color: var(--text-primary);
            font-family: inherit;
        }

        .mobile-overlay .create-section textarea { min-height: 80px; }
        .mobile-overlay .create-section .color-picker-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
        .mobile-overlay .create-section .color-swatch-compact { min-height: 28px; max-height: 32px; border-radius: 6px; }
        .mobile-overlay .create-section .tag-btn { padding: 8px 14px; font-size: 0.8rem; min-height: 34px; min-width: 48px; }
        .mobile-overlay .create-section .btn { padding: 12px 16px; font-size: 1rem; border-radius: 8px; }

        /* TOAST  / MARKERS / FILTER / ONBOARDING / CRYPTO */
        .toast {
            position: fixed; bottom: 50px; left: 50%; transform: translateX(-50%) translateY(8px);
            background: var(--toast-bg); color: var(--toast-text); padding: 8px 20px; border-radius: 6px;
            font-size: 0.875rem; font-weight: 500; z-index: 13000; opacity: 0; pointer-events: none;
            border: 1px solid var(--toast-border); box-shadow: var(--shadow-md);
            transition: all 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
            font-family: inherit;
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
        .toast.error { background: #dc2626; color: #fff; border-color: #991b1b; }
        .toast.success { background: #16a34a; color: #fff; border-color: #15803d; }
        .toast.rate-limit { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-input); }



        .custom-marker { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 1px 3px rgba(0,0,0,0.5); cursor: pointer; transform: translate(-50%,-50%); transition: transform 0.1s; }
        .custom-marker:hover { transform: translate(-50%,-50%) scale(1.15); }
        .temp-marker { width: 22px; height: 22px; border-radius: 4px; background-color: var(--text-primary); border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 0 0 3px rgba(255,255,255,0.25); transform: translate(-50%,-50%); animation: pulse-marker 1.5s ease-out infinite; }
        @keyframes pulse-marker { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); } 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

        /* TOOLTIP */
        .marker-tooltip {
            position: absolute;
            z-index: 15;
            border: 1px solid transparent;
            background:
                linear-gradient(135deg, var(--tt-bg-top, var(--bg-surface)), var(--tt-bg-bottom, var(--bg-surface))) padding-box,
                linear-gradient(180deg, var(--tt-border-top, var(--border-subtle)), var(--tt-border-bottom, var(--border-subtle))) border-box;
            border-radius: 8px;
            padding: 8px 12px;
            max-width: 240px;
            min-width: 180px;
            box-shadow: var(--shadow-lg);
            pointer-events: none;
            opacity: 0;
            transform: translate(-100%, -50%) translateX(-12px);
            transition: opacity 0.15s ease, transform 0.15s ease;
            font-family: inherit;
        }
        .marker-tooltip.show {
            opacity: 1;
            transform: translate(-100%, -50%) translateX(-16px);
        }
        body.light-theme .marker-tooltip {
            background:
                linear-gradient(135deg, var(--tt-bg-top-light, var(--bg-surface)), var(--tt-bg-bottom-light, var(--bg-surface))) padding-box,
                linear-gradient(180deg, var(--tt-border-top-light, var(--border-subtle)), var(--tt-border-bottom-light, var(--border-subtle))) border-box;
        }
        .marker-tooltip-text.is-empty { color: var(--text-secondary); font-style: italic; }
        .marker-tooltip-gif {
            display: block;
            max-width: 100%;
            max-height: 120px;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 6px;
            margin: 6px auto 8px;
            background: var(--bg-input);
            animation: gif-fade-in .15s ease;
        }
        .overlay-fact-gif {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            max-height: 280px;
            min-height: 80px;
            margin: 4px 0 10px;
            border-radius: 12px;
            overflow: hidden;

        }
        .overlay-fact-gif img {
            display: block;
            max-width: 100%;
            max-height: 280px;
            width: auto;
            height: auto;
            object-fit: contain;
            border-radius: 12px;
            overflow: hidden;
            clip-path: inset(0 round 12px);
            animation: gif-fade-in .18s ease;
        }

        .gif-picker {
            margin: 14px 0 18px;
            padding: 16px;
            border: 1px solid var(--border-input);
            border-radius: 14px;
            background: linear-gradient(145deg, var(--bg-elevated), var(--bg-input));
            box-shadow: var(--shadow-sm);
        }
        .gif-picker-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 11px;
        }
        .gif-picker-heading .label {
            margin: 0;
            color: var(--text-primary);
            font-size: .78rem;
            letter-spacing: .02em;
        }
        .gif-picker-optional {
            display: block;
            margin-top: 3px;
            color: var(--text-tertiary);
            font-size: .68rem;
            font-weight: 400;
            letter-spacing: 0;
            text-transform: none;
        }
        .gif-powered {
            flex: 0 0 auto;
            padding: 4px 7px;
            border: 1px solid var(--border-subtle);
            border-radius: 5px;
            color: var(--text-tertiary);
            font-size: .62rem;
            font-weight: 600;
            white-space: nowrap;
        }
        .gif-search-row {
            display: flex;
            align-items: stretch;
            gap: 8px;
        }
        .gif-search-row input {
            min-width: 0;
            flex: 1;
            height: 38px;
            padding: 0 12px;
            border: 1px solid var(--border-input);
            border-radius: 8px;
            outline: none;
            background: var(--bg-body);
            color: var(--text-primary);
            font: inherit;
            font-size: .82rem;
            transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
        }
        .gif-search-row input::placeholder { color: var(--text-tertiary); }
        .gif-search-row input:hover { border-color: var(--text-secondary); }
        .gif-search-row input:focus {
            border-color: var(--text-primary);
            background: var(--bg-input);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 12%, transparent);
        }
        .create-section .gif-search-row button {
            flex: 0 0 auto;
            width: auto;
            min-width: 76px;
            padding: 0 13px;
            border-radius: 8px;
            font-size: .78rem;
        }
        .gif-search-status {
            min-height: 20px;
            margin: 8px 2px 5px;
            color: var(--text-secondary);
            font-size: .72rem;
            line-height: 20px;
        }
        .gif-results-shell {
            position: relative;
            min-width: 0;
        }
        .gif-scroll-btn {
            position: absolute;
            top: 50%;
            z-index: 2;
            display: grid;
            width: 28px;
            height: 28px;
            place-items: center;
            padding: 0 0 2px;
            border: 1px solid var(--border-input);
            border-radius: 50%;
            background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
            color: var(--text-primary);
            cursor: pointer;
            font-family: inherit;
            font-size: 17px;
            font-weight: 700;
            line-height: 1;
            opacity: .9;
            transform: translateY(-50%);
            transition: opacity .15s ease, background .15s ease, transform .15s ease;
        }
        .gif-scroll-btn[hidden] { display: none !important; }
        .gif-picker .gif-scroll-btn:hover { background: var(--bg-hover); transform: translateY(-50%) scale(1.06); }
        .gif-picker .gif-scroll-btn:active { background: var(--bg-hover); opacity: .8; transform: translateY(-50%) scale(.9); }
        .gif-scroll-btn:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
        .gif-scroll-left { left: 4px; }
        .gif-scroll-right { right: 4px; }
        .gif-results {
            --gif-card-width: 128px;
            display: flex;
            flex-wrap: nowrap;
            gap: 8px;
            max-width: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 2px max(2px, calc((100% - var(--gif-card-width)) / 2)) 8px;
            scroll-behavior: smooth;
            cursor: grab;
            user-select: none;
            -webkit-user-select: none;
            scrollbar-width: thin;
            scrollbar-color: var(--border-input) transparent;
        }
        .gif-results.dragging { cursor: grabbing; }
        .gif-results.dragging .gif-result { cursor: grabbing; }
        .gif-results::-webkit-scrollbar { height: 6px; }
        .gif-results::-webkit-scrollbar-track { background: transparent; }
        .gif-results::-webkit-scrollbar-thumb { background: var(--border-input); border-radius: 999px; }
        .gif-result {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 var(--gif-card-width);
            height: 82px;
            padding: 0;
            overflow: hidden;
            cursor: pointer;
            border: 2px solid transparent;
            border-radius: 9px;
            background: var(--bg-body);
            box-shadow: 0 1px 3px rgba(0,0,0,.18);
            transition: transform .15s ease, opacity .15s ease, filter .15s ease, border-color .15s ease, box-shadow .15s ease;
            animation: gif-card-in .18s ease backwards;
        }
        .gif-results.ready .gif-result:not(.is-center) { opacity: .5; filter: saturate(.8); transform: scale(.97); }
        .gif-result:hover { border-color: var(--text-secondary); box-shadow: var(--shadow-md); }
        .gif-result:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
        .gif-result.selected {
            border-color: var(--text-primary);
            box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-primary) 28%, transparent), var(--shadow-md);
        }
        .gif-result.selected::after {
            content: '✓';
            position: absolute;
            top: 5px;
            right: 5px;
            display: grid;
            width: 20px;
            height: 20px;
            place-items: center;
            border-radius: 50%;
            background: var(--text-primary);
            color: var(--bg-body);
            font-size: .75rem;
            font-weight: 800;
            animation: gif-pop .12s ease backwards;
        }
        .gif-result img {
            display: block;
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
            pointer-events: none;
        }
        .selected-gif[hidden] {
            display: none !important;
        }
        .selected-gif {
            display: flex;
            align-items: center;
            gap: 11px;
            margin-top: 10px;
            padding: 8px;
            border: 1px solid var(--border-input);
            border-radius: 9px;
            background: var(--bg-body);
            color: var(--text-primary);
            font-size: .75rem;
        }
        .selected-gif img {
            max-width: 72px;
            max-height: 52px;
            width: auto;
            height: auto;
            flex: 0 0 auto;
            object-fit: contain;
            border-radius: 6px;
        }
        .selected-gif strong { display: block; margin-bottom: 2px; font-size: .76rem; }
        .gif-remove-btn { display: block; padding: 2px 0; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; font-size: .7rem; text-decoration: underline; }
        .gif-remove-btn:hover { color: var(--text-primary); }
        .selected-gif:not([hidden]) { animation: gif-panel-in .15s ease backwards; }

        .gif-skeleton {
            flex: 0 0 var(--gif-card-width);
            height: 82px;
            border-radius: 9px;
            background: linear-gradient(100deg, var(--bg-body) 40%, var(--bg-hover) 50%, var(--bg-body) 60%);
            background-size: 220% 100%;
            animation: gif-skeleton-pulse 1.1s linear infinite;
        }

        @keyframes gif-card-in {
            from { opacity: 0; transform: translateY(6px) scale(.96); }
            to { opacity: 1; transform: none; }
        }
        @keyframes gif-pop {
            from { opacity: 0; transform: scale(.4); }
            to { opacity: 1; transform: scale(1); }
        }
        @keyframes gif-panel-in {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: none; }
        }
        @keyframes gif-fade-in {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes gif-skeleton-pulse {
            from { background-position: 120% 0; }
            to { background-position: -120% 0; }
        }

        @media (prefers-reduced-motion: reduce) {
            .gif-result, .gif-scroll-btn, .gif-skeleton, .selected-gif, .marker-tooltip-gif, .overlay-fact-gif img { animation: none !important; transition: none !important; }
            .gif-results { scroll-behavior: auto; }
        }

        @media (max-width: 420px) {
            .gif-picker { padding: 12px; }
            .gif-picker-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
            .gif-powered { align-self: flex-start; }
            .gif-results { --gif-card-width: 120px; }
            .gif-result { height: 82px; }
            .gif-scroll-btn { width: 26px; height: 26px; }
        }

        /* FACT CREATE PREVIEW (desktop sidebar) */
        .fact-preview {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 10px;
            border: 1px dashed var(--border-subtle);
            border-radius: 8px;
            margin-bottom: 4px;
        }
        .fact-preview-marker {
            width: 22px;
            height: 22px;
            flex-shrink: 0;
            border-radius: 4px;
            border: 2px solid rgba(255,255,255,0.9);
            box-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }
        .fact-preview-tooltip {
            position: static;
            opacity: 1;
            transform: none;
            transition: none;
            pointer-events: auto;
            z-index: auto;
            flex: 0 0 auto;
            max-width: 240px;
            min-width: 180px;
        }
        .marker-tooltip-user {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .marker-tooltip-user::before {
            content: '@';
            color: var(--accent);
        }
        .marker-tooltip-text {
            font-size: 0.8125rem;
            color: var(--text-primary);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            word-break: break-word;
            margin-bottom: 6px;
        }
        .marker-tooltip-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 2px;
        }
        .marker-tooltip-tag {
            font-size: 0.6rem;
            font-weight: 700;
            padding: 1px 8px;
            border-radius: 10px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            color: #fff;
        }
        .marker-tooltip-votes {
            font-size: 0.7rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 8px;
        }


        #faktTransferModal { display:none; position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,0.65); backdrop-filter:blur(4px); align-items:center; justify-content:center; }
        #faktTransferModal.show { display:flex; }
        #faktTransferModal .modal-box { background:var(--bg-modal); border:1px solid var(--border-modal); border-radius:12px; padding:24px; width:min(400px,90%); box-shadow:var(--shadow-lg); color:var(--text-primary); }
        #faktTransferModal h3 { margin:0 0 8px; font-size:1.1rem; }
        #faktTransferModal p { margin:0 0 12px; color:var(--text-secondary); font-size:.85rem; line-height:1.4; }
        #faktTransferModal input { width:100%; box-sizing:border-box; padding:10px 12px; margin-top:8px; background:var(--bg-input); border:1px solid var(--border-input); border-radius:6px; color:var(--text-primary); font:inherit; }
        #faktTransferPreview { display:none; margin-top:10px; padding:10px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-input); }
        #faktTransferPreview.show { display:block; }
        #faktTransferModal .modal-actions { display:flex; gap:8px; margin-top:18px; }
        #faktTransferModal button { flex:1; padding:10px 12px; border-radius:6px; border:1px solid var(--border-input); background:var(--bg-input); color:var(--text-primary); cursor:pointer; font:inherit; }
        #faktTransferModal #faktTransferSubmit { background:var(--text-primary); color:var(--bg-body); border-color:var(--text-primary); }

        #feedbackModal { display:flex; visibility:hidden; opacity:0; pointer-events:none; position:fixed; inset:0; z-index:10001; background:rgba(0,0,0,.7); backdrop-filter:blur(4px); align-items:center; justify-content:center; padding:16px; transition:opacity .25s ease, visibility 0s linear .25s; }
        #feedbackModal.show { visibility:visible; opacity:1; pointer-events:auto; transition-delay:0s; }
        #feedbackModal .modal-box { width:min(440px,100%); max-height:90vh; overflow:auto; padding:24px; background:var(--bg-modal); border:1px solid var(--border-modal); border-radius:12px; box-shadow:var(--shadow-lg); color:var(--text-primary); opacity:0; transform:translateY(16px) scale(.97); transition:opacity .25s ease, transform .25s ease; }
        #feedbackModal.show .modal-box { opacity:1; transform:translateY(0) scale(1); }
        @media (prefers-reduced-motion: reduce) {
            #feedbackModal, #feedbackModal .modal-box { transition:none; }
        }
        #feedbackModal h3 { margin:0 0 8px; font-size:1.15rem; }
        #feedbackModal p { margin:0 0 18px; color:var(--text-secondary); font-size:.85rem; line-height:1.45; }
        #feedbackModal label { display:block; margin:12px 0 6px; color:var(--text-secondary); font-size:.8rem; }
        #feedbackModal select, #feedbackModal textarea { width:100%; box-sizing:border-box; padding:10px 12px; background:var(--bg-input); border:1px solid var(--border-input); border-radius:6px; color:var(--text-primary); font:inherit; }
        #feedbackModal textarea { min-height:120px; resize:vertical; }
        #feedbackModal .feedback-error { display:none; margin-top:8px; color:#ef4444; font-size:.8rem; }
        #feedbackModal .feedback-error.show { display:block; }
        #feedbackModal .modal-actions { display:flex; gap:8px; margin-top:18px; }
        #feedbackModal button { flex:1; padding:10px 12px; border-radius:6px; border:1px solid var(--border-input); background:var(--bg-input); color:var(--text-primary); cursor:pointer; font:inherit; }
        #feedbackModal #feedbackSubmit { background:var(--text-primary); color:var(--bg-body); border-color:var(--text-primary); }
        #feedbackModal button:disabled { opacity:.55; cursor:not-allowed; }

        #filterModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 60; align-items: center; justify-content: center; }
        #filterModal .modal-box { background: var(--bg-modal); border: 1px solid var(--border-modal); border-radius: 8px; padding: 24px; max-width: 400px; width: 90%; box-shadow: var(--shadow-lg); transition: background 0.2s, border-color 0.2s; }
        #filterModal .modal-box h3 { margin-bottom: 12px; color: var(--text-primary); font-family: inherit; }
        #filterModal .modal-box select { width: 100%; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); border-radius: 6px; padding: 8px; font-size: 0.875rem; transition: background 0.2s, color 0.2s, border-color 0.2s; font-family: inherit; }
        #filterModal .modal-box .actions-row { display: flex; gap: 8px; margin-top: 16px; }
        #filterModal .modal-box .actions-row .btn { flex: 1; }

        #settingsModal {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6); z-index: 70; align-items: center; justify-content: center;
            backdrop-filter: blur(4px);
        }
        #settingsModal .modal-box { background: var(--bg-modal); border: 1px solid var(--border-modal); border-radius: 8px; padding: 32px; max-width: 360px; width: 90%; box-shadow: var(--shadow-lg); transition: background 0.2s, border-color 0.2s; }
        #settingsModal .modal-box h3 { color: var(--text-primary); font-size: 1.125rem; font-family: inherit; }
        #settingsModal .modal-box .setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
        #settingsModal .modal-box .setting-row span { color: var(--text-primary); font-family: inherit; }
        #settingsModal .modal-box .setting-row button { background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; padding: 6px 16px; color: var(--text-primary); cursor: pointer; font-size: 0.8125rem; transition: background 0.1s, color 0.2s, border-color 0.2s; font-family: inherit; }
        #settingsModal .modal-box .setting-row button:hover { background: var(--bg-hover); }

        #onboardingModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
        #onboardingModal .modal-box { background: var(--bg-modal); border: 1px solid var(--border-modal); border-radius: 8px; padding: 40px; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; transition: background 0.2s, border-color 0.2s; }
        #onboardingModal .modal-box h2 { font-size: 1.5rem; margin-bottom: 8px; color: var(--text-primary); font-family: inherit; }
        #onboardingModal .modal-box p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.95rem; font-family: inherit; }
        #onboardingModal .modal-box .step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
        #onboardingModal .modal-box .step .num { background: var(--text-primary); color: var(--bg-body); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: 0.85rem; font-family: inherit; }
        #onboardingModal .modal-box .step .content strong { color: var(--text-primary); font-family: inherit; }
        #onboardingModal .modal-box .step .content p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; margin-bottom: 0; font-family: inherit; }
        #onboardingModal .modal-box .terms { color: var(--text-tertiary); font-size: 0.8rem; text-align: center; margin-top: 20px; line-height: 1.6; font-family: inherit; }
        #onboardingModal .modal-box .terms a { color: var(--text-primary); text-decoration: underline; font-weight: 500; }
        #onboardingModal .modal-box .got-it { margin-top: 16px; width: 100%; background: var(--text-primary); color: var(--bg-body); border: none; border-radius: 6px; padding: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: inherit; }
        #onboardingModal .modal-box .got-it:hover { opacity: 0.9; }
        #onboardingModal .modal-box .hint { color: var(--text-tertiary); font-size: 0.75rem; text-align: center; margin-top: 12px; font-family: inherit; }

        .crypto-support-btn {
            position: fixed; bottom: 20px; right: 20px; z-index: 25;
            background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px;
            padding: 10px 16px; font-size: 0.8125rem; font-weight: 600; color: var(--text-primary);
            cursor: pointer; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
            transition: all 0.1s, background 0.2s, color 0.2s, border-color 0.2s; user-select: none;
            font-family: inherit;
        }
        .crypto-support-btn:hover { background: var(--bg-hover); transform: scale(1.03); }
        .crypto-support-btn .crypto-badge { background: #FFDD00; color: #000; padding: 2px 8px; border-radius: 12px; font-size: 0.6rem; font-weight: 700; }
        .crypto-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 9999; align-items: center; justify-content: center; }
        .crypto-modal.show { display: flex; }
        .crypto-modal-content { background: var(--bg-modal); border: 1px solid var(--border-modal); padding: 28px; border-radius: 8px; max-width: 420px; width: 90%; color: var(--text-primary); box-shadow: var(--shadow-lg); position: relative; animation: modalSlideUp 0.3s ease-out; transition: background 0.2s, border-color 0.2s, color 0.2s; }
        @keyframes modalSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        .crypto-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
        .crypto-modal-header h3 { margin: 0; font-size: 1.25rem; color: #FFDD00; font-weight: 700; font-family: inherit; }
        .crypto-modal-close { cursor: pointer; font-size: 1.6rem; color: var(--text-secondary); transition: color 0.1s; background: none; border: none; line-height: 1; }
        .crypto-modal-close:hover { color: var(--text-primary); }
        .crypto-modal-text { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.6; font-family: inherit; }
        .crypto-address-label { font-size: 0.75rem; color: var(--text-secondary); display: block; margin-bottom: 6px; font-weight: 600; font-family: inherit; }
        .crypto-address-container { display: flex; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; padding: 4px; overflow: hidden; align-items: center; transition: background 0.2s, border-color 0.2s; }
        .crypto-address-input { background: transparent; border: none; color: var(--text-primary); padding: 8px 12px; font-size: 0.8125rem; width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; outline: none; cursor: text; }
        .crypto-copy-btn { background: var(--text-primary); color: var(--bg-body); border: none; padding: 8px 16px; border-radius: 6px; font-size: 0.8125rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: background 0.1s; white-space: nowrap; flex-shrink: 0; font-family: inherit; }
        .crypto-copy-btn:hover { opacity: 0.9; }
        .crypto-copy-btn.copied { background: #16a34a; color: #fff; }
        .crypto-modal-footer { font-size: 0.75rem; color: var(--text-tertiary); text-align: center; margin-top: 12px; font-family: inherit; }

        /* MEDIA QUERIES */
        @media (max-width: 768px) {
            .sidebar { display: none !important; }
            .open-sidebar-btn { display: none !important; }
            .settings-btn { display: none !important; }
            .random-btn { display: none !important; }
            .mobile-nav { display: flex; }
            .mobile-overlay { display: block; }

            .overlay {
                position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.9);
                width: 92%; max-width: 500px; height: auto; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 16px;
                padding: 24px 20px; background: var(--bg-modal); border: 1px solid var(--border-modal);
                box-shadow: var(--shadow-lg); z-index: 60; opacity: 0; pointer-events: none;
                transition: opacity 0.3s ease, transform 0.3s ease; right: auto; bottom: auto; top: 50%; left: 50%;
            }
            .overlay.show { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
            .overlay .close-btn { position: absolute; top: 12px; right: 16px; font-size: 1.8rem; padding: 4px; }
            .overlay .fact-text { font-size: 1rem; line-height: 1.7; margin-top: 8px; }
            .fact-text-wrapper { max-height: 180px; }
            .overlay .vote-buttons button { padding: 8px 14px; font-size: 0.9rem; border-radius: 30px; min-width: 60px; justify-content: center; }
            .overlay .stats { font-size: 0.85rem; padding: 10px 0; }
            .overlay .actions { flex-wrap: nowrap; gap: 8px; }
            .overlay .actions-row { flex-wrap: wrap; gap: 6px; }
            .overlay .actions button { flex: 1; padding: 12px 8px; font-size: 0.85rem; border-radius: 8px; }
            .overlay .actions-share .card-btn { flex: 1 1 100%; }
            .overlay-reactions { display: none !important; }

            #locationHint { font-size: 0.85rem; padding: 10px 14px; max-width: 94%; }
            #mobileCancelSelection { bottom: 140px; padding: 14px 28px; font-size: 1rem; border-radius: 40px; }

            .crypto-support-btn { bottom: 80px; right: 16px; padding: 10px 14px; border-radius: 30px; font-size: 0.75rem; z-index: 35; }
            .crypto-support-btn .crypto-badge { font-size: 0.55rem; padding: 1px 6px; }

            .mobile-overlay .create-section .color-picker-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
            .mobile-overlay .create-section .color-swatch-compact { min-height: 28px; max-height: 32px; border-radius: 6px; }
            .mobile-overlay .create-section .tag-btn { padding: 8px 14px; font-size: 0.8rem; min-height: 34px; min-width: 48px; }
            .mobile-overlay .create-section .btn { padding: 12px 16px; font-size: 1rem; border-radius: 8px; }
            .mobile-overlay .create-section textarea { min-height: 80px; font-size: 1rem; }

            #filterModal .modal-box, #settingsModal .modal-box, #onboardingModal .modal-box { max-width: 95%; padding: 24px 20px; margin: 16px; border-radius: 12px; }
            #filterModal .modal-box h3, #settingsModal .modal-box h3, #onboardingModal .modal-box h2 { font-size: 1.2rem; }
            #filterModal .modal-box select { font-size: 1rem; padding: 10px; }
            #onboardingModal .modal-box .step { gap: 12px; }
            #onboardingModal .modal-box .step .num { width: 32px; height: 32px; font-size: 1rem; }
            #userBadge { display: none !important; }
        }

        @media (max-width: 480px) {
            .crypto-support-btn { bottom: 76px; right: 12px; padding: 8px 12px; font-size: 0.7rem; }
            .mobile-nav-btn { padding: 2px 6px; font-size: 0.5rem; min-width: 40px; }
            .mobile-nav-btn svg { width: 20px; height: 20px; }
            .overlay { padding: 16px; height: auto; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
            .overlay .fact-text { font-size: 0.95rem; }
            .overlay .vote-buttons button { padding: 6px 12px; font-size: 0.8rem; min-width: 50px; }
            .overlay .actions button { font-size: 0.8rem; padding: 10px 6px; }

            .overlay .actions .update-btn {
                background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px;
                padding: 8px; font-size: 0.875rem; font-weight: 600; cursor: pointer;
                transition: all 0.15s; display: flex; align-items: center; justify-content: center;
                flex: 1; color: var(--text-secondary); font-family: inherit; min-height: 40px;
            }
            .overlay .actions .update-btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-primary); color: var(--text-primary); }
            .overlay .actions .update-btn:disabled { opacity: 0.4; cursor: not-allowed; }
            .overlay .actions .update-btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: var(--text-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

            .overlay .close-btn { top: 8px; right: 12px; }
            #mobileCancelSelection { bottom: 120px; padding: 12px 20px; font-size: 0.9rem; }
            #locationHint { font-size: 0.78rem; padding: 8px 12px; max-width: 90%; }
            .mobile-overlay { padding: 12px 16px; height: 100vh; max-height: 100vh; }
            .mobile-overlay .create-section .color-picker-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
            .mobile-overlay .create-section .color-swatch-compact { min-height: 24px; max-height: 28px; }
            .mobile-overlay .create-section .tag-btn { padding: 6px 12px; font-size: 0.75rem; min-height: 30px; min-width: 40px; }
        }

        @media (max-width: 768px) and (orientation: landscape) {
            .mobile-overlay { max-height: 100vh; height: 100vh; }
            #mobileCancelSelection { bottom: 80px; }
        }

        #loadingPopup {
            display: none; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;
            cursor: pointer; transition: transform 0.1s ease;
        }
        #loadingPopup.show { display: block; animation: slideDown 0.3s ease; }
        #loadingPopup.show ~ #mapSourceSwitcher {
            opacity: 0;
            pointer-events: none;
        }
        #mapSourceSwitcher { transition: opacity 0.15s ease, background 0.2s; }
        #loadingPopup.pop { animation: popClick 0.2s ease; }
        @keyframes popClick { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(0.92); } 70% { transform: translateX(-50%) scale(1.04); } 100% { transform: translateX(-50%) scale(1); } }
        @keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

        .loading-spinner-simple {
            width: 22px; height: 22px; border-radius: 50%;
            background: conic-gradient(from 0deg, transparent, var(--text-primary), var(--text-secondary), transparent);
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
            -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #fff calc(100% - 3px));
            animation: spin 0.8s linear infinite; flex-shrink: 0;
        }

        #activateSelectionMobile { transition: all 0.2s ease; }
        #activateSelectionMobile[style*="background-color: #16a34a"] { color: #fff !important; }
        #cancelSelectionMobile { transition: all 0.2s ease; }

        #mobileOverlayContainer { transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.35s ease; }
        #mobileOverlayContainer.open { display: block !important; }
        #mobileOverlayContainer.closed { display: none !important; }

        /* USER BADGE */
        #userBadge {
            position: fixed; top: 16px; z-index: 20; display: flex; align-items: center; gap: 12px;
            background: var(--bg-surface); padding: 8px 16px; border-radius: 8px;
            border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md); font-size: 0.9rem;
            transition: left 0.25s ease; left: calc(var(--sidebar-w, 400px) + 16px);
        }
        .sidebar.collapsed ~ #userBadge { left: 16px; }
        #userBadge a { text-decoration: none; }
        #userBadge .user-name a { color: var(--text-primary); }
        #userBadge .user-name a:hover { color: var(--text-secondary); text-decoration: underline; }

        /* MAP SOURCE SWITCHER */
        #mapSourceSwitcher {
            position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
            z-index: 25; display: flex; align-items: center; gap: 3px;
            padding: 3px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
            border-radius: 999px; box-shadow: var(--shadow-md); transition: background 0.2s;
        }
        #mapSourceSwitcher button {
            border: 0; border-radius: 999px; padding: 8px 14px; background: transparent;
            color: var(--text-secondary); font: 600 0.72rem/1 inherit; cursor: pointer;
            transition: background 0.15s, color 0.15s;
        }
        #mapSourceSwitcher button:hover { color: var(--text-primary); }
        #mapSourceSwitcher button.active { background: var(--text-primary); color: var(--bg-body); }
        @media (max-width: 768px) {
            #mapSourceSwitcher { top: 12px; }
            #mapSourceSwitcher button { padding: 8px 10px; font-size: 0.68rem; }
            #topLogo { top: 62px !important; }
        }

        @media (max-width: 768px) {
            #userBadge { left: auto !important; right: 16px; background: transparent; border: none; box-shadow: none; padding: 0; gap: 0; }
            #userBadge .user-name, #userBadge .user-logout, #userBadge .user-login-text { display: none; }
            #userBadge .user-avatar {
                font-size: 2rem; background: var(--bg-surface); border-radius: 50%; width: 44px; height: 44px;
                display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-subtle);
                box-shadow: var(--shadow-md); text-decoration: none; color: var(--text-primary);
            }
            #userBadge .user-login-text-mobile {
                display: block !important; background: var(--text-primary); color: var(--bg-body);
                padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 0.85rem;
            }
        }

        .mobile-overlay-container { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--bg-surface); overflow: hidden; }
        .mobile-overlay-container.open { display: block; }
        .mobile-page { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-surface); display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; transform: translateY(20px); }
        .mobile-page.active { opacity: 1; pointer-events: auto; transform: translateY(0); }
        .mobile-page-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
        .mobile-page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
        .mobile-page-close { background: none; border: none; color: var(--text-secondary); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; }
        .mobile-page-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }

        .create-body .create-section textarea { font-size: 0.95rem; min-height: 80px; }
        .create-body .color-picker-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
        .create-body .color-swatch-compact { min-height: 28px; max-height: 32px; border-radius: 6px; }
        .create-body .tag-btn { padding: 8px 14px; font-size: 0.8rem; min-height: 34px; min-width: 48px; }
        .create-body .btn { padding: 12px 16px; font-size: 1rem; border-radius: 8px; }

        /* Custom marker color: RGB sliders (left) + preview (right) */
        .custom-color-picker { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
        .rgb-sliders { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
        .rgb-slider { display: flex; align-items: center; gap: 10px; }
        .rgb-slider-label { width: 14px; flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); text-align: center; }
        .rgb-slider input[type="range"] {
            flex: 1; height: 10px; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
            -webkit-appearance: none; appearance: none;
            border: none; outline: none; cursor: pointer;
            border-radius: 999px;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
        }
        .rgb-slider input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none;
            width: 20px; height: 20px; border-radius: 50%;
            background: #fff; border: 1px solid rgba(0,0,0,0.1);
            box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25);
            cursor: grab; transition: transform 0.12s ease, box-shadow 0.12s ease;
        }
        .rgb-slider input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 3px 10px rgba(0,0,0,0.35); }
        .rgb-slider input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); cursor: grabbing; }
        .rgb-slider input[type="range"]::-webkit-slider-runnable-track {
            -webkit-appearance: none; appearance: none;
            background: transparent; border: none; box-shadow: none;
        }
        .rgb-slider input[type="range"]::-moz-range-track {
            height: 10px; border-radius: 999px;
            background: transparent; border: none; box-shadow: none;
        }
        .rgb-slider input[type="range"]::-moz-range-progress {
            background: transparent; border: none;
        }
        .rgb-slider input[type="range"]::-moz-range-thumb {
            width: 20px; height: 20px; border-radius: 50%;
            background: #fff; border: 1px solid rgba(0,0,0,0.1);
            box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25);
            cursor: grab; transition: transform 0.12s ease, box-shadow 0.12s ease;
        }
        .rgb-slider input[type="range"]:active::-moz-range-thumb { transform: scale(1.2); cursor: grabbing; }
        @media (prefers-reduced-motion: reduce) {
            .rgb-slider input[type="range"]::-webkit-slider-thumb,
            .rgb-slider input[type="range"]::-moz-range-thumb { transition: none; }
        }
        .rgb-slider[data-channel="r"] input[type="range"] { background: linear-gradient(to right, #7f1d1d, #ef4444); }
        .rgb-slider[data-channel="g"] input[type="range"] { background: linear-gradient(to right, #14532d, #22c55e); }
        .rgb-slider[data-channel="b"] input[type="range"] { background: linear-gradient(to right, #1e3a8a, #3b82f6); }
        .create-body .color-picker-grid .color-swatch-compact { height: 44px !important; min-height: 44px !important; max-height: 44px !important; aspect-ratio: auto !important; }

        .profile-body .profile-card { text-align: center; padding: 20px 0; }
        .profile-body .profile-avatar { font-size: 3.5rem; margin-bottom: 8px; }
        .profile-body .profile-name { font-size: 1.3rem; font-weight: 600; color: var(--text-primary); }
        .profile-body .profile-username { color: var(--text-secondary); font-size: 0.95rem; }
        .profile-body .profile-bio { color: var(--text-secondary); font-size: 0.9rem; margin: 8px 0 16px; line-height: 1.5; }
        .profile-body .profile-stats { display: flex; justify-content: center; gap: 32px; padding: 12px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin: 8px 0 16px; }
        .profile-body .profile-stats .stat { text-align: center; }
        .profile-body .profile-stats .stat .number { font-size: 1.2rem; font-weight: 700; }
        .profile-body .profile-stats .stat .label { font-size: 0.7rem; color: var(--text-secondary); }
        .profile-body .profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
        .profile-body .profile-actions button { padding: 12px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
        .profile-body .profile-actions .btn-primary { background: var(--text-primary); color: var(--bg-body); }
        .profile-body .profile-actions .btn-danger { background: #dc2626; color: #fff; }
        .profile-body .profile-actions .btn-outline { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); }
        .profile-body .auth-form input { width: 100%; padding: 10px 12px; margin-bottom: 12px; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; color: var(--text-primary); font-size: 0.95rem; }
        .profile-body .auth-form button { width: 100%; padding: 12px; border: none; border-radius: 6px; background: var(--text-primary); color: var(--bg-body); font-weight: 600; font-size: 1rem; cursor: pointer; }
        .profile-body .auth-form .switch-link { text-align: center; margin-top: 12px; color: var(--text-secondary); font-size: 0.9rem; }
        .profile-body .auth-form .switch-link a { color: var(--text-primary); cursor: pointer; text-decoration: underline; }
        .profile-body .edit-profile-form textarea { width: 100%; min-height: 60px; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; color: var(--text-primary); font-size: 0.95rem; resize: vertical; }
        .profile-body .edit-profile-form input { width: 100%; padding: 8px 12px; margin-bottom: 10px; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; color: var(--text-primary); font-size: 0.95rem; }
        .profile-body .edit-profile-form .char-counter { font-size: 0.7rem; color: var(--text-secondary); text-align: right; margin-top: -4px; margin-bottom: 8px; }

        .fakt-bank-body { padding: 16px; }
        .fakt-mobile-balance-card { padding: 20px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 14px; }
        .fakt-mobile-label { color: var(--text-secondary); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
        .fakt-mobile-balance { margin: 5px 0 20px; font-size: 2.25rem; font-weight: 700; text-align: center; }
        .fakt-mobile-actions { display: flex; gap: 8px; }
        .fakt-mobile-actions button { flex: 1; min-height: 44px; padding: 10px 8px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--bg-surface); color: var(--text-primary); cursor: pointer; font: inherit; font-size: .82rem; }
        .fakt-mobile-actions .fakt-mobile-primary { background: var(--text-primary); color: var(--bg-body); border-color: var(--text-primary); font-weight: 600; }
        .fakt-mobile-actions button:disabled { opacity: .5; cursor: not-allowed; }
        .fakt-mobile-status { min-height: 20px; margin-top: 12px; color: var(--text-secondary); font-size: .8rem; }
        .fakt-mobile-section-title { margin: 24px 0 10px; color: var(--text-secondary); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
        .fakt-mobile-activity { border-top: 1px solid var(--border-subtle); }
        .fakt-mobile-transaction { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border-subtle); }
        .fakt-mobile-transaction-info { min-width: 0; }
        .fakt-mobile-description { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-size: .85rem; }
        .fakt-mobile-date { margin-top: 3px; color: var(--text-secondary); font-size: .72rem; }
        .fakt-mobile-positive { color: #22c55e; white-space: nowrap; }
        .fakt-mobile-negative { color: #ef4444; white-space: nowrap; }
        .fakt-mobile-empty { padding: 14px 0; color: var(--text-secondary); font-size: .85rem; }

        .settings-body .setting-row { padding: 16px 0; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }
        .settings-body .setting-row button {
            background: var(--bg-input);
            border: 1px solid var(--border-input);
            border-radius: 6px;
            padding: 8px 18px;
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 500;
            transition: all 0.15s ease;
            font-family: inherit;
            min-width: 100px;
        }

        .settings-body .setting-row button:hover {
            background: var(--bg-hover);
            border-color: var(--text-secondary);
        }

        .settings-body .setting-row button:active {
            transform: scale(0.96);
        }

        @media (max-width: 768px) {
            .mobile-overlay-container.open { display: block; }
            .mobile-page { bottom: 0; padding-bottom: 72px; }
            .mobile-page-body { padding: 20px 18px 28px; }
            .mobile-nav { display: flex; padding-top: 8px; }
            .mobile-nav-btn {
                min-width: 56px;
                min-height: 52px;
                padding: 6px 8px;
                gap: 4px;
                font-size: 0.7rem;
            }
            .mobile-nav-btn svg { width: 26px; height: 26px; }

            .mobile-page-header {
                min-height: 60px;
                padding: 10px 18px;
            }
            .mobile-page-title { font-size: 1.25rem; }
            .mobile-page-close,
            .mobile-page-back {
                min-width: 44px;
                min-height: 44px;
                padding: 8px 10px;
                font-size: 1rem;
            }

            .mobile-page-body,
            .mobile-page-body p,
            .mobile-page-body label,
            .mobile-page-body input,
            .mobile-page-body textarea,
            .mobile-page-body select,
            .mobile-page-body button {
                font-size: 1rem;
            }
            .mobile-page-body label { font-size: 0.95rem !important; }
            .mobile-page-body input,
            .mobile-page-body textarea,
            .mobile-page-body select {
                min-height: 46px;
                padding: 11px 13px !important;
                line-height: 1.35;
            }
            .mobile-page-body textarea { min-height: 110px; }
            .mobile-page-body button,
            .mobile-page-body .btn,
            .mobile-page-body .profile-actions button {
                min-height: 46px;
                padding: 12px 16px !important;
                font-size: 1rem !important;
            }

            .mobile-page-body .edit-profile-form {
                padding: 20px !important;
                border-radius: 12px;
            }
            .mobile-page-body .edit-profile-form p { font-size: 1rem !important; line-height: 1.5; }
            .profile-body .profile-name { font-size: 1.65rem; }
            .profile-body .profile-username { font-size: 1.05rem; }
            .profile-body .profile-bio { font-size: 1rem; max-width: 94%; }
            .profile-body .profile-stats { gap: 24px; padding: 16px 0; }
            .profile-body .profile-stats .stat .number { font-size: 1.35rem; }
            .profile-body .profile-stats .stat .label { font-size: 0.82rem; }
            .profile-body .profile-actions { max-width: none; gap: 12px; }
            .fakt-transfer-mobile-body .edit-profile-form > p {
                color: var(--text-secondary);
                font-size: 1rem;
                line-height: 1.5;
                margin: 0 0 18px;
            }
            .fakt-transfer-mobile-body .edit-profile-form label {
                display: block;
                margin: 14px 0 6px;
                color: var(--text-secondary);
            }
            .fakt-transfer-mobile-body .fakt-transfer-preview {
                display: none;
                margin-top: 12px;
                padding: 12px;
                border: 1px solid var(--border-subtle);
                border-radius: 10px;
                background: var(--bg-input);
            }
            .fakt-transfer-mobile-body .fakt-transfer-preview.show { display: block; }
            .fakt-transfer-mobile-body .fakt-transfer-error {
                display: none;
                margin-top: 8px;
                color: #ef4444;
                font-size: 0.9rem;
            }
            .fakt-transfer-mobile-body .fakt-transfer-error:not(:empty) { display: block; }
            .fakt-transfer-mobile-body .modal-actions {
                display: flex;
                gap: 10px;
                margin-top: 20px;
            }
            .fakt-transfer-mobile-body .modal-actions button {
                flex: 1;
                min-height: 48px;
                padding: 12px 16px !important;
                border: 1px solid var(--border-input);
                border-radius: 8px;
                background: var(--bg-input);
                color: var(--text-primary);
                font: inherit;
                font-size: 1rem !important;
                font-weight: 600;
                cursor: pointer;
                transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
            }
            .fakt-transfer-mobile-body .modal-actions button:first-child:hover {
                background: var(--bg-hover);
                border-color: var(--text-secondary);
            }
            .fakt-transfer-mobile-body #faktTransferMobileSubmit {
                background: var(--text-primary);
                color: var(--bg-body);
                border-color: var(--text-primary);
            }
            .fakt-transfer-mobile-body #faktTransferMobileSubmit:hover:not(:disabled) {
                opacity: 0.85;
            }
            .fakt-transfer-mobile-body #faktTransferMobileSubmit:disabled {
                opacity: 0.45;
                cursor: not-allowed;
            }

            .create-body .create-section textarea,
            .profile-body .edit-profile-form textarea { font-size: 1rem; }
            .create-body .tag-btn,
            .mobile-overlay .create-section .tag-btn {
                min-height: 44px;
                padding: 10px 14px;
                font-size: 0.95rem;
            }
            .create-body .btn,
            .mobile-overlay .create-section .btn { min-height: 46px; font-size: 1rem; }

            .fakt-bank-body { padding: 18px; }
            .fakt-mobile-balance-card { padding: 22px 18px; }
            .fakt-mobile-actions button { min-height: 48px; font-size: 0.95rem; }
            .fakt-mobile-status,
            .fakt-mobile-description { font-size: 0.95rem; }
            .fakt-mobile-date { font-size: 0.8rem; }
            .settings-body .setting-row { padding: 18px 0; gap: 16px; }
            .settings-body .setting-row button { min-height: 44px; font-size: 0.95rem; }

            .auth-modal-content {
                width: calc(100% - 28px);
                max-height: calc(100dvh - 28px);
                padding: 28px 20px;
                border-radius: 14px;
            }
            .auth-modal .form-group label { font-size: 0.9rem; }
            .auth-modal .form-group input,
            .auth-modal .form-group textarea { min-height: 46px; font-size: 1rem; }
            .auth-modal .btn { min-height: 48px; font-size: 1rem; }


        }

        .auth-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 2000; align-items: center; justify-content: center; }
        .auth-modal.show { display: flex; }
        .auth-modal-content { background: var(--bg-modal); border: 1px solid var(--border-modal); border-radius: 12px; padding: 32px 28px; max-width: 420px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); position: relative; animation: modalSlideUp 0.3s ease; }
        .auth-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-secondary); font-size: 1.6rem; cursor: pointer; line-height: 1; }
        .auth-modal-close:hover { color: var(--text-primary); }
        .auth-modal-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border-subtle); }
        .auth-modal-tab { flex: 1; padding: 10px 0; text-align: center; font-weight: 600; font-size: 0.95rem; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
        .auth-modal-tab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
        .auth-modal-tab:hover { color: var(--text-primary); }
        .auth-modal .form-group { margin-bottom: 16px; }
        .auth-modal .form-group label { display: block; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
        .auth-modal .form-group input, .auth-modal .form-group textarea { width: 100%; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: 6px; padding: 10px 14px; font-size: 0.95rem; color: var(--text-primary); outline: none; transition: border-color 0.15s; font-family: inherit; resize: vertical; max-height: 120px; }
        .auth-modal .form-group input:focus, .auth-modal .form-group textarea:focus { border-color: var(--text-primary); }
        .auth-modal .form-group .error { color: #dc2626; font-size: 0.8rem; margin-top: 4px; display: none; }
        .auth-modal .form-group .error.show { display: block; }
        .auth-modal .form-group .hint { color: var(--text-tertiary); font-size: 0.75rem; margin-top: 4px; }
        .auth-modal .btn { width: 100%; border: none; border-radius: 6px; padding: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.15s; margin-top: 8px; }
        .auth-modal .btn-primary { background: var(--text-primary); color: var(--bg-body); }
        .auth-modal .btn-primary:hover:not(:disabled) { opacity: 0.9; }
        .auth-modal .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
        .auth-modal .switch-link { text-align: center; margin-top: 16px; color: var(--text-secondary); font-size: 0.9rem; }
        .auth-modal .switch-link a { color: var(--text-primary); cursor: pointer; text-decoration: underline; }
        .auth-modal .avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 4px; }
        .auth-modal .avatar-option { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--bg-input); border: 2px solid transparent; border-radius: 4px; cursor: pointer; transition: all 0.15s; padding: 4px; }
        .auth-modal .avatar-option:hover { border-color: rgba(255,255,255,0.2); }
        .auth-modal .avatar-option.selected { border-color: var(--text-primary); background: rgba(255,255,255,0.1); }
        body.light-theme .auth-modal .avatar-option.selected { background: rgba(0,0,0,0.05); }
        .auth-modal .avatar-custom { grid-column: span 2; }
        .auth-modal .avatar-custom input { width: 100%; text-align: center; font-size: 1.2rem; padding: 8px; background: transparent; border: 1px solid var(--border-input); border-radius: 4px; color: var(--text-primary); outline: none; }
        .auth-modal .avatar-custom input:focus { border-color: var(--text-primary); }



        #loadingPopup {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            background: var(--bg-surface);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            padding: 14px 24px;
            box-shadow: var(--shadow-lg);
            min-width: 180px;
            text-align: center;
            cursor: pointer;
        }
        #loadingPopup .loading-inner {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 14px;
            position: relative;
        }
        #loadingPopup .loading-text {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary);
            font-family: -apple-system, 'SF Pro Text', sans-serif;
        }
        #loadingPopup .loading-counter {
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-family: -apple-system, 'SF Pro Text', sans-serif;
        }

        #fallingMarker {
            position: fixed;
            z-index: 10000;
            pointer-events: none;
            width: 22px;
            height: 22px;
            border-radius: 4px;
            border: 2px solid rgba(255,255,255,0.9);
            box-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }

        .sr-only {
            position: absolute;
            left: -9999px;
            top: auto;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

        #overlayBackdrop {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 55;
            backdrop-filter: blur(4px);
        }

        #settingsModal .modal-box {
            padding: 32px;
            max-width: 360px;
            width: 90%;
        }

        #onboardingModal .modal-box {
            padding: 40px;
            max-width: 480px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
        }

        #cryptoModal .modal-box {
            padding: 28px;
            max-width: 420px;
            width: 90%;
        }

        .mobile-overlay-container.open {
            display: block;
        }

        .mobile-page {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--bg-surface);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
            transform: translateY(20px);
        }
        .mobile-page.active {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .create-body .create-section textarea {
            font-size: 0.95rem;
            min-height: 80px;
        }
        .create-body .color-picker-grid {
            grid-template-columns: repeat(8, 1fr);
            gap: 6px;
        }
        .create-body .color-swatch-compact {
            min-height: 28px;
            max-height: 32px;
            border-radius: 6px;
        }
        .create-body .tag-btn {
            padding: 8px 14px;
            font-size: 0.8rem;
            min-height: 34px;
            min-width: 48px;
        }
        .create-body .btn {
            padding: 12px 16px;
            font-size: 1rem;
            border-radius: 8px;
        }

        .profile-body .profile-card {
            text-align: center;
            padding: 20px 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 80vh;
            justify-content: flex-start;
        }

        .profile-body .profile-name {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 10px;
            letter-spacing: -0.02em;
        }

        .profile-body .profile-avatar-wrapper {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 1px solid var(--text-tertiary);
            box-shadow: 0 0 0 2px var(--border-subtle);
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-input);
            margin-bottom: 8px;
        }

        .profile-body .profile-avatar {
            font-size: 3.5rem;
            line-height: 1;
        }

        .profile-body .profile-username {
            color: var(--text-secondary);
            font-size: 1rem;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .profile-body .profile-bio {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin: 4px 0 16px;
            line-height: 1.5;
            max-width: 80%;
            text-align: center;
        }

        .profile-body .profile-stats {
            display: flex;
            justify-content: center;
            gap: 32px;
            padding: 12px 0;
            border-top: 1px solid var(--border-subtle);
            border-bottom: 1px solid var(--border-subtle);
            margin: 8px 0 16px;
            width: 100%;
        }

        .profile-body .profile-stats .stat {
            text-align: center;
        }

        .profile-body .profile-stats .stat .number {
            font-size: 1.2rem;
            font-weight: 700;
        }

        .profile-body .profile-stats .stat .label {
            font-size: 0.7rem;
            color: var(--text-secondary);
        }

        .profile-tabs {
            display: flex;
            gap: 6px;
        }

        .profile-tab {
            flex: 1;
            padding: 9px 12px;
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            background: transparent;
            color: var(--text-secondary);
            font: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
        }

        .profile-tab:hover { background: var(--bg-hover); }

        .profile-tab.active {
            background: var(--bg-elevated);
            border-color: var(--border-input);
            color: var(--text-primary);
        }

        .profile-body .profile-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 16px;
            width: 100%;
            max-width: 300px;
        }

        .profile-body .profile-actions button {
            padding: 12px;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            font-size: 0.95rem;
            width: 100%;
        }

        .profile-body .profile-actions .btn-primary {
            background: var(--text-primary);
            color: var(--bg-body);
        }

        .profile-body .profile-actions .btn-danger {
            background: #dc2626;
            color: #fff;
        }

        .profile-body .profile-actions .btn-outline {
            background: var(--bg-input);
            color: var(--text-primary);
            border: 1px solid var(--border-input);
        }

        .auth-modal .form-group .error {
            color: #dc2626;
            font-size: 0.8rem;
            margin-top: 4px;
            display: none;
        }
        .auth-modal .form-group .error.show {
            display: block;
        }

        .settings-body .setting-row {
            padding: 16px 0;
            border-bottom: 1px solid var(--border-subtle);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }


        /* #loadingPopup */
        #loadingPopup { position: fixed; top: 15px; left: 50%; transform: translateX(-50%); z-index: 9999; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px 24px; box-shadow: var(--shadow-lg); min-width: 180px; text-align: center; cursor: pointer; }
        #loadingPopup .loading-inner { display: flex; align-items: center; justify-content: center; gap: 14px; position: relative; }
        #loadingPopup .loading-text { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); font-family: -apple-system, 'SF Pro Text', sans-serif; }
        #loadingPopup .loading-counter { font-size: 0.75rem; color: var(--text-secondary); font-family: -apple-system, 'SF Pro Text', sans-serif; }

        /* #fallingMarker */
        #fallingMarker { position: fixed; z-index: 10000; pointer-events: none; width: 22px; height: 22px; border-radius: 4px; border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 1px 3px rgba(0,0,0,0.5); }

        /* .sr-only */
        .sr-only { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

        /* #overlayBackdrop */
        #overlayBackdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 55; backdrop-filter: blur(4px); }

        /* #settingsModal .modal-box */
        #settingsModal .modal-box { padding: 32px; max-width: 360px; width: 90%; }
        #onboardingModal .modal-box { padding: 40px; max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; }
        #cryptoModal .modal-box { padding: 28px; max-width: 420px; width: 90%; }

        /* .mobile-overlay-container.open */
        .mobile-overlay-container.open { display: block; }

        /* .mobile-page */
        .mobile-page { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-surface); display: flex; flex-direction: column; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; transform: translateY(20px); }
        .mobile-page.active { opacity: 1; pointer-events: auto; transform: translateY(0); }

        /* .create-body */
        .create-body .create-section textarea { font-size: 0.95rem; min-height: 80px; }
        .create-body .color-picker-grid { grid-template-columns: repeat(8, 1fr); gap: 6px; }
        .create-body .color-swatch-compact { min-height: 28px; max-height: 32px; border-radius: 6px; }
        .create-body .tag-btn { padding: 8px 14px; font-size: 0.8rem; min-height: 34px; min-width: 48px; }
        .create-body .btn { padding: 12px 16px; font-size: 1rem; border-radius: 8px; }

        /* .profile-body */
        .profile-body .profile-card { text-align: center; padding: 20px 0; }
        .profile-body .profile-avatar { font-size: 3.5rem; margin-bottom: 8px; }
        .profile-body .profile-name { font-size: 1.3rem; font-weight: 600; color: var(--text-primary); }
        .profile-body .profile-username { color: var(--text-secondary); font-size: 0.95rem; }
        .profile-body .profile-bio { color: var(--text-secondary); font-size: 0.9rem; margin: 8px 0 16px; line-height: 1.5; }
        .profile-body .profile-stats { display: flex; justify-content: center; gap: 32px; padding: 12px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin: 8px 0 16px; }
        .profile-body .profile-stats .stat { text-align: center; }
        .profile-body .profile-stats .stat .number { font-size: 1.2rem; font-weight: 700; }
        .profile-body .profile-stats .stat .label { font-size: 0.7rem; color: var(--text-secondary); }
        .profile-body .profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
        .profile-body .profile-actions button { padding: 12px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
        .profile-body .profile-actions .btn-primary { background: var(--text-primary); color: var(--bg-body); }
        .profile-body .profile-actions .btn-danger { background: #dc2626; color: #fff; }
        .profile-body .profile-actions .btn-outline { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); }

        /* .auth-modal .form-group .error */
        .auth-modal .form-group .error { color: #dc2626; font-size: 0.8rem; margin-top: 4px; display: none; }
        .auth-modal .form-group .error.show { display: block; }

        /* .settings-body */
        .settings-body .setting-row { padding: 16px 0; border-bottom: 1px solid var(--border-subtle); display: flex; justify-content: space-between; align-items: center; }

        /* User badge auth links */
        .user-login-text {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 500;
        }
        .user-login-text.primary {
            background: var(--text-primary);
            color: var(--bg-body);
            padding: 4px 12px;
            border-radius: 4px;
        }
        body.light-theme .user-login-text.primary {
            color: var(--bg-body); /* color inversion for light theme */
        }
        #userBadge .user-avatar {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--bg-input);
            border: 1px solid var(--border-subtle);
            font-size: 1.3rem !important;
            text-decoration: none !important;
            color: var(--text-primary) !important;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
            line-height: 1;
        }
        #userBadge .user-avatar:hover {
            background: var(--bg-hover);
            border-color: var(--text-secondary);
        }

        #userBadge .user-name a {
            cursor: pointer;
        }
        #userBadge .user-logout {
            cursor: pointer;
        }
        #userBadge .user-login-text {
            cursor: pointer;
        }

        #userBadge {
            cursor: default;
        }
        #userBadge .user-name {
            cursor: pointer;
        }

        .mobile-page-back {
            background: none;
            border: none;
            color: var(--text-primary);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            padding: 4px 8px;
            display: flex;
            align-items: center;
            gap: 4px;
            font-family: inherit;
        }
        .mobile-page-back:hover {
            color: var(--text-secondary);
        }

        .mobile-page.active {
            display: flex !important;
            opacity: 1 !important;
            pointer-events: auto !important;
        }
        #profileMenuPopup {
            animation: fadeIn 0.2s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }



        .auth-modal .avatar-grid {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 4px;
            margin-top: 4px;
            max-height: 200px;
            overflow-y: auto;
            padding: 4px;
            background: var(--bg-input);
            border-radius: 6px;
            border: 1px solid var(--border-input);
        }

        .auth-modal .avatar-option {
            aspect-ratio: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            background: transparent;
            border: 2px solid transparent;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s;
            padding: 4px;
            min-height: 36px;
            min-width: 36px;
        }

        .auth-modal .avatar-option:hover {
            border-color: rgba(255,255,255,0.2);
            transform: scale(1.05);
            background: var(--bg-hover);
        }

        .auth-modal .avatar-option.selected {
            border-color: var(--text-primary);
            background: rgba(255,255,255,0.1);
            transform: scale(1.08);
        }

        body.light-theme .auth-modal .avatar-option.selected {
            background: rgba(0,0,0,0.05);
        }

        .auth-modal .avatar-grid::-webkit-scrollbar {
            width: 4px;
        }

        .auth-modal .avatar-grid::-webkit-scrollbar-thumb {
            background: var(--border-subtle);
            border-radius: 4px;
        }

        .auth-modal .avatar-grid::-webkit-scrollbar-track {
            background: transparent;
        }



        .vote-section {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px 0;
            border-top: 1px solid var(--border-subtle);
            border-bottom: 1px solid var(--border-subtle);
            margin: 8px 0;
        }

        .vote-buttons {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .vote-btn {
            background: var(--bg-input);
            border: 1px solid var(--border-input);
            border-radius: 8px;
            padding: 8px 16px;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.15s;
            display: flex;
            align-items: center;
            gap: 6px;
            font-family: inherit;
            font-weight: 600;
        }

        .vote-btn:hover {
            background: var(--bg-hover);
            transform: scale(1.02);
        }

        .vote-btn.up:hover {
            border-color: #22c55e;
            color: #22c55e;
        }

        .vote-btn.down:hover {
            border-color: #ef4444;
            color: #ef4444;
        }

        .vote-btn.voted-up {
            background: #22c55e;
            border-color: #22c55e;
            color: #fff;
        }

        .vote-btn.voted-down {
            background: #ef4444;
            border-color: #ef4444;
            color: #fff;
        }

        .vote-score {
            font-size: 1.3rem;
            font-weight: 700;
            min-width: 50px;
            text-align: center;
            color: var(--text-primary);
        }
        #overlayDate {
            display: none;
            margin-bottom: 8px;
            font-size: 0.75rem;
            color: var(--text-tertiary);
        }

        .vote-score.positive { color: #22c55e; }
        .vote-score.negative { color: #ef4444; }




        .profile-loader {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            gap: 16px;
            min-height: 200px;
        }
        .profile-loader .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--border-subtle);
            border-top-color: var(--text-primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .profile-loader .text {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .collection-load-error {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            padding: 28px 16px;
            margin-top: 8px;
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            background: var(--bg-input);
            text-align: center;
        }
        .collection-load-error span {
            color: var(--text-secondary);
            font-size: 0.85rem;
            line-height: 1.4;
        }
        .collection-load-error .collection-retry-btn {
            border: 1px solid var(--border-input);
            border-radius: 8px;
            padding: 8px 22px;
            font: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            background: var(--bg-elevated);
            color: var(--text-primary);
            transition: background 0.15s;
        }
        .collection-load-error .collection-retry-btn:hover {
            background: var(--bg-hover);
        }




        .fact-action-btn {
            transition: color 0.15s ease, background 0.15s ease !important;
        }

        .fact-action-btn:hover {
            color: var(--text-primary) !important;
            background: rgba(255, 255, 255, 0.08) !important;
        }

        .fact-action-btn.delete-btn-fact:hover {
            color: #dc2626 !important;
            background: rgba(220, 38, 38, 0.1) !important;
        }

        .fact-card {
            transition: background 0.15s ease, border-color 0.15s ease !important;
        }

        .fact-card:hover {
            background: var(--bg-hover) !important;
            border-color: var(--border-subtle) !important;
        }

        .refresh-profile-btn {
            transition: color 0.15s ease, background 0.15s ease !important;
        }

        .refresh-profile-btn:hover {
            color: var(--text-primary) !important;
            background: var(--bg-hover) !important;
        }

        .profile-menu-btn {
            transition: background 0.15s ease !important;
        }

        .profile-menu-btn:hover {
            background: var(--bg-hover) !important;
        }

        .profile-menu-btn-item {
            transition: background 0.1s ease !important;
        }

        .profile-menu-btn-item:hover {
            background: var(--bg-hover) !important;
        }

        /* ============================================================
           UI POLISH LAYER — additive animation & micro-interactions.
           Visuals only: safe to remove entirely, no layout/logic impact.
           ============================================================ */

        :root {
            --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
            --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
            --dur-fast: 0.15s;
            --dur-med: 0.25s;
        }

        @keyframes modalPop {
            from { opacity: 0; transform: translateY(14px) scale(0.96); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes backdropFade {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes fadeSlideUp {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Modal backdrops fade in instead of appearing instantly */
        #filterModal,
        #settingsModal,
        #onboardingModal,
        #faktTransferModal,
        .fact-card-sheet {
            animation: backdropFade 0.2s ease-out;
        }

        /* Modal boxes pop in */
        #filterModal .modal-box,
        #settingsModal .modal-box,
        #onboardingModal .modal-box,
        #faktTransferModal .modal-box,
        .fact-card-sheet-panel {
            animation: modalPop var(--dur-med) var(--ease-soft);
        }

        /* Toast: softer, slightly springy reveal */
        .toast {
            transition:
                opacity var(--dur-med) var(--ease-soft),
                transform var(--dur-med) var(--ease-spring),
                background 0.2s, color 0.2s, border-color 0.2s;
        }

        /* Gentle hover lift on primary action buttons */
        .overlay .actions button:not(:disabled),
        .create-section .btn:not(:disabled),
        #onboardingModal .modal-box .got-it,
        .fact-card-sheet-actions button {
            transition:
                transform var(--dur-fast) var(--ease-soft),
                background 0.15s, opacity 0.15s, border-color 0.15s, color 0.2s;
        }

        .overlay .actions button:hover:not(:disabled),
        .create-section .btn:hover:not(:disabled),
        #onboardingModal .modal-box .got-it:hover,
        .fact-card-sheet-actions button:hover {
            transform: translateY(-1px);
        }

        /* List items: entrance animation with a light stagger */
        .my-fact-item,
        .collection-list-item {
            animation: fadeSlideUp 0.28s var(--ease-soft) both;
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
        }

        .my-fact-item:hover {
            transform: translateX(3px);
        }

        .my-fact-item:nth-child(1), .collection-list-item:nth-child(1) { animation-delay: 0.02s; }
        .my-fact-item:nth-child(2), .collection-list-item:nth-child(2) { animation-delay: 0.05s; }
        .my-fact-item:nth-child(3), .collection-list-item:nth-child(3) { animation-delay: 0.08s; }
        .my-fact-item:nth-child(4), .collection-list-item:nth-child(4) { animation-delay: 0.11s; }
        .my-fact-item:nth-child(5), .collection-list-item:nth-child(5) { animation-delay: 0.14s; }
        .my-fact-item:nth-child(6), .collection-list-item:nth-child(6) { animation-delay: 0.17s; }
        .my-fact-item:nth-child(7), .collection-list-item:nth-child(7) { animation-delay: 0.20s; }
        .my-fact-item:nth-child(8), .collection-list-item:nth-child(8) { animation-delay: 0.23s; }

        /* Smooth in-panel scrolling */
        .overlay,
        .sidebar-content,
        .mobile-page-body {
            scroll-behavior: smooth;
        }

        /* Visible keyboard focus */
        :where(button, a, input, select, textarea):focus-visible {
            outline: 2px solid var(--text-primary);
            outline-offset: 2px;
        }

        /* Respect users who prefer reduced motion */
        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
                scroll-behavior: auto !important;
            }
        }

        /* ============================================================
           MOBILE COLLECTIONS — page, editor, mini-bar, viewer card.
           ============================================================ */

        .mobile-collection-new-btn { width: 100%; padding: 12px; border: 1px dashed var(--border-input); border-radius: 8px; background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-bottom: 12px; transition: background 0.15s ease; }
        .mobile-collection-new-btn:hover { background: var(--bg-hover); }

        .mobile-collection-item { display: block; width: 100%; text-align: left; padding: 12px; margin: 6px 0; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-input); color: var(--text-primary); cursor: pointer; font: inherit; animation: fadeSlideUp 0.28s var(--ease-soft) both; transition: background 0.15s ease, border-color 0.15s ease; }
        .mobile-collection-item:active { transform: scale(0.98); }
        .mobile-collection-item strong { display: block; font-size: 0.95rem; }
        .mobile-collection-item small { display: block; color: var(--text-secondary); margin-top: 3px; font-size: 0.72rem; }

        .mobile-collection-item-actions { display: flex; gap: 6px; margin-top: 8px; }
        .mobile-collection-item-actions button { flex: 1; padding: 8px 6px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--bg-elevated); color: var(--text-primary); font: inherit; font-size: 0.75rem; cursor: pointer; min-height: 36px; transition: background 0.15s ease; }
        .mobile-collection-item-actions button:active { background: var(--bg-hover); }
        .mobile-collection-item-actions button.danger { color: #dc2626; border-color: rgba(220,38,38,0.4); }

        /* Collection cards (shared desktop sidebar + mobile list) */
        .collection-card { position: relative; display: flex; gap: 12px; align-items: stretch; width: 100%; text-align: left; padding: 10px; margin: 8px 0; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-input); color: var(--text-primary); cursor: pointer; animation: fadeSlideUp 0.28s var(--ease-soft) both; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease; }
        .collection-card:hover { background: var(--bg-hover); border-color: var(--border-input); transform: translateY(-1px); }
        .collection-card:active { transform: scale(0.99); }
        .collection-card:focus-visible { outline: 2px solid var(--text-secondary); outline-offset: 2px; }
        .collection-card.is-loading { pointer-events: none; }
        .collection-card-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); border-radius: inherit; z-index: 2; }

        .collection-thumb { position: relative; width: 88px; height: 88px; flex: 0 0 88px; border-radius: 10px; overflow: hidden; background-color: #0b0e13; border: 1px solid var(--border-subtle); background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px); background-size: 11px 11px; }
        .collection-thumb-canvas { position: absolute; inset: -30%; animation: collectionThumbAmbient 18s ease-in-out infinite alternate; }
        .collection-thumb-canvas-inner { position: absolute; inset: 0; }
        @keyframes collectionThumbAmbient { from { transform: translateY(-4%); } to { transform: translateY(4%); } }
        .collection-thumb-dot { position: absolute; width: 13px; height: 13px; border-radius: 3px; border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); transform: translate(-50%, -50%); }
        .collection-thumb-line { position: absolute; inset: 0; width: 100%; height: 100%; }

        .collection-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 2px 0; }
        .collection-card-title { font-weight: 700; font-size: 0.95rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 4px; }
        .collection-card-desc { color: var(--text-secondary); font-size: 0.74rem; line-height: 1.35; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .collection-card-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.75rem; color: var(--text-secondary); }
        .collection-card-author { white-space: nowrap; }

        .collection-card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; transition: opacity 0.15s ease; }
        .collection-card-actions button { padding: 3px 7px; font-size: 0.7rem; cursor: pointer; border: 1px solid var(--border-input); border-radius: 7px; background: var(--bg-elevated); color: var(--text-primary); }
        .collection-card-actions button:hover { background: var(--bg-hover); }
        .collection-card-actions button.danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.4); }
        @media (hover: hover) {
            .collection-card-actions { opacity: 0; }
            .collection-card:hover .collection-card-actions,
            .collection-card:focus-within .collection-card-actions { opacity: 1; }
        }

        @media (max-width: 768px) {
            .collection-card { padding: 12px; border-radius: 16px; flex-wrap: wrap; }
            .collection-thumb { width: 92px; height: 92px; flex-basis: 92px; }
            .collection-thumb-dot { width: 15px; height: 15px; }
            .collection-card-title { font-size: 1.05rem; }
            .collection-card-desc { font-size: 0.82rem; }
            .collection-card-footer { font-size: 0.82rem; }
            .collection-card-actions { position: static; flex: 1 1 100%; margin-top: 8px; opacity: 1 !important; }
            .collection-card-actions button { flex: 1; padding: 9px 8px; font-size: 0.85rem; min-height: 40px; }
        }

        .mobile-collection-editor { flex-direction: column; gap: 14px; }
        .mobile-collection-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 4px; }
        .mobile-collection-editor-head > div { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
        .mobile-collection-editor-head span:first-child { font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }
        .mobile-collection-editor-head span:last-child { color: var(--text-secondary); font-size: 0.78rem; white-space: nowrap; padding-top: 4px; }
        .mobile-editor-back { align-self: flex-start; border: 0; padding: 0; background: none; color: var(--text-secondary); font: inherit; font-size: 0.78rem; cursor: pointer; }
        .mobile-editor-intro { display: none; }
        .mobile-editor-section { display: flex; flex-direction: column; gap: 11px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-surface); box-shadow: var(--shadow-sm); }
        .mobile-editor-step { color: var(--text-secondary); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
        .mobile-editor-step b { color: var(--text-primary); margin-left: 5px; letter-spacing: 0; }
        .mobile-editor-section label { color: var(--text-secondary); font-size: 0.76rem; font-weight: 600; margin-top: 2px; }
        .mobile-editor-section label em { color: var(--text-tertiary); font-style: normal; font-weight: 400; }
        .mobile-editor-places { gap: 12px; }
        .mobile-editor-places-copy { display: flex; flex-direction: column; gap: 4px; }
        .mobile-editor-places-copy strong { font-size: 1.05rem; }
        .mobile-collection-editor input[type="text"], .mobile-collection-editor textarea, .mobile-collection-editor select { width: 100%; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); border-radius: 10px; padding: 13px 14px; font: inherit; font-size: 1.05rem; outline: none; }
        .mobile-collection-editor textarea { resize: vertical; min-height: 74px; }
        .mobile-collection-editor input:focus, .mobile-collection-editor textarea:focus, .mobile-collection-editor select:focus { border-color: var(--text-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-primary) 12%, transparent); }
        .mobile-collection-editor input[type="text"], .mobile-collection-editor textarea, .mobile-collection-editor select { -webkit-appearance: none; appearance: none; }
        .mobile-collection-editor-actions { position: sticky; bottom: 0; padding: 10px 0 max(4px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg-body) 22%); }
        .mobile-collection-editor-actions button { min-height: 48px; border-radius: 11px; }
        #mobileCancelCollectionBtnBottom { background: transparent; }
        #mobileCollectionSelectedFacts:empty::before { content: 'No places added yet'; display: block; padding: 14px; border: 1px dashed var(--border-input); border-radius: 10px; color: var(--text-tertiary); font-size: 0.8rem; text-align: center; }
        .mobile-collection-add-on-map { background: var(--bg-input); color: var(--text-primary); border-style: solid; font-weight: 650; min-height: 46px; }

        .mobile-collection-editor input[type="text"], .mobile-collection-editor textarea, .mobile-collection-editor select { width: 100%; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-input); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 0.85rem; outline: none; }
        .mobile-collection-editor textarea { resize: vertical; min-height: 56px; }

        .mobile-collection-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-input); margin-bottom: 6px; }
        .mobile-collection-row .fact-copy { min-width: 0; }
        .mobile-collection-row .fact-copy strong { display: block; font-size: 0.98rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .mobile-collection-row .fact-copy small { display: none; }
        .mobile-collection-row .row-tools { display: flex; gap: 4px; }
        .mobile-collection-row .row-tools button { border: 1px solid var(--border-input); background: var(--bg-elevated); color: var(--text-primary); border-radius: 6px; min-width: 34px; min-height: 32px; font-size: 0.7rem; cursor: pointer; font: inherit; }
        .mobile-collection-row .row-tools button.remove { color: #dc2626; }

        .mobile-collection-transition-input { grid-column: 1 / -1; width: 100%; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-input); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 0.75rem; outline: none; }

        .mobile-collection-error { color: #dc2626; font-size: 0.95rem; min-height: 1em; }

        .mobile-collection-add-on-map { width: 100%; padding: 10px; border-radius: 8px; border: 1px dashed var(--border-input); background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.8rem; cursor: pointer; }

        .mobile-collection-editor-actions { display: flex; gap: 8px; }
        .mobile-collection-editor-actions button { flex: 1; padding: 12px; border-radius: 8px; border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
        .mobile-collection-editor-actions button:disabled { opacity: 0.5; cursor: not-allowed; }
        #mobilePublishCollectionBtn { background: var(--text-primary); color: var(--bg-body); border-color: var(--text-primary); }

        #mobileCollectionViewCard { position: fixed; left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); z-index: 48; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-lg); max-height: 55vh; overflow-y: auto; animation: fadeSlideUp 0.25s var(--ease-soft) both; }
        .mobile-collection-viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
        .mobile-collection-viewer-head strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .mobile-collection-viewer-head button { background: none; border: none; color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; padding: 2px 6px; }

        .mobile-collection-progress { height: 4px; background: var(--bg-input); border-radius: 4px; margin-top: 8px; overflow: hidden; }
        .mobile-collection-progress > div { height: 100%; width: 0; background: var(--text-primary); border-radius: 4px; transition: width 0.3s var(--ease-soft); }
        .mobile-collection-progress-text { font-size: 0.65rem; color: var(--text-tertiary); text-align: right; margin-top: 2px; }

        #mobileCollectionViewFact { margin-top: 8px; font-size: 0.85rem; line-height: 1.5; color: var(--text-primary); word-break: break-word; }
        #mobileCollectionViewFact small { display: block; color: var(--text-secondary); margin-top: 6px; font-size: 0.7rem; }

        .mobile-collection-viewer-nav { display: flex; gap: 8px; margin-top: 10px; }
        .mobile-collection-viewer-nav button { flex: 1; padding: 11px; border-radius: 8px; border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; }
        .mobile-collection-viewer-nav button:disabled { opacity: 0.5; cursor: not-allowed; }
        #mobileCollectionViewNext { background: var(--text-primary) !important; color: var(--bg-body) !important; border-color: var(--text-primary) !important; }

        #mobileCollectionViewComplete { margin-top: 12px; text-align: center; }
        #mobileCollectionViewComplete p { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.5; margin: 0 0 12px; overflow-wrap: anywhere; word-break: break-word; }
        .mobile-collection-vote-box { display: flex; align-items: stretch; border: 1px solid var(--border-input); border-radius: 12px; background: var(--bg-input); overflow: hidden; }
        .mobile-collection-vote-box .vote-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 6px; border: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
        .mobile-collection-vote-box .vote-btn:hover { background: var(--bg-hover); }
        .mobile-collection-vote-box .vote-btn.active { background: var(--bg-hover); }
        .mobile-collection-vote-box .vote-up.active { color: #22c55e; }
        .mobile-collection-vote-box .vote-down.active { color: #ef4444; }
        .vote-divider { width: 1px; background: var(--border-input); }
        .mobile-collection-copy-btn { width: 100%; margin-top: 8px; padding: 11px; border-radius: 12px; border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: border-color 0.15s ease; }
        .mobile-collection-copy-btn:hover { border-color: var(--text-secondary); }
        #mobileCollectionViewRestart { width: 100%; margin-top: 6px; padding: 10px; border-radius: 12px; border: none; background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.78rem; cursor: pointer; transition: color 0.15s ease; }
        #mobileCollectionViewRestart:hover { color: var(--text-primary); }

        @media (min-width: 769px) {
            #mobileCollectionViewCard { left: 0; right: 0; margin: 0 auto; max-width: 560px; bottom: 24px; padding: 14px 18px; }
        }

        /* CREATE SUBTABS STYLES */
        .create-subtab-btn {
            flex: 1;
            padding: 8px 12px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            position: relative;
            transition: color 0.15s ease;
        }
        .create-subtab-btn:hover {
            color: var(--text-primary);
        }
        .create-subtab-btn.active {
            color: var(--text-primary);
        }
        .create-subtab-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .mobile-add-menu button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .mobile-add-menu button:disabled:hover,
        .mobile-add-menu button:disabled:active {
            background: transparent;
            transform: none;
        }
        .add-nav-wrap {
            display: contents;
        }

        .mobile-add-menu {
            display: flex;
            position: fixed;
            left: var(--mobile-add-menu-left, 50%);
            bottom: var(--mobile-add-menu-bottom, calc(64px + env(safe-area-inset-bottom, 0px) + 7px));
            z-index: 49;
            gap: 0;
            transform: translate(-50%, 18px) scale(.82);
            transform-origin: bottom center;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity .24s ease, transform .28s cubic-bezier(.22, 1.28, .36, 1), visibility 0s linear .28s;
        }

        .mobile-add-menu::after {
            content: '';
            position: absolute;
            left: 50%;
            bottom: -7px;
            width: 14px;
            height: 14px;
            background: var(--bg-surface);
            border-right: 1px solid var(--border-subtle);
            border-bottom: 1px solid var(--border-subtle);
            transform: translateX(-50%) rotate(45deg);
        }

        .mobile-add-menu.open {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: translate(-50%, 0) scale(1);
            transition-delay: 0s;
        }

        .mobile-add-menu button {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            width: 78px;
            height: 68px;
            padding: 8px 5px;
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            background: var(--bg-surface);
            font: inherit;
            font-size: .8125rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: var(--shadow-md);
            transition: background .15s ease, color .15s ease, transform .15s ease;
        }

        .mobile-add-menu button:first-child {
            border-right: 0;
            border-radius: 16px 0 0 16px;
        }
        .mobile-add-menu button:last-child {
            border-left: 1px solid var(--border-subtle);
            border-radius: 0 16px 16px 0;
        }
        .mobile-add-menu button:hover,
        .mobile-add-menu button:active { background: var(--bg-hover); color: var(--text-primary); }
        .mobile-add-menu button:active { transform: translateY(2px) scale(.96); }
        .mobile-add-menu button strong { font-size: .8125rem; font-weight: 600; }

        .add-choice-icon {
            position: relative;
            display: block;
            width: 28px;
            height: 24px;
            color: var(--text-primary);
        }
        .fact-marker-icon {
            width: 18px;
            height: 18px;
            border: 2px solid currentColor;
            border-radius: 5px;
            box-shadow: inset 0 0 0 3px var(--bg-surface);
        }
        .route-icon i,
        .route-icon b {
            position: absolute;
            display: block;
            top: 10px;
            height: 3px;
            background: currentColor;
        }
        .route-icon i {
            width: 9px;
            border-radius: 3px;
        }
        .route-icon i:first-child { left: 3px; }
        .route-icon i:last-child { right: 3px; }
        .route-icon b {
            left: 9px;
            width: 10px;
            transform: rotate(-16deg);
            border-radius: 3px;
        }
        .route-icon i::after {
            content: '';
            position: absolute;
            top: -4px;
            width: 10px;
            height: 10px;
            border: 2px solid currentColor;
            border-radius: 3px;
            background: var(--bg-surface);
        }
        .route-icon i:first-child::after { left: -2px; }
        .route-icon i:last-child::after { right: -2px; }

        @media (max-width: 768px) {
            .mobile-add-menu button { min-height: 0; }
        }

        .create-subtab-btn.active::after {
            content: '';
            position: absolute;
            bottom: -9px;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--text-primary);
        }

        /* Collections entry stays inert until map facts finish loading */
        .sidebar-tab:disabled, .mobile-nav-btn:disabled { opacity: 0.4; pointer-events: none; }

        /* Hide map-mode switcher and crypto button during collection preview */
        #mapSourceSwitcher, .crypto-support-btn { transition: opacity 0.25s ease, visibility 0.25s ease; }
        body.collection-viewer-active #mapSourceSwitcher,
        body.collection-viewer-active .crypto-support-btn { opacity: 0; visibility: hidden; pointer-events: none; }

        /* Collection preview: tooltips swap in place instead of gliding —
           the old one fades out as a ghost while the next one grows back in,
           slightly brightened. Fixed width so long texts keep one shape. */
        body.collection-viewer-active .marker-tooltip { width: 320px; max-width: 320px; }
        body.collection-viewer-active .marker-tooltip.collection-tooltip-in {
            animation: collectionTooltipIn 0.4s var(--ease-soft);
        }
        .collection-tooltip-ghost { z-index: 14; animation: collectionTooltipOut 0.35s ease forwards; }
        @keyframes collectionTooltipOut {
            from { opacity: 1; scale: 1; }
            to { opacity: 0; scale: 0.85; }
        }
        @keyframes collectionTooltipIn {
            from { opacity: 0; scale: 0.85; filter: brightness(1.6); }
            to { opacity: 1; scale: 1; filter: brightness(1); }
        }

        /* Collection preview on PC: sidebar slides away, auth window never shows */
        @media (min-width: 769px) {
            body.collection-viewer-active .sidebar { transform: translateX(-100%); border-right: none; box-shadow: none; }
        }
        body.collection-viewer-active #authModal { display: none !important; }
        body.collection-viewer-active #userBadge { display: none !important; }

        /* Viewer on phone: the FAKTMAP logo overlaps the map — hide it. */
        @media (max-width: 768px) {
            body.collection-viewer-active #topLogo { display: none !important; }
        }

        /* Collection preview: only the control card and the map stay interactive.
           !important beats inline styles (#topLogo) and ID rules (#feedbackModal.show). */
        body.collection-viewer-active * { pointer-events: none !important; }
        body.collection-viewer-active #map,
        body.collection-viewer-active #map *,
        body.collection-viewer-active #mobileCollectionViewCard,
        body.collection-viewer-active #mobileCollectionViewCard * { pointer-events: auto !important; }
        body.collection-viewer-active .mobile-page.active { pointer-events: none !important; }

        /* Larger mobile collections UI (1rem inputs prevent iOS focus zoom) */
        @media (max-width: 768px) {
            .mobile-collection-new-btn { padding: 14px; font-size: 1rem; }
            .mobile-collection-item { padding: 14px; margin: 8px 0; }
            .mobile-collection-item strong { font-size: 1.05rem; }
            .mobile-collection-item small { font-size: 0.8rem; }
            .mobile-collection-item-actions button { font-size: 0.85rem; min-height: 42px; padding: 10px 8px; }
            .mobile-collection-editor { gap: 12px; }
            .mobile-collection-editor input[type="text"], .mobile-collection-editor textarea, .mobile-collection-editor select { font-size: 1.05rem; padding: 13px 14px; }
            .mobile-collection-row { padding: 13px; }
            .mobile-collection-row .fact-copy strong { font-size: 1rem; line-height: 1.35; white-space: normal; }
            .mobile-collection-row .fact-copy small { display: none; }
            .mobile-collection-row .row-tools button { min-width: 42px; min-height: 40px; font-size: 0.85rem; }
            .mobile-collection-transition-input { font-size: 0.9rem; padding: 10px 12px; }
            .mobile-collection-error { font-size: 0.85rem; }
            .mobile-collection-add-on-map { font-size: 0.9rem; padding: 12px; }
            .mobile-collection-editor-actions button { padding: 14px; font-size: 0.95rem; }
            #mobileCollectionViewCard { padding: 16px 18px; max-height: 62vh; }
            #mobileCollectionViewFact span { max-width: 250px; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            .mobile-collection-viewer-head strong { font-size: 1.05rem; }
            .mobile-collection-viewer-head button { font-size: 1.3rem; }
            .mobile-collection-progress { height: 5px; }
            #mobileCollectionViewFact { font-size: 1rem; margin-bottom: 6px; text-align: center; }
            #mobileCollectionViewFact strong { display: block; font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-primary); }
            #mobileCollectionViewFact small { font-size: 0.78rem; }
            .mobile-collection-viewer-nav button { padding: 14px; font-size: 1rem; }
            .mobile-collection-vote-box .vote-btn { padding: 13px 8px; font-size: 1rem; }
            .mobile-collection-copy-btn { font-size: 0.95rem; padding: 13px; }
            #mobileCollectionViewRestart { font-size: 0.9rem; padding: 12px; }
        }

        /* MOBILE UI FOUNDATION
           Keep the mobile interface readable and usable on narrow screens. */
        @media (max-width: 768px) {
            html { font-size: 16px; }

            body {
                min-width: 0;
                overflow: hidden;
                overscroll-behavior: none;
            }

            #map {
                width: 100%;
                height: 100dvh;
                min-height: 100svh;
            }

            .mobile-nav {
                min-height: 68px;
                padding: 8px 4px max(8px, env(safe-area-inset-bottom));
                box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.32);
            }

            .mobile-nav-btn {
                flex: 1 1 0;
                min-width: 0;
                min-height: 52px;
                padding: 6px 4px;
                gap: 4px;
                font-size: 0.75rem;
                line-height: 1.2;
                font-weight: 600;
                letter-spacing: 0;
            }

            .mobile-nav-btn svg {
                width: 24px;
                height: 24px;
                flex: 0 0 24px;
            }

            .mobile-page,
            .mobile-overlay {
                height: 100dvh;
                max-height: 100dvh;
                min-height: 100svh;
            }

            .mobile-page {
                padding-bottom: calc(76px + env(safe-area-inset-bottom));
            }

            .mobile-page-header {
                min-height: 64px;
                padding: max(10px, env(safe-area-inset-top)) 16px 10px;
            }

            .mobile-page-title {
                font-size: 1.25rem;
                line-height: 1.2;
                font-weight: 700;
            }

            .mobile-page-close,
            .mobile-page-back {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 44px;
                min-width: 44px;
                height: 44px;
                min-height: 44px;
                padding: 0;
                font-size: 1.25rem;
            }

            .mobile-page-body {
                min-height: 0;
                padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
                font-size: 1rem;
                line-height: 1.5;
                overscroll-behavior: contain;
            }

            .mobile-page-body p,
            .mobile-page-body label,
            .mobile-page-body input,
            .mobile-page-body textarea,
            .mobile-page-body select,
            .mobile-page-body button {
                font-size: 1rem;
                line-height: 1.45;
            }

            .mobile-page-body label {
                margin-top: 16px;
                margin-bottom: 6px;
                font-size: 0.875rem;
                line-height: 1.35;
            }

            .mobile-page-body input,
            .mobile-page-body textarea,
            .mobile-page-body select {
                min-height: 48px;
                font-size: 1rem !important;
                line-height: 1.4;
            }

            .mobile-page-body textarea,
            .create-body .create-section textarea,
            .profile-body .edit-profile-form textarea {
                min-height: 112px;
                line-height: 1.5;
            }

            .mobile-page-body button,
            .mobile-page-body .btn,
            .mobile-page-body .profile-actions button,
            .mobile-overlay .create-section .btn,
            .mobile-overlay .create-section .tag-btn {
                min-height: 48px;
                font-size: 1rem !important;
            }

            .create-body .create-section > div[style*="display:flex"] {
                flex-direction: column;
                gap: 8px !important;
            }

            .create-body .create-section > div[style*="display:flex"] .btn {
                width: 100%;
            }

            .create-body .tag-buttons,
            .mobile-overlay .create-section .tag-buttons {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 8px;
            }

            .create-body .tag-btn,
            .mobile-overlay .create-section .tag-btn {
                width: 100%;
                min-width: 0;
                padding: 10px 4px;
                white-space: nowrap;
                text-align: center;
                font-size: 0.78rem !important;
            }

            .create-body .tag-btn[data-tag="OTHER"],
            .mobile-overlay .create-section .tag-btn[data-tag="OTHER"] {
                grid-column: 1 / -1;
            }

            .color-picker-grid {
                gap: 8px !important;
            }

            .color-swatch-compact {
                height: 44px !important;
                min-height: 44px !important;
                max-height: 44px !important;
                aspect-ratio: auto !important;
            }

            .my-fact-item {
                min-height: 56px;
                padding: 12px;
            }

            .my-fact-item .text,
            .fakt-mobile-description {
                font-size: 1rem;
                line-height: 1.45;
            }

            .fresh-badge {
                font-size: 0.75rem;
                line-height: 1.2;
            }

            .profile-body .profile-bio,
            .profile-body .auth-form .switch-link,
            .mobile-page-body .edit-profile-form p {
                font-size: 1rem !important;
                line-height: 1.5;
            }

            .profile-body .profile-stats .stat .label,
            .fakt-mobile-date,
            .fakt-mobile-status {
                font-size: 0.8125rem;
                line-height: 1.4;
            }

            .fakt-mobile-actions {
                gap: 10px;
            }

            .fakt-mobile-actions button,
            .settings-body .setting-row button {
                min-height: 48px;
                font-size: 1rem;
            }

            .settings-body .setting-row {
                gap: 12px;
                align-items: flex-start;
                font-size: 1rem;
                line-height: 1.45;
            }

            .mobile-overlay {
                padding: max(20px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
                border-radius: 20px 20px 0 0;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            .mobile-overlay .handle {
                width: 44px;
                height: 5px;
                margin-bottom: 20px;
            }

            .mobile-overlay .close-mobile {
                top: max(16px, env(safe-area-inset-top));
                right: 12px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 44px;
                height: 44px;
                font-size: 1.5rem;
            }

            .mobile-overlay .panel-title {
                padding-right: 44px;
                font-size: 1.25rem;
                line-height: 1.25;
            }

            #overlay {
                width: calc(100% - 24px);
                max-width: 520px;
                max-height: calc(100dvh - 32px);
                padding: 24px 18px calc(20px + env(safe-area-inset-bottom));
                border-radius: 20px;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            #overlay .fact-text {
                font-size: 1rem;
                line-height: 1.55;
            }

            #overlay .vote-buttons button,
            #overlay .actions button,
            #overlay .card-btn {
                min-height: 48px;
                font-size: 1rem;
            }

            #overlay .close-btn {
                width: 44px;
                height: 44px;
                padding: 10px;
            }

            #mobileCancelSelection {
                bottom: calc(84px + env(safe-area-inset-bottom));
                min-height: 48px;
                padding: 12px 22px;
                font-size: 1rem;
            }

            #locationHint {
                top: env(safe-area-inset-top);
                max-width: calc(100% - 24px);
                padding: 12px 14px;
                font-size: 0.875rem;
                line-height: 1.4;
            }

            #mapSourceSwitcher button {
                min-height: 44px;
                font-size: 0.8125rem;
            }

            /* Map tooltip: primary reading surface on touch screens */
            .marker-tooltip {
                max-width: min(280px, calc(100vw - 64px));
                min-width: 200px;
                padding: 10px 14px;
            }

            .marker-tooltip-text { font-size: 1rem; line-height: 1.45; }
            .marker-tooltip-user { font-size: 0.8125rem; }
            .marker-tooltip-tag { font-size: 0.75rem; padding: 2px 9px; }
            .marker-tooltip-votes { font-size: 0.8125rem; }

            .crypto-support-btn { min-height: 44px; padding: 11px 16px; font-size: 0.8125rem; }
            .crypto-support-btn .crypto-badge { font-size: 0.65rem; }

            #factPreviewMobile { justify-content: center; }

            .toast {
                bottom: calc(76px + env(safe-area-inset-bottom));
                max-width: calc(100% - 32px);
                padding: 12px 16px;
                font-size: 0.875rem;
                line-height: 1.4;
                text-align: center;
            }

            #filterModal .modal-box,
            #settingsModal .modal-box,
            #onboardingModal .modal-box,
            #faktTransferModal .modal-box,
            #feedbackModal .modal-box,
            .auth-modal-content {
                width: calc(100% - 24px);
                max-width: 520px;
                max-height: calc(100dvh - 24px);
                margin: 12px;
                padding: 24px 18px;
                border-radius: 16px;
                overflow-y: auto;
            }

            #filterModal .modal-box h3,
            #settingsModal .modal-box h3,
            #onboardingModal .modal-box h2,
            #faktTransferModal h3,
            #feedbackModal h3 {
                font-size: 1.25rem;
                line-height: 1.25;
            }

            #faktTransferModal input,
            #feedbackModal select,
            #feedbackModal textarea,
            .auth-modal .form-group input,
            .auth-modal .form-group textarea {
                min-height: 48px;
                font-size: 1rem;
            }

            #faktTransferModal button,
            #feedbackModal button,
            .auth-modal .btn {
                min-height: 48px;
                font-size: 1rem;
            }

            .mobile-add-menu button {
                min-height: 52px;
                padding: 12px 16px;
                font-size: 1rem;
            }

            .mobile-collection-item-actions button { min-height: 44px; }
            .mobile-collection-copy-btn { min-height: 44px; }
            #mobileCollectionViewRestart { min-height: 44px; }

            .collection-card-actions button { min-height: 44px; }

            /* Compact, card-like fact creation form */
            .create-body {
                padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
            }

            .create-body .create-section {
                padding: 2px 0 8px;
            }

            .create-body .create-section .label {
                margin: 16px 0 6px;
                color: var(--text-secondary);
                font-size: 0.8125rem;
                font-weight: 700;
                letter-spacing: 0.04em;
                text-transform: uppercase;
            }

            .create-body .create-section > .label:first-of-type {
                margin-top: 0;
            }

            .create-body .create-section > div[style*="display:flex"] {
                display: grid !important;
                grid-template-columns: 1fr 1fr;
                gap: 8px !important;
                margin-bottom: 2px;
            }

            .create-body .create-section > div[style*="display:flex"] .btn {
                min-height: 48px;
                padding: 10px 8px !important;
                border-radius: 10px;
                line-height: 1.25;
            }

            .create-body .create-section textarea {
                min-height: 124px;
                max-height: 220px;
                padding: 12px 14px;
                border-radius: 12px;
                line-height: 1.5;
            }

            .create-body .char-counter {
                margin: 6px 2px 0;
                font-size: 0.8125rem;
            }
        }

        @media (max-width: 380px) {
            .mobile-nav-btn {
                font-size: 0.6875rem;
            }

            .mobile-nav-btn svg {
                width: 22px;
                height: 22px;
            }

            .mobile-page-body,
            .mobile-overlay {
                padding-left: 12px;
                padding-right: 12px;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .mobile-page,
            .mobile-overlay {
                transition: none;
            }
        }

        /* GIF picker on mobile create page: cancel global mobile button inflation
           (.mobile-page-body button sets min-height/padding/font-size on every button) */
        @media (max-width: 768px) {
            .gif-picker .gif-scroll-btn {
                min-height: 0;
                padding: 0 0 2px !important;
                font-size: 17px !important;
            }
            .gif-picker .gif-result {
                padding: 0 !important;
            }
            .gif-picker .gif-remove-btn {
                min-height: 0;
                padding: 2px 0 !important;
                font-size: 0.7rem !important;
            }
        }
