.debug-toggle {
    position: fixed;
    bottom: 70px;
    right: 10px;
    z-index: 10000;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
#debugLog {
    user-select: text !important;
    -webkit-user-select: text !important;
    pointer-events: auto !important;
}
:root {
    --bg-primary: #f5f3ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ede9fe;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --accent: #6C5CE7;
    --accent-hover: #5a4bd1;
    --accent-light: rgba(108, 92, 231, 0.1);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(108, 92, 231, 0.08);
    --shadow-lg: 0 10px 25px rgba(108, 92, 231, 0.1);
    --shadow-xl: 0 20px 50px rgba(108, 92, 231, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --gradient-1: linear-gradient(135deg, #6C5CE7, #a78bfa);
    --gradient-2: linear-gradient(135deg, #10b981, #34d399);
    --gradient-3: linear-gradient(135deg, #ef4444, #fbbf24);
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(108, 92, 231, 0.15);
    --surface-hover: #f0ebff;
    --surface-active: #e4dcff;
    --btn-secondary-bg: #f0ebff;
    --btn-secondary-text: #6C5CE7;
    --btn-secondary-hover: #e4dcff;
    --input-focus-ring: rgba(108, 92, 231, 0.25);
}
[data-theme="dark"] {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a35;
    --bg-tertiary: #252547;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --accent-light: rgba(167, 139, 250, 0.15);
    --border: #2d2d55;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(167, 139, 250, 0.08);
    --shadow-lg: 0 10px 25px rgba(167, 139, 250, 0.1);
    --shadow-xl: 0 20px 50px rgba(167, 139, 250, 0.12);
    --glass: rgba(26, 26, 53, 0.85);
    --glass-border: rgba(167, 139, 250, 0.15);
    --surface-hover: #252547;
    --surface-active: #2d2d5a;
    --btn-secondary-bg: #252547;
    --btn-secondary-text: #c4b5fd;
    --btn-secondary-hover: #2d2d5a;
    --input-focus-ring: rgba(167, 139, 250, 0.25);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}
body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
#app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: visible;
}
@media (min-width: 769px) {
    #app { 
        margin: 20px auto; 
        border-radius: var(--radius-xl); 
        min-height: calc(100vh - 40px);
        min-height: calc(100dvh - 40px);
    }
}
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 20px 10px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    margin-right: -4px;
    padding-left: 60px;
}
.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.app-logo {
    width: 40px; height: 40px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    animation: logoPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.app-title {
    font-size: clamp(16px, 5vw, 20px);
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.icon-btn:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.08);
    box-shadow: var(--shadow-md);
}
.icon-btn:active { transform: scale(0.92); }
.main-content {
    padding: 16px 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(100px, calc(env(safe-area-inset-bottom) + 80px));
    animation: fadeSlideIn 0.3s ease;
    -webkit-overflow-scrolling: touch;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-enter {
    animation: pageIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pageIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex; justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
    transition: all 0.3s ease;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 12px; border: none; background: transparent;
    color: var(--text-tertiary); cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; font-size: 11px; font-weight: 500;
    flex: 1; max-width: 80px;
}
.nav-item i { font-size: clamp(18px, 5vw, 22px); transition: all 0.25s ease; }
.nav-item.active { color: var(--accent); }
.nav-item.active i { transform: translateY(-2px); }
.nav-item.active::before {
    content: ''; position: absolute; top: 0;
    width: 24px; height: 3px;
    background: var(--accent); border-radius: 0 0 4px 4px;
}
.nav-item:active { transform: scale(0.9); }
.card {
    box-sizing: border-box;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: clamp(10px, 3vw, 12px);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    animation: cardAppear 0.4s ease forwards;
    opacity: 0;
    cursor: pointer;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:active { transform: scale(0.98); box-shadow: var(--shadow-md); }
.card-media {
    width: 100%; height: 200px; object-fit: cover;
    border-radius: var(--radius-md); margin-bottom: 12px;
    background: var(--bg-tertiary);
}
.card-title { font-size: clamp(14px, 4vw, 16px); font-weight: 600; margin-bottom: 6px; }
.card-price { font-size: clamp(16px, 5vw, 20px); font-weight: 700; color: var(--accent); }
.card-meta {
    display: flex; gap: 12px; font-size: clamp(11px, 3vw, 13px);
    color: var(--text-secondary); margin-top: 8px;
    flex-wrap: wrap;
}
.card-meta span { display: flex; align-items: center; gap: 4px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: clamp(10px, 2.5vw, 12px) clamp(18px, 4vw, 24px);
    border-radius: var(--radius-md); border: none;
    font-size: clamp(13px, 3.5vw, 15px); font-weight: 600; cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
    white-space: nowrap;
}
.btn::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(255,255,255,0.2); opacity: 0; transition: opacity 0.3s;
}
.btn:active::after { opacity: 1; }
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--gradient-1); color: white; box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4); transform: translateY(-1px); }
.btn-success { background: var(--gradient-2); color: white; }
.btn-success:hover { box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3); transform: translateY(-1px); }
.btn-outline {
    background: var(--btn-secondary-bg);
    border: 1.5px solid var(--accent);
    color: var(--btn-secondary-text);
}
.btn-outline:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-light);
    transform: translateY(-1px);
}
.btn-block { width: 100%; }
.btn-lg { padding: clamp(14px, 3vw, 16px) clamp(24px, 5vw, 32px); font-size: clamp(14px, 4vw, 16px); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: clamp(12px, 3vw, 14px); color: var(--text-secondary); }
.form-input {
    width: 100%; padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
    border: 2px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-primary); color: var(--text-primary);
    font-size: clamp(14px, 3.5vw, 15px); transition: all 0.3s ease; outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
    background: var(--bg-primary); border-radius: var(--radius-lg);
    padding: clamp(12px, 3vw, 20px); text-align: center; border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
}
.stat-card:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.stat-value {
    font-size: clamp(22px, 6vw, 28px); font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: clamp(11px, 2.5vw, 13px); color: var(--text-secondary); margin-top: 4px; }
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    font-size: clamp(10px, 2.5vw, 12px); font-weight: 600;
    background: var(--accent-light); color: var(--accent);
    white-space: nowrap;
}
.toast {
    position: fixed; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
    z-index: 1000; padding: 14px 24px; border-radius: var(--radius-md);
    color: white; font-weight: 600;
    animation: toastIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: var(--shadow-xl); max-width: 90%; text-align: center;
    font-size: clamp(12px, 3vw, 14px);
}
.toast-success { background: var(--gradient-2); }
.toast-error { background: var(--gradient-3); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.empty-state { text-align: center; padding: 60px 20px; animation: fadeSlideIn 0.5s ease; }
.empty-state i {
    font-size: clamp(48px, 12vw, 64px); color: var(--text-tertiary);
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.empty-state h3 { font-size: clamp(16px, 4vw, 18px); margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); font-size: clamp(12px, 3vw, 14px); }
.badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; background: var(--danger);
    color: white; border-radius: 50%;
    font-size: 10px; display: flex; align-items: center;
    justify-content: center; font-weight: 700;
}
.gallery {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 8px 0; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.gallery img {
    width: 280px; height: 200px; object-fit: cover;
    border-radius: var(--radius-md); scroll-snap-align: start;
    transition: transform 0.3s ease;
}
.gallery img:active { transform: scale(1.02); }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200; display: flex; align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%; max-width: 480px; max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto; padding: 24px 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-handle {
    width: 36px; height: 4px; background: var(--border);
    border-radius: 2px; margin: 0 auto 16px;
}
.pulse-dot {
    width: 8px; height: 8px; background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(0, 184, 148, 0); }
}
.ripple { position: relative; overflow: hidden; }
.ripple span {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}
.offline-banner {
    background: var(--danger); color: white;
    text-align: center; padding: 8px; font-size: 13px;
    font-weight: 600;
}
.icon-btn.refreshing i {
    animation: refreshSpin 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes refreshSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #0088cc, #00a8e8);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
    white-space: nowrap;
}
.chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}
.chat-btn:active {
    transform: scale(0.95);
}
.chat-btn i {
    font-size: 18px;
}
.nav-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    animation: badgePop 0.3s ease;
    z-index: 5;
    border: 2px solid var(--bg-secondary);
    pointer-events: auto;
}
@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
#walletBadge {
    background: var(--warning);
    color: #000;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
}
.publish-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: publishSpin 0.7s linear infinite;
}
@keyframes publishSpin {
    to { transform: rotate(360deg); }
}
.save-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.save-btn:hover {
    transform: scale(1.1);
    background: rgba(0,0,0,0.7);
}
.save-btn.saved {
    background: var(--accent);
    border-color: var(--accent);
    animation: savePop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.save-btn.saved i {
    animation: heartBeat 0.4s ease;
}
@keyframes savePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.card .save-btn {
    position: static !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    margin-left: 8px;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
}
.card .save-btn.saved {
    background: var(--accent-light) !important;
    border-color: var(--accent) !important;
}
.card .save-btn i {
    font-size: 14px;
    color: var(--text-secondary);
}
.card .save-btn.saved i {
    color: var(--accent);
}
#savedHeaderBadge, #homeBrowseBadge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid var(--bg-primary);
    animation: badgePop 0.3s ease;
    z-index: 20;
}
#homeBrowseBadge {
    background: var(--danger);
}
#refreshBtn {
    position: relative;
    overflow: visible !important;
}
#refreshBtn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: wandPulse 2s ease-in-out infinite;
}
#refreshBtn.refreshing::after {
    content: '✨';
    position: absolute;
    font-size: 10px;
    animation: sparkleBurst 0.6s ease-out forwards;
}
@keyframes wandPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.3); }
}
@keyframes sparkleBurst {
    0% { opacity: 1; transform: scale(0) rotate(0deg); }
    100% { opacity: 0; transform: scale(2) rotate(180deg); }
}

/* ============================================================
   DEVICE-SPECIFIC FIXES
   ============================================================ */

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 480px) {
    .form-input, select, textarea {
        font-size: 16px !important;
    }
}

/* Fix for very small screens */
@media screen and (max-width: 360px) {
    .grid-2 { gap: 8px; }
    .grid-3 { gap: 6px; }
    .card { padding: 10px; }
    .btn { padding: 8px 14px; }
    .btn-lg { padding: 12px 20px; }
    .nav-item { padding: 6px 8px; font-size: 10px; }
}

/* Fix for tall/notched phones */
@supports (padding: max(0px)) {
    .app-header { padding-top: max(16px, env(safe-area-inset-top)); }
    .bottom-nav { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
    .main-content { padding-bottom: max(100px, calc(env(safe-area-inset-bottom) + 80px)); }
}

/* Fix for foldable phones */
@media screen and (max-width: 280px) {
    .header-actions { gap: 4px; }
    .icon-btn { width: 34px; height: 34px; font-size: 15px; }
    .app-title { font-size: 14px; }
}

.main-content .page-enter > div[style*="grid-template-columns: 1fr 1fr"] {
    width: 100%;
}