/* COLOR THEMES */
        :root, [data-theme="dark"] {
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-card: #334155;
            --accent: #3b82f6;
            --accent-hover: #2563eb;
            --danger: #ef4444;
            --success: #10b981;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --border: #475569;
        }

        [data-theme="light"] {
            --bg-primary: #f8fafc;
            --bg-secondary: #ffffff;
            --bg-card: #f1f5f9;
            --accent: #2563eb;
            --accent-hover: #1d4ed8;
            --danger: #dc2626;
            --success: #059669;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --border: #cbd5e1;
        }

        html { scroll-behavior: smooth; overscroll-behavior-y:none; }
        body { overscroll-behavior-y:none; }
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
        
        body { 
            background-color: var(--bg-primary); 
            color: var(--text-main); 
            min-height: 100vh; 
            padding: 0; 
            padding-bottom: calc(90px + env(safe-area-inset-bottom)); 
        }

        .container { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding: 16px 16px 0; overscroll-behavior-y:none; touch-action:pan-x pan-y; -webkit-overflow-scrolling:touch; }
        
        /* APP HEADER */
        header { 
            position: sticky; 
            top: 0; 
            z-index: 100; 
            background: var(--bg-primary); 
            backdrop-filter: blur(12px); 
            -webkit-backdrop-filter: blur(12px);
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            padding: 12px 16px; 
            padding-top: calc(12px + env(safe-area-inset-top));
            border-bottom: 1px solid var(--border); 
                    }
        .logo-group { display: flex; align-items: center; gap: 12px; }
        .hamburger-btn { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-main); font-size: 1.1rem; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
        .hamburger-btn:hover { background: var(--border); }
        .logo { font-size: 1.55rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; display: flex; align-items: center; }
        .user-info { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
        .logout-btn { color: var(--text-muted); text-decoration: none; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; }
        .bell-btn { position: relative; background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.95rem; }
        .bell-btn:hover { color: var(--text-main); }
        .bell-btn.has-unread { color: var(--accent); border-color: var(--accent); }
        .notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-primary); padding: 0; }
        .notif-badge.hidden { display: none; }
        .notif-panel { position: absolute; top: 46px; right: 0; width: 290px; max-width: 88vw; max-height: 70vh; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 4000; display: none; flex-direction: column; }
        .notif-panel.active { display: flex; }
        .notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .8rem; }
        .notif-clear-btn { background: transparent; border: none; color: var(--accent); font-size: .72rem; cursor: pointer; font-weight: 600; }
        .notif-panel-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
        .notif-item { padding: 8px 10px; border-radius: 8px; background: var(--bg-primary); border: 1px solid var(--border); font-size: .78rem; display: flex; gap: 8px; align-items: flex-start; }
        .notif-item.error { border-color: var(--danger); }
        .notif-item.success { border-color: var(--success); }
        .notif-panel .empty-state { padding: 16px; text-align: center; color: var(--text-muted); font-size: .8rem; }
.notif-flash { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%) translateY(-14px); background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 500; z-index: 5000; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: 90vw; }
.notif-flash.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notif-flash.error { border-color: var(--danger); }
.notif-flash.error i { color: var(--danger); }
.notif-flash.success { border-color: var(--success); }
.notif-flash.success i { color: var(--success); }

        /* HAMBURGER SIDE DRAWER */
        .drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
        .drawer-overlay.active { opacity: 1; pointer-events: auto; }
        
        .side-drawer { position: fixed; top: 0; left: 0; width: 310px; max-width: 85vw; height: 100%; background: var(--bg-secondary); border-right: 1px solid var(--border); z-index: 1200; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; padding: 16px; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
        .side-drawer.active { transform: translateX(0); }
        
        .drawer-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
        .drawer-title { font-size: 1.15rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
        .close-drawer-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 4px; }
        
        .drawer-body { flex: 1; padding: 14px 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: thin; }
        .drawer-body::-webkit-scrollbar { width: 4px; }
        .drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
        
        .user-profile-card { background: var(--bg-primary); padding: 12px; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; text-decoration: none; }
        .user-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; overflow: hidden; flex-shrink: 0; }
        .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
        
        .drawer-nav-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 10px; color: var(--text-main); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: border-color 0.2s; }
        .drawer-nav-link:hover { border-color: var(--accent); }

        .theme-swatch-btn { width: 100%; aspect-ratio: 1.6 / 1; border-radius: 6px; cursor: pointer; }
        .storage-box { background: var(--bg-primary); padding: 12px; border-radius: 10px; border: 1px solid var(--border); flex-shrink: 0; }
        .storage-progress { width: 100%; height: 6px; background: var(--bg-card); border-radius: 3px; overflow: hidden; margin: 8px 0 4px 0; }
        .storage-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.4s ease; }

        /* SETTINGS CARDS & FORMS */

        .theme-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-width:360px; }
        .theme-setting { min-height:46px; background:var(--bg-primary); border:1px solid var(--border); color:var(--text-main); border-radius:10px; padding:8px 12px; display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:10px; font-size:.9rem; cursor:pointer; }
        .theme-setting span { width:20px; height:20px; border-radius:50%; border:2px solid var(--border); display:block; flex:0 0 auto; }
        .theme-setting:hover { border-color:var(--accent); }
        @media (max-width:600px) { .theme-settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); max-width:none; } }
        .settings-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: 0 8px 25px rgba(0,0,0,0.2); display: flex; flex-direction: column; gap: 12px; }
        .settings-card h3 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
        .settings-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
        /* ===== Tab strips: one size and one spacing on every page (Dashboard, Files, Photos, Settings, Engine Room).
           When there are more tabs than fit, the strip scrolls sideways and static/js/tab-strip.js slides the active tab into view. ===== */
        .settings-tabs, .er-tabs, .docs-tabs { display:flex; flex-wrap:nowrap; align-items:stretch; gap:4px; margin-bottom:4px; border-bottom:0; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; scroll-behavior:smooth; }
        .rc-tabs { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; scroll-behavior:smooth; }
        .settings-tabs::-webkit-scrollbar, .er-tabs::-webkit-scrollbar, .docs-tabs::-webkit-scrollbar, .rc-tabs::-webkit-scrollbar { display:none; }
        .settings-tabs .settings-tab-btn, .er-tabs .er-tab-btn, .rc-tabs .rc-tab { flex:0 0 auto; display:inline-flex !important; align-items:center; justify-content:center; gap:6px !important; box-sizing:border-box; min-height:46px; margin:0 !important; padding:12px 14px !important; background:transparent !important; border:0 !important; border-bottom:3px solid transparent !important; border-radius:0 !important; color:#fff !important; font-family:inherit; font-size:.95rem !important; font-weight:700 !important; line-height:1.2 !important; white-space:nowrap !important; cursor:pointer !important; }
        .settings-tabs .settings-tab-btn.active, .er-tabs .er-tab-btn.active, .rc-tabs .rc-tab.active { color:#fff !important; border-bottom-color:var(--accent) !important; }
        .rc-tabs .rc-tab { margin-bottom:-1px !important; }
        .settings-tab-panel { display:none; flex-direction:column; gap:12px; }
        .settings-tab-panel.active { display:flex; }
        .settings-tab-panel.settings-tab-slide { animation:settings-tab-slide 420ms cubic-bezier(.22,1,.36,1) both; }
        .settings-tab-panel.settings-tab-dragging { transition:none; will-change:transform,opacity; }
        .settings-tab-panel.settings-tab-snap-away { transition:transform 170ms cubic-bezier(.22,1,.36,1),opacity 170ms ease; }
        .settings-tab-panel.settings-tab-snap-back { transition:transform 220ms cubic-bezier(.22,1,.36,1),opacity 220ms ease; }
        @keyframes settings-tab-slide { from { opacity:.55; transform:translate3d(var(--settings-tab-offset,32px),0,0); } to { opacity:1; transform:translate3d(0,0,0); } }
        @media(prefers-reduced-motion:reduce) { .settings-tab-panel.settings-tab-slide,.settings-tab-panel.settings-tab-snap-away,.settings-tab-panel.settings-tab-snap-back { animation:none; transition:none; } }
        .settings-drawer-card { gap: 10px; }
        .settings-profile-link { display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--border); border-radius:10px; color:var(--text-main); background:var(--bg-secondary); text-decoration:none; }
        .settings-select { width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--bg-primary); color:var(--text-main); font-size:.92rem; }
        .settings-inline-actions { display:flex; gap:8px; flex-wrap:wrap; }
        .settings-inline-status { min-height:1.1em; color:var(--text-muted); font-size:.8rem; }
        .settings-drawer-toggle { width:100%; min-height:48px; padding:0; display:flex; align-items:center; justify-content:space-between; gap:12px; border:0; background:transparent; color:var(--text-main); font-size:1rem; font-weight:700; text-align:left; cursor:pointer; }
        .settings-drawer-toggle > span { display:flex; align-items:center; gap:9px; }
        .settings-drawer-toggle > span i { color:var(--accent); }
        .drawer-chevron { color:var(--text-muted); transition:transform .2s ease; }
        .drawer-chevron.is-open { transform:rotate(180deg); }
        .settings-drawer { border-top:1px solid var(--border); padding-top:12px; }
        .settings-drawer[hidden] { display:none !important; }
        .settings-drawer-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin-top:14px; }
        .settings-managed-list { display:flex; flex-direction:column; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
        .settings-managed-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; background:var(--bg-primary); border-bottom:1px solid var(--border); }
        .settings-managed-row:last-child { border-bottom:0; }
        .settings-managed-info { min-width:0; display:flex; flex-direction:column; gap:4px; overflow-wrap:anywhere; }
        .settings-managed-info strong { color:var(--text-main); font-size:.92rem; }
        .settings-managed-info span { color:var(--text-muted); font-size:.78rem; line-height:1.35; }
        .settings-managed-actions { flex:0 0 auto; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
        .settings-managed-actions .btn-secondary,.settings-managed-actions .btn-danger { min-height:40px; width:auto; padding:8px 12px; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-size:.82rem; white-space:nowrap; text-decoration:none; }
        .settings-managed-actions .icon-action { width:42px; min-width:42px; padding:8px; }
        .offline-usage { display:flex; flex-direction:column; gap:9px; margin-bottom:14px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--bg-primary); }
        .offline-usage > div:first-child { display:flex; justify-content:space-between; gap:10px; font-size:.84rem; }
        .offline-usage > div:first-child span { color:var(--text-muted); }
        .offline-usage-track { height:7px; border-radius:99px; background:var(--bg-card); overflow:hidden; }
        .offline-usage-track span { display:block; height:100%; border-radius:inherit; background:var(--accent); }
        .passport-security-note { color:var(--text-muted); font-size:.74rem; line-height:1.4; }
        .settings-account-actions { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:3px 2px; }
        .settings-account-actions p { margin:0; font-size:.77rem; color:var(--text-muted); }
        .settings-account-actions form { margin:0; }
        .settings-account-actions .btn-danger,.settings-logout-link { width:auto; min-height:34px; padding:6px 10px; border-radius:7px; text-decoration:none; font-size:.8rem; font-weight:650; }
        @media(max-width:520px) { .settings-managed-row { align-items:flex-start; flex-direction:column; } .settings-managed-actions { width:100%; justify-content:flex-start; } .settings-managed-actions .btn-secondary,.settings-managed-actions .btn-danger { flex:1 1 auto; } }

        .input-group { display: flex; flex-direction: column; gap: 6px; }
        @media (max-width:700px) {
            #profileForm, #passwordForm { scroll-margin-bottom: 42vh; }
            #profileForm input:focus, #passwordForm input:focus { scroll-margin-block: 20vh; }
        }
        .input-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
        input[type="text"], input[type="email"], input[type="password"], input[type="file"] { background: var(--bg-primary); border: 1px solid var(--border); padding: 12px; border-radius: 10px; color: var(--text-main); width: 100%; outline: none; font-size: 0.95rem; }
        input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25); }
        input[type="file"] { padding: 8px; cursor: pointer; }

        .btn-primary { background: var(--accent); border: none; color: white; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
        .btn-primary:hover { background: var(--accent-hover); }

        .btn-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: var(--danger); padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.2s; }
        .btn-danger:hover { background: var(--danger); color: white; }

        /* Secondary actions (Preview Pico, Restore All, the Open/Restore buttons in rows): outlined, same shape as the other buttons.
           Without this they fell back to the browser's flat grey 3D button. */
        .btn-secondary { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 16px; border:1px solid var(--border); border-radius:10px; background:var(--bg-primary); color:var(--text-main); font-size:.92rem; font-weight:600; line-height:1.2; text-decoration:none; cursor:pointer; transition:background .2s, border-color .2s; }
        .btn-secondary i { color:var(--accent); }
        .btn-secondary:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, var(--bg-primary)); }
        .btn-secondary:disabled { opacity:.5; cursor:not-allowed; }
        /* the caption inside a <label class="input-group"> (e.g. above the Automatic filing dropdown) matches the other field labels */
        label.input-group > span { font-size:0.78rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.05em; }

        /* BOTTOM APP NAVIGATION BAR (same as Docs and Photos) */
        /* IDENTICAL BOTTOM APP NAVIGATION BAR */
        .bottom-nav {
            position: fixed !important;
            bottom: 0 !important;
            left: 0 !important;
            right: 0 !important;
            width: 100% !important;
            height: 68px !important;
            min-height: 68px !important;
            background: var(--bg-secondary) !important;
            border-top: 1px solid var(--border) !important;
            display: flex !important;
            justify-content: space-around !important;
            align-items: center !important;
            padding: 6px 12px !important;
            margin: 0 !important;
            z-index: 10000 !important;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .nav-fab {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: linear-gradient(145deg, var(--accent), var(--accent-hover));
            color: #fff;
            border: 4px solid var(--bg-primary);
            font-size: 1.35rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            margin-top: -28px;
            box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 55%, transparent), 0 2px 5px rgba(0,0,0,.3);
            flex-shrink: 0;
        }
        .nav-fab:active { transform: scale(.92); }
        .nav-item {
            background: transparent;
            border: none;
            color: var(--text-muted);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 3px;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            padding: 6px 10px;
            border-radius: 10px;
            text-decoration: none;
            transition: color 0.2s ease, background 0.2s ease;
            flex: 1;
            min-width: 0;
            max-width: 140px;
            height: 100%;
        }
        .nav-item i { font-size: 1.25rem; }
        .nav-item.active { color: var(--accent); background: rgba(59, 130, 246, 0.1); }

        html { max-width: 100%; overflow-x: hidden; } body { max-width: 100%; }
*, *::before, *::after { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
.side-drawer { box-shadow: none !important; transform: translate3d(-105%, 0, 0) !important; }
.side-drawer.active { transform: translate3d(0, 0, 0) !important; }
.drawer-overlay { overflow: hidden; }



html { overflow-x: hidden !important; }
.side-drawer, .drawer-body, .modal-body { scrollbar-width: none !important; -ms-overflow-style: none !important; }
.side-drawer::-webkit-scrollbar, .drawer-body::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }



html { overflow-x:hidden !important; }
html *, body * { scrollbar-width:none !important; -ms-overflow-style:none !important; }
html *::-webkit-scrollbar, body *::-webkit-scrollbar { width:0 !important; height:0 !important; display:none !important; background:transparent !important; }
.side-drawer { box-shadow:none !important; border-right:0 !important; visibility:hidden; pointer-events:none; transform:translate3d(-110%,0,0) !important; }
.side-drawer.active { visibility:visible; pointer-events:auto; transform:translate3d(0,0,0) !important; }
.drawer-overlay { overflow:hidden !important; }



@media (max-width: 600px) {
  html, body { width:100%; min-width:0; max-width:100%; overflow-x:clip !important; }
  body > .container, body > .container > *, .settings-tab-panel, .settings-card { min-width:0; max-width:100%; }
  .settings-tabs { width:100%; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; }
  .settings-tab-panel { touch-action:pan-y pinch-zoom; }
  .settings-tabs .settings-tab-btn { flex:0 0 auto; min-width:max-content; min-height:52px; white-space:nowrap !important; scroll-snap-align:start; padding:12px 14px !important; font-size:.95rem !important; }
  .settings-tab-panel, .settings-card, .settings-card > *, .input-group, form { overflow-wrap:anywhere; }
  .settings-card input, .settings-card select, .settings-card textarea { min-width:0; max-width:100%; }
  body { padding-left:0 !important; padding-right:0 !important; padding-top:env(safe-area-inset-top) !important; padding-bottom:calc(90px + env(safe-area-inset-bottom)) !important; }
  body > .container, body > main.container, body > main { padding-left:16px !important; padding-right:16px !important; width:100%; }
  header { margin-left:0 !important; margin-right:0 !important; padding-left:16px !important; padding-right:16px !important; }
}



:root { --ui-spring:cubic-bezier(.22,1.35,.36,1); }
button, a, .btn, .btn-primary, .btn-danger, .btn-action, .btn-submit, .btn-post, .btn-sm, .action-btn, .nav-item, .tab, select { -webkit-tap-highlight-color:transparent; transition:transform .22s var(--ui-spring), box-shadow .22s ease, background-color .22s ease, border-color .22s ease, color .22s ease !important; }
button:active, a.btn:active, a.btn-action:active, .btn:active, .btn-primary:active, .btn-danger:active, .btn-action:active, .btn-submit:active, .btn-post:active, .btn-sm:active, .action-btn:active, .nav-item:active, .tab:active { transform:scale(.94); }
button:hover, a.btn:hover, a.btn-action:hover, .btn:hover, .btn-primary:hover, .btn-danger:hover, .btn-action:hover, .btn-submit:hover, .btn-post:hover, .btn-sm:hover { transform:translateY(-1px); box-shadow:0 7px 18px color-mix(in srgb,var(--accent) 22%,transparent); }
.toast, #toastContainer .toast { border-color:var(--accent); background:color-mix(in srgb,var(--bg-secondary) 94%,var(--accent)); color:var(--text-main); }
.toast.error, #toastContainer .toast.error { border-color:var(--danger); background:color-mix(in srgb,var(--bg-secondary) 90%,var(--danger)); }
.toast.success, #toastContainer .toast.success { border-color:var(--success); background:color-mix(in srgb,var(--bg-secondary) 90%,var(--success)); }
@media (max-width:600px) { button, a.btn, .btn, .btn-primary, .btn-danger, .btn-action, .btn-submit, .btn-post, .btn-sm, .action-btn { min-height:44px; } }
/* header icon buttons keep their normal size, like Docs and Photos */
@media (max-width:600px) { header button { min-height:0; } }

/* Leave scroll room after the final settings action above the fixed app navigation. */
body { padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important; }


/* ---- Settings: calmer, more consistent cards; Account Management grouped into labelled sections ---- */
.settings-tab-panel { gap:10px; }
.settings-card { padding:14px; gap:10px; box-shadow:0 1px 3px rgba(0,0,0,.18); }
.settings-card h3 { gap:10px; font-size:1.02rem; }
.settings-card h3 > i:first-child { flex:0 0 auto; width:32px; height:32px; display:inline-grid; place-items:center; border-radius:10px; background:color-mix(in srgb,var(--accent) 14%,transparent); color:var(--accent); font-size:.9rem; }
.settings-section-title { margin:6px 4px -4px; font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); }
.settings-tab-panel > .settings-section-title:first-child { margin-top:0; }
.settings-storage-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.settings-storage-ratio { font-size:.9rem; font-weight:700; color:var(--text-main); font-variant-numeric:tabular-nums; white-space:nowrap; }
.settings-storage-card .storage-progress { height:10px; margin:0; border-radius:99px; }
.settings-storage-card .storage-fill { border-radius:inherit; }
.settings-danger-zone { gap:0; padding:4px 18px; }
.settings-danger-zone .settings-account-actions { flex-direction:row; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; }
.settings-danger-zone .settings-account-actions + .settings-account-actions { border-top:1px solid var(--border); }
.settings-danger-zone .settings-account-actions p { order:-1; flex:1 1 auto; min-width:0; font-size:.82rem; }
.settings-danger-zone .settings-account-actions .btn-danger { flex:0 0 auto; min-height:40px; padding:8px 14px; font-size:.85rem; white-space:nowrap; }
.settings-danger-zone .settings-account-actions .settings-logout-link { white-space:nowrap; }

/* Polish: consistent spacing, improved visual hierarchy, cohesive look */
.settings-tab-panel { padding: 0 2px; }
.settings-card + .settings-section-title { margin-top: 10px; }
.settings-card p { line-height: 1.5; }
.settings-card form .input-group { gap: 4px; }
.settings-card form .input-group label { font-weight: 600; font-size: 0.9rem; }
.settings-card form .input-group input, .settings-card form .input-group select { border-radius: 8px; border: 1px solid var(--border); padding: 10px 12px; font-size: 0.95rem; }
.settings-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.settings-inline-actions .btn-primary, .settings-inline-actions .btn-secondary { padding: 10px 16px; font-size: 0.9rem; }
.input-group { display: flex; flex-direction: column; gap: 4px; }
.settings-card form { display:flex; flex-direction:column; gap:10px; }
