/* Elima page entry: books.css */
/*
 * Elima CSS Architecture v1.0
 * Module: 01-settings/tokens.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


:root {
    /* لایت مود - بازطراحی شده: چشم‌نواز، ملایم، دارای عمق و کاملاً حرفه‌ای */
    --bg-main: #f8fafc; 
    --bg-cards: rgba(255, 255, 255, 0.95); 
    --border-glass: rgba(15, 23, 42, 0.08); 
    --text-title: #0f172a; 
    --text-body: #334155; 
    --text-muted: #64748b;
    --primary: #4338ca; 
    --primary-light: #e0e7ff; 
    --accent: #059669; 
    --shape-1: rgba(67, 56, 202, 0.06); 

    --header-bg: rgba(255, 255, 255, 0.82); 
    --header-bg-scrolled: rgba(255, 255, 255, 0.94);
    --input-bg: #ffffff; 
    --glass-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03); 
    
    /* اسکلتون شیمر */
    --skeleton-base: rgba(226, 232, 240, 0.7);
    --skeleton-shine: rgba(255, 255, 255, 0.85);
    
    /* تایپوگرافی ریتمیک */
    --leading-relaxed: 1.85;
    --leading-tight: 1.35;
    --tracking-tight: -0.015em;
    --tracking-loose: 0.015em;
}

html.dark-theme,
body.dark-theme {
    /* دارک مود - دست‌نخورده و بهینه‌شده */
    --bg-main: #0b1120;
    --bg-cards: rgba(30, 41, 59, 0.4);
    --border-glass: rgba(255, 255, 255, 0.06);
    --text-title: #f8fafc;
    --text-body: #94a3b8;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-light: #1e1b4b;
    --accent: #34d399;
    --shape-1: rgba(99, 102, 241, 0.12);
    --header-bg: rgba(11, 17, 32, 0.65);
    --header-bg-scrolled: rgba(11, 17, 32, 0.88);
    --input-bg: rgba(15, 23, 42, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    
    /* اسکلتون شیمر دارک */
    --skeleton-base: rgba(30, 41, 59, 0.6);
    --skeleton-shine: rgba(51, 65, 85, 0.8);
}

/* ================= آیکون سبد خرید SVG و تعویض تم بدون لگ ================= */
.cart-svg-icon {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
    vertical-align: middle;
    flex-shrink: 0;
}

span.cart-svg-icon {
    background-color: currentColor;
    -webkit-mask: url('/icon/cart.svg') no-repeat center / contain;
    mask: url('/icon/cart.svg') no-repeat center / contain;
}

/* View Transitions API: Symmetric silky smooth cross-fade for both directions */
::view-transition-image-pair(root) {
    isolation: isolate;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.28s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    mix-blend-mode: normal !important;
}

::view-transition-old(root) {
    animation-name: themeFadeOut;
}

::view-transition-new(root) {
    animation-name: themeFadeIn;
}

@keyframes themeFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes themeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.theme-transitioning body,
.theme-transitioning header,
.theme-transitioning footer,
.theme-transitioning main,
.theme-transitioning .site-wrapper,
.theme-transitioning .glass-effect,
.theme-transitioning .card,
.theme-transitioning .cat-card,
.theme-transitioning .book-item,
.theme-transitioning .book-visual-card,
.theme-transitioning .book-detail-surface,
.theme-transitioning .pro-book-page,
.theme-transitioning .pro-buy-section,
.theme-transitioning .related-books-section,
.theme-transitioning .cats-container a,
.theme-transitioning .theme-switch,
.theme-transitioning .social-icon-btn,
.theme-transitioning .cart-nav-btn,
.theme-transitioning .cart-drawer,
.theme-transitioning .mobile-nav,
.theme-transitioning .auth-shell,
.theme-transitioning .profile-card,
.theme-transitioning .contact-info-card,
.theme-transitioning .contact-form-card,
.theme-transitioning .news-card,
.theme-transitioning .trust-badge-card,
.theme-transitioning input,
.theme-transitioning textarea,
.theme-transitioning select {
    transition: background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                color 0.18s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/*
 * Elima CSS Architecture v1.0
 * Module: 02-base/fonts.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


@font-face {
    font-family: 'Farhang';
    src: url('../../fonts/Farhang-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Farhang';
    src: url('../../fonts/Farhang-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: 'Farhang';
    src: url('../../fonts/Farhang-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

/*
 * Elima CSS Architecture v1.0
 * Module: 02-base/global.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */



html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
    transition: background-color 0.22s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Farhang', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    padding-top: 85px;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: var(--leading-relaxed, 1.85);
    letter-spacing: var(--tracking-tight, -0.015em);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.22s ease, color 0.22s ease;
}

p {
    line-height: var(--leading-relaxed, 1.85);
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight, 1.35);
    letter-spacing: -0.02em;
}

body.no-scroll {
    overflow: hidden;
    touch-action: none;
}

img { max-width: 100%; height: auto; display: block; }

.site-wrapper { position: relative; width: 100%; min-height: 100vh; z-index: 1; }

main, site-footer {
    animation: fadeInPage 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0.001;
}

.glass-effect {
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glass-shadow);
}

/* ==========================================================================
   Sleek Minimal Glass Scrollbar (Idea 5)
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.28);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

html.dark-theme ::-webkit-scrollbar-thumb,
body.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
}

html.dark-theme ::-webkit-scrollbar-thumb:hover,
body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Tactile Button Press Feedback (Idea 8)
   ========================================================================== */
button, 
.btn-primary, 
.btn-secondary, 
.square-action-btn, 
.btn-action, 
.filter-btn, 
.theme-switch {
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

button:active:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.square-action-btn:active:not(:disabled),
.btn-action:active:not(:disabled),
.filter-btn:active:not(:disabled),
.theme-switch:active {
    transform: scale(0.962) !important;
    transition: transform 0.08s ease !important;
}

::selection { background: var(--primary-light); color: var(--primary); }

::-moz-selection { background: var(--primary-light); color: var(--primary); }

.delay-100 { transition-delay: 70ms; }

.delay-200 { transition-delay: 140ms; }

.delay-300 { transition-delay: 210ms; }

.delay-400 { transition-delay: 280ms; }

@media (max-width: 768px) {
    .delay-100 { transition-delay: 20ms; }
    .delay-200 { transition-delay: 40ms; }
    .delay-300 { transition-delay: 60ms; }
    .delay-400 { transition-delay: 80ms; }
}

.book-details-body main,
.book-details-body site-footer {
    animation: none;
    opacity: 1;
}

.book-details-body {
    --detail-surface: rgba(255, 255, 255, 0.88);
    --detail-surface-strong: rgba(255, 255, 255, 0.94);
    --detail-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

html.dark-theme .book-details-body,
body.dark-theme.book-details-body {
    --detail-surface: rgba(15, 23, 42, 0.82);
    --detail-surface-strong: rgba(15, 23, 42, 0.92);
    --detail-shadow: 0 10px 28px rgba(2, 6, 23, 0.22);
}



/* Long text readability and typography */
p {
    line-height: 1.95;
    letter-spacing: -0.01em;
}
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
}
/*
 * Elima CSS Architecture v1.0
 * Module: 02-base/accessibility.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */



:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/*
 * Elima CSS Architecture v1.0
 * Module: 02-base/motion.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.reveal-on-scroll {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.988);
    transition:
        opacity 0.44s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-zoom {
    opacity: 0;
    transform: scale3d(0.97, 0.97, 1);
    transition:
        opacity 0.40s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.40s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}
.reveal-zoom.is-visible {
    opacity: 1;
    transform: scale3d(1, 1, 1);
}
body.fade-out { animation: fadeOutPage 0.24s ease-in forwards; }
@keyframes fadeInPage {
    0% { opacity: 0; transform: translate3d(0, 10px, 0); }
    100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeOutPage {
    0% { opacity: 1; transform: translate3d(0, 0, 0); }
    100% { opacity: 0; transform: translate3d(0, -8px, 0); }
}
@media (max-width: 768px) {
    .reveal-on-scroll { transform: translate3d(0, 14px, 0) scale(0.992); }
}
@keyframes pulseLogo {
    0% { transform: scale(0.96); opacity: 0.85; }
    100% { transform: scale(1.03); opacity: 1; }
}
@keyframes loadingBar {
    0% { left: -40%; }
    100% { left: 100%; }
}
html.theme-switching body,
html.theme-switching header,
html.theme-switching footer,
html.theme-switching nav.mobile-nav {
    transition-duration: .24s !important;
    transition-timing-function: cubic-bezier(.22,1,.36,1) !important;
}
@keyframes blinkDot { 0% { opacity: 0.5; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1.2); } }
@keyframes sweepLight { 0% { left: -100%; } 20%, 100% { left: 200%; } }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes accountCardIn{from{opacity:0;transform:translateY(18px) scale(.985)}to{opacity:1;transform:none}}
@keyframes profileCardIn{from{opacity:0;transform:translateY(14px) scale(.992)}to{opacity:1;transform:none}}
@keyframes panelIn{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}
@keyframes dialogIn{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
@keyframes auroraDrift{from{transform:translate3d(-2%,0,0) scale(.96)}to{transform:translate3d(4%,3%,0) scale(1.06)}}
@keyframes orbDrift{from{transform:translate3d(-2%,0,0) scale(.97)}to{transform:translate3d(3%,3%,0) scale(1.05)}}
@keyframes iconBreathe{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-3px) rotate(-2deg)}}
@keyframes avatarFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes securePulse{0%,100%{opacity:.65}50%{opacity:1}}
@keyframes minimalCardIn{from{opacity:0;transform:translate3d(0,14px,0) scale(.988)}to{opacity:1;transform:translate3d(0,0,0) scale(1)}}
@keyframes minimalPanelIn{from{opacity:0;transform:translate3d(0,7px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes minimalProfileIn{from{opacity:0;transform:translate3d(0,10px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes minimalFavoriteIn{from{opacity:0;transform:translate3d(0,6px,0)}to{opacity:1;transform:translate3d(0,0,0)}}
@keyframes lightIconFloat{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-2px,0)}}
@keyframes lightAvatarFloat{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-3px,0)}}
@keyframes gentleBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes simpleFade { to { opacity: 1; } }

/* ==========================================================================
   Micro-Interactions & Modern Shimmer Animations
   ========================================================================== */
@keyframes cleanHeartScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes shimmerWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fade-in-img {
    opacity: 0;
    filter: blur(6px);
    transform: scale(0.985);
    transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1), filter 0.38s cubic-bezier(0.16, 1, 0.3, 1), transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}

.fade-in-img.loaded {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/actions.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    color: #ffffff !important;
    font-size: 0.98rem;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #3730a3;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.36);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.96) !important;
}

.btn-primary:disabled {
    opacity: 0.92;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1;
    box-shadow: none;
    font-weight: 800;
}

html.dark-theme .btn-primary:disabled,
body.dark-theme .btn-primary:disabled {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-secondary { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    min-height: 48px;
    border-radius: 14px;
    background: var(--input-bg); 
    color: var(--text-title); 
    border: 1px solid var(--border-glass) !important; 
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.book-back-btn,
.back-to-gallery-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    color: var(--text-title) !important;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.book-back-btn:hover,
.back-to-gallery-btn:hover {
    background: var(--shape-1);
    border-color: var(--primary);
    color: var(--primary) !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
}

.book-back-btn .arrow,
.back-to-gallery-btn .arrow {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.btn-share {
    flex: 0 0 55px !important; background: var(--input-bg); color: var(--text-title);
    border: 1px solid var(--border-glass) !important; border-radius: 16px;
}

@media (max-width: 768px) {
    .btn-primary { flex: 1 1 100%; padding: 14px; font-size: 1rem; }
    .btn-secondary { flex: 1; padding: 12px; font-size: 0.92rem; }
    .btn-share { flex: 0 0 50px !important; }
}
.content-square-actions{display:flex;align-items:center;gap:9px;direction:rtl}
.square-action-btn{position:relative;width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;padding:0;border:1px solid rgba(79,70,229,.14);border-radius:13px;background:rgba(255,255,255,.72);color:var(--primary);cursor:pointer;box-shadow:0 4px 12px rgba(49,46,129,.04);transition:transform .18s ease,border-color .18s ease,background-color .18s ease,box-shadow .18s ease}
.square-action-btn img{width:20px;height:20px;display:block;object-fit:contain;filter:invert(35%) sepia(88%) saturate(1650%) hue-rotate(226deg) brightness(87%) contrast(95%);transition:transform .18s ease}
@media (hover: hover) and (pointer: fine) {.square-action-btn:hover{transform:translateY(-2px);border-color:rgba(79,70,229,.3);background:rgba(79,70,229,.07);box-shadow:0 8px 16px rgba(49,46,129,.08)}.square-action-btn:hover img{transform:scale(1.06)}}
.square-action-btn:focus-visible{outline:3px solid rgba(79,70,229,.22);outline-offset:2px}
.square-action-btn:disabled{opacity:.62;cursor:wait;transform:none}
.dark-theme .square-action-btn{border-color:rgba(167,139,250,.18);background:rgba(255,255,255,.045);box-shadow:none}
.dark-theme .square-action-btn img{filter:invert(82%) sepia(18%) saturate(1120%) hue-rotate(203deg) brightness(106%) contrast(96%)}

/* Clean & Elegant Favorite Button */
.square-action-btn.favorite-action-btn .favorite-heart-filled {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    filter: none !important;
}
.square-action-btn.favorite-action-btn .favorite-heart-outline {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.square-action-btn.favorite-action-btn.is-favorite .favorite-heart-outline {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}
.square-action-btn.favorite-action-btn.is-favorite .favorite-heart-filled {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}
.square-action-btn.favorite-action-btn.is-favorite {
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
.dark-theme .square-action-btn.favorite-action-btn.is-favorite {
    border-color: rgba(239, 68, 68, 0.45) !important;
    background: rgba(239, 68, 68, 0.14) !important;
}
.square-action-btn.favorite-action-btn.heart-popping {
    animation: cleanHeartScale 0.18s ease-out;
}

@media(max-width:780px){.content-square-actions{gap:7px}.square-action-btn{width:44px;height:44px;flex-basis:44px;border-radius:12px}}
@media (max-width: 768px) {
    .btn-action { padding: 8px; font-size: 0.85rem; border-radius: 10px; }
}
@media (max-width: 768px) {

    .btn-share {
        flex: 1 1 auto !important;
    }
}
@media (max-width: 768px) {

    .btn-action {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .filter-btn {
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.82rem;
    }

    .scroll-top {
        right: 14px;
        bottom: 14px;
    }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/cards.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.cat-card {
    display: block;
    padding: 30px 20px;
    color: inherit;
    text-align: center;
    text-decoration: none;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}
.cat-card h3 { color: var(--text-title); font-weight: 700; font-size: 1.05rem; transition: color var(--smooth-trans); }
.book-item {
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    will-change: transform;
}
.book-cover-img {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 auto 18px;
    display: block;
    box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-glass);
    background-color: var(--bg-main);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}
.item-title { 
    font-size: 1.15rem; 
    font-weight: 800; 
    color: var(--text-title); 
    margin-bottom: 6px; 
    line-height: 1.4;
    letter-spacing: -0.015em;
    transition: color var(--smooth-trans); 
}
.item-author { 
    font-size: 0.88rem; 
    color: var(--text-muted); 
    margin-bottom: 14px; 
    transition: color var(--smooth-trans); 
}
.item-price { 
    font-size: 1.15rem; 
    font-weight: 900; 
    color: var(--primary); 
    margin-top: auto; 
    margin-bottom: 16px; 
    transition: color var(--smooth-trans); 
}
.item-price.is-free { color: #059669; }
.compact-card { 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 100%; 
    max-width: 160px; 
    position: relative;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1); 
}
.compact-card.hide { display: none; }
.compact-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.10);
    border: 1px solid var(--border-glass);
    margin-bottom: 10px;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.compact-card h4 { 
    font-size: 0.86rem; 
    color: var(--text-title); 
    font-weight: 700; 
    text-align: center; 
    line-height: 1.45; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    transition: color var(--smooth-trans); 
    margin-bottom: 4px; 
}
.compact-price { font-size: 0.74rem; font-weight: 800; color: var(--primary); }
.compact-price.is-free { color: #059669; }

@media (hover: hover) and (pointer: fine) {
    .cat-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08); }
    .cat-card:hover h3 { color: var(--primary); }
    .cat-card:hover .cat-icon { transform: scale(1.1) rotate(4deg); }

    .book-item:hover { 
        transform: translateY(-5px); 
        border-color: rgba(79, 70, 229, 0.28); 
        box-shadow: 0 16px 36px -4px rgba(79, 70, 229, 0.14), 0 4px 12px rgba(15, 23, 42, 0.04); 
    }
    .book-item:hover .book-cover-img { 
        transform: translateY(-3px) scale(1.025); 
        box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.22), 0 4px 10px rgba(0, 0, 0, 0.06); 
        border-color: rgba(79, 70, 229, 0.25);
    }
    .book-item:hover .item-title { color: var(--primary); }
    .book-item:hover .btn-action {
        box-shadow: 0 8px 20px rgba(79, 70, 229, 0.36);
    }

    .compact-card:hover { transform: translateY(-4px); }
    .compact-card:hover img { 
        box-shadow: 0 14px 30px -4px rgba(79, 70, 229, 0.24), 0 4px 8px rgba(0, 0, 0, 0.06); 
        border-color: rgba(79, 70, 229, 0.35); 
    }
    .compact-card:hover h4 { color: var(--primary); }
}
@media (max-width: 768px) {
    .compact-card h4 { font-size: 0.8rem; }
}
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
    .btn-action:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(79, 70, 229, 0.38);
        background: linear-gradient(135deg, #5b52f0 0%, #3730a3 100%);
        color: #ffffff !important;
    }
    .btn-action:active {
        transform: translateY(0) scale(0.98);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    }
}
.book-item .btn-action {
    margin-top: auto;
}
@media (max-width: 768px) {

    .cat-card { flex: 0 0 135px; scroll-snap-align: center; padding: 15px 10px; border-radius: 14px; }
    .cat-card h3 { font-size: 0.9rem; }

    .book-item { flex: 0 0 170px; scroll-snap-align: center; padding: 12px; border-radius: 16px; }
    .book-cover-img { max-width: 130px; margin-bottom: 12px; border-radius: 6px; }
    .item-title { font-size: 0.95rem; margin-bottom: 4px; }
    .item-author { font-size: 0.8rem; margin-bottom: 10px; }
    .item-price { font-size: 0.95rem; margin-bottom: 12px; }
}
@media (max-width: 500px) {
    .compact-card h4 { font-size: 0.75rem; }
}
@media (max-width: 768px) {

    .book-item {
        flex: 0 0 178px;
        padding: 14px;
        border-radius: 18px;
    }

    .book-cover-img {
        max-width: 132px;
        margin-bottom: 10px;
    }

    .item-title {
        font-size: 0.98rem;
        line-height: 1.55;
    }

    .item-author {
        line-height: 1.7;
    }

    .compact-card {
        max-width: none;
    }

    .compact-card h4 {
        font-size: 0.82rem;
        line-height: 1.6;
    }
}
@media (max-width: 500px) {

    .book-item {
        flex: 0 0 168px;
    }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/chips.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.dev-badge { position: relative; overflow: hidden; display: flex; align-items: center; gap: 0; background: rgba(249, 115, 22, 0.1); color: #ea580c; border: 1px solid rgba(249, 115, 22, 0.2); font-size: 0.7rem; font-weight: 800; padding: 5px 12px; border-radius: 20px; flex-shrink: 0; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); }
body.dark-theme .dev-badge { color: #fdba74; background-color: rgba(249, 115, 22, 0.15); border-color: rgba(249, 115, 22, 0.3); }

/* Subtle Frosted Pill Badges (Idea 7) */
.badge-tag, .pro-badge, .book-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-title);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

html.dark-theme .badge-tag,
body.dark-theme .badge-tag,
html.dark-theme .pro-badge,
body.dark-theme .pro-badge {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.08);
}

.badge-tag.highlight {
    background: rgba(5, 150, 105, 0.12);
    color: var(--accent);
    border-color: rgba(5, 150, 105, 0.28);
}

.meta-chip {
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 7px 14px;
    background: var(--bg-cards); 
    border: 1px solid var(--border-glass); 
    border-radius: 14px;
    font-size: 0.88rem; 
    font-weight: 600; 
    color: var(--text-body);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.24s ease, color 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.meta-chip svg { color: var(--primary); width: 16px; height: 16px; transition: transform 0.24s ease; }
.meta-chip:hover { 
    background: rgba(79, 70, 229, 0.08); 
    border-color: rgba(79, 70, 229, 0.25); 
    transform: translateY(-2px); 
    color: var(--primary); 
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.10);
}
@media (max-width: 992px) {
    .dev-badge { padding: 4px 10px; font-size: 0.65rem; white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 768px) {
    .badge-tag { padding: 3px 10px; font-size: 0.8rem; }
}
@media (max-width: 768px) {

    .meta-chip {
        font-size: 0.82rem;
        padding: 7px 10px;
        border-radius: 18px;
    }
}
@media (max-width: 420px) {

    .meta-chip {
        justify-content: center;
    }
}
@media (max-width: 768px) {

    .meta-chip {
        min-height: 42px;
        padding: 8px;
        font-size: 0.78rem;
    }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/forms.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.info-subtitle, .form-subtitle { color: var(--text-body); font-size: 1rem; margin-bottom: 40px; opacity: 0.9; }

.form-row { display: flex; gap: 25px; margin-bottom: 25px; }

.form-group { flex: 1; display: flex; flex-direction: column; gap: 10px; }

.form-group.full-width { margin-top: 25px; margin-bottom: 35px; }

.form-group label { color: var(--text-title); font-size: 1rem; font-weight: 700; }

.form-group label span { color: #ef4444; }

.form-group input, .form-group select, .form-group textarea { padding: 16px 20px; border: 2px solid var(--border-glass); background: var(--input-bg); color: var(--text-title); border-radius: 16px; font-size: 1rem; outline: none; transition: transform 0.3s ease-out, background-color 0.3s ease-out, color 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out; }

.form-group select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 20px center; background-size: 18px; padding-left: 50px; }

.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: var(--bg-cards); }

@media (hover: hover) and (pointer: fine) {

    .form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: rgba(79, 70, 229, 0.4); }
}

@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 15px; margin-bottom: 15px; }
    .form-group.full-width { margin-top: 15px; margin-bottom: 25px; }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/search.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.search-box { display: flex; max-width: 540px; margin: 0 auto; background: var(--input-bg); border-radius: 50px; padding: 6px 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.03); border: 1px solid var(--border-glass); transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); position: relative; z-index: 100; }
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 15px 35px rgba(79, 70, 229, 0.15), 0 0 0 4px var(--shape-1); transform: translateY(-2px); }
.search-box input { flex: 1; border: none; background: transparent; padding: 10px 10px 10px 20px; outline: none; }
.submit-search-btn { background: var(--primary); border: none; width: 42px !important; height: 42px !important; border-radius: 50% !important; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0 !important; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); }
.search-icon { display: block; width: 20px; height: 20px; background-color: #ffffff; -webkit-mask-image: url('/icon/search.svg?v=20260717-7'); mask-image: url('/icon/search.svg?v=20260717-7'); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.search-box .voice-btn { background: transparent !important; border: none !important; width: 38px !important; height: 38px !important; border-radius: 50% !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0 8px 0 4px; flex-shrink: 0; position: relative; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); }
.mic-icon { display: block; width: 18px; height: 18px; background-color: var(--text-body); -webkit-mask-image: url('/icon/microphone.svg?v=20260717-7'); mask-image: url('/icon/microphone.svg?v=20260717-7'); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; transition: background-color var(--smooth-trans); }
body.dark-theme .mic-icon { background-color: var(--text-title); }
.search-box .voice-btn.recording { background: rgba(239, 68, 68, 0.1) !important; animation: pulseRecord 1.5s infinite; }
@keyframes pulseRecord {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.live-search-dropdown { position: relative; z-index: 200; width: 100%; max-width: 540px; margin: 10px auto 0; background: var(--bg-cards); border: 1px solid var(--border-glass); border-radius: 16px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); max-height: 300px; overflow-y: auto; overflow-x: hidden; padding: 8px; display: none; text-align: right; }
body.dark-theme .live-search-dropdown { background: rgba(30, 41, 59, 0.98); }
.live-search-dropdown.active { display: block; animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.live-result-item { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 12px; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); border-bottom: 1px solid rgba(0,0,0,0.04); }
.live-result-item:hover { background: var(--shape-1); transform: translateX(-5px); }
.live-result-img { width: 40px; height: 58px; object-fit: cover; border-radius: 6px; }
.live-result-info h4 { color: var(--text-title); font-size: 0.9rem; margin-bottom: 4px; font-weight: 800; transition: color var(--smooth-trans); }
.live-result-item:hover h4 { color: var(--primary); }
.live-result-info p { color: var(--text-body); font-size: 0.8rem; }
.search-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--bg-main); z-index: 9999; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.search-overlay.active { opacity: 1; visibility: visible; }
.search-overlay-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: var(--header-bg); border-bottom: 1px solid var(--border-glass); }
.search-overlay-header h3 { color: var(--text-title); font-size: 1.05rem; font-weight: 800; }
.search-overlay-header h3 span { color: var(--primary); }
.close-overlay-btn { background: var(--input-bg); color: var(--text-title); border: 1px solid var(--border-glass); border-radius: 50%; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); }
.close-overlay-btn:hover { background: #ef4444; color: white; transform: rotate(90deg) scale(1.1); border-color: #ef4444; }
.search-overlay-body { padding: 20px 15px; overflow-y: auto; flex: 1; }
.search-results-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.search-result-card { display: flex; gap: 12px; padding: 12px; background: var(--bg-cards); border: 1px solid var(--border-glass); border-radius: 12px; text-decoration: none; transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease; }
.search-result-card img { width: 50px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; transition: transform var(--smooth-trans); }
.search-result-info h4 { color: var(--text-title); font-size: 0.95rem; font-weight: 800; margin-bottom: 4px; transition: color var(--smooth-trans); }
.search-result-info p { color: var(--text-body); font-size: 0.8rem; }
.search-no-results-full { text-align: center; padding: 40px 20px; color: var(--text-body); font-size: 1rem; grid-column: 1 / -1; }
@media (hover: hover) and (pointer: fine) {
    .search-box button:hover { transform: scale(1.05); }
    .search-box .voice-btn:hover .mic-icon { transform: scale(1.1); }
    .search-result-card:hover { border-color: var(--primary); transform: translateX(-3px); box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05); }
    .search-result-card:hover img { transform: scale(1.05); }
    .search-result-card:hover h4 { color: var(--primary); }
}
.search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    max-width: 560px;
    min-height: 60px;
    padding: 8px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: visible;
}
body.dark-theme .search-box {
    background: linear-gradient(180deg, rgba(15,23,42,0.86), rgba(17,24,39,0.92));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.22);
}
.search-box::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 23px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.14), transparent 48%);
    opacity: 0.9;
}
.search-box:focus-within {
    border-color: rgba(79, 70, 229, 0.26);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.10), 0 0 0 4px rgba(79, 70, 229, 0.08);
    transform: translateY(-1px);
}
.search-box input {
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-title);
    text-overflow: ellipsis;
}
.search-box input::placeholder {
    color: color-mix(in srgb, var(--text-body) 88%, transparent);
    font-weight: 600;
}
.submit-search-btn,
.search-box .voice-btn {
    position: relative;
    z-index: 1;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.submit-search-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.22);
}
.submit-search-btn:active {
    transform: scale(0.98);
}
.search-box .voice-btn {
    background: rgba(79, 70, 229, 0.08) !important;
    border: 1px solid rgba(79, 70, 229, 0.14) !important;
    overflow: hidden;
}
body.dark-theme .search-box .voice-btn {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
.mic-icon {
    width: 19px;
    height: 19px;
    background-color: var(--primary);
    transition: transform .18s ease, background-color .18s ease, opacity .18s ease;
}
body.dark-theme .mic-icon {
    background-color: #c7d2fe;
}
.search-box .voice-btn.recording {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
    animation: none;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08);
}
.search-box .voice-btn.recording .mic-icon {
    background-color: #ef4444 !important;
    transform: scale(1.04);
}
.search-box .voice-btn::before {
    content: '';
    position: absolute;
    inset: auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    top: 7px;
    left: 7px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
}
.search-box .voice-btn.is-supported::before {
    opacity: 1;
    transform: scale(1);
}
.search-box .voice-btn.recording::before {
    background: #ef4444;
}
.voice-ring {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    opacity: 0;
    pointer-events: none;
}
.search-box.voice-active .voice-ring,
.search-box .voice-btn.recording .voice-ring {
    opacity: 1;
    animation: voiceRingPulse 1.2s ease-out infinite;
}
@keyframes voiceRingPulse {
    0% { transform: scale(.92); border-color: rgba(239, 68, 68, 0.36); opacity: .85; }
    100% { transform: scale(1.18); border-color: rgba(239, 68, 68, 0); opacity: 0; }
}
.voice-search-status {
    width: min(100%, 560px);
    margin: 10px auto 0;
    min-height: 24px;
    padding: 0 6px;
    color: var(--text-body);
    font-size: 0.82rem;
    line-height: 1.8;
    text-align: right;
}
.voice-search-status[data-state="listening"] { color: #ef4444; }
.voice-search-status[data-state="processing"] { color: var(--primary); }
.voice-search-status[data-state="success"] { color: #10b981; }
.voice-search-status[data-state="error"] { color: #ef4444; }
.live-search-dropdown {
    width: min(100%, 560px);
    margin-top: 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px;
}
body.dark-theme .live-search-dropdown {
    background: rgba(15,23,42,0.90);
    border-color: rgba(255,255,255,0.08);
}
.live-result-item {
    border-radius: 14px;
    padding: 10px;
    border-bottom-color: rgba(148, 163, 184, 0.08);
}
.live-result-item:last-child {
    border-bottom: 0;
}
.live-result-item:hover {
    transform: translateX(-2px);
    background: rgba(79, 70, 229, 0.06);
}
.search-overlay {
    background: rgba(248, 250, 252, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
body.dark-theme .search-overlay {
    background: rgba(2, 6, 23, 0.82);
}
.search-overlay-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
@media (hover: hover) and (pointer: fine) {
    .search-box .voice-btn:hover {
        transform: translateY(-1px);
        background: rgba(79, 70, 229, 0.12) !important;
        border-color: rgba(79, 70, 229, 0.18) !important;
    }

    body.dark-theme .search-box .voice-btn:hover {
        background: rgba(255,255,255,0.08) !important;
    }

    .search-box .voice-btn:hover .mic-icon {
        transform: scale(1.08);
    }

    .submit-search-btn:hover {
        transform: translateY(-1px) scale(1.02);
        box-shadow: 0 14px 24px rgba(79, 70, 229, 0.24);
    }
}
.search-overlay {
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 0.16s ease, visibility 0.16s ease;
}
body.dark-theme .search-overlay {
    background: rgba(2, 6, 23, 0.94);
}
.search-overlay-header {
    position: sticky;
    top: 0;
    z-index: 4;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.search-overlay-body {
    padding: 16px 14px 22px;
}
.search-results-grid {
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.search-result-card {
    min-height: 72px;
    padding: 10px 12px;
    box-shadow: none;
    align-items: center;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.search-result-card img {
    width: 44px;
    border-radius: 8px;
    transition: transform 0.16s ease;
}
.search-result-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.search-result-meta {
    margin-top: 0;
}
.live-search-dropdown {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.live-result-item {
    transition: background-color 0.14s ease, transform 0.14s ease;
}
.close-overlay-btn {
    transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}
@media (hover: hover) and (pointer: fine) {
    .search-result-card:hover {
        transform: translateX(-2px);
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
    }

    .search-result-card:hover img {
        transform: scale(1.03);
    }

    .close-overlay-btn:hover {
        transform: rotate(90deg);
    }
}
.search-result-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.search-result-topline h4 {
    margin: 0;
    min-width: 0;
}
.search-match-chips {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.search-match-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.09);
    border: 1px solid rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
}
.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    color: var(--text-body);
    font-size: 0.76rem;
    opacity: 0.92;
}
.search-result-snippet {
    margin-top: 8px;
    color: var(--text-body);
    font-size: 0.8rem;
    line-height: 1.8;
}
.live-result-item.active,
.search-result-card.active {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.18);
}
.search-result-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 2px;
}
.search-result-count {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
}
.search-empty-title {
    color: var(--text-title);
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.search-empty-hint {
    color: var(--text-body);
    font-size: 0.8rem;
    line-height: 1.8;
}
.search-suggestion-btn {
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}
.live-result-item mark,
.search-result-card mark,
.live-no-results mark,
.search-no-results-full mark {
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    border-radius: 6px;
    padding: 0 3px;
}
.search-box .voice-btn {
    overflow: visible;
}
@media (max-width: 768px) {
    .search-box {
        width: 100%;
        padding: 5px 6px;
    }

    .search-box input {
        padding: 12px 5px 12px 15px !important;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    .submit-search-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .search-box .voice-btn {
        width: 38px !important;
        height: 38px !important;
        margin: 0 6px 0 2px !important;
    }

    .search-icon { width: 18px; height: 18px; }
    .mic-icon { width: 18px; height: 18px; }
}
@media (max-width: 500px) {

    .search-box input { font-size: 0.8rem !important; padding: 10px 5px 10px 12px !important; }
}
@media (max-width: 768px) {
    .search-box {
        max-width: 100%;
        min-height: 58px;
        padding: 7px;
        gap: 6px;
        border-radius: 20px;
    }

    .search-box::after {
        border-radius: 19px;
    }

    .search-box input {
        min-height: 42px;
        padding: 0 12px !important;
        font-size: 0.9rem !important;
    }

    .submit-search-btn,
    .search-box .voice-btn {
        width: 42px !important;
        height: 42px !important;
        border-radius: 14px !important;
    }

    .search-icon,
    .mic-icon {
        width: 18px;
        height: 18px;
    }

    .voice-search-status {
        margin-top: 8px;
        padding: 0 4px;
        font-size: 0.78rem;
    }

    .live-search-dropdown {
        max-width: 100%;
        margin-top: 10px;
        border-radius: 18px;
        padding: 8px;
    }

    .live-result-item {
        gap: 10px;
        padding: 9px;
    }

    .live-result-img {
        width: 38px;
        height: 54px;
    }

    .live-result-info h4 {
        font-size: 0.84rem;
    }

    .live-result-info p,
    .live-no-results {
        font-size: 0.76rem;
    }

    .search-overlay-header {
        padding: 12px 14px;
    }

    .search-overlay-header h3 {
        font-size: 0.88rem;
        line-height: 1.7;
    }

    .search-overlay-body {
        padding: 12px 10px 18px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .search-result-card {
        padding: 9px 10px;
        gap: 10px;
        border-radius: 14px;
    }

    .search-result-card img {
        width: 40px;
        border-radius: 7px;
    }

    .search-result-meta {
        font-size: 0.74rem;
    }
}
@media (max-width: 500px) {
    .search-box {
        min-height: 56px;
    }

    .search-box input {
        font-size: 0.84rem !important;
    }

    .submit-search-btn,
    .search-box .voice-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .voice-search-status {
        font-size: 0.74rem;
    }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/feedback.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.skeleton-box { background: var(--shape-1); border-radius: 6px; pointer-events: none; }
.empty-state-container { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 15px; width: 100%; }
.empty-state-icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.8; }
.empty-state-text { color: var(--text-title); font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.empty-state-subtext { color: var(--text-body); font-size: 0.9rem; margin-bottom: 20px; }
.empty-state-btn { background: var(--shape-1); color: var(--primary); border: none; padding: 8px 20px; border-radius: 10px; font-weight: 700; font-size: 0.9rem; cursor: pointer; transition: transform var(--smooth-trans), background-color var(--smooth-trans), color var(--smooth-trans), border-color var(--smooth-trans), box-shadow var(--smooth-trans), opacity var(--smooth-trans); }
@media (hover: hover) and (pointer: fine) {
    .empty-state-btn:hover { background: var(--primary); color: white; transform: translateY(-2px); box-shadow: 0 8px 15px rgba(79, 70, 229, 0.2); }
}
.wip-toast{background:var(--bg-cards);border:1px solid var(--border-glass);box-shadow:0 10px 30px rgba(0,0,0,.12);border-radius:14px;padding:14px 20px;font-weight:700}
.network-toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,120px);opacity:0;z-index:99999;padding:12px 18px;border-radius:12px;background:var(--bg-cards);color:var(--text-title);border:1px solid var(--border-glass);transition:.3s ease}
.network-toast.show{transform:translate(-50%,0);opacity:1}
.network-toast.offline{border-color:#ef4444}
.network-toast.online{border-color:#10b981}
#wipToastContainer {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 100000;
    pointer-events: none;
    width: min(92vw, 380px);
}
.wip-toast {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255,255,255,0.74);
    color: var(--text-title);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
html.dark-theme .wip-toast,
body.dark-theme .wip-toast {
    background: rgba(15,23,42,0.74);
    border-color: rgba(255,255,255,0.10);
}
.wip-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.wip-toast-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(79,70,229,0.10);
    color: var(--primary);
    font-size: 1.1rem;
}
html.dark-theme .wip-toast-icon,
body.dark-theme .wip-toast-icon {
    background: rgba(94,159,232,0.14);
    color: #9fc7f3;
}
.wip-toast-body {
    display: grid;
    gap: 3px;
}
.wip-toast-title {
    font-size: 0.86rem;
    font-weight: 800;
}
.wip-toast-progress {
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(79,70,229,0.92), rgba(94,159,232,0.92));
    transform-origin: right;
    animation: wipToastTimer 3.15s linear forwards;
}
.network-toast {
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
html.dark-theme .network-toast,
body.dark-theme .network-toast {
    background: rgba(15,23,42,0.72);
    border-color: rgba(255,255,255,0.10);
}
.empty-state-container {
    position: relative;
    overflow: hidden;
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 34px 22px;
    border-radius: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(248,250,252,0.96));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
html.dark-theme .empty-state-container,
body.dark-theme .empty-state-container {
    background: linear-gradient(180deg, rgba(15,23,42,0.82), rgba(17,24,39,0.9));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.20);
}
.empty-state-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(79,70,229,0.12), transparent 55%);
    pointer-events: none;
}
.empty-state-container.is-error::after {
    background: radial-gradient(circle at top, rgba(239,68,68,0.12), transparent 58%);
}
.empty-state-icon,
.empty-state-text,
.empty-state-subtext,
.empty-state-actions {
    position: relative;
    z-index: 1;
}
.empty-state-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: rgba(79, 70, 229, 0.10);
    color: var(--primary);
    font-size: 1.9rem;
}
.empty-state-container.is-error .empty-state-icon {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
}
.empty-state-text {
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 10px;
}
.empty-state-subtext {
    max-width: 560px;
    line-height: 1.95;
    margin: 0 auto 18px;
}
.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.empty-state-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.18);
}
.empty-state-btn.secondary {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.12);
    box-shadow: none;
}
html.dark-theme .empty-state-btn.secondary,
body.dark-theme .empty-state-btn.secondary {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
    color: #c7d2fe;
}
.shimmer-block,
.skeleton-line {
    position: relative;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.16);
}
html.dark-theme .shimmer-block,
html.dark-theme .skeleton-line,
body.dark-theme .shimmer-block,
body.dark-theme .skeleton-line {
    background: rgba(255,255,255,0.08);
}
.shimmer-block::after,
.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.52), transparent);
    animation: shimmerMove 1.35s ease-in-out infinite;
}
html.dark-theme .shimmer-block::after,
html.dark-theme .skeleton-line::after,
body.dark-theme .shimmer-block::after,
body.dark-theme .skeleton-line::after {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
@keyframes shimmerMove {
    100% { transform: translateX(-100%); }
}
.skeleton-stack {
    display: grid;
    gap: 10px;
    width: 100%;
}
.skeleton-line {
    display: block;
    height: 12px;
    border-radius: 999px;
}
.skeleton-line.w-95 { width: 95%; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-35 { width: 35%; }
.book-skeleton-card {
    align-items: stretch;
}
.skeleton-poster {
    width: min(100%, 180px);
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    margin: 0 auto 18px;
}
.skeleton-button {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    margin-top: 8px;
}
.compact-skeleton-card {
    max-width: 160px;
    width: 100%;
}
.compact-skeleton-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    margin-bottom: 10px;
}
.compact-skeleton-text {
    align-items: center;
}
.compact-skeleton-text .skeleton-line {
    margin: 0 auto;
}
.skeleton-inline-row {
    margin-top: auto;
}
.book-details-skeleton-shell,
.news-details-skeleton-shell {
    pointer-events: none;
    user-select: none;
}
.inline-feedback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: min(100%, 520px);
    margin: 8px auto 0;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255,255,255,0.74);
    color: var(--text-title);
    box-shadow: 0 14px 28px rgba(15,23,42,0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
html.dark-theme .inline-feedback,
body.dark-theme .inline-feedback {
    background: rgba(15,23,42,0.74);
    border-color: rgba(255,255,255,0.08);
}
.inline-feedback.is-error {
    border-color: rgba(239,68,68,0.18);
}
.inline-feedback.is-muted {
    color: var(--text-body);
}
.inline-feedback-text {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.8;
}
.inline-feedback-btn {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    background: rgba(79, 70, 229, 0.10);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}
@keyframes inlineSpin {
    to { transform: rotate(360deg); }
}
.filter-empty-state {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 8px;
}
.modern-action-toast{position:fixed;left:50%;bottom:max(24px,env(safe-area-inset-bottom));z-index:10050;min-width:min(420px,calc(100vw - 28px));max-width:min(520px,calc(100vw - 28px));display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;border:1px solid rgba(16,185,129,.2);border-radius:15px;background:rgba(255,255,255,.93);color:var(--text-title);font-size:.76rem;font-weight:800;box-shadow:0 18px 50px rgba(15,23,42,.18);backdrop-filter:blur(18px);transform:translate(-50%,18px);opacity:0;transition:opacity .23s ease,transform .23s ease}
.modern-action-toast.show{opacity:1;transform:translate(-50%,0)}
.modern-action-toast.is-error{border-color:rgba(239,68,68,.24)}
.modern-action-toast.is-account{border-color:rgba(79,70,229,.25)}
.modern-action-toast a{flex:0 0 auto;padding:7px 10px;border-radius:9px;background:var(--primary);color:#fff;text-decoration:none;font-size:.68rem;font-weight:900}
.dark-theme .modern-action-toast{background:rgba(17,20,36,.94);box-shadow:0 18px 50px rgba(0,0,0,.38)}
@media(max-width:780px){.modern-action-toast{align-items:flex-start;font-size:.7rem}}
#bookActionToast.modern-action-toast{
    width:max-content;
    min-width:0;
    max-width:min(92vw,420px);
    min-height:0;
    justify-content:center;
    gap:8px;
    padding:8px 11px;
    border:1px solid rgba(255,255,255,.5);
    border-radius:12px;
    background:rgba(255,255,255,.72);
    color:var(--text-title);
    font-size:.66rem;
    font-weight:800;
    line-height:1.55;
    white-space:normal;
    box-shadow:0 10px 28px rgba(15,23,42,.13),inset 0 1px 0 rgba(255,255,255,.72);
    backdrop-filter:blur(10px) saturate(1.12);
    -webkit-backdrop-filter:blur(10px) saturate(1.12);
    transform:translate(-50%,10px) scale(.98);
    transition:opacity .2s ease,transform .24s cubic-bezier(.22,1,.36,1);
}
#bookActionToast.modern-action-toast.show{transform:translate(-50%,0) scale(1)}
#bookActionToast.modern-action-toast.is-error{border-color:rgba(239,68,68,.22);background:rgba(255,248,248,.78)}
#bookActionToast.modern-action-toast.is-account{border-color:rgba(79,70,229,.2)}
#bookActionToast.modern-action-toast a{min-height:28px;padding:4px 8px;border-radius:8px;font-size:.6rem;white-space:nowrap}
.dark-theme #bookActionToast.modern-action-toast{border-color:rgba(255,255,255,.11);background:rgba(17,20,36,.7);box-shadow:0 12px 30px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.05)}
.dark-theme #bookActionToast.modern-action-toast.is-error{border-color:rgba(239,68,68,.28);background:rgba(40,18,26,.76)}
@media(max-width:560px){#bookActionToast.modern-action-toast{bottom:max(14px,env(safe-area-inset-bottom));max-width:calc(100vw - 24px);padding:7px 9px;font-size:.62rem;border-radius:11px}}
@media (max-width: 768px) {

    .empty-state-container {
        padding: 26px 16px;
        border-radius: 22px;
    }

    .empty-state-icon {
        width: 58px;
        height: 58px;
        font-size: 1.6rem;
        border-radius: 18px;
    }

    .empty-state-text {
        font-size: 1.05rem;
        line-height: 1.8;
    }

    .empty-state-subtext,
    .inline-feedback-text {
        font-size: 0.82rem;
    }
}
@media (max-width: 500px) {

    .empty-state-actions {
        width: 100%;
        flex-direction: column;
    }

    .empty-state-btn,
    .inline-feedback-btn {
        width: 100%;
    }

    .inline-feedback {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Centered empty and error states across desktop containers */
.empty-state-container {
    grid-column: 1 / -1;
    justify-self: center;
    align-self: center;
    flex: 0 1 720px;
    max-width: min(720px, calc(100vw - 40px));
    margin-inline: auto !important;
    direction: rtl;
}
.books-wrapper > .empty-state-container,
.news-wrapper > .empty-state-container,
#bookDetailsContainer > .empty-state-container,
#newsDetailsContainer > .empty-state-container,
.gallery-grid > .empty-state-container {
    width: min(100%, 720px);
}
.books-wrapper:has(> .empty-state-container:only-child),
.news-wrapper:has(> .empty-state-container:only-child),
.gallery-grid:has(> .empty-state-container:only-child) {
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
}
@media (max-width: 768px) {
    .empty-state-container { flex-basis: calc(100% - 28px); max-width: calc(100vw - 28px); padding: 27px 18px; border-radius: 21px; }
}

/* ==========================================================================
   Elima Unified Glassmorphic Dialog & Modal System
   ========================================================================== */
.elima-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.elima-dialog-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.elima-dialog-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    direction: rtl;
    transform: scale(0.94) translateY(12px);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
.elima-dialog-overlay.is-open .elima-dialog-card {
    transform: scale(1) translateY(0);
}
.elima-dialog-badge {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}
.elima-dialog-badge.is-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}
.elima-dialog-body {
    margin-bottom: 24px;
    width: 100%;
}
.elima-dialog-title {
    font-size: 1.18rem;
    font-weight: 900;
    color: var(--text-title);
    margin-bottom: 8px;
    line-height: 1.5;
}
.elima-dialog-desc {
    font-size: 0.88rem;
    color: var(--text-body);
    line-height: 1.9;
    opacity: 0.9;
}
.elima-dialog-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}
.elima-dialog-actions.single-action {
    justify-content: center;
}
.elima-dialog-confirm,
.elima-dialog-cancel {
    flex: 1;
    min-height: 46px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.elima-dialog-confirm.is-danger {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}
.elima-dialog-confirm.is-danger:hover {
    background: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.4);
}
.elima-dialog-cancel {
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-title);
}
.elima-dialog-cancel:hover {
    background: rgba(148, 163, 184, 0.12);
    transform: translateY(-2px);
}

/* ==========================================================================
   Elima Unified Glassmorphic Toast System
   ========================================================================== */
.elima-toast-container {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10060;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(440px, calc(100vw - 28px));
    pointer-events: none;
}
.elima-toast {
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: var(--bg-cards);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    direction: rtl;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.elima-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.elima-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
}
.elima-toast-icon-wrap {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 900;
}
.elima-toast.is-success .elima-toast-icon-wrap {
    background: rgba(5, 150, 105, 0.14);
    color: #059669;
}
.elima-toast.is-error .elima-toast-icon-wrap {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}
.elima-toast.is-cart .elima-toast-icon-wrap {
    background: rgba(79, 70, 229, 0.14);
    color: var(--primary);
}
.elima-toast-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.elima-toast-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-title);
}
.elima-toast-msg {
    font-size: 0.78rem;
    color: var(--text-body);
    line-height: 1.6;
}
.elima-toast-action-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.16s ease;
}
.elima-toast-action-btn:hover {
    transform: translateY(-1px);
}
.elima-toast-close {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-body);
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.16s ease, background-color 0.16s ease;
}
.elima-toast-close:hover {
    opacity: 1;
    background: rgba(148, 163, 184, 0.15);
}
.elima-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    transform-origin: right;
    animation: elimaToastTimer linear forwards;
}
.elima-toast.is-success .elima-toast-progress {
    background: linear-gradient(90deg, #059669, #10b981);
}
.elima-toast.is-error .elima-toast-progress {
    background: linear-gradient(90deg, #ef4444, #f87171);
}
@keyframes elimaToastTimer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ==========================================================================
   Modern Angled Shimmer Skeleton Loaders (Idea 10)
   ========================================================================== */
.shimmer-block,
.skeleton-line,
.skeleton-poster,
.compact-skeleton-poster,
.news-skeleton-media {
    position: relative;
    overflow: hidden;
    background: var(--skeleton-base, rgba(226, 232, 240, 0.7));
    border-radius: 8px;
}

.shimmer-block::after,
.skeleton-line::after,
.skeleton-poster::after,
.compact-skeleton-poster::after,
.news-skeleton-media::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(110deg, transparent 20%, var(--skeleton-shine, rgba(255, 255, 255, 0.8)) 50%, transparent 80%);
    animation: shimmerWave 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.skeleton-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
}

.skeleton-line.w-95 { width: 95%; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-45 { width: 45%; }
.skeleton-line.w-35 { width: 35%; }

.book-skeleton-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
    border-radius: 24px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    box-shadow: var(--glass-shadow);
}

.skeleton-poster {
    width: 100%;
    max-width: 170px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
}

.compact-skeleton-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 160px;
    gap: 8px;
}

.compact-skeleton-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
}

.compact-skeleton-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.skeleton-inline-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}



/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/preloader.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.preloader-wrapper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at top, rgba(99,102,241,0.12), transparent 24%), var(--bg-main);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.24s;
}

.preloader-wrapper.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.preloader-logo {
    width: 95px;
    height: auto;
    animation: pulseLogo 1.15s infinite ease-in-out alternate;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.05));
}

.preloader-bar {
    width: 140px;
    height: 4px;
    background-color: var(--border-glass);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.preloader-bar::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    width: 40%;
    background-color: var(--primary);
    border-radius: 10px;
    animation: loadingBar 0.95s infinite ease-in-out alternate;
}

.book-details-body .preloader-wrapper {
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/misc.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


:root {
    --smooth-trans: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.live-no-results { padding: 15px; text-align: center; color: var(--text-body); font-size: 0.9rem; font-weight: 600; }
.cat-icon { font-size: 2.8rem; margin-bottom: 12px; display: block; transition: transform var(--smooth-trans); }
.author-pic {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 4px solid var(--bg-main);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    transition: transform var(--smooth-trans), border-color var(--smooth-trans);
}
.back-link-wrapper { width: 100%; margin-bottom: 10px; }
.compact-desc-title {
    font-size: 1.2rem; font-weight: 800; color: var(--text-title);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.compact-desc-title::before { content: ''; display: block; width: 4px; height: 18px; background: var(--primary); border-radius: 4px; }
@media (max-width: 768px) { /* پدینگ بیشتر در پایین برای دکمه‌های ثابت احتمالی */

    /* عکس کتاب در موبایل بزرگتر و زیباتر */

    /* اسکرول افقی تصاویر بندانگشتی بدون نوار اسکرول */

    /* متن‌ها در موبایل (چیدمان وسط‌چین برای زیبایی) */

    /* توضیحات به صورت یکپارچه */
    .compact-desc-title { font-size: 1.1rem; }

    /* ویجت خرید مینیمال در موبایل */ /* دکمه اصلی تمام‌عرض و بزرگ */
}
.section-header-compact .section-title { font-size: 1.2rem; font-weight: 800; color: var(--text-title); padding-right: 10px; border-right: 3px solid var(--primary); margin-bottom: 15px; }
.fade-in-img { opacity: 0; transition: opacity 0.4s ease; }
.fade-in-img.loaded { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
    /* جستجو */

    /* کارت‌ها با Lift نرم */

    /* نتایج سرچ */

    /* دکمه‌ها */

    /* جزئیات کتاب */

    /* اخبار */
}
@media (max-width: 768px) {
    .compact-desc-title { font-size: 1rem; margin-bottom: 10px; border-bottom: none; color: var(--primary); }

    /* بخش کتاب‌های مرتبط در موبایل */
    .section-header-compact .section-title { font-size: 1.1rem; margin-bottom: 10px; border-right: 2px solid var(--primary); padding-right: 8px; }
}
.back-link-wrapper {
    margin-bottom: 0;
}
.book-heading-block {
    margin-bottom: 20px;
}
.wip-text {
    font-size: 0.83rem;
    line-height: 1.75;
    color: var(--text-body);
    font-weight: 700;
}
.live-no-results {
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
}
body.dark-theme .live-no-results {
    background: rgba(255,255,255,0.04);
}
.books-load-status {
    width: 100%;
}
.inline-loader {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(79, 70, 229, 0.16);
    border-top-color: var(--primary);
    animation: inlineSpin .8s linear infinite;
}
@media(min-width:900px){.book-heading-block{animation:bookContentReveal .65s .14s cubic-bezier(.2,1,.3,1) both}}

/*
 * Elima CSS Architecture v1.0
 * Module: 03-components/responsive-compat.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */

@media (max-width: 768px) {

    .section-header { margin: 40px auto 15px; padding: 0 15px; }
    .section-header h2 { font-size: 1.35rem; }
    .cat-icon { font-size: 2.2rem; margin-bottom: 8px; }
    .author-pic { width: 75px; height: 75px; margin-bottom: 10px; border-width: 2px; }

    /* ================= رفع باگ‌های باکس جستجو در موبایل ================= */
    /* ======================================================================== */

    .core-values { grid-template-columns: 1fr; gap: 15px; }
    .value-card { padding: 25px 20px; border-radius: 18px; }
    .value-icon { font-size: 2.5rem; margin-bottom: 10px; }
    .value-card h3 { font-size: 1.1rem; }
    .section-title { font-size: 1.15rem; margin-bottom: 15px; }
    .spec-row { padding: 8px; flex-direction: column; gap: 4px; text-align: center; font-size: 0.85rem; }

    /* ================= استایل‌های اصلاح‌شده صفحه ارتباط با ما ================= */
    /* ======================================================================== */

    footer { padding: 46px 15px 24px; }
}

@media (max-width: 480px) {
    .spec-row { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 380px) {
    .spec-row { flex-direction: row; text-align: right; justify-content: space-between; }
}

@media (max-width: 768px) {

    .compact-desc-title,
    .section-title {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {

    .book-back-btn {
        padding: 9px 12px;
        min-height: 42px;
        font-size: 0.8rem;
        border-radius: 12px;
    }

    .section-kicker {
        font-size: 0.68rem;
    }
}

@media (max-width: 768px) {

    .section-header {
        margin: 34px auto 16px;
        padding: 0 14px;
        padding-right: 12px;
        border-right-width: 4px;
    }

    .section-header h2 {
        font-size: 1.2rem;
        line-height: 1.5;
    }

    .filter-container {
        gap: 8px;
        padding: 0 4px;
    }
}

/* Cross-device layout hardening v2 */
main, section, .site-wrapper { min-width: 0; }
main { width: 100%; overflow: clip; }
@media (min-width: 769px) and (max-width: 1100px) {
    .section-header { margin-top: 52px; }
    .books-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
    .news-wrapper { padding-inline: 18px; }
}
@media (max-width: 768px) {
    .section-header { width: calc(100% - 28px); }
    button, a, input, select, textarea { max-width: 100%; }
    .books-wrapper, .authors-wrapper { max-width: 100%; }
}
@media (max-width: 380px) {
    .section-header { width: calc(100% - 20px); padding-inline: 10px; }
    .section-header h2 { font-size: 1.08rem; }
}

/* Interaction and layout stabilization v3 */
:where(a, button, input, textarea, select) { -webkit-tap-highlight-color: transparent; }
:where(.btn-primary,.btn-secondary,.btn-share,.btn-action,.empty-state-btn,.submit-search-btn,.square-action-btn,.social-icon-btn,.newsletter-box button) {
    -webkit-tap-highlight-color: transparent;
}
@media (hover: none), (pointer: coarse) {
    :where(a,button,[role="button"]):hover { filter: none !important; }
}
.page-container, .container, .about-shell, .contact-container, .news-article-shell, .book-details-container {
    min-width: 0;
}
:where(h1,h2,h3,p,a,button) { overflow-wrap: break-word; }
@media (max-width: 768px) {
    main { overflow-x: clip; }
    .news-page, .news-details-page { width: 100%; max-width: 100%; }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 04-layout/site-shell.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.scroll-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 45px; height: 45px;
    background: var(--primary); color: white;
    border: none; border-radius: 50%;
    display: none !important; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
}
.scroll-top.visible { display: flex !important; opacity: 1; visibility: visible; pointer-events: auto; }
.scroll-top.visible:hover { transform: translateY(-4px) scale(1.08); box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4); background: #4338ca; }
.scroll-top.visible:active { transform: translateY(-1px) scale(0.98); }
img.is-broken-icon{opacity:0!important;visibility:hidden!important}
.profile-feature-icon,.profile-favorite-actions img,.profile-empty-icon img{backface-visibility:hidden}

/*
 * Elima CSS Architecture v1.0
 * Module: 04-layout/header.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    transition: background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                backdrop-filter 0.3s ease, 
                -webkit-backdrop-filter 0.3s ease,
                border-color 0.3s ease, 
                box-shadow 0.3s ease;
}
header.header-scrolled {
    background: var(--header-bg-scrolled);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}
html.dark-theme header.header-scrolled,
body.dark-theme header.header-scrolled {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.header-container { max-width: 1300px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.logo-area { order: 1; flex: 1; display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.logo-area img { object-fit: contain; }
.dev-badge {
    position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px;
    background: rgba(249, 115, 22, 0.1); color: #ea580c; border: 1px solid rgba(249, 115, 22, 0.2);
    font-size: 0.7rem; font-weight: 800; padding: 5px 12px; border-radius: 20px;
    backdrop-filter: blur(4px); transition: color 0.4s, background-color 0.4s, border-color 0.4s; white-space: nowrap; flex-shrink: 0;
}
body.dark-theme .dev-badge { color: #fdba74; background-color: rgba(249, 115, 22, 0.15); border-color: rgba(249, 115, 22, 0.3); }
.dev-badge::before { display: none !important; content: none !important; }
.dev-badge::after { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: sweepLight 3s infinite linear; }
nav.desktop-nav { order: 2; flex: 2; display: flex; justify-content: center; }
nav.desktop-nav .nav-links { display: flex; list-style: none !important; margin: 0; padding: 0; gap: 6px; align-items: center; }
nav.desktop-nav .nav-links li { list-style: none !important; list-style-type: none !important; margin: 0; padding: 0; }
nav.desktop-nav .nav-links .nav-item-link {
    font-weight: 600; color: var(--text-body); position: relative; padding: 8px 14px;
    font-size: 0.95rem; text-decoration: none; border-radius: 12px; display: inline-block; white-space: nowrap;
    background-color: transparent;
    transition: color 0.22s ease, transform 0.22s ease, background-color 0.22s ease;
}
nav.desktop-nav .nav-links .nav-item-link:hover {
    color: var(--primary);
    background-color: var(--shape-1);
    transform: translateY(-2px);
}
.nav-links .nav-item-link.active-page {
    color: var(--primary) !important;
    background-color: var(--shape-1);
    font-weight: 800;
}
.header-controls { order: 3; flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 15px; }
.burger-wrapper { display: none; }
.theme-switch { background: var(--primary-light); border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.22s ease, background-color 0.22s ease; will-change: transform; }
@media (hover: hover) and (pointer: fine) { .theme-switch:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,.12); } }
.theme-switch img { width: 24px; height: 24px; object-fit: contain; transition: transform 0.22s ease; }
nav.mobile-nav, .mobile-nav-backdrop { display: none; }
.logo-area {
    overflow: visible;
}
.dev-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    overflow: visible;
}
.logo-area .dev-badge {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(249, 115, 22, 0.22);
    background: rgba(249, 115, 22, 0.10);
    color: #ea580c;
    cursor: default;
    isolation: isolate;
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease, color .22s ease;
}
html.dark-theme .logo-area .dev-badge,
body.dark-theme .logo-area .dev-badge {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.16);
    border-color: rgba(249, 115, 22, 0.28);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}
.logo-area .dev-badge:hover,
.dev-badge-wrap:hover .dev-badge {
    transform: translateY(-1px) scale(1.015);
    border-color: rgba(249, 115, 22, 0.32);
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.16);
}
.dev-badge-text {
    position: relative;
    z-index: 1;
}
.dev-badge-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(260px, 72vw);
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(249, 115, 22, 0.18);
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), rgba(255, 237, 213, 0.98));
    color: #9a3412;
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(0.96);
    transform-origin: top right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 40;
}
.dev-badge-tooltip::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 24px;
    width: 14px;
    height: 14px;
    border-top: 1px solid rgba(249, 115, 22, 0.18);
    border-left: 1px solid rgba(249, 115, 22, 0.18);
    background: rgba(255, 243, 225, 0.98);
    transform: rotate(45deg);
}
.dev-badge-tooltip strong {
    font-size: 0.78rem;
    line-height: 1.7;
    color: inherit;
}
.dev-badge-tooltip span {
    font-size: 0.72rem;
    line-height: 1.85;
    color: rgba(154, 52, 18, 0.86);
}
html.dark-theme .dev-badge-tooltip,
body.dark-theme .dev-badge-tooltip {
    background: linear-gradient(180deg, rgba(67, 20, 7, 0.96), rgba(88, 28, 12, 0.94));
    border-color: rgba(251, 146, 60, 0.20);
    color: #fed7aa;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.28);
}
html.dark-theme .dev-badge-tooltip::before,
body.dark-theme .dev-badge-tooltip::before {
    background: rgba(74, 24, 10, 0.96);
    border-color: rgba(251, 146, 60, 0.20);
}
html.dark-theme .dev-badge-tooltip span,
body.dark-theme .dev-badge-tooltip span {
    color: rgba(255, 237, 213, 0.86);
}
.dev-badge-wrap:hover .dev-badge-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
@media (max-width: 992px) {
    .dev-badge-wrap {
        display: inline-flex;
        align-items: center;
    }

    .dev-badge-tooltip {
        display: none !important;
    }

    .logo-area .dev-badge {
        padding: 4px 10px;
        font-size: 0.64rem;
        border-radius: 16px;
        box-shadow: none;
    }
}
@media (max-width: 640px) {
    .logo-area {
        gap: 8px;
    }

    .logo-area .dev-badge {
        padding: 3px 9px;
        font-size: 0.6rem;
    }
}
.logo-area .dev-badge{font-family:inherit}
@media (hover:hover) and (pointer:fine){.dev-badge-wrap:hover .dev-badge-tooltip{opacity:1;visibility:visible;transform:translateY(0) scale(1)}}
@media (hover:none),(pointer:coarse){
  .logo-area .dev-badge{cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
  .dev-badge-tooltip{display:grid!important;position:fixed;top:78px;right:14px;left:14px;width:auto;max-width:360px;margin:0 auto;transform:translateY(-8px) scale(.97);transform-origin:top center;z-index:3000;pointer-events:none}
  .dev-badge-tooltip::before{right:50%;margin-right:-7px}
  .dev-badge-wrap:not(.is-open) .dev-badge-tooltip{opacity:0!important;visibility:hidden!important;transform:translateY(-8px) scale(.97)!important}
  .dev-badge-wrap.is-open .dev-badge-tooltip{opacity:1!important;visibility:visible!important;transform:translateY(0) scale(1)!important;pointer-events:auto}
  .dev-badge-wrap.is-open .dev-badge{transform:translateY(-1px) scale(1.015);border-color:rgba(249,115,22,.34);box-shadow:0 12px 24px rgba(249,115,22,.14)}
}
@media(max-width:640px){.dev-badge-tooltip{top:74px;right:12px;left:12px;padding:12px 14px;border-radius:17px}.dev-badge-tooltip strong{font-size:.76rem}.dev-badge-tooltip span{font-size:.7rem;line-height:1.8}}
.nav-item-disabled { cursor: default; opacity: .72; }

/* ================= Mobile header & navigation — canonical v2.0 ================= */
@media (max-width: 992px) {
    body { padding-top: 64px; overflow-x: clip; }
    site-header { display: block; }
    header {
        min-height: 64px;
        z-index: 2600;
        background: color-mix(in srgb, var(--header-bg) 96%, transparent);
        border-bottom-color: color-mix(in srgb, var(--border-glass) 82%, transparent);
        box-shadow: 0 1px 0 rgba(15,23,42,.02);
    }
    header.header-scrolled { box-shadow: 0 8px 28px rgba(15,23,42,.08); }
    .header-container {
        width: 100%;
        max-width: 100%;
        min-height: 64px;
        padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        direction: ltr;
    }
    .burger-wrapper {
        flex: 0 0 42px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        order: 1;
    }
    .logo-area {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        order: 2;
    }
    .logo-area > a { min-width: 0; display: inline-flex; align-items: center; justify-content: center; }
    .logo-area img { width: auto; max-width: 110px; height: 38px; object-fit: contain; }
    .logo-area .dev-badge-wrap { display: none; }
    .header-controls {
        flex: 0 0 auto;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        order: 3;
    }
    nav.desktop-nav { display: none; }
    .cart-nav-btn-wrapper {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .cart-nav-btn, .theme-switch, .burger-menu {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        display: grid !important;
        place-items: center !important;
        padding: 0 !important;
        border: 1px solid color-mix(in srgb, var(--border-glass) 90%, transparent) !important;
        border-radius: 13px !important;
        background: color-mix(in srgb, var(--bg-cards) 94%, transparent) !important;
        box-shadow: 0 4px 14px rgba(15,23,42,.045) !important;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        cursor: pointer;
        flex-shrink: 0;
    }
    .cart-nav-btn {
        font-size: 1.15rem !important;
        color: var(--primary) !important;
    }
    .theme-switch { position: relative; overflow: hidden; }
    .theme-switch img { width: 20px; height: 20px; }
    .theme-switch:active, .burger-menu:active, .cart-nav-btn:active { transform: scale(.95); }
    .burger-menu {
        position: relative;
        cursor: pointer;
        transition: transform .18s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
    }
    .burger-menu span {
        position: absolute;
        left: 11px;
        width: 20px;
        height: 2px;
        border-radius: 99px;
        background: var(--text-title);
        transform-origin: center;
        transition: top .22s cubic-bezier(.2,.8,.2,1), transform .22s cubic-bezier(.2,.8,.2,1), opacity .14s ease, width .22s ease;
    }
    .burger-menu span:nth-child(1) { top: 14px; }
    .burger-menu span:nth-child(2) { top: 21px; width: 14px; }
    .burger-menu span:nth-child(3) { top: 28px; }
    .burger-menu.open { background: var(--primary-light); border-color: color-mix(in srgb, var(--primary) 20%, transparent); box-shadow: none; }
    .burger-menu.open span:nth-child(1) { top: 21px; transform: rotate(45deg); }
    .burger-menu.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .burger-menu.open span:nth-child(3) { top: 21px; transform: rotate(-45deg); }
    .mobile-nav-backdrop {
        position: fixed;
        inset: 64px 0 0;
        z-index: 2400;
        border: 0;
        background: rgba(15,23,42,.16);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .2s ease, visibility .2s ease;
    }
    .mobile-nav-backdrop.active { opacity: 1; visibility: visible; pointer-events: auto; }
    nav.mobile-nav {
        position: fixed;
        top: calc(70px + env(safe-area-inset-top));
        left: max(10px, env(safe-area-inset-left));
        z-index: 2500;
        width: min(300px, calc(100vw - 20px));
        height: auto;
        max-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
        display: block;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border: 1px solid color-mix(in srgb, var(--border-glass) 92%, transparent);
        border-radius: 16px;
        background: color-mix(in srgb, var(--bg-main) 96%, transparent);
        box-shadow: 0 22px 54px rgba(15,23,42,.18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(0,-8px,0) scale(.985);
        transform-origin: top left;
        transition: opacity .2s ease, visibility .2s ease, transform .24s cubic-bezier(.16,1,.3,1), background-color .35s ease;
    }
    nav.mobile-nav.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
    nav.mobile-nav::before, .close-menu-btn { display: none; }
    nav.mobile-nav .nav-links {
        width: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
        list-style: none;
        text-align: right;
    }
    nav.mobile-nav .nav-links li { width: 100%; }
    nav.mobile-nav .nav-links .nav-item-link {
        position: relative;
        width: 100%;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 9px 12px 9px 34px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--text-title);
        box-shadow: none;
        font-size: .82rem;
        font-weight: 700;
        line-height: 1.65;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: color .18s ease, background-color .18s ease, transform .16s ease;
    }
    nav.mobile-nav .nav-links .nav-item-link::after {
        content: '←';
        position: absolute;
        left: 12px;
        color: var(--text-body);
        font-size: .78rem;
        opacity: .48;
        transition: transform .18s ease, color .18s ease, opacity .18s ease;
    }
    nav.mobile-nav .nav-links .nav-item-link::before { display: none; }
    nav.mobile-nav .nav-links .nav-item-link:active { transform: scale(.985); background: var(--shape-1); }
    nav.mobile-nav .nav-links .nav-item-link.active-page {
        color: var(--primary) !important;
        background: var(--primary-light);
        font-weight: 850;
    }
    nav.mobile-nav .nav-links .nav-item-link.active-page::after { color: var(--primary); opacity: .9; }
    body.no-scroll { overflow: hidden; }
}
@media (hover: hover) and (max-width: 992px) {
    nav.mobile-nav .nav-links .nav-item-link:hover { color: var(--primary); background: var(--shape-1); }
    nav.mobile-nav .nav-links .nav-item-link:hover::after { color: var(--primary); opacity: .9; transform: translateX(-2px); }
}
@media (max-width: 480px) {
    body { padding-top: 62px; }
    header, .header-container { min-height: 62px; }
    .header-container { grid-template-columns: 44px minmax(0,1fr) 44px; padding-inline: 10px; gap: 6px; }
    .theme-switch, .burger-menu { width: 42px; height: 42px; min-width: 42px; min-height: 42px; border-radius: 12px; }
    .logo-area img { width: clamp(94px, 30vw, 108px); }
    .mobile-nav-backdrop { inset-block-start: 62px; }
    nav.mobile-nav { top: calc(68px + env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); width: min(288px, calc(100vw - 16px)); padding: 7px; border-radius: 15px; }
    nav.mobile-nav .nav-links .nav-item-link { min-height: 43px; font-size: .8rem; }
}
@media (max-width: 340px) {
    .logo-area img { width: 90px; }
    nav.mobile-nav { width: calc(100vw - 16px); }
}


/* Lightweight theme icon crossfade v4 - Silky smooth spring physics */
.theme-switch {
    isolation: isolate;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.theme-switch:active {
    transform: scale(0.88) !important;
}
.theme-icon-stack {
    position: relative;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    overflow: visible;
    color: transparent;
    font-size: 0;
    line-height: 0;
    transform: translateZ(0);
    pointer-events: none;
}
.theme-icon-stack .theme-icon {
    position: absolute;
    inset: 0;
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: opacity, transform;
    transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-icon-light {
    opacity: 0;
    transform: rotate(-55deg) scale(0.65);
}
.theme-icon-dark {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 1px 4px rgba(79, 70, 229, 0.2));
}
html.dark-theme .theme-icon-light,
body.dark-theme .theme-icon-light {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}
html.dark-theme .theme-icon-dark,
body.dark-theme .theme-icon-dark {
    opacity: 0;
    transform: rotate(55deg) scale(0.65);
}
.theme-switch[data-switching="1"] {
    pointer-events: none;
}

/* Header Cart Button & Drawer */
.cart-nav-btn-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-toast-pill {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.92);
    background: #059669;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 99px;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3100;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cart-toast-pill.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.cart-nav-btn {
    position: relative;
    background: var(--primary-light);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s ease, background-color 0.22s ease;
    font-size: 1.2rem;
    color: var(--primary);
}
.cart-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}
.cart-count-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-main);
}

.cart-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.cart-drawer-backdrop.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.cart-drawer {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(400px, 100vw);
    max-width: 100vw;
    z-index: 2600;
    background: var(--bg-main);
    border-right: 1px solid var(--border-glass);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.is-open {
    display: flex;
    transform: translateX(0);
}

@media (max-width: 992px) {
    .cart-nav-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        border-radius: 13px;
        font-size: 1.15rem;
    }
    .cart-drawer-backdrop {
        inset: 64px 0 0;
        background: rgba(15, 23, 42, 0.28);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
    .cart-drawer {
        position: fixed;
        top: calc(68px + env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        left: auto;
        bottom: auto;
        width: min(350px, calc(100vw - 24px));
        height: auto;
        max-height: calc(100dvh - 84px - env(safe-area-inset-bottom));
        border-radius: 20px;
        border: 1px solid var(--border-glass);
        background: var(--bg-cards);
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: translate3d(0, -12px, 0) scale(0.96);
        transform-origin: top right;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.26s ease;
    }
    .cart-drawer.is-open {
        display: flex !important;
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .cart-drawer-header {
        padding: 14px 16px;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    .cart-drawer-footer {
        padding: 14px 16px;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
    }
    .cart-drawer-close {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 1.1rem !important;
        border-radius: 12px !important;
    }
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-cards);
}
.cart-drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-drawer-title-wrap h2 {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--text-title);
    margin: 0;
}
.cart-drawer-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    background: var(--input-bg);
    color: var(--text-body);
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.cart-drawer-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.cart-drawer-close:active {
    transform: scale(0.9);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-body);
    padding: 30px 10px;
}
.cart-empty-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}
.cart-empty-state strong {
    font-size: 1rem;
    color: var(--text-title);
    display: block;
    margin-bottom: 6px;
}

.cart-item-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    align-items: center;
}
.cart-item-thumb {
    width: 50px;
    height: 75px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.cart-item-info {
    flex: 1;
    min-width: 0;
}
.cart-item-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-title);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item-author {
    font-size: 0.72rem;
    color: var(--text-body);
    margin: 2px 0 4px;
}
.cart-item-price {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--primary);
}
.cart-item-price.is-free {
    color: #059669;
}
.cart-clear-all-btn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 9px;
    font-size: 0.76rem;
    font-weight: 800;
    transition: background-color 0.16s ease, transform 0.16s ease;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.cart-clear-all-btn:hover {
    background: #ef4444;
    color: #ffffff;
}
.cart-clear-all-btn:active {
    transform: scale(0.94);
}

.cart-item-remove {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: grid;
    place-items: center;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.14);
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: background-color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.cart-item-remove:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}
.cart-item-remove:active {
    transform: scale(0.9);
}

.cart-drawer-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-cards);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: var(--text-body);
}
.cart-summary-row strong {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--primary);
}
html.dark-theme .cart-summary-row,
body.dark-theme .cart-summary-row {
    color: #cbd5e1;
}
html.dark-theme .cart-summary-row strong,
body.dark-theme .cart-summary-row strong {
    color: #818cf8;
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.cart-checkout-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.42);
    color: #ffffff !important;
}
.cart-checkout-btn:disabled {
    background: #e2e8f0 !important;
    color: #64748b !important;
    border: 1px solid #cbd5e1 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    opacity: 0.85;
}
html.dark-theme .cart-checkout-btn,
body.dark-theme .cart-checkout-btn {
    color: #ffffff !important;
}
html.dark-theme .cart-checkout-btn:disabled,
body.dark-theme .cart-checkout-btn:disabled {
    background: rgba(30, 41, 59, 0.75) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
}

/*
 * Elima CSS Architecture v1.0
 * Module: 04-layout/footer.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


footer {
    position: relative;
    background: var(--header-bg);
    padding: 86px 20px 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.24s ease;
    overflow: hidden;
}
footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.4), transparent);
}
footer::after {
    content: '';
    position: absolute;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 200px;
    background: radial-gradient(ellipse at top, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}
.footer-grid {
    max-width: 1250px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 50px;
}
.footer-grid h3 {
    color: var(--text-title);
    margin-bottom: 25px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.footer-grid p {
    color: var(--text-body);
    line-height: 1.8;
    font-size: 0.95rem;
    opacity: 0.9;
}
.social-icons.compact {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}
.social-icon-btn {
    width: 42px; height: 42px;
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 12px; /* طراحی مدرن‌تر به جای دایره کامل */
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.social-icon-btn img {
    width: 20px; height: 20px;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.25s ease, filter 0.25s ease;
    opacity: 0.75;
    filter: invert(0);
}
body.dark-theme .social-icon-btn img {
    filter: invert(1);
    opacity: 0.8;
}
.social-icon-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}
.social-icon-btn:hover img {
    transform: scale(1.12);
    filter: invert(1);
    opacity: 1;
}
.quick-links-wrapper {
    display: flex; flex-direction: column; gap: 16px;
}
.quick-link-item {
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    width: fit-content;
}
.quick-link-item .arrow {
    font-size: 0.8rem;
    color: var(--primary);
    opacity: 0;
    transform: translateX(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quick-link-item:hover {
    color: var(--primary);
    transform: translateX(-5px); /* حرکت نرم به سمت چپ در فارسی */
}
.quick-link-item:hover .arrow {
    opacity: 1;
    transform: translateX(0);
}
.trust-section {
    display: flex;
    flex-direction: column;
}
.trust-badges-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.trust-badge-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    min-width: 130px;
    min-height: 130px;
    aspect-ratio: 1 / 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    text-decoration: none;
    overflow: hidden;
    flex-shrink: 0;
}
html.dark-theme .trust-badge-card,
body.dark-theme .trust-badge-card {
    background: rgba(30, 41, 59, 0.45);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.trust-badge-card:has(img),
.trust-badge-card:has(a),
.trust-badge-card.has-badge {
    background: #ffffff !important;
    border-style: solid;
    border-width: 1.5px;
    border-color: rgba(148, 163, 184, 0.22);
    min-height: auto;
}
html.dark-theme .trust-badge-card:has(img),
html.dark-theme .trust-badge-card:has(a),
body.dark-theme .trust-badge-card:has(img),
body.dark-theme .trust-badge-card:has(a) {
    background: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.trust-badge-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.45);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.18);
}
.enamad-empty-hint {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    padding: 0 12px;
    line-height: 1.7;
    user-select: none;
    display: inline-block;
}
.trust-badge-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline: none;
}
.trust-badge-card img {
    max-width: 100%;
    height: auto;
    max-height: 125px;
    width: auto;
    object-fit: contain;
    display: block;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.25s ease;
}
.trust-badge-card:hover img {
    transform: scale(1.03);
}
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    max-width: 1250px;
    margin: 80px auto 0;
    padding-top: 25px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 0.85rem;
    color: #64748b;
}
.bottom-bar strong {
    color: var(--text-title);
    margin: 0 4px;
}
@media (max-width: 768px) {
    footer {
        padding: 56px 18px 24px;
    }
    .footer-grid {
        gap: 36px;
    }
    .bottom-bar {
        margin-top: 48px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .trust-badge-card {
        width: 125px;
        height: 125px;
        min-width: 125px;
        min-height: 125px;
        aspect-ratio: 1 / 1;
        border-radius: 18px;
        padding: 8px;
    }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 07-utilities/utilities.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.u-hidden{display:none!important}.u-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}.u-no-scroll{overflow:hidden!important}.u-text-center{text-align:center!important}.u-text-start{text-align:start!important}.u-text-end{text-align:end!important}

/*
 * Elima CSS Architecture v1.0
 * Module: 05-pages/home.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */



.author-card {
    text-align: center;
    cursor: pointer;
    padding: 25px 15px;
    border-radius: 20px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}
.author-card h3 { font-size: 1.1rem; color: var(--text-title); font-weight: 800; margin-bottom: 5px; transition: color var(--smooth-trans); }
.author-card p { font-size: 0.9rem; color: var(--text-body); }
@media (hover: hover) and (pointer: fine) {

    .author-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06); }
    .author-card:hover .author-pic { transform: scale(1.05); border-color: var(--primary); }
    .author-card:hover h3 { color: var(--primary); }
}
.hero-section { padding: 80px 20px 100px; text-align: center; position: relative; }
.hero-container { max-width: 800px; margin: 0 auto; }
.hero-logo { margin: 0 auto 20px; animation: floatAnim 4s ease-in-out infinite; object-fit: contain; }
.hero-section h1 { font-size: 3.4rem; font-weight: 900; color: var(--text-title); margin-bottom: 15px; letter-spacing: -0.5px; transition: color 0.4s; }
.hero-section p { font-size: 1.25rem; color: var(--text-body); max-width: 650px; margin: 0 auto 35px; line-height: 1.85; transition: color 0.4s; }
.section-header { max-width: 1300px; margin: 70px auto 30px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; border-right: 5px solid var(--primary); padding-right: 15px; transition: border-color 0.4s; }
.section-header h2 { font-size: 1.8rem; font-weight: 800; color: var(--text-title); transition: color 0.4s; }
.cats-container { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; padding: 0 20px; }
.books-wrapper { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; padding: 0 20px; }
.authors-wrapper { max-width: 1300px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 25px; padding: 0 20px; }
.cta-banner { max-width: 1260px; margin: 90px auto; padding: 60px 40px; border-radius: 32px; background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%); color: #fff; text-align: center; box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2); }
.cta-banner h2 { font-size: 2.4rem; margin-bottom: 15px; font-weight: 800; }
.cta-banner p { font-size: 1.15rem; max-width: 650px; margin: 0 auto 30px; opacity: 0.95; line-height: 1.85; }
.cta-banner .btn-white { display: inline-block; background: #fff; color: #4f46e5; padding: 15px 40px; border-radius: 14px; font-weight: 800; text-decoration: none; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s; }
.core-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.value-card { padding: 35px 25px; text-align: center; border-radius: 20px; background: var(--bg-cards); border: 1px solid var(--border-glass); }
.value-icon { font-size: 3rem; display: block; margin-bottom: 15px; }
.value-card h3 { color: var(--text-title); margin-bottom: 10px; font-weight: 800; }
.value-card p { color: var(--text-body); font-size: 0.95rem; line-height: 1.7; }
.filter-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: 600px; margin: 0 auto; }
.text-primary { color: var(--primary); }
@media (hover: hover) and (pointer: fine) {
    .cta-banner .btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,0.1); }

}
.glare-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease;
    mix-blend-mode: overlay;
}
.seo-content-section {
    max-width: 900px;
    margin: 0 auto 60px auto;
    padding: 35px 40px;
    border-radius: 20px;
    background: var(--bg-cards); /* هماهنگ با حالت دارک/لایت سایت */
    border: 1px solid rgba(79, 70, 229, 0.15); /* حاشیه ملایم بنفش/نیلی */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    line-height: 2.1;
    text-align: justify;
    font-size: 1.05rem;
    color: var(--text-body);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
.seo-content-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.12);
}
.seo-content-section strong,
.seo-content-section b {
    color: #4f46e5; /* رنگ اصلی برند شما */
    font-weight: 800;
    position: relative;
    z-index: 1;
}
.seo-content-section strong::after,
.seo-content-section b::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(79, 70, 229, 0.15);
    border-radius: 4px;
    z-index: -1;
    transition: background 0.3s ease;
}
.seo-content-section em {
    font-style: normal; /* حذف کجی پیش‌فرض فارسی */
    color: var(--text-title);
    font-weight: 700;
    background: rgba(245, 158, 11, 0.1); /* پس‌زمینه محو طلایی/نارنجی */
    padding: 2px 8px;
    border-radius: 6px;
}
@media (max-width: 768px) {
    .seo-content-section {
        padding: 25px 20px;
        font-size: 0.95rem;
        line-height: 1.9;
        margin: 0 15px 40px 15px;
    }
}
.home-book-finder{position:relative;width:min(100%,620px);margin:8px auto 0;padding:18px;border-radius:28px;background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(248,250,252,.86));border:1px solid rgba(148,163,184,.14);box-shadow:0 10px 24px rgba(15,23,42,.05);backdrop-filter:none;-webkit-backdrop-filter:none;transition:margin-bottom .16s ease,box-shadow .16s ease,border-color .16s ease}
body.dark-theme .home-book-finder{background:linear-gradient(180deg,rgba(15,23,42,.68),rgba(17,24,39,.82));border-color:rgba(255,255,255,.07);box-shadow:0 12px 28px rgba(2,6,23,.16)}
.book-finder-heading{display:flex;align-items:center;justify-content:center;gap:11px;margin-bottom:13px;text-align:right}
.book-finder-spark{width:38px;height:38px;display:grid;place-items:center;flex-shrink:0;border-radius:13px;background:rgba(79,70,229,.1);border:1px solid rgba(79,70,229,.12);color:var(--primary);font-size:1rem}
.book-finder-heading div{display:grid;gap:1px}
.book-finder-heading strong{color:var(--text-title);font-size:1rem;font-weight:900}
.book-finder-heading small{color:var(--text-body);font-size:.72rem;line-height:1.7}
.home-book-finder .search-box{max-width:100%;margin:0;z-index:3}
.home-book-finder .voice-search-status{width:100%;margin-top:7px;text-align:center}
.home-book-finder .live-search-dropdown{position:absolute;top:calc(100% - 3px);right:18px;left:18px;width:auto;max-width:none;margin:0;z-index:2100}
.home-book-finder .live-result-info{min-width:0}
.home-book-finder .live-result-info h4,.home-book-finder .live-result-info p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-book-finder.home-book-finder-plain{width:min(100%,560px);margin:0 auto;padding:0;background:transparent;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
.home-book-finder.home-book-finder-plain .live-search-dropdown{right:0;left:0;top:calc(100% + 7px)}
body.dark-theme .home-book-finder.home-book-finder-plain{background:transparent;border:0;box-shadow:none}
@media (max-width: 768px) {
    .hero-section { padding: 25px 15px 35px; }
    .hero-logo { width: 80px; height: 80px; margin-bottom: 12px; }
    .hero-section h1 { font-size: 1.6rem; margin-bottom: 8px; }
    .hero-section p { font-size: 0.9rem; margin-bottom: 18px; line-height: 1.6; }

    .cats-container, .books-wrapper, .authors-wrapper {
        display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        padding: 25px 15px 35px; gap: 15px; scroll-snap-type: x mandatory; scrollbar-width: none; justify-content: flex-start; scroll-padding-inline: 15px; overscroll-behavior-x: contain;
    }
    .cats-container::-webkit-scrollbar, .books-wrapper::-webkit-scrollbar, .authors-wrapper::-webkit-scrollbar { display: none; }

    .cats-container::before, .cats-container::after,
    .books-wrapper::before, .books-wrapper::after,
    .authors-wrapper::before, .authors-wrapper::after { content: ''; flex: 0 0 1px; display: block; }

    .author-card { flex: 0 0 145px; scroll-snap-align: center; padding: 15px 10px; border-radius: 14px; }
    .author-card h3 { font-size: 0.95rem; }
    .author-card p { font-size: 0.8rem; }

    .cat-card:active, .book-item:active, .author-card:active { transform: scale(0.985); transition: transform 0.1s; border-color: var(--primary); }

    .cta-banner { padding: 30px 20px; margin: 30px 15px; border-radius: 18px; }
    .cta-banner h2 { font-size: 1.3rem; margin-bottom: 10px; }
    .cta-banner p { font-size: 0.85rem; margin-bottom: 20px; }
    .cta-banner .btn-white { padding: 10px 20px; font-size: 0.9rem; border-radius: 10px; }
}
@media (max-width: 768px) {
    .hero-section {
        padding: 22px 14px 30px;
    }

    .hero-container {
        max-width: 100%;
    }

    .hero-section h1 {
        font-size: 1.7rem;
        line-height: 1.4;
    }

    .hero-section p {
        font-size: 0.92rem;
        line-height: 1.85;
        margin-bottom: 16px;
    }

    .books-wrapper,
    .authors-wrapper,
    .cats-container {
        gap: 14px;
        padding: 18px 0 28px;
    }
}
@media (max-width: 500px) {
    .hero-logo {
        width: 72px;
        height: 72px;
    }

    .books-wrapper,
    .authors-wrapper,
    .cats-container {
        gap: 12px;
        padding-bottom: 24px;
    }

    .cta-banner {
        margin: 26px 14px;
        padding: 24px 18px;
        border-radius: 22px;
    }

    .cta-banner h2 {
        font-size: 1.14rem;
    }

    .cta-banner p {
        font-size: 0.82rem;
        line-height: 1.9;
    }
}
@media(max-width:768px){.home-book-finder{width:100%;padding:13px;border-radius:22px}.book-finder-heading{margin-bottom:10px}.book-finder-spark{width:34px;height:34px;border-radius:11px}.book-finder-heading strong{font-size:.92rem}.book-finder-heading small{font-size:.66rem}.home-book-finder .search-box{min-height:56px}.home-book-finder .live-search-dropdown{right:13px;left:13px;max-height:270px}.home-book-finder .voice-search-status{font-size:.72rem}}
@media(max-width:420px){.home-book-finder{padding:11px}.book-finder-heading{justify-content:flex-start;padding:0 3px}.home-book-finder .search-box input{font-size:.78rem!important}.home-book-finder .search-box .voice-btn{width:38px!important;height:38px!important}.home-book-finder .submit-search-btn{width:40px!important;height:40px!important}}

/* Compact horizontal quick categories v2 */
.cats-container {
    position: relative;
    width: min(100%, 1300px);
    max-width: 1300px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    padding: 6px 20px 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 20px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 38%, transparent) transparent;
}
.cats-container::-webkit-scrollbar { height: 5px; }
.cats-container::-webkit-scrollbar-track { background: transparent; }
.cats-container::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 34%, transparent); border-radius: 99px; }
.cats-container .cat-card {
    flex: 0 0 clamp(174px, 17vw, 208px);
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 13px 15px;
    border-radius: 15px;
    text-align: right;
    scroll-snap-align: start;
}
.cats-container .cat-icon { flex: 0 0 auto; margin: 0; font-size: 1.7rem; line-height: 1; }
.cats-container .cat-card h3 { margin: 0; font-size: .88rem; line-height: 1.55; }
@media (max-width: 768px) {
    .cats-container { gap: 10px; padding: 6px 14px 17px; scroll-padding-inline: 14px; }
    .cats-container::before, .cats-container::after { display: none; }
    .cats-container .cat-card { flex-basis: 152px; min-height: 70px; padding: 11px 13px; border-radius: 14px; }
    .cats-container .cat-icon { font-size: 1.55rem; }
    .cats-container .cat-card h3 { font-size: .8rem; }
}

/*
 * Elima CSS Architecture v1.0
 * Module: 05-pages/books.css
 * Generated from the verified production stylesheet set.
 * Keep page-specific rules in 05-pages and shared UI in 03-components.
 */


.back-to-gallery-btn {
    display: inline-flex; gap: 8px;
    color: var(--text-body); font-weight: 700; text-decoration: none;
    padding: 8px 0; font-size: 0.95rem; transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
.back-to-gallery-btn .arrow { transition: transform 0.3s ease; }
.back-to-gallery-btn:hover { transform: translateX(5px); }
.back-to-gallery-btn:hover .arrow { transform: translateX(4px); }
@media (hover: hover) and (pointer: fine) {
    .back-to-gallery-btn:hover, .back-news-btn:hover { background: var(--primary); color: #fff !important; border-color: var(--primary); transform: translateX(5px); box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2); }
}
.back-to-gallery-btn {
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-radius: 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-title);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}
.back-to-gallery-btn:hover {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    transform: translateX(-4px);
}
.back-to-gallery-btn .arrow {
    font-size: 1rem;
}
.gallery-page { padding-top: 40px; padding-bottom: 80px; min-height: 80vh; }
.gallery-header { text-align: center; margin-bottom: 40px; padding: 0 20px; }
.gallery-header h1 { font-size: 2.5rem; font-weight: 900; color: var(--text-title); margin-bottom: 10px; }
.gallery-header h1 span { color: var(--primary); }
.gallery-header p { font-size: 1rem; color: var(--text-body); margin-bottom: 25px; }
@media (max-width: 768px) {

    .back-to-gallery-btn {
        padding: 10px 14px;
        border-radius: 14px;
        font-size: 0.88rem;
    }
}
@media (max-width: 768px) {

    .gallery-page {
        padding-top: 26px;
        padding-bottom: 60px;
    }

    .gallery-header {
        margin-bottom: 24px;
        padding: 0 14px;
    }

    .gallery-header h1 {
        font-size: 1.9rem;
        line-height: 1.35;
    }

    .gallery-header p {
        font-size: 0.88rem;
        line-height: 1.8;
        margin-bottom: 18px;
    }

    .back-news-btn,
    .back-to-gallery-btn {
        width: 100%;
        justify-content: center;
    }
}
.gallery-page {
    min-height: 80vh;
    padding: 34px 0 84px;
}
.gallery-search-hero {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 32px;
    padding: 42px 24px 22px;
    text-align: center;
    isolation: isolate;
}
.gallery-search-hero::before {
    content: '';
    position: absolute;
    width: min(560px, 90vw);
    height: 250px;
    top: -78px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(79,70,229,.13), transparent 68%);
    pointer-events: none;
    z-index: -1;
}
.gallery-search-heading {
    max-width: 720px;
    margin: 0 auto 24px;
}
.gallery-search-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    margin-bottom: 12px;
    border-radius: 999px;
    color: var(--primary);
    background: rgba(79,70,229,.08);
    border: 1px solid rgba(79,70,229,.13);
    font-size: .76rem;
    font-weight: 800;
}
.gallery-book-finder-title {
    margin: 0 0 10px;
    color: var(--text-title);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -1px;
}
.gallery-book-finder-title span {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), #818cf8 55%, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.gallery-book-finder-title span::after {
    content: '';
    position: absolute;
    right: 8%;
    left: 8%;
    bottom: -3px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(79,70,229,.65), transparent);
}
.gallery-search-heading p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--text-body);
    font-size: .96rem;
    line-height: 1.9;
}
.gallery-search-panel {
    position: relative;
    max-width: 820px;
    margin: 0 auto 22px;
    padding: 9px;
    border-radius: 24px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(148,163,184,.18);
    box-shadow: 0 16px 36px rgba(15,23,42,.07);
}
body.dark-theme .gallery-search-panel {
    background: rgba(15,23,42,.92);
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 18px 40px rgba(2,6,23,.22);
}
.gallery-search-form {
    display: grid;
    grid-template-columns: minmax(0,1fr) 48px auto;
    align-items: center;
    gap: 8px;
}
.gallery-search-input-wrap {
    position: relative;
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    border-radius: 16px;
    background: rgba(148,163,184,.08);
    border: 1px solid rgba(148,163,184,.14);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.gallery-search-input-wrap:focus-within {
    border-color: rgba(79,70,229,.32);
    background: rgba(79,70,229,.045);
    box-shadow: 0 0 0 4px rgba(79,70,229,.08);
}
.gallery-search-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    flex: 0 0 auto;
    background: var(--primary);
    -webkit-mask: url('/icon/search.svg?v=20260717-7') center / contain no-repeat;
    mask: url('/icon/search.svg?v=20260717-7') center / contain no-repeat;
}
.gallery-search-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-title);
    font-size: .95rem;
    font-weight: 700;
}
.gallery-search-input-wrap input::-webkit-search-cancel-button { display: none; }
.gallery-search-input-wrap input::placeholder { color: var(--text-body); opacity: .68; }
.gallery-search-clear {
    width: 34px;
    height: 34px;
    margin-left: 8px;
    border: 0;
    border-radius: 10px;
    background: rgba(148,163,184,.13);
    color: var(--text-body);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(.9);
    transition: opacity .16s ease, transform .16s ease, background-color .16s ease;
}
.gallery-search-clear.is-visible { opacity: 1; visibility: visible; transform: scale(1); }
.gallery-voice-btn,
.gallery-search-submit {
    min-height: 48px;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.gallery-voice-btn {
    position: relative;
    width: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--primary);
    background: rgba(79,70,229,.09);
    border: 1px solid rgba(79,70,229,.13);
}
.gallery-voice-btn .mic-icon { width: 19px; height: 19px; background-color: var(--primary); }
.gallery-voice-btn.recording { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.22); }
.gallery-voice-btn.recording .mic-icon { background-color: #ef4444 !important; }
.gallery-voice-pulse {
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    border: 1px solid transparent;
    pointer-events: none;
}
.gallery-voice-btn.recording .gallery-voice-pulse { animation: galleryVoicePulse 1.2s ease-out infinite; }
.gallery-search-submit {
    padding: 0 22px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: white;
    box-shadow: 0 8px 18px rgba(79,70,229,.2);
}
.gallery-voice-status {
    min-height: 22px;
    padding: 7px 12px 0;
    text-align: right;
    color: var(--text-body);
    font-size: .78rem;
    line-height: 1.8;
}
.gallery-voice-status:empty { min-height: 0; padding-top: 0; }
.gallery-voice-status[data-state='listening'], .gallery-voice-status[data-state='error'] { color: #ef4444; }
.gallery-voice-status[data-state='success'] { color: #10b981; }
.category-browser {
    position: relative;
    max-width: 1060px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.38) transparent;
}
.category-browser::-webkit-scrollbar {
    height: 8px;
}
.category-browser::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.32);
    border-radius: 999px;
}
.category-browser::-webkit-scrollbar-track {
    background: transparent;
}
.gallery-search-hero .filter-container {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 3px 3px 4px;
    overflow: visible;
    scroll-snap-type: x proximity;
}
@media (max-width: 768px) {
    .category-browser {
        overflow-x: visible;
        padding-bottom: 0;
        scrollbar-width: none;
    }
    .category-browser::-webkit-scrollbar { display: none; }
}
.category-browser,
.gallery-search-hero .filter-container {
    scroll-behavior: smooth;
}
.gallery-search-hero .filter-btn {
    flex: 0 0 auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    border-radius: 13px;
    scroll-snap-align: start;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    color: var(--text-body);
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.gallery-search-hero .filter-btn small {
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(148,163,184,.12);
    color: inherit;
    font-size: .68rem;
}
.gallery-search-hero .filter-btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(79,70,229,.18);
}
.gallery-search-hero .filter-btn.active small { background: rgba(255,255,255,.16); }
.gallery-filter-toolbar {
    max-width: 1060px;
    min-height: 58px;
    display: grid;
    grid-template-columns: auto auto minmax(0,1fr);
    align-items: center;
    gap: 10px;
    margin: 8px auto 0;
    padding: 8px;
    border-radius: 17px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
}
.advanced-filter-toggle,
.quick-sort-control {
    min-height: 42px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-glass);
}
.advanced-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: var(--text-title);
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
}
.advanced-filter-toggle b {
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 7px;
    background: var(--primary);
    color: #fff;
    font-size: .68rem;
}
.quick-sort-control {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    color: var(--text-body);
    font-size: .76rem;
    font-weight: 700;
}
.quick-sort-control select {
    min-height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-title);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    color-scheme: light;
}
.quick-sort-control select option {
    background: #ffffff;
    color: #0f172a;
}
body.dark-theme .quick-sort-control select {
    color-scheme: dark;
}
body.dark-theme .quick-sort-control select option {
    background: #0f172a;
    color: #e5e7eb;
}
.gallery-result-summary {
    justify-self: end;
    color: var(--text-body);
    font-size: .82rem;
    line-height: 1.8;
}
.gallery-result-summary strong { color: var(--primary); font-weight: 900; }
.gallery-filter-panel {
    max-width: 1060px;
    max-height: 0;
    margin: 0 auto;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.99);
    border-radius: 20px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    box-shadow: 0 16px 38px rgba(15,23,42,.08);
    padding: 0 20px;
    transition: max-height 0.36s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.28s ease,
                transform 0.36s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.36s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.36s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.36s ease;
}
.gallery-filter-panel.is-open {
    max-height: 520px;
    margin-top: 14px;
    padding: 22px 20px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    text-align: right;
}
.filter-panel-header > div { display: grid; gap: 3px; }
.filter-panel-header strong { color: var(--text-title); font-size: .98rem; }
.filter-panel-header span { color: var(--text-body); font-size: .74rem; }
#filterPanelClose {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-glass);
    border-radius: 11px;
    background: var(--input-bg);
    color: var(--text-body);
    font: inherit;
    cursor: pointer;
}
.advanced-filter-grid {
    display: grid;
    grid-template-columns: minmax(280px,1.6fr) repeat(2,minmax(180px,1fr));
    gap: 12px;
    align-items: start;
}
.filter-field {
    min-width: 0;
    display: grid;
    gap: 7px;
    text-align: right;
}
.filter-field > span,
.filter-field > label,
.filter-field > :first-child:not(select) {
    color: var(--text-title);
    font-size: .78rem;
    font-weight: 800;
}
.filter-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border-glass);
    border-radius: 11px;
    outline: 0;
    background: var(--input-bg);
    color: var(--text-title);
    font: inherit;
    font-size: .8rem;
    color-scheme: light;
}
.filter-field select option {
    background: #ffffff;
    color: #0f172a;
}
body.dark-theme .filter-field select {
    color-scheme: dark;
}
body.dark-theme .filter-field select option {
    background: #0f172a;
    color: #e5e7eb;
}
.filter-field select:focus { border-color: rgba(79,70,229,.36); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.subcategory-filter-field {
    grid-row: span 2;
}
.subcategory-filter-list {
    min-height: 96px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--input-bg);
}
.subcategory-option { position: relative; cursor: pointer; }
.subcategory-option input { position: absolute; opacity: 0; pointer-events: none; }
.subcategory-option span {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    color: var(--text-body);
    font-size: .74rem;
    font-weight: 800;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.subcategory-option input:checked + span {
    background: rgba(79,70,229,.1);
    border-color: rgba(79,70,229,.26);
    color: var(--primary);
}
.subcategory-option input:focus-visible + span { outline: 3px solid rgba(79,70,229,.2); outline-offset: 2px; }
.filter-guidance { width: 100%; margin: auto; color: var(--text-body); font-size: .76rem; line-height: 1.8; text-align: center; }
.filter-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
}
.clear-filter-btn,
.apply-filter-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 11px;
    font: inherit;
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
}
.clear-filter-btn { background: var(--input-bg); color: var(--text-body); border: 1px solid var(--border-glass); }
.apply-filter-btn { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.gallery-filter-backdrop { display: none; }
.active-filter-chips {
    max-width: 1060px;
    min-height: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 7px;
    margin: 10px auto 0;
}
.active-filter-chips:empty { display: none; }
.active-filter-chips button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid rgba(79,70,229,.16);
    border-radius: 10px;
    background: rgba(79,70,229,.07);
    color: var(--primary);
    font: inherit;
    font-size: .72rem;
    font-weight: 800;
    cursor: pointer;
}
.active-filter-chips button span { font-size: 1rem; line-height: 1; }
.compact-book-gallery.gallery-live-results {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px,1fr));
    gap: 22px 16px;
    align-items: stretch;
}
.gallery-book-card {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 11px;
    border-radius: 20px;
    background: var(--bg-cards);
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 24px rgba(15,23,42,.045);
    color: inherit;
    text-decoration: none;
    content-visibility: auto;
    contain-intrinsic-size: 220px 430px;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gallery-book-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: var(--bg-main);
}
.gallery-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .24s ease, opacity .24s ease;
}
.gallery-book-category {
    position: absolute;
    top: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 8px;
    border-radius: 9px;
    background: rgba(15,23,42,.78);
    color: #fff;
    font-size: .64rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-book-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 3px 3px;
    text-align: right;
}
.gallery-book-info h3 {
    color: var(--text-title);
    font-size: .96rem;
    line-height: 1.65;
    font-weight: 850;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-book-info p {
    margin-top: 5px;
    color: var(--text-body);
    font-size: .75rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-book-badge-pdf {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 3px 7px;
    border-radius: 7px;
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
}
.gallery-book-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 11px;
    border-top: 1px solid var(--border-glass);
}
.gallery-book-price {
    font-size: .78rem;
    font-weight: 900;
    color: var(--primary);
}
.gallery-book-price.is-free {
    color: #059669;
}
.gallery-book-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-body);
    font-size: .72rem;
    font-weight: 800;
}
@media (hover:hover) {
    .gallery-book-card:hover { transform: translateY(-4px); border-color: rgba(79,70,229,.24); box-shadow: 0 16px 34px rgba(79,70,229,.09); }
    .gallery-book-card:hover .gallery-book-cover { transform: scale(1.025); }
    .gallery-search-submit:hover, .apply-filter-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 22px rgba(79,70,229,.24); }
    .gallery-voice-btn:hover, .gallery-search-clear:hover, .advanced-filter-toggle:hover { background: rgba(79,70,229,.13); }
    .gallery-search-hero .filter-btn:not(.active):hover { color: var(--primary); border-color: rgba(79,70,229,.24); transform: translateY(-1px); }
    .active-filter-chips button:hover { background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.16); color: #ef4444; }
}
@media (max-width: 900px) {
    .advanced-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .subcategory-filter-field { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 768px) {
    body.gallery-filters-open { overflow: hidden; }
    .gallery-page { padding-top: 22px; padding-bottom: 64px; }
    .gallery-search-hero { width: 100%; padding: 24px 12px 16px; margin-bottom: 20px; }
    .gallery-search-hero::before { width: 330px; height: 180px; top: -55px; }
    .gallery-search-heading { margin-bottom: 17px; }
    .gallery-search-kicker { min-height: 29px; margin-bottom: 9px; font-size: .69rem; }
    .gallery-book-finder-title { font-size: 2.22rem; letter-spacing: -.5px; }
    .gallery-search-heading p { font-size: .84rem; }
    .gallery-search-panel { padding: 7px; border-radius: 19px; }
    .gallery-search-form { grid-template-columns: minmax(0,1fr) 46px; gap: 7px; }
    .gallery-search-input-wrap { min-height: 46px; border-radius: 13px; }
    .gallery-search-input-wrap input { height: 46px; padding: 0 8px; font-size: .84rem; }
    .gallery-search-icon { width: 18px; height: 18px; margin-right: 12px; }
    .gallery-search-clear { width: 32px; height: 32px; margin-left: 6px; }
    .gallery-voice-btn { width: 46px; min-height: 46px; border-radius: 13px; }
    .gallery-search-submit { grid-column: 1 / -1; min-height: 44px; border-radius: 13px; }
    .gallery-voice-status { padding-inline: 6px; text-align: center; font-size: .72rem; }
    .gallery-search-hero .filter-container { gap: 7px; width: auto; min-width: 0; max-width: 100%; padding-bottom: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .gallery-search-hero .filter-container::-webkit-scrollbar { display: none; }
    .gallery-search-hero .filter-btn { min-height: 40px; padding-inline: 12px; font-size: .76rem; border-radius: 12px; }

    .gallery-filter-toolbar {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        min-height: 0;
        padding: 7px;
        border-radius: 15px;
    }
    .advanced-filter-toggle, .quick-sort-control { min-height: 44px; }
    .quick-sort-control { justify-content: center; padding: 0 7px; }
    .quick-sort-control > span { display: none; }
    .gallery-result-summary { grid-column: 1 / -1; justify-self: center; padding: 2px 0; font-size: .76rem; }

    .gallery-filter-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        z-index: 6998;
        background: rgba(15,23,42,.48);
        opacity: 0;
        visibility: hidden;
        transition: opacity .18s ease, visibility .18s ease;
    }
    .gallery-filter-backdrop.is-open { opacity: 1; visibility: visible; }

    .gallery-filter-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 6999;
        width: 100%;
        max-width: none;
        max-height: 88dvh;
        margin: 0;
        padding: 18px 14px calc(14px + env(safe-area-inset-bottom));
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(100%);
        border: 1px solid var(--border-glass);
        border-bottom: 0;
        border-radius: 24px 24px 0 0;
        background: var(--bg-main);
        box-shadow: 0 -18px 45px rgba(15,23,42,.18);
        transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease, visibility 0.28s ease;
    }
    .gallery-filter-panel.is-open {
        max-height: 88dvh;
        margin: 0;
        padding: 18px 14px calc(14px + env(safe-area-inset-bottom));
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        border-width: 1px;
    }
    .filter-panel-header { position: sticky; top: -18px; z-index: 3; margin: -18px -14px 14px; padding: 16px 14px 12px; background: var(--bg-main); border-bottom: 1px solid var(--border-glass); }
    .advanced-filter-grid { grid-template-columns: 1fr; }
    .subcategory-filter-list { min-height: 80px; }
    .filter-panel-actions { position: sticky; bottom: calc(-14px - env(safe-area-inset-bottom)); z-index: 3; margin: 16px -14px calc(-14px - env(safe-area-inset-bottom)); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--bg-main); }
    .filter-panel-actions > * { flex: 1; }
    .active-filter-chips { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 0 2px 4px; scrollbar-width: none; }
    .active-filter-chips::-webkit-scrollbar { display: none; }
    .active-filter-chips button { flex: 0 0 auto; }

    .compact-book-gallery.gallery-live-results { width: calc(100% - 24px); grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 9px; }
    .gallery-book-card { padding: 8px; border-radius: 16px; contain-intrinsic-size: 160px 330px; }
    .gallery-book-cover-wrap { border-radius: 11px; }
    .gallery-book-category { top: 6px; right: 6px; max-width: calc(100% - 12px); padding: 4px 6px; border-radius: 7px; font-size: .56rem; }
    .gallery-book-info { padding: 9px 2px 2px; }
    .gallery-book-info h3 { font-size: .81rem; }
    .gallery-book-info p { font-size: .67rem; }
    .gallery-book-link { padding-top: 8px; font-size: .66rem; }
}
@media (max-width: 370px) {
    .compact-book-gallery.gallery-live-results { width: calc(100% - 18px); gap: 10px 7px; }
    .gallery-book-card { padding: 7px; }
    .gallery-search-hero { padding-inline: 9px; }
}

/* Elima runtime performance layer v9. Visual design remains unchanged. */
@supports (content-visibility: auto) {
    @media (max-width: 768px) {
        .books-wrapper,
        .news-wrapper,
        .related-books-section,
        .compact-book-gallery,
        .profile-favorites-grid,
        .cta-banner,
        site-footer {
            content-visibility: auto;
            contain-intrinsic-size: auto 560px;
        }
    }
}



    html.theme-switching .pro-image-glow,
    html.theme-switching .profile-ambient,
    html.theme-switching .account-ambient {
        filter: none !important;
        opacity: 0 !important;
    }
}

