:root {
    --primary: #ff9eb5;
    --primary-light: rgba(255, 158, 181, 0.15);

    --bg-main: #131314;
    --surface: #1e1e20;
    --surface-lighter: #28282a;
    --text-main: #e3e3e3;
    --text-muted: #c4c7c5;
    --border-color: #333336;

    --success: #10b981;
    --warning: #f59e0b;
    --font-head: 'Gloria Hallelujah', cursive;
    --font-main: 'Outfit', sans-serif;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
    --radius: 24px;
}

body.light-mode {
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --surface-lighter: #f1f5f9;
    --text-main: #1f1f1f;
    --text-muted: #444746;
    --border-color: #e2e8f0;
    --shadow: 0 8px 24px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-main); }
body { background: var(--bg-main); color: var(--text-main); transition: background-color 0.3s, color 0.3s; -webkit-tap-highlight-color: transparent;}
svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0;}

.app-header { position: fixed; top: 0; width: 100%; height: 70px; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 100; transition: background-color 0.3s;}
.header-left, .header-right { display: flex; align-items: center; gap: 15px;}
.desktop-nav { display: none; }
.top-logo { font-family: var(--font-head); font-size: 1.5rem; color: var(--primary); font-weight: bold; cursor: pointer;}
.icon-btn { width: 45px; height: 45px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-color); color: var(--text-muted); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s;}
.icon-btn:hover, .icon-btn.active-mic { color: var(--primary); border-color: var(--primary); }

.top-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(18, 18, 18, 0.8) !important;
    backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), background 0.3s ease !important;
}

.bottom-nav {
    position: fixed; bottom: 0; width: 100%; height: 80px; z-index: 100;
    display: flex; justify-content: space-evenly; align-items: center;
    background: rgba(18, 18, 18, 0.8) !important;
    backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: background 0.3s ease !important;
}

body.light-mode .top-nav, body.light-mode .bottom-nav {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.header-hidden { transform: translateY(-100%); }

.nav-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; padding: 10px 0; width: 28%; border-radius: 16px; transition: 0.3s ease;}
.nav-tab.active { color: var(--primary); font-weight: bold; background: var(--primary-light);}
.nav-tab svg { transition: transform 0.2s ease; }
.nav-tab.active svg { transform: translateY(-2px); }

.hero { text-align: center; margin-bottom: 30px; transition: 0.3s; position: relative; }
.hero-title { font-family: var(--font-head); font-size: 4rem; color: var(--primary); text-shadow: 0 0 20px rgba(219,39,119,0.4); line-height: 1;}
.hero-subtitle { color: var(--text-muted); margin-top: 10px; font-size: 1.1rem;}
#minion-container { position: absolute; left: 50%; top: -10px; transform: translateX(-50%); width: 250px; height: 60px; overflow: hidden; pointer-events: none; display:none;}

.offline-banner {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 350px;
    background: rgba(18, 18, 20, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color); border-radius: 16px; padding: 15px;
    display: none; align-items: center; gap: 15px; z-index: 99;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideDown 0.4s ease;
}
.wifi-icon-anim { width: 40px; height: 40px; background: rgba(239, 68, 68, 0.15); color: #ef4444; border-radius: 50%; display: flex; justify-content: center; align-items: center; }
.offline-text { display: flex; flex-direction: column; }
.offline-text strong { color: var(--text-main); font-size: 0.95rem; }
.offline-text span { color: var(--text-muted); font-size: 0.8rem; }
@keyframes slideDown { from { transform: translateX(-50%) translateY(-20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

.main-container { max-width: 500px; margin: 90px auto 100px; padding: 0 20px; transition: margin-left 0.3s, max-width 0.3s;}
.content-section { display: none; }
.content-section.active { display: block; animation: sectionFadeIn 0.22s ease both; }
.content-section.section-exit { display: block; animation: sectionFadeOut 0.18s ease both; pointer-events: none; }
@keyframes sectionFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sectionFadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-6px); } }

.search-wrapper { position: relative; margin-bottom: 30px; z-index: 50;}
#search-input { width: 100%; padding: 20px 100px 20px 50px; border-radius: 30px; border: 2px solid var(--border-color); background: var(--surface); color: var(--text-main); font-size: 1.1rem; outline: none; transition: 0.3s;}
#search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);}
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted);}
.search-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px;}

.autocomplete-dropdown { position: absolute; top: 110%; width: 100%; background: var(--surface); border: 1px solid var(--border-color); border-radius: 16px; display: none; flex-direction: column; overflow: hidden; box-shadow: var(--shadow);}
.auto-item { padding: 15px 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color); cursor: pointer;}
.auto-text { display: flex; flex-direction: column; }
.filter-dropdown { position: absolute; top: 110%; right: 0; width: 220px; background: var(--surface); border: 1px solid var(--border-color); border-radius: 16px; display: none; flex-direction: column; padding: 15px; box-shadow: var(--shadow); z-index: 60;}
.filter-option { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; border-radius: 8px; transition: 0.2s;}
.filter-option:hover { background: var(--bg-main); }
.filter-option input { display: none; }
.checkmark { width: 20px; height: 20px; border: 2px solid var(--text-muted); border-radius: 6px; display: flex; justify-content: center; align-items: center; transition: 0.2s;}
.filter-option input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.filter-option input:checked ~ .checkmark:after { content: '✔'; color: white; font-size: 12px;}

.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px;}
.book-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; animation: fadeInUp 0.4s both; position: relative;}
.cover-box { width: 100%; aspect-ratio: 2/3; background: var(--border-color); border-radius: 12px; position: relative; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.2); display: flex; justify-content: center; align-items: center;}
.cover-box img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.4s ease, transform 0.4s ease !important;}
.book-info strong { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;}
.book-info small { color: var(--text-muted); }

.book-card:hover .cover-box img, .book-card.show-actions .cover-box img {
    filter: blur(4px) brightness(0.4) !important; transform: scale(0.95) !important;
}

.cover-box .fav-btn {
    position: absolute !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) scale(0.5) !important;
    width: 65px !important; height: 65px !important;
    background: rgba(18, 18, 18, 0.6) !important;
    border: 2px solid var(--primary) !important; color: var(--primary) !important;
    border-radius: 50% !important; opacity: 0 !important; z-index: 10 !important;
    display: flex; justify-content: center; align-items: center; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cover-box .fav-btn svg, .cover-box .fav-btn i { width: 30px; height: 30px; }
.book-card:hover .fav-btn, .book-card.show-actions .fav-btn { opacity: 1 !important; transform: translate(-50%, -50%) scale(1) !important; }
.cover-box .fav-btn.active { background: var(--primary) !important; color: white !important; }

.new-badge { position: absolute; top: -10px; left: -10px; background: var(--primary); color: white; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.75rem; box-shadow: 0 4px 10px rgba(255, 158, 181, 0.5); z-index: 10; letter-spacing: 1px; text-transform: uppercase; border: 2px solid var(--surface); animation: newShimmer 3s ease-in-out infinite; }
.hot-badge { position: absolute; top: -10px; right: -10px; background: #ef4444; color: white; padding: 6px 12px; border-radius: 20px; font-weight: bold; font-size: 0.75rem; box-shadow: 0 4px 10px rgba(239, 68, 68, 0.5); z-index: 10; letter-spacing: 1px; text-transform: uppercase; border: 2px solid var(--surface); display: flex; align-items: center; gap: 4px; animation: hotPulse 2.2s ease-in-out infinite; }

.featured-wrap { margin-bottom: 30px; }
.feat-tag { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: bold; color: var(--warning); text-transform: uppercase; margin-bottom: 15px;}
.featured-card { 
    background: var(--surface); 
    border: 1px solid var(--border-color); 
    padding: 20px; 
    border-radius: var(--radius); 
    display: flex; gap: 20px; align-items: center; cursor: pointer; position: relative; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.featured-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 50%, var(--feat-glow, rgba(255,158,181,0.08)) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}
.featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
}
.featured-card > * { position: relative; z-index: 1; }

.feat-img-wrap { width: 90px; height: 135px; border-radius: 8px; background: var(--border-color); position: relative; flex-shrink: 0; overflow: hidden; display: flex; justify-content: center; align-items: center;}
.feat-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.4s; }
.feat-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center !important;
    text-align: center !important;
    width: 100%;
}
.book-badge { background: var(--primary-light); color: var(--primary); padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; width: fit-content; margin: 0 auto; }

.featured-card:hover .feat-img-wrap img, .featured-card.show-actions .feat-img-wrap img { filter: blur(4px) brightness(0.4); transform: scale(0.95); }
.featured-card:hover .fav-btn, .featured-card.show-actions .fav-btn { opacity: 1 !important; transform: translate(-50%, -50%) scale(1) !important; }

.unified-modal-header {
    display: flex; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; width: 100%; gap: 10px; margin-bottom: 25px;
}
.umh-book-section { display: flex; flex-direction: row; align-items: center; gap: 15px; flex: 1; }
.umh-cover-wrap { width: 80px; height: 120px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-color); flex-shrink: 0; }
.umh-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.umh-book-info { display: flex; flex-direction: column; align-items: flex-start; }
.umh-book-info h2 { font-size: 1.1rem; margin-bottom: 6px; line-height: 1.2; font-weight: bold; color: var(--text-main); }
.umh-book-info .book-badge { margin: 0; font-size: 0.7rem; padding: 4px 10px; }

.umh-divider { display: block; width: 1px; height: 70px; background: var(--border-color); opacity: 0.6; flex-shrink: 0; }

.umh-author-section { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 70px; flex-shrink: 0; text-align: center; overflow: hidden; }
.umh-author-wrap { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.umh-author-wrap img { width: 100%; height: 100%; object-fit: cover; }
.umh-author-section h3 { color: var(--text-muted); font-size: 0.75rem; font-weight: normal; line-height: 1.1; overflow-wrap: anywhere; margin: 0; }

@media (min-width: 850px) {
    .unified-modal-header { justify-content: center; gap: 40px; margin-bottom: 30px; }
    .umh-book-section { gap: 25px; flex: unset; }
    .umh-cover-wrap { width: 140px; height: 210px; border-radius: 12px; }
    .umh-book-info h2 { font-size: 1.6rem; margin-bottom: 10px; }
    .umh-book-info .book-badge { font-size: 0.8rem; padding: 6px 14px; }
    .umh-divider { height: 100px; width: 2px; opacity: 1; }
    .umh-author-section { width: auto; gap: 10px; overflow: visible; }
    .umh-author-wrap { width: 80px; height: 80px; border: 3px solid var(--surface); }
    .umh-author-section h3 { font-size: 1.1rem; }
}

.btn-primary { width: 100%; background: var(--primary); color: white; border: none; padding: 18px; border-radius: 16px; font-size: 1.1rem; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.2s;}
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { width: 100%; background: var(--surface-lighter); border: 1px solid var(--border-color); color: var(--text-main); padding: 18px; border-radius: 16px; font-size: 1.1rem; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;}
.btn-success { width: 100%; background: var(--success); color: white; border: none; padding: 18px; border-radius: 16px; font-size: 1.1rem; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;}
.btn-outline-warning { width: 100%; background: transparent; border: 2px solid var(--warning); color: var(--warning); padding: 18px; border-radius: 12px; font-size: 1.1rem; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;}
button:active, .book-card:active, .menu-item:active, .icon-btn:active, .nav-item:active { transform: scale(0.95); transition: transform 0.1s; }

.input-label { display: block; margin-bottom: 12px; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; }
.input-with-icon { position: relative; margin-bottom: 25px; }
.input-field { width: 100%; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-main); padding: 20px; border-radius: 16px; font-size: 1.1rem; outline: none; margin-bottom: 15px; transition: 0.3s;}
.input-field:focus { border-color: var(--primary); }
.input-with-icon input { padding-left: 55px !important; margin-bottom: 0 !important; }
.input-with-icon svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); margin: 0 !important; padding: 0 !important; display: block; }
.mt { margin-top: 20px; }
.full-width { width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;}

.side-menu { position: fixed; top: 0; left: -100%; width: 280px; height: 100%; background: var(--surface); z-index: 200; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; border-right: 1px solid var(--border-color);}
.side-menu.active { left: 0; box-shadow: var(--shadow); }
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 150; display: none; }
.menu-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px;}
.menu-header h2 { display: flex; align-items: center; color: var(--text-main); font-size: 1.2rem; margin: 0;}
.menu-header h2 svg { margin-right: 15px !important; width: 24px; height: 24px; }
.close-btn-side { background: transparent; border: none; color: var(--text-muted); cursor: pointer; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; border-radius: 50%; border: 1px solid var(--border-color); transition: 0.2s;}
.close-btn-side:hover { background: var(--bg-main); color: var(--text-main); }
.menu-content { display: flex; flex-direction: column; gap: 5px; padding: 0 15px; overflow-y: auto; flex: 1; padding-bottom: 80px; -ms-overflow-style: none; scrollbar-width: none; }
.menu-content::-webkit-scrollbar { display: none; }
.menu-item { display: flex; align-items: center; padding: 15px 20px; border-radius: 12px; border: none; background: transparent; color: var(--text-muted); font-size: 1.1rem; font-weight: 500; cursor: pointer; transition: 0.2s; text-align: left;}
.menu-item svg { margin-right: 25px !important; width: 24px !important; }
.menu-item:hover { background: var(--bg-main); color: var(--text-main); }
.menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: bold;}
.divider { height: 1px; background: var(--border-color); margin: 10px 0; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 1000; display: none; justify-content: center; align-items: center; padding: 20px;}
.modal-overlay[style*='flex'] > .modal-box, .modal-overlay[style*='flex'] > .popup-box { animation: modalPopIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both; }
.modal-box { background: var(--surface); width: 100%; max-width: 400px; border-radius: var(--radius); border: 1px solid var(--border-color); padding: 35px 25px; position: relative; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow);}
.modal-box.dynamic-theme { box-shadow: 0 0 100px var(--dynamic-color, rgba(219, 39, 119, 0.2)); border: 1px solid var(--dynamic-color, var(--border-color)); }
.close-btn { position: absolute; top: 22px; right: 22px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-muted); display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 50; transition: 0.2s;}
.close-btn:hover { background: var(--surface-lighter); color: var(--primary); border-color: var(--primary); }
.share-btn-top { position: absolute; top: 22px; left: 22px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-muted); display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 50; transition: 0.2s;}
.share-btn-top:hover { background: var(--surface-lighter); color: var(--primary); border-color: var(--primary); }

.map-carousel {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-main);
    border-radius: 16px;
    position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 1px solid var(--border-color); margin-bottom: 20px; margin-top: 20px;
}
.map-carousel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 45px; height: 45px; border-radius: 50%; background: rgba(18,18,18,0.7); backdrop-filter: blur(4px); border: 1px solid var(--border-color); color: white; display: flex; justify-content: center; align-items: center; cursor: pointer; z-index: 10;}
.nav-arrow.left { left: 10px; } .nav-arrow.right { right: 10px; }
.step-tag { position: absolute; bottom: 15px; background: rgba(18,18,18,0.8); backdrop-filter: blur(4px); color: white; padding: 6px 20px; border-radius: 20px; font-weight: bold; border: 1px solid var(--border-color); font-size: 0.9rem;}

.virtual-shelf-footer { margin-top: 25px; border-top: 1px solid var(--border-color); padding-top: 20px; width: 100%; }
.virtual-shelf-footer h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: bold;}
.related-grid { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; -ms-overflow-style: none; scrollbar-width: none; }
.related-grid::-webkit-scrollbar { display: none; }
.related-card { flex: 0 0 auto; width: 110px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); cursor: pointer; background: var(--border-color); scroll-snap-align: start; transition: transform 0.2s;}
.related-card:hover { transform: translateY(-4px); }
.related-card img { width: 100%; height: 100%; object-fit: cover; }

.card-box { background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 30px; display: flex; flex-direction: column; gap: 20px;}
.card-header { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px;}
.icon-box { width: 50px; height: 50px; background: var(--primary-light); color: var(--primary); border-radius: 16px; display: flex; justify-content: center; align-items: center;}
.action-list { display: flex; flex-direction: column; gap: 15px;}
.action-btn { display: flex; align-items: center; gap: 15px; padding: 20px; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 16px; font-size: 1.1rem; cursor: pointer; transition: 0.2s;}
.action-btn:hover { border-color: var(--primary); }
.tip-box { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); padding: 20px; border-radius: 16px; margin-top: 10px;}
.tip-header { display: flex; align-items: center; gap: 10px; color: var(--warning); font-weight: bold; margin-bottom: 10px; text-transform: uppercase; font-size: 0.9rem;}
.steps-container { display: flex; flex-direction: column; gap: 25px; margin-top: 10px;}
.step-item { display: flex; gap: 20px; align-items: flex-start;}
.step-num { width: 35px; height: 35px; background: var(--primary); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 1.1rem; flex-shrink: 0;}
.step-text { display: flex; flex-direction: column; gap: 5px; margin-top: 4px;}
.step-text strong { font-size: 1.2rem; color: var(--text-main); }
.step-text span { color: var(--text-muted); line-height: 1.5;}
.sub-title { font-size: 1.2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px;}
.admin-list { display: flex; flex-direction: column; gap: 15px; max-height: 250px; overflow-y: auto;}
.admin-list-item { background: var(--bg-main); border: 1px solid var(--border-color); padding: 15px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px;}
.admin-list-item .info { display: flex; flex-direction: column;}
.admin-list-item .info strong { font-size: 1.1rem; }
.admin-list-item .info small { color: var(--text-muted);}
.admin-list-item .actions { display: flex; gap: 10px; }
.btn-edit { flex: 1; background: var(--primary-light); color: var(--primary); border: none; padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px;}
.btn-delete { flex: 1; background: rgba(245,158,11,0.1); color: var(--warning); border: none; padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px;}

.popup-box { background: var(--surface); width: 100%; max-width: 320px; border-radius: var(--radius); text-align: center; padding: 35px 25px; position: relative; border: 1px solid var(--border-color); box-shadow: var(--shadow);}
.popup-icon-wrapper { width: 70px; height: 70px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px;}
.popup-actions { display: flex; gap: 10px; margin-top: 25px; }
.success-icon { width: 80px; height: 80px; background: rgba(16, 185, 129, 0.15); color: var(--success); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
.success-icon svg { width: 45px; height: 45px; }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #1e1e20; color: white; padding: 15px 30px; border-radius: 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); display: flex; align-items: center; gap: 15px; z-index: 20000; border: 1px solid #333; opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast i { color: var(--success); }
.qr-scanner-box { position: relative; display: inline-block; background: white; padding: 20px; border-radius: 16px; border: 4px solid var(--border-color); overflow: hidden; }
.scanner-line { position: absolute; width: 100%; height: 4px; background: var(--primary); box-shadow: 0 0 10px var(--primary); top: 0; left: 0; animation: scan 2s linear infinite; opacity: 0.6; }
@keyframes scan { 0% { top: 0; } 50% { top: 100%; } 100% { top: 0; } }
.skeleton { position: relative; overflow: hidden; background: var(--bg-main); }
.skeleton::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: translateX(-100%); background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0.1) 60%, rgba(255, 255, 255, 0)); animation: shimmer 2s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.screensaver {
    position: fixed; inset: 0; width: 100vw; height: 100vh;
    background: var(--bg-main);
    z-index: 99999; display: none; flex-direction: column;
    justify-content: center; align-items: center;
    overflow: hidden;
}

.ss-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.18;
    animation: orbFloat 8s ease-in-out infinite;
}

.ss-orb1 { width: 420px; height: 420px; background: var(--primary); top: -100px; left: -80px; animation-delay: 0s; }
.ss-orb2 { width: 300px; height: 300px; background: #a78bfa; bottom: -60px; right: -60px; animation-delay: -3s; }
.ss-orb3 { width: 200px; height: 200px; background: #60a5fa; top: 40%; left: 60%; animation-delay: -5s; }

@keyframes orbFloat {
    0%,100% { transform: translateY(0px) scale(1); }
    50%      { transform: translateY(-24px) scale(1.04); }
}

body.light-mode .ss-bg-orb { opacity: 0.09; }

.ss-inner {
    display: flex; flex-direction: column; align-items: center;
    gap: 0; position: relative; z-index: 2; padding: 30px 20px;
    text-align: center;
}

.ss-logo-wrap {
    position: relative;
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
}

.ss-logo-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.5;
    animation: ringPulse 2.5s ease-in-out infinite;
}

.ss-logo-ring::after {
    content: '';
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    opacity: 0.25;
    animation: ringPulse 2.5s 0.4s ease-in-out infinite;
}

@keyframes ringPulse {
    0%,100% { transform: scale(1); opacity: 0.5; }
    50%      { transform: scale(1.12); opacity: 0.2; }
}

.ss-logo-icon { width: 38px; height: 38px; color: var(--primary); }

.ss-title {
    font-family: 'Gloria Hallelujah', cursive;
    font-size: 2.8rem; font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
    margin-bottom: 8px;
    animation: pulse 3s ease-in-out infinite;
}

.ss-subtitle {
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 28px;
    animation: pulse 3s 0.5s ease-in-out infinite;
}

.ss-clock {
    font-size: 4.5rem; font-weight: 900;
    color: var(--text-main);
    letter-spacing: -3px;
    line-height: 1;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
}

body.light-mode .ss-clock { color: var(--text-main); }

.ss-fact-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 18px 22px;
    max-width: 380px;
    width: 100%;
    text-align: left;
    backdrop-filter: blur(10px);
}

.ss-fact-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--primary); margin-bottom: 10px;
}

.ss-fact-label svg { width: 13px; height: 13px; }

.ss-fact-card p {
    font-size: 0.88rem; line-height: 1.6;
    color: var(--text-muted);
    font-weight: 400; margin: 0;
    font-style: italic;
    text-transform: none; letter-spacing: normal;
    animation: none;
}

.ss-footer {
    margin-top: 28px;
    font-size: 0.62rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); opacity: 0.5;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.feedback-layout {
    max-width: 440px !important; padding: 0 !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border-radius: 24px; overflow: hidden;
    max-height: 90vh; overflow-y: auto;
}
.feedback-hero {
    background: linear-gradient(135deg, rgba(255,158,181,0.15) 0%, rgba(255,158,181,0.03) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 24px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.feedback-icon-wrap {
    width: 54px; height: 54px;
    background: var(--primary); color: white;
    border-radius: 16px;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 8px 24px rgba(255,158,181,0.4);
}
.feedback-icon-wrap svg { width: 26px; height: 26px; stroke-width: 2px; }
.feedback-hero h2 { font-size: 1.3rem; color: var(--text-main); margin: 0; font-weight: 800; }
.feedback-hero p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; margin: 0; }

#fb-loading, #fb-guest-notice, #fb-existing-review, #fb-write-form, #fb-new-user-form { padding: 20px 22px 22px; }

.star-rating-input { background: var(--bg-main); padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-color); text-align: center; }
.stars { display: flex; justify-content: center; gap: 8px; flex-direction: row-reverse; margin-top: 4px; }
.stars input { display: none; }
.stars label { cursor: pointer; padding: 4px; transition: transform 0.15s; }
.stars label svg { width: 30px; height: 30px; fill: transparent; stroke: var(--text-muted); transition: 0.2s; stroke-width: 2px; }
.stars input:checked ~ label svg, .stars label:hover svg, .stars label:hover ~ label svg { fill: #eab308; stroke: #eab308; filter: drop-shadow(0 0 6px rgba(234,179,8,0.6)); transform: scale(1.15); }

.fb-existing-card { background: var(--primary-light); border: 1.5px solid var(--primary); border-radius: 16px; padding: 16px; margin-bottom: 4px; animation: fadeSlideUp 0.3s ease both; }
.fb-existing-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.fb-existing-actions { margin-left: auto; display: flex; gap: 6px; }
.fb-action-btn { background: transparent; border: 1px solid var(--border-color); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.fb-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.fb-action-btn--danger:hover { border-color: #ef4444; color: #ef4444; }
.fb-action-btn svg { width: 14px; height: 14px; }
.fb-reviewer-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: white; flex-shrink: 0; background: linear-gradient(135deg,#db2777,#9333ea); }
.fb-star-display { font-size: 0.82rem; margin-top: 2px; }
.fb-existing-text { color: var(--text-main); font-size: 0.88rem; line-height: 1.6; margin: 0; }

.fb-reviews-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; margin: 18px 0 14px; }
.fb-reviews-divider::before, .fb-reviews-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.fb-reviews-list { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
.fb-review-card { background: var(--surface-lighter); border: 1px solid var(--border-color); border-radius: 14px; padding: 14px; animation: fadeSlideUp 0.3s ease both; }
.fb-review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fb-review-text { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; margin: 0; }

#fb-submit-btn, #fb-new-submit-btn { width: 100%; background: linear-gradient(135deg, var(--primary) 0%, #be185d 100%); color: #fff; border: none; padding: 15px; border-radius: 12px; font-weight: bold; font-size: 0.95rem; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; box-shadow: 0 8px 24px -8px rgba(219,39,119,0.6); transition: 0.2s; }
#fb-submit-btn:hover, #fb-new-submit-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

@keyframes fadeSlideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeSlideIn { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.92); } to { opacity:1; transform:scale(1); } }

.book-card { animation: fadeSlideUp 0.35s ease both; }
.featured-wrap { animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.content-section.active { animation: fadeSlideIn 0.25s ease both; }
.admin-list-item { animation: fadeSlideUp 0.2s ease both; }
.sn-hero, .sn-pills-row, .sn-section { animation: fadeSlideUp 0.35s ease both; }

.modal-overlay[style*="flex"] > .modal-box { animation: scaleIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both !important; }

.fb-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .fb-name-row { grid-template-columns: 1fr; } }

.stats-layout {
    max-width: 480px !important; width: 88%;
    display: flex; flex-direction: column; align-items: stretch;
    background: var(--surface) !important;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow), 0 0 0 1px rgba(255,158,181,0.04);
    border-radius: 32px; padding: 0 !important;
    overflow-y: auto; overflow-x: hidden;
    max-height: 88vh; overscroll-behavior: contain;
    margin: auto;
}
.stats-layout::-webkit-scrollbar { display: none; }

#stats-modal .modal-box {
    position: relative;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
#stats-modal .close-btn {
    position: sticky !important;
    top: 0;
    left: 100%;
    display: block;
    margin-left: auto;
    margin-right: 16px;
    margin-top: 16px;
    z-index: 100;
    background: var(--surface-lighter) !important;
    border-color: var(--border-color) !important;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
}

.sn-pill.sn-pill-accent {
    background: var(--primary-light);
    border-color: rgba(255,158,181,0.3);
}
.sn-pill.sn-pill-accent .sn-pill-val {
    font-size: 1rem;
    letter-spacing: -0.5px;
}
.sn-pill.sn-pill-accent svg { color: var(--primary); }

.sn-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 22px 22px 16px;
}
.sn-eyebrow {
    display: block; font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--primary); margin-bottom: 4px;
}
.sn-title { font-size: 1.8rem; font-weight: 900; color: var(--text-main); margin: 0; letter-spacing: -1px; }
.sn-uptime {
    display: flex; align-items: center; gap: 7px;
    background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.2);
    color: #4ade80; padding: 6px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; white-space: nowrap;
    font-variant-numeric: tabular-nums; flex-shrink: 0; margin-top: 4px;
}
.sn-live-dot {
    width: 6px; height: 6px; background: #4ade80; border-radius: 50%;
    box-shadow: 0 0 8px #4ade80; animation: pulse 2s ease-in-out infinite;
}

.sn-hero {
    position: relative; overflow: hidden;
    margin: 0 14px 14px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255,158,181,0.03) 60%, transparent 100%);
    border: 1px solid rgba(255,158,181,0.2);
    border-radius: 24px; padding: 26px 26px 22px;
}
.sn-hero-glow {
    position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,158,181,0.25) 0%, transparent 70%);
    pointer-events: none;
}
.sn-hero-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--primary); margin-bottom: 16px;
}
.sn-hero-label svg { width: 13px; height: 13px; }
.sn-hero-views {
    font-size: 4.5rem; font-weight: 900; color: var(--text-main);
    line-height: 1; letter-spacing: -3px;
}
.sn-hero-views-sub {
    font-size: 0.8rem; font-weight: 600; color: var(--primary);
    text-transform: uppercase; letter-spacing: 2px; margin: 4px 0 16px;
}
.sn-hero-divider {
    width: 40px; height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 2px; margin-bottom: 16px;
}
.sn-hero-title {
    font-size: 1.35rem; font-weight: 800; color: var(--text-main);
    margin: 0 0 6px; line-height: 1.2;
}
.sn-hero-author { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 12px; }
.sn-hero-genre {
    display: inline-block;
    background: rgba(255,158,181,0.15); color: var(--primary);
    border: 1px solid rgba(255,158,181,0.25);
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}

.sn-pills-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; padding: 0 16px 16px;
}
.sn-pills-two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 320px; margin: 0 auto;
}
.sn-pill {
    background: var(--surface-lighter); border: 1px solid var(--border-color);
    border-radius: 18px; padding: 18px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center; transition: background 0.2s, border-color 0.2s;
}
.sn-pill:hover { background: var(--surface); border-color: rgba(255,158,181,0.35); }
.sn-pill svg { width: 18px; height: 18px; color: var(--primary); }
.sn-pill-val { font-size: 1.6rem; font-weight: 900; color: var(--text-main); line-height: 1; }
.sn-pill-lbl { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

.sn-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 16px; }

.sn-section {
    background: var(--surface-lighter); border: 1px solid var(--border-color);
    border-radius: 20px; padding: 22px 20px;
}
.sn-section-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 16px;
}
.sn-section-label svg { width: 13px; height: 13px; }

.sn-rating-num {
    font-size: 2.8rem; font-weight: 900; color: var(--text-main);
    line-height: 1; margin-bottom: 12px;
}
.sn-rating-num span { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.sn-rating-bar-track {
    width: 100%; height: 5px; background: var(--border-color);
    border-radius: 4px; overflow: hidden; margin-bottom: 10px;
}
.sn-rating-bar-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, #be185d, var(--primary));
    transition: width 1s cubic-bezier(0.4,0,0.2,1);
}
.sn-rating-reviews { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

.sn-new-badge-inline {
    display: inline-block; background: #4ade80; color: #000;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.65rem; font-weight: 900; letter-spacing: 1px;
    margin-bottom: 10px;
}
.sn-new-title {
    font-size: 1rem; font-weight: 800; color: var(--text-main);
    line-height: 1.3; margin: 0 0 6px;
}
.sn-new-author { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.sn-catalog-section { margin: 0 16px 20px; }
.sn-genre-list { display: flex; flex-direction: column; gap: 14px; }
.sn-genre-item { display: flex; flex-direction: column; gap: 6px; }
.sn-genre-top { display: flex; justify-content: space-between; align-items: center; }
.sn-genre-name { font-size: 0.88rem; font-weight: 600; color: var(--text-main); }
.sn-genre-count { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); }
.sn-genre-track {
    width: 100%; height: 5px; background: var(--border-color);
    border-radius: 4px; overflow: hidden;
}
.sn-genre-fill {
    height: 100%; border-radius: 4px;
    width: 0;
    opacity: 0.85;
    transition: none;
}

@media (min-width: 600px) {
    .stats-layout { max-width: 580px !important; }
    .sn-hero-views { font-size: 5.5rem; }
    .sn-pills-row { gap: 14px; padding: 0 20px 20px; }
    .sn-two-col { gap: 14px; padding: 0 20px 20px; }
    .sn-catalog-section { margin: 0 20px 24px; }
    .sn-header { padding: 28px 28px 20px; }
    .sn-hero { margin: 0 20px 20px; }
}
@media (max-width: 360px) {
    .sn-two-col { grid-template-columns: 1fr; }
    .sn-hero-views { font-size: 3.8rem; }
}

.stats-compact-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.bento-card { background: var(--bg-main) !important; border: 1px solid var(--border-color) !important; border-radius: 20px; padding: 22px; transition: 0.3s; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.bento-card:hover { transform: translateY(-4px); border-color: var(--primary) !important; box-shadow: 0 15px 35px rgba(0,0,0,0.15) !important; }
.compact-card { padding: 20px; }
.compact-stat-row { display: flex; align-items: center; gap: 15px; flex: 1; }
.compact-stat-row strong { font-size: 1.5rem; color: var(--text-main); display: block; line-height: 1; }
.compact-stat-row span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }
.csr-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; }
.csr-icon.yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.csr-icon.pink { background: rgba(219, 39, 119, 0.15); color: var(--primary); }
.compact-divider { width: 1px; height: 40px; background: var(--border-color); margin: 0 5px; }
.csr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.csr-header span { font-weight: bold; color: var(--text-main); font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.csr-header small { background: var(--primary-light); color: var(--primary); padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; }

.neon-bars { display: flex; flex-direction: column; gap: 12px; }
.neon-bar-row { display: flex; flex-direction: column; gap: 6px; }
.neon-bar-labels { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.neon-bar-track { width: 100%; height: 8px; background: var(--surface-lighter); border-radius: 4px; overflow: hidden; }
.neon-bar-fill { height: 100%; background: linear-gradient(90deg, #be185d, var(--primary)); border-radius: 4px; }

@media (min-width: 850px) {
    .mobile-only, .mobile-only-share, .mobile-only-flex, .bottom-nav { display: none !important; }
    .desktop-nav, .desktop-only, .desktop-only-flex { display: flex !important; }
    .floating-btn { bottom: 40px; right: 40px; width: 60px; height: 60px; }
    .app-header .header-left .icon-btn { display: flex !important; }
    .close-btn-side { display: flex !important; }
    .app-header { padding: 0 50px; height: 80px; width: 100%; left: 0; z-index: 100;}
    .desktop-nav { gap: 30px; }
    .desk-nav-item { font-size: 1.1rem; color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 8px;}
    .desk-nav-item.active { color: var(--primary); font-weight: bold;}
    .side-menu { position: fixed; top: 100px; left: 20px; width: 260px; height: calc(100vh - 120px); background: var(--surface); display: flex !important; border: 1px solid var(--border-color); border-radius: 24px; box-shadow: var(--shadow); padding-top: 10px; z-index: 110; }
    .menu-overlay { display: none !important; }
    .main-container { margin-left: 310px; max-width: calc(100% - 330px); margin-top: 110px; padding: 0 40px;}
    body.sidebar-closed .side-menu { left: -300px !important; }
    body.sidebar-closed .main-container { margin-left: auto; margin-right: auto; max-width: 1000px; padding-left: 20px; padding-right: 20px; }
    .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px;}
    #admin-modal .modal-box { max-width: 750px; padding: 40px; }
    #stats-modal .modal-box { max-width: 650px; padding: 40px; }
    #feedback-modal .modal-box { max-width: 550px; padding: 40px; }
    .modal-box.book-layout { max-width: 900px; }
    .map-carousel { min-height: 320px; }

    .stats-compact-grid { grid-template-columns: 1fr 1fr; }
    .compact-card.full-width { grid-column: span 2; }
    .compact-stat-row { justify-content: center; }
}

.stats-layout { padding-top: 0 !important; } .feedback-layout { padding-top: 0 !important; }

.desktop-only-flex { display: none !important; }
@media (min-width: 850px) { .desktop-only-flex { display: flex !important; } }

.floating-btn {
    position: fixed !important; bottom: 100px !important; right: 20px !important;
    width: 50px !important; height: 50px !important; border-radius: 50% !important;
    background: var(--primary) !important; color: white !important; border: none !important;
    box-shadow: 0 8px 20px rgba(219,39,119,0.4) !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    cursor: pointer !important; opacity: 0; pointer-events: none; transition: 0.3s !important; z-index: 9999 !important;
}
.floating-btn.visible { opacity: 1 !important; pointer-events: auto !important; transform: translateY(0) !important; }
.floating-btn i, .floating-btn svg { width: 24px !important; height: 24px !important; stroke: white !important; }

.featured-card {
    flex-direction: column !important; text-align: center !important;
    justify-content: center !important; overflow: visible !important;
}

.feat-img-wrap {
    width: 140px !important; height: 210px !important;
    margin: 0 auto 15px auto !important; position: relative !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    border-radius: 12px !important; box-shadow: var(--shadow) !important;
}
.feat-img-wrap img {
    width: 100% !important; height: 100% !important; object-fit: cover !important;
    border-radius: 12px !important; transition: filter 0.4s ease, transform 0.4s ease !important;
}
.featured-card .fav-btn {
    position: absolute !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%, -50%) scale(0.5) !important;
    width: 65px !important; height: 65px !important;
    background: rgba(18, 18, 18, 0.6) !important;
    border: 2px solid var(--primary) !important; color: var(--primary) !important;
    border-radius: 50% !important; z-index: 10 !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.cover-box .fav-btn, .featured-card .fav-btn,
.cover-box .fav-btn.active, .featured-card .fav-btn.active {
    opacity: 0 !important;
}
.cover-box .fav-btn.active, .featured-card .fav-btn.active {
    background: var(--primary) !important; color: white !important;
}

.book-card:hover .fav-btn, .book-card.show-actions .fav-btn,
.featured-card:hover .fav-btn, .featured-card.show-actions .fav-btn {
    opacity: 1 !important; transform: translate(-50%, -50%) scale(1) !important;
}

.autocomplete-dropdown {
    position: absolute !important; top: 110% !important; left: 0 !important; width: 100% !important;
    background: var(--surface) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 16px !important; display: none; flex-direction: column !important; overflow: hidden !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
    z-index: 9999 !important;
}
body.light-mode .autocomplete-dropdown {
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}
.auto-item { padding: 15px 20px !important; display: flex !important; align-items: center !important; gap: 15px !important; border-bottom: 1px solid var(--border-color) !important; cursor: pointer !important; transition: 0.2s !important; }
.auto-item:hover { background: var(--surface-lighter) !important; }
.auto-item:last-child { border-bottom: none !important; }

.recent-header { padding: 15px 20px !important; font-size: 0.8rem !important; font-weight: bold !important; color: var(--text-muted) !important; text-transform: uppercase !important; letter-spacing: 1px !important; background: var(--surface-lighter) !important; display: flex !important; justify-content: space-between !important; align-items: center !important; border-bottom: 1px solid var(--border-color) !important; }
.recent-header span { display: flex !important; align-items: center !important; gap: 8px !important; }
.clear-recent { background: rgba(239, 68, 68, 0.1) !important; border: none !important; color: #ef4444 !important; padding: 6px 12px !important; border-radius: 8px !important; cursor: pointer !important; font-size: 0.75rem !important; transition: 0.2s !important; display: flex !important; align-items: center !important; gap: 6px !important; font-weight: bold !important;}
.clear-recent:hover { background: rgba(239, 68, 68, 0.2) !important; }

@media (min-width: 850px) {
    .stats-compact-grid .bento-span-2 { grid-column: span 2 !important; }
}

.saved-actions-bar {
    grid-column: 1 / -1 !important; width: 100% !important; display: flex !important; justify-content: space-between !important;
    align-items: center !important; background: var(--primary-light) !important;
    padding: 15px 20px !important; border-radius: 16px !important;
    margin-bottom: 20px !important; border: 1px solid rgba(255, 158, 181, 0.3) !important;
    box-sizing: border-box !important;
}
.saved-actions-bar span { color: var(--primary) !important; font-weight: bold !important; display: flex !important; align-items: center !important; gap: 8px !important; }
.btn-export { background: var(--primary) !important; color: white !important; border: none !important; padding: 8px 16px !important; border-radius: 12px !important; font-weight: bold !important; cursor: pointer !important; display: flex !important; align-items: center !important; gap: 8px !important; font-size: 0.9rem !important; }

.empty-state {
    grid-column: 1 / -1 !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important;
    text-align: center !important; padding: 60px 20px !important;
    width: 100% !important; min-height: 40vh !important;
}
.empty-icon-wrap {
    width: 90px !important; height: 90px !important;
    background: linear-gradient(135deg, rgba(219, 39, 119, 0.15) 0%, rgba(0,0,0,0) 100%) !important;
    color: var(--primary) !important; border-radius: 50% !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    margin-bottom: 25px !important; border: 1px solid rgba(219, 39, 119, 0.3) !important;
    box-shadow: 0 0 40px rgba(219, 39, 119, 0.2) !important;
    animation: float 3s ease-in-out infinite !important;
}
.empty-icon-wrap svg { width: 45px !important; height: 45px !important; stroke-width: 1.5px !important; }
.empty-state h3 { font-size: 1.8rem !important; margin-bottom: 10px !important; color: var(--text-main) !important; font-weight: 800 !important; }
.empty-state p { color: var(--text-muted) !important; font-size: 1rem !important; max-width: 300px !important; line-height: 1.5 !important; }

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.app-header.top-nav, .bottom-nav {
    background: rgba(19, 19, 20, 0.65) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.bottom-nav { border-bottom: none !important; border-top: 1px solid rgba(255, 255, 255, 0.05) !important; }

body.light-mode .app-header.top-nav, body.light-mode .bottom-nav {
    background: rgba(255, 255, 255, 0.65) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.stats-split-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 25px 20px !important;
    gap: 15px !important;
}
.split-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    width: 100%;
}
.split-divider {
    width: 60%;
    height: 1px;
    background: var(--border-color);
    opacity: 0.6;
}

@media (min-width: 850px) {
    .stats-split-card {
        flex-direction: row !important;
        justify-content: space-evenly !important;
        gap: 0 !important;
        padding: 20px 10px !important;
    }
    .split-divider {
        width: 1px !important;
        height: 65px !important;
    }
        }

.map-carousel {
    width: 100%;
    height: auto;
    min-height: 220px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 12px;
}
.map-carousel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(219, 39, 119, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 0 15px rgba(219, 39, 119, 0); transform: scale(1.05); }
    100% { box-shadow: 0 0 0 0 rgba(219, 39, 119, 0); transform: scale(1); }
}

.zoom-badge {
    position: absolute;
    bottom: 5px;
    right: 2px;
    background: rgba(18, 18, 18, 0.85); color: white; border: none;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(6px); cursor: pointer; z-index: 20;
    transition: 0.2s; border: 1px solid rgba(255,255,255,0.1);
    animation: pulse-glow 2.5s infinite;
}
.zoom-badge:active { transform: scale(0.9); background: var(--primary); border-color: var(--primary); }
.zoom-badge svg { width: 20px; height: 20px; }

.carousel-dots {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 20;
    background: rgba(0,0,0,0.6); padding: 6px 12px; border-radius: 20px;
    backdrop-filter: blur(2px);
}
.dot {
    width: 8px; height: 8px; background: rgba(255,255,255,0.5);
    border-radius: 50%; transition: 0.3s;
}
.dot.active { background: var(--primary); transform: scale(1.2); }

.carousel-controls {
    display: flex; align-items: center; justify-content: center; gap: 15px;
    width: 100%; margin-bottom: 15px;
}
.nav-control-btn {
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--surface-lighter); border: 1px solid var(--border-color);
    color: var(--text-main); display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: 0.2s;
}
.step-pill {
    background: var(--surface-lighter); color: var(--text-main);
    padding: 8px 20px; border-radius: 20px; font-weight: bold;
    font-size: 0.9rem; border: 1px solid var(--border-color);
    min-width: 100px; text-align: center;
}

@media (max-width: 849px) {
    .carousel-controls { display: none !important; }
    .map-carousel { min-height: 300px; }

    #step-counter { display: none; }
}

.swipe-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.72);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 25;
    pointer-events: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.12);
    white-space: nowrap;
    animation: swipeFade 2.2s ease-in-out forwards;
}
body.light-mode .swipe-hint {
    background: rgba(30,30,30,0.8);
    border-color: rgba(255,255,255,0.15);
}
@keyframes swipeFade {
    0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
    18%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.map-carousel { touch-action: none !important; overflow: hidden; }
.map-carousel img { touch-action: none !important; transform-origin: center; transition: transform 0.1s ease-out; will-change: transform; }

.broadcast-layout.theme-info { border-color: #3b82f6 !important; }
.broadcast-layout.theme-info .welcome-icon-wrap { background: #3b82f6 !important; color: white !important; box-shadow: 0 0 30px rgba(59, 130, 246, 0.3) !important; }

.broadcast-layout.theme-success { border-color: var(--success) !important; }
.broadcast-layout.theme-success .welcome-icon-wrap { background: var(--success) !important; color: white !important; box-shadow: 0 0 30px rgba(16, 185, 129, 0.3) !important; }

.broadcast-layout.theme-warning { border-color: var(--warning) !important; }
.broadcast-layout.theme-warning .welcome-icon-wrap { background: var(--warning) !important; color: white !important; box-shadow: 0 0 30px rgba(245, 158, 11, 0.3) !important; }

.broadcast-layout.theme-alert { border-color: #ef4444 !important; }
.broadcast-layout.theme-alert .welcome-icon-wrap { background: #ef4444 !important; color: white !important; box-shadow: 0 0 30px rgba(239, 68, 68, 0.3) !important; }

.switch-wrapper { display: flex; align-items: center; justify-content: space-between; background: var(--bg-main); padding: 15px 20px; border-radius: 16px; border: 1px solid var(--border-color); margin-bottom: 20px;}
.switch-label { font-weight: bold; color: var(--text-main); font-size: 1.1rem; display: flex; align-items: center; gap: 10px;}
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-color); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--warning); }
input:checked + .slider:before { transform: translateX(26px); }

#maintenance-overlay {
    position: fixed; inset: 0;
    background: #0d0d0f;
    z-index: 9999999; display: none; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 30px; box-sizing: border-box; overflow: hidden;
}

.maint-bg-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,158,181,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,158,181,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.maint-content {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    max-width: 480px; width: 100%;
}

.maint-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255, 158, 181, 0.1); border: 1px solid rgba(255,158,181,0.25);
    color: var(--primary); padding: 8px 18px; border-radius: 30px;
    font-size: 0.8rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1.5px;
    margin-bottom: 35px;
    animation: pulse 2.5s ease-in-out infinite;
}
.maint-badge svg { width: 14px; height: 14px; }

.maint-icon-container {
    position: relative; width: 120px; height: 120px; margin-bottom: 30px;
    display: flex; justify-content: center; align-items: center;
    background: radial-gradient(circle, rgba(255,158,181,0.15) 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(255,158,181,0.2);
}
.maint-cog { stroke: var(--primary); }
.main-cog { width: 72px; height: 72px; animation: spin 5s linear infinite; opacity: 0.9; }
.sub-cog { width: 38px; height: 38px; position: absolute; bottom: 12px; right: 12px; animation: spin-reverse 3s linear infinite; background: #0d0d0f; border-radius: 50%; padding: 3px; opacity: 0.7; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 100% { transform: rotate(-360deg); } }

#maintenance-overlay h1 {
    font-family: var(--font-head); font-size: 3rem; color: var(--text-main);
    margin-bottom: 14px; line-height: 1.15; letter-spacing: -1px;
}
#maintenance-overlay h1 span {
    color: var(--primary);
    text-shadow: 0 0 40px rgba(255,158,181,0.4);
}
#maintenance-overlay > .maint-content > p {
    color: var(--text-muted); font-size: 1rem; max-width: 380px;
    line-height: 1.7; margin-bottom: 28px;
}

.maint-status-row {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 28px;
}
.maint-status-pill {
    display: flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    padding: 7px 14px; border-radius: 20px;
    font-size: 0.78rem; color: var(--text-muted); font-weight: 500;
}
.maint-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}
.maint-dot.green { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.maint-dot.yellow { background: #facc15; box-shadow: 0 0 6px #facc15; animation-delay: 0.4s; }
.maint-dot.red { background: #f87171; box-shadow: 0 0 6px #f87171; animation-delay: 0.8s; }

.maint-card {
    width: 100%; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px; padding: 20px 24px; margin-bottom: 30px;
    text-align: left;
}
.maint-card-row {
    display: flex; align-items: flex-start; gap: 14px; padding: 6px 0;
}
.maint-card-row svg { width: 18px; height: 18px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.maint-card-row div { display: flex; flex-direction: column; gap: 3px; }
.maint-card-row strong { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: bold; }
.maint-card-row span { font-size: 0.95rem; color: var(--text-main); font-weight: 500; }
.maint-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 14px 0; }

.maint-footer {
    font-size: 0.78rem; color: rgba(255,255,255,0.2);
    text-transform: uppercase; letter-spacing: 2px; margin: 0 !important;
}

#shush-overlay {
    position: fixed; inset: 0; background: rgba(13, 13, 15, 0.95); backdrop-filter: blur(10px);
    z-index: 100000; display: none; flex-direction: column; justify-content: center; align-items: center;
    color: white; animation: fadeIn 0.3s ease-out;
}
.easter-egg-frame {
    width: 250px; height: 250px; border-radius: 50%; overflow: hidden;
    border: 8px solid var(--primary); box-shadow: 0 0 80px rgba(219, 39, 119, 0.5);
    margin-bottom: 40px; display: flex; justify-content: center; align-items: center;
    background: #000; position: relative;
}

.easter-egg-frame .tenor-gif-embed {
    width: 200% !important; height: 200% !important;
    pointer-events: none; margin-top: -5px;
}

#shush-text {
    font-family: 'Gloria Hallelujah', cursive; font-size: 5rem; color: var(--primary);
    text-shadow: 0 0 40px rgba(219, 39, 119, 0.8); margin: 0; letter-spacing: 5px;
    animation: pulse 1.5s infinite;
}

.welcome-layout, .broadcast-layout { text-align: center; max-width: 450px !important; padding: 40px 30px !important; }
.welcome-layout h2, .broadcast-layout h2 { color: var(--text-main); font-family: var(--font-head); font-size: 2rem; margin-bottom: 15px; }
.welcome-icon-wrap { width: 80px; height: 80px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; justify-content: center; align-items: center; margin: 0 auto 20px; box-shadow: 0 0 30px rgba(219, 39, 119, 0.3); }
.welcome-icon-wrap svg { width: 40px; height: 40px; }

.modal-box.book-layout {
    background: var(--surface) !important;
    border: 1px solid var(--border-color) !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-height: 92vh;
    width: 95%;
    max-width: 900px;
    position: relative;
}

.bm-float-btns {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    z-index: 200;
    pointer-events: none;
}

.bm-float-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: 0.2s;
    position: relative;
    top: auto;
    right: auto;
    left: auto;
}

.bm-float-btn:hover {
    background: rgba(0,0,0,0.8);
    border-color: var(--primary);
    color: var(--primary);
}

body.light-mode .bm-float-btn {
    background: rgba(255,255,255,0.75);
    border-color: rgba(0,0,0,0.12);
    color: #1f1f1f;
}

body.light-mode .bm-float-btn:hover {
    background: rgba(255,255,255,0.95);
    border-color: var(--primary);
    color: var(--primary);
}

.close-btn.bm-float-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
}

.book-modal-grid {
    display: flex;
    width: 100%;
}

.book-left {
    display: flex;
    flex-direction: column;
    background: var(--bg-main);
    border-right: 1px solid var(--border-color);
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

.bm-cover-hero {
    flex: 1;
    min-height: 280px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    overflow: hidden;
}

.bm-cover-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--primary-light) 0%, transparent 65%);
    pointer-events: none;
}

.umh-cover-wrap {
    position: relative;
    z-index: 2;
    width: 130px !important;
    height: 195px !important;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    background: var(--border-color) !important;
    border: none !important;
    flex-shrink: 0;
}

.umh-cover-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

#umh-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.bm-info-strip {
    padding: 16px 18px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--surface);
    flex-shrink: 0;
}

.bm-genre-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(255,158,181,0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.bm-book-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 12px;
}

.bm-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    background: var(--border-color);
}

.bm-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bm-author-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.bm-author-name {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.book-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 28px 24px 24px;
    overflow-y: auto;
    background: var(--surface);
    min-width: 0;
}

.book-right::-webkit-scrollbar { display: none; }

.bm-map-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-map-label svg { width: 12px; height: 12px; color: var(--primary); }

.map-carousel {
    border-radius: 14px !important;
    overflow: hidden !important;
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
}

.bm-action-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.bm-desktop-qr {
    display: flex;
}

.bm-qr-btn {
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
    width: 100%;
}

.bm-qr-btn:hover { border-color: var(--primary); color: var(--primary); }

.bm-found-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    flex: 1.5;
}

.bm-found-btn:hover { opacity: 0.9; }

.virtual-shelf-footer { display: none !important; }

.virtual-shelf-footer.bm-shelf {
    display: block !important;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 16px;
    width: 100%;
    flex-shrink: 0;
}

.virtual-shelf-footer.bm-shelf h3 {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

@media (min-width: 850px) {
    .modal-box.book-layout { max-width: 900px; }
    .book-left { width: 300px; }
    .umh-cover-wrap { width: 150px !important; height: 225px !important; }
    .bm-book-title { font-size: 1.1rem; }
    .map-carousel { min-height: 340px; }
    .bm-desktop-qr { display: flex !important; }
    #mobile-action-area { display: none !important; }
}

@media (max-width: 849px) {
    .modal-overlay { padding: 12px; }
    .modal-box.book-layout {
        max-height: 94vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        width: 100%;
        border-radius: 24px;
    }
    .book-modal-grid {
        flex-direction: column;
        overflow-y: auto;
        flex: 1;
    }
    .book-modal-grid::-webkit-scrollbar { display: none; }
    .book-left {
        width: 100%;
        flex-direction: column;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .bm-cover-hero {
        min-height: 220px;
        padding: 60px 20px 20px;
    }
    .umh-cover-wrap {
        width: 110px !important;
        height: 165px !important;
    }
    .bm-info-strip {
        padding: 14px 18px 18px;
    }
    .bm-book-title { font-size: 0.98rem; }
    .book-right {
        padding: 18px 18px 20px;
        overflow-y: visible;
    }
    .bm-desktop-qr { display: none !important; }
    .map-carousel { min-height: 240px; }
    .carousel-controls { display: flex !important; }
}

.pg-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.pg-eyebrow {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 4px;
}

.pg-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
    line-height: 1;
}

.tool-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: left;
    width: 100%;
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.tool-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tc-purple { background: rgba(167,139,250,0.15); color: #a78bfa; }
.tc-pink { background: var(--primary-light); color: var(--primary); }
.tc-green { background: rgba(74,222,128,0.12); color: #4ade80; }

.tool-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tool-card-body strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.tool-card-body span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.tool-card-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.tool-card:hover .tool-card-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

.tip-feature-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 80%);
    border: 1px solid rgba(255,158,181,0.2);
    border-radius: 18px;
    padding: 20px;
}

.tip-fc-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 10px;
}

.tip-fc-top svg { width: 14px; height: 14px; }

.tip-feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-style: italic;
}

.about-hero-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.about-hero-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-hero-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
    padding-top: 4px;
}

.how-section {
    margin-bottom: 20px;
}

.how-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.how-label svg { width: 14px; height: 14px; }

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl-item {
    display: grid;
    grid-template-columns: 36px 20px 1fr;
    gap: 0 12px;
    padding-bottom: 24px;
}

.tl-last { padding-bottom: 0; }

.tl-node {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
}

.tl-line {
    grid-column: 1;
    grid-row: 2 / 99;
    width: 2px;
    background: var(--border-color);
    margin: 6px auto 0;
    border-radius: 2px;
    min-height: 100%;
}

.tl-content {
    grid-column: 3;
    grid-row: 1 / 99;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
}

.tl-content strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.tl-content span {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.reminder-banner {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.reminder-icon {
    width: 38px;
    height: 38px;
    background: rgba(245,158,11,0.15);
    color: var(--warning);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reminder-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.reminder-text strong {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--warning);
}

.reminder-text span {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.bm-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.bm-genre-badge {
    margin-bottom: 0 !important;
}

.bm-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-lighter);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.sn-hero-views {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -3px;
    font-variant-numeric: tabular-nums;
}

@keyframes modalPopIn {
    0%   { opacity: 0; transform: scale(0.88) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes hotPulse {
    0%,100% { box-shadow: 0 4px 10px rgba(239,68,68,0.5); transform: scale(1); }
    50%      { box-shadow: 0 4px 22px rgba(239,68,68,0.85); transform: scale(1.06); }
}

@keyframes newShimmer {
    0%,100% { box-shadow: 0 4px 10px rgba(255,158,181,0.5); opacity: 1; }
    50%      { box-shadow: 0 4px 20px rgba(255,158,181,0.9); opacity: 0.85; }
}

@keyframes navBounce {
    0%   { transform: translateY(0) scale(1); }
    35%  { transform: translateY(-5px) scale(1.18); }
    60%  { transform: translateY(1px) scale(0.95); }
    80%  { transform: translateY(-2px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes favPop {
    0%   { transform: translate(-50%,-50%) scale(1); }
    40%  { transform: translate(-50%,-50%) scale(1.45); }
    70%  { transform: translate(-50%,-50%) scale(0.9); }
    100% { transform: translate(-50%,-50%) scale(1); }
}

@keyframes barGrow {
    from { width: 0; }
    to   { width: var(--bar-w, 100%); }
}

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

@keyframes featFloat {
    0%,100% { transform: translateY(0px); }
    50%     { transform: translateY(-6px); }
}

.nav-tab.active i, .nav-tab.active svg {
    animation: navBounce 0.42s cubic-bezier(0.34,1.56,0.64,1) both;
}

.fav-pop {
    animation: favPop 0.38s cubic-bezier(0.34,1.56,0.64,1) both !important;
}

.sn-genre-fill {
    animation: barGrow 0.85s cubic-bezier(0.4,0,0.2,1) both;
}

.sn-section {
    animation: statsItemIn 0.35s ease both;
}

.sn-hero {
    animation: statsItemIn 0.3s ease both;
}

.sn-pills-row .sn-pill {
    animation: statsItemIn 0.32s ease both;
}

.sn-pills-row .sn-pill:nth-child(1) { animation-delay: 0.05s; }
.sn-pills-row .sn-pill:nth-child(2) { animation-delay: 0.12s; }
.sn-pills-row .sn-pill:nth-child(3) { animation-delay: 0.19s; }

.sn-genre-item {
    animation: statsItemIn 0.32s ease both;
}
.sn-genre-item:nth-child(1) { animation-delay: 0.08s; }
.sn-genre-item:nth-child(2) { animation-delay: 0.14s; }
.sn-genre-item:nth-child(3) { animation-delay: 0.20s; }
.sn-genre-item:nth-child(4) { animation-delay: 0.26s; }
.sn-genre-item:nth-child(5) { animation-delay: 0.32s; }
.sn-genre-item:nth-child(6) { animation-delay: 0.38s; }

.featured-card {
    animation: statsItemIn 0.4s ease both;
}

.feat-img-wrap img {
    transition: transform 0.4s ease;
}

.featured-card:hover .feat-img-wrap img,
.featured-card:active .feat-img-wrap img {
    transform: scale(1.03);
}

.book-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

body.light-mode .book-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.tool-card {
    transition: transform 0.18s ease, border-color 0.2s, box-shadow 0.2s;
}

.tool-card:active {
    transform: scale(0.97);
}

.tl-node {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tl-item:hover .tl-node {
    transform: scale(1.12);
    box-shadow: 0 0 0 6px var(--primary-light);
}

.bm-float-btn {
    transition: transform 0.18s ease, background 0.18s, border-color 0.18s, color 0.18s;
}

.bm-float-btn:active {
    transform: scale(0.88);
}

.nav-control-btn {
    transition: transform 0.15s ease, opacity 0.2s;
}

.nav-control-btn:active {
    transform: scale(0.88);
}

.swipe-hint svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pg-title {
    animation: statsItemIn 0.3s ease both;
}

.pg-eyebrow {
    animation: statsItemIn 0.22s ease both;
}

.about-hero-card {
    animation: statsItemIn 0.3s 0.05s ease both;
}

.how-section {
    animation: statsItemIn 0.3s 0.1s ease both;
}

.reminder-banner {
    animation: statsItemIn 0.3s 0.15s ease both;
}

.tool-card:nth-child(1) { animation: statsItemIn 0.28s 0.04s ease both; }
.tool-card:nth-child(2) { animation: statsItemIn 0.28s 0.09s ease both; }
.tool-card:nth-child(3) { animation: statsItemIn 0.28s 0.14s ease both; }

.tip-feature-card {
    animation: statsItemIn 0.3s 0.2s ease both;
}

.modal-box.book-layout {
    animation: modalPopIn 0.3s cubic-bezier(0.34,1.4,0.64,1) both !important;
}

.search-clear-btn {
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.search-clear-btn[style*='flex'] {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.related-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
    padding: 12px 0;
    text-align: center;
    width: 100%;
}

.ss-clock {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -3px;
    line-height: 1;
    margin-bottom: 32px;
    font-variant-numeric: tabular-nums;
}

body.light-mode .ss-title { text-shadow: none; }

@media (max-width: 400px) {
    .ss-clock { font-size: 3.2rem; }
    .ss-title { font-size: 2rem; }
    .ss-fact-card { padding: 14px 16px; }
}

.app-loader {
    position: fixed; inset: 0;
    background: var(--bg-main);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.app-loader.loader-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}
.loader-bg-orb {
    position: absolute; border-radius: 50%;
    filter: blur(90px); pointer-events: none;
}
.loader-orb1 { width: 500px; height: 500px; background: var(--primary); top: -200px; left: -150px; opacity: 0.12; animation: orbFloat 6s ease-in-out infinite; }
.loader-orb2 { width: 350px; height: 350px; background: #a78bfa; bottom: -100px; right: -100px; opacity: 0.1; animation: orbFloat 8s 2s ease-in-out infinite; }

.loader-inner {
    display: flex; flex-direction: column; align-items: center;
    gap: 0; position: relative; z-index: 2;
    padding: 30px 24px; text-align: center; width: 100%; max-width: 360px;
}

.loader-logo-ring {
    position: relative; width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
}
.loader-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid transparent;
}
.loader-ring.r1 {
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    animation: loaderSpin 1.2s linear infinite;
}
.loader-ring.r2 {
    inset: 8px;
    border-bottom-color: rgba(167,139,250,0.7);
    border-left-color: rgba(167,139,250,0.7);
    animation: loaderSpin 1.8s linear infinite reverse;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
.loader-icon { width: 36px; height: 36px; color: var(--primary); }

.loader-title {
    font-family: 'Gloria Hallelujah', cursive;
    font-size: 2.4rem; font-weight: 900;
    color: var(--text-main); letter-spacing: -1px; margin-bottom: 6px;
    animation: pulse 2s ease-in-out infinite;
}
.loader-subtitle {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 2.5px; color: var(--text-muted); margin-bottom: 32px;
}

.loader-steps {
    display: flex; flex-direction: column; gap: 10px;
    width: 100%; margin-bottom: 24px; text-align: left;
}
.loader-step {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.82rem; color: var(--text-muted);
    opacity: 0.35; transition: opacity 0.4s ease, color 0.4s ease;
}
.loader-step.active {
    opacity: 1; color: var(--text-main);
}
.loader-step.done { opacity: 0.6; color: var(--text-muted); }
.ls-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border-color); flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.loader-step.active .ls-dot {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    animation: lsDotPulse 1s ease-in-out infinite;
}
.loader-step.done .ls-dot { background: #4ade80; box-shadow: none; animation: none; }
@keyframes lsDotPulse {
    0%,100% { box-shadow: 0 0 6px var(--primary); }
    50%      { box-shadow: 0 0 14px var(--primary), 0 0 24px rgba(255,158,181,0.4); }
}

.loader-bar-track {
    width: 100%; height: 4px; background: var(--border-color);
    border-radius: 99px; overflow: hidden; margin-bottom: 20px;
}
.loader-bar-fill {
    height: 100%; width: 0%; border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(255,158,181,0.5);
}
.loader-footer {
    font-size: 0.6rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted); opacity: 0.4;
}

.bm-shelf { position: relative; }

.related-scroll-wrap {
    position: relative;
}
.related-scroll-wrap::before,
.related-scroll-wrap::after {
    content: '';
    position: absolute; top: 0; bottom: 0; width: 40px;
    pointer-events: none; z-index: 5;
}
.related-scroll-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--surface), transparent);
    opacity: 0; transition: opacity 0.2s;
}
.related-scroll-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--surface), transparent);
}
.related-scroll-wrap.can-scroll-left::before { opacity: 1; }
.related-scroll-wrap.no-more-right::after { opacity: 0; }

.related-grid {
    display: flex; gap: 12px;
    overflow-x: auto; padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none; scrollbar-width: none;
    scroll-behavior: smooth;
}
.related-grid::-webkit-scrollbar { display: none; }

.related-shelf-arrows {
    display: none;
    gap: 6px; margin-top: 10px; justify-content: flex-end;
}
@media (min-width: 850px) {
    .related-shelf-arrows { display: flex; }
}
.rel-arrow-btn {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface-lighter); border: 1px solid var(--border-color);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.18s ease;
}
.rel-arrow-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.rel-arrow-btn:disabled { opacity: 0.3; pointer-events: none; }
.rel-arrow-btn svg { width: 14px; height: 14px; }

.related-count {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.5px;
    color: var(--primary); background: var(--primary-light);
    padding: 2px 8px; border-radius: 20px;
    margin-left: 8px; vertical-align: middle;
}

.clickable-author {
    text-decoration: underline; text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.18s ease;
}
.clickable-author:hover { color: var(--primary); }

.bm-genre-badge {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bm-genre-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast-milestone {
    background: linear-gradient(135deg, #1e1e20, #2a1a2e) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 30px rgba(255,158,181,0.3) !important;
}

.undo-bar {
    position: fixed; bottom: 90px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 40px); max-width: 420px;
    background: #1c1c1e; border: 1px solid #333;
    border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.65);
    z-index: 99997; opacity: 0; pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
    overflow: hidden;
}
.undo-bar.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.undo-bar-fill {
    position: absolute; bottom: 0; left: 0; height: 3px; width: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 0 0 18px 18px;
}
.undo-bar-content { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.undo-bar-content > svg { width: 18px; height: 18px; color: #ef4444; flex-shrink: 0; }
.undo-bar-content > span { flex: 1; font-size: 0.9rem; color: #a0a0a0; }
.undo-bar-content > span strong { color: #e3e3e3; font-weight: 600; }
.undo-btn {
    background: rgba(239,68,68,0.15); color: #ef4444;
    border: 1.5px solid rgba(239,68,68,0.35);
    padding: 7px 14px; border-radius: 10px; font-size: 0.85rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: background 0.18s; white-space: nowrap; flex-shrink: 0;
}
.undo-btn:hover { background: rgba(239,68,68,0.28); }
.undo-btn svg { width: 14px; height: 14px; }

.modal-loading-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 18px; padding: 60px 20px; min-height: 220px; width: 100%;
}
.modal-loading-state p { color: var(--text-muted); font-size: 0.9rem; letter-spacing: 0.3px; }
.modal-loader-ring {
    width: 44px; height: 44px;
    border: 3px solid var(--border-color); border-top-color: var(--primary);
    border-radius: 50%; animation: loaderSpin 0.75s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }

#helped-pill .sn-pill-val { color: #10b981; }
#helped-pill svg { color: #10b981; }
#helped-pill { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.25); }
#helped-pill:hover { border-color: rgba(16, 185, 129, 0.5) !important; }

.feat-info { position: relative; z-index: 1; }
.feat-img-wrap { position: relative; z-index: 1; }

.input-field:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.virtual-shelf-footer h3 {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}

.auth-layout { max-width: 380px; }
.auth-logo-wrap { text-align: center; margin-bottom: 20px; }
.auth-logo-wrap h2 { font-family: var(--font-head); color: var(--primary); font-size: 1.8rem; margin-top: 10px; }
.auth-logo-wrap p { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.auth-tabs { display: flex; gap: 0; background: var(--surface-lighter); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-muted); border-radius: 10px; cursor: pointer; font-weight: bold; font-size: 0.95rem; transition: 0.2s; }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.profile-layout { max-width: 380px; }
.social-proof-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--text-muted); background: var(--surface-lighter); border: 1px solid var(--border-color); padding: 3px 8px; border-radius: 20px; margin-top: 4px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.profile-icon-btn { position: relative; }
.profile-icon-btn.logged-in::after { content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; background: #10b981; border-radius: 50%; border: 2px solid var(--bg-main); }

.auth-layout { max-width: 390px; padding: 30px; }
.auth-logo-wrap { text-align: center; margin-bottom: 28px; }
.auth-logo-ring { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-light); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; position: relative; animation: authLogoPulse 3s ease-in-out infinite; }
.auth-logo-ring-inner { position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed var(--primary); opacity: 0.5; animation: spin 8s linear infinite; }
.auth-logo-icon { width: 32px; height: 32px; color: var(--primary); }
.auth-logo-title { font-family: var(--font-head); color: var(--primary); font-size: 1.9rem; margin-bottom: 4px; }
.auth-logo-sub { color: var(--text-muted); font-size: 0.82rem; }
@keyframes authLogoPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,158,181,0.3); } 50% { box-shadow: 0 0 0 12px rgba(255,158,181,0); } }

.auth-tabs { display: flex; gap: 0; background: var(--surface-lighter); border-radius: 14px; padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 11px 8px; border: none; background: transparent; color: var(--text-muted); border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: all 0.25s; display: flex; align-items: center; justify-content: center; gap: 7px; }
.auth-tab svg { width: 16px; height: 16px; }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,0.25); }

.auth-panel { display: flex; flex-direction: column; gap: 12px; }
.auth-input-group { position: relative; }
.auth-input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 20px; height: 20px; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.auth-input-icon svg { width: 20px !important; height: 20px !important; }
.auth-input { padding-left: 46px !important; padding-right: 46px !important; }
.auth-btn { margin-top: 4px; padding: 16px !important; font-size: 1rem !important; border-radius: 14px !important; display: flex; align-items: center; justify-content: center; gap: 9px; }
.auth-btn-ghost { background: transparent !important; border: 1px solid var(--border-color) !important; color: var(--text-muted) !important; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 14px !important; border-radius: 14px !important; cursor: pointer; font-size: 0.95rem; transition: 0.2s; }
.auth-btn-ghost:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.auth-forgot { text-align: center; color: var(--primary); cursor: pointer; font-size: 0.88rem; margin-top: 4px; opacity: 0.85; transition: opacity 0.2s; }
.auth-forgot:hover { opacity: 1; }
.auth-verify-icon { width: 70px; height: 70px; background: var(--primary-light); border: 2px solid var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--primary); }
.auth-verify-icon svg { width: 32px; height: 32px; }

.profile-layout { max-width: 390px; padding: 28px; }
.profile-guest-view { text-align: center; padding: 10px 0; }
.profile-guest-art { position: relative; width: 100px; height: 100px; margin: 0 auto 20px; }
.profile-guest-orb { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%); animation: authLogoPulse 3s ease-in-out infinite; }
.profile-guest-avatar { width: 100px; height: 100px; border-radius: 50%; background: var(--surface-lighter); border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-muted); position: relative; }
.profile-guest-view h3 { font-size: 1.15rem; margin-bottom: 8px; }
.profile-guest-view p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 20px; }
.profile-guest-features { display: flex; justify-content: center; gap: 20px; margin-bottom: 22px; }
.pgf-item { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.78rem; }
.pgf-item svg { width: 22px; height: 22px; color: var(--primary); }

.profile-header-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-avatar-ring { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #a855f7); padding: 3px; flex-shrink: 0; }
.profile-avatar-circle { width: 100%; height: 100%; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.profile-user-info h3 { font-size: 1.1rem; margin-bottom: 3px; }
.profile-user-info p { color: var(--text-muted); font-size: 0.82rem; }
.profile-rank-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; background: var(--primary-light); border: 1px solid var(--primary); border-radius: 20px; color: var(--primary); font-weight: 700; font-size: 0.88rem; margin-bottom: 16px; width: fit-content; }
.rank-icon { font-size: 1.1rem; }
.profile-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.profile-stat-card { background: var(--surface-lighter); border: 1px solid var(--border-color); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.profile-stat-card svg { width: 20px; height: 20px; color: var(--primary); }
.psv { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.psl { font-size: 0.75rem; color: var(--text-muted); }
.profile-admin-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #7c3aed, #4f46e5); color: white; border: none; border-radius: 14px; font-size: 0.95rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; transition: 0.2s; box-shadow: 0 4px 20px rgba(124,58,237,0.3); }
.profile-admin-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.profile-signout-btn { width: 100%; padding: 13px; background: transparent; border: 1px solid rgba(239,68,68,0.3); color: #ef4444; border-radius: 14px; font-size: 0.95rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 8px; transition: 0.2s; }
.profile-signout-btn:hover { background: rgba(239,68,68,0.08); }

.social-proof-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--text-muted); background: var(--surface-lighter); border: 1px solid var(--border-color); padding: 3px 8px; border-radius: 20px; margin-top: 4px; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.auth-google-btn {
    width: 100%;
    padding: 13px 18px;
    background: var(--surface-lighter);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 0;
}
.auth-google-btn:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.auth-email-toggle {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1.5px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 0;
}
.auth-email-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.auth-email-toggle svg { width: 16px; height: 16px; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 14px;
    padding: 11px 18px;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: 0.2s;
    margin-top: 16px;
}
.btn-ghost:hover { background: var(--surface-lighter); color: var(--text-main); }
.auth-spam-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: 10px;
    color: #fbbf24;
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: left;
}
.auth-eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.auth-eye-btn svg { width: 18px; height: 18px; }
.auth-input-group { position: relative; }

.profile-hero-wrap {
    position: relative;
    margin: -24px -24px 0 -24px;
    height: 100px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    margin-bottom: 0;
}
.profile-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 50%, #6366f1 100%);
    opacity: 0.25;
}
.profile-hero-wrap .profile-avatar-ring {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 72px;
    border: 3px solid var(--bg-main);
}
.profile-hero-wrap .profile-avatar-circle {
    font-size: 1.8rem;
}
.profile-user-info-center {
    text-align: center;
    padding-top: 40px;
    margin-bottom: 16px;
}
.profile-user-info-center h3 { font-size: 1.2rem; margin-bottom: 3px; }
.profile-email-text { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 10px; }
.profile-user-info-center .profile-rank-badge { margin: 8px auto 0; }
.profile-stats-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.profile-stat-card { background: var(--surface-lighter); border: 1px solid var(--border-color); border-radius: 14px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.psc-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.psc-icon svg { width: 16px; height: 16px; color: var(--primary); }
.profile-rank-progress-wrap { margin-bottom: 14px; }
.profile-rank-hint { font-size: 0.78rem; color: var(--text-muted); text-align: center; line-height: 1.5; padding: 10px 14px; background: var(--surface-lighter); border-radius: 10px; border: 1px solid var(--border-color); }

.auth-layout {
    max-height: 90vh;
    overflow-y: auto;
}

.edit-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.edit-profile-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}
.edit-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
    flex-shrink: 0;
}
.edit-back-btn:hover { background: var(--primary-light); color: var(--primary); }
.edit-back-btn svg { width: 18px; height: 18px; }

.edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--surface-lighter);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
.edit-avatar-preview-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    cursor: pointer;
}
.edit-avatar-preview {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    border: 3px solid var(--border-color);
    overflow: hidden;
}
.edit-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    color: white;
}
.edit-avatar-overlay svg { width: 22px; height: 22px; }
.edit-avatar-preview-wrap:hover .edit-avatar-overlay { opacity: 1; }

.edit-avatar-actions {
    display: flex;
    gap: 10px;
}
.edit-avatar-upload-btn, .edit-avatar-remove-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}
.edit-avatar-upload-btn {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary);
}
.edit-avatar-upload-btn:hover { background: var(--primary); color: white; }
.edit-avatar-remove-btn {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}
.edit-avatar-remove-btn:hover { background: rgba(239,68,68,0.1); }
.edit-avatar-upload-btn svg, .edit-avatar-remove-btn svg { width: 14px; height: 14px; }
.edit-avatar-hint { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

.edit-field-group {
    margin-bottom: 20px;
}
.edit-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.edit-field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.profile-edit-inline-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    flex-shrink: 0;
}
.profile-edit-inline-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.profile-avatar-edit-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: 0.2s;
    z-index: 2;
}
.profile-avatar-edit-btn:hover { transform: scale(1.1); }
.profile-avatar-edit-btn svg { width: 12px; height: 12px; }
.profile-hero-wrap .profile-avatar-ring { position: relative; }

.auth-signup-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin: 4px 0 12px;
    line-height: 1.5;
    padding: 8px 12px;
    background: var(--surface-lighter);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-hero-wrap {
    margin: -24px -24px 0 -24px;
    height: 110px;
    position: relative;
    border-radius: 20px 20px 0 0;
    overflow: visible;
}
.profile-hero-bg {
    position: absolute;
    inset: 0;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, #db2777 0%, #9333ea 50%, #4f46e5 100%);
    opacity: 0.35;
}
.profile-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.profile-hero-wrap .profile-avatar-ring {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #db2777, #9333ea);
    padding: 3px;
    border: 3px solid var(--bg-main);
    z-index: 2;
}
.profile-hero-wrap .profile-avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--primary);
    overflow: hidden;
}

.profile-user-info-center {
    text-align: center;
    padding-top: 46px;
    margin-bottom: 18px;
}
.profile-user-info-center h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 3px;
    color: var(--text-main);
}
.profile-email-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.profile-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: linear-gradient(135deg, rgba(219,39,119,0.15), rgba(147,51,234,0.15));
    border: 1px solid rgba(219,39,119,0.3);
    border-radius: 20px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    margin: 8px auto 0;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.profile-stat-card {
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: border-color 0.2s;
}
.profile-stat-card:hover { border-color: var(--primary); }
.psc-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.psc-icon svg { width: 17px; height: 17px; color: var(--primary); }
.psv {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}
.psl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.profile-rank-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(219,39,119,0.05), rgba(147,51,234,0.05));
    border-radius: 12px;
    border: 1px solid rgba(219,39,119,0.12);
    margin-bottom: 0;
}

.profile-action-divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}
#profile-leaderboard-btn {
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    border-radius: 14px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    cursor: pointer;
    transition: 0.2s;
    margin-bottom: 10px;
}
#profile-leaderboard-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
#profile-leaderboard-btn svg { width: 18px; height: 18px; }

.profile-signout-btn {
    width: 100%;
    padding: 13px;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.25);
    color: rgba(239,68,68,0.8);
    border-radius: 14px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: 0.2s;
}
.profile-signout-btn:hover { background: rgba(239,68,68,0.08); border-color: #ef4444; color: #ef4444; }

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 3px;
}
.profile-edit-inline-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-lighter);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    flex-shrink: 0;
}
.profile-edit-inline-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.profile-edit-inline-btn svg { width: 13px; height: 13px; }

.profile-avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: transform 0.2s;
    z-index: 3;
}
.profile-avatar-edit-btn:hover { transform: scale(1.15); }
.profile-avatar-edit-btn svg { width: 11px; height: 11px; }

.auth-layout { max-height: 92vh; overflow-y: auto; }

.leaderboard-top { background: linear-gradient(135deg, rgba(219,39,119,0.08), rgba(147,51,234,0.08)) !important; border-color: rgba(219,39,119,0.25) !important; }

.edit-avatar-picker-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    text-align: center;
}

.avatar-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.avatar-preset-btn {
    position: relative;
    border: 2.5px solid transparent;
    border-radius: 16px;
    padding: 12px 6px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    aspect-ratio: 1;
    justify-content: center;
    overflow: hidden;
}

.avatar-preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.avatar-preset-btn.selected {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(219,39,119,0.5), 0 8px 20px rgba(0,0,0,0.3);
    transform: scale(1.04);
}

.avatar-preset-letter {
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
    line-height: 1;
}

.avatar-preset-name {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.avatar-preset-check {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.85rem;
    color: white;
    font-weight: 900;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--surface-lighter);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.edit-avatar-preview-wrap {
    position: relative;
    width: 80px;
    height: 80px;
}

.edit-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg,#db2777,#9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    border: 3px solid var(--border-color);
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: background 0.3s ease;
}
