@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,800;1,400;1,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&display=swap');

:root {
    --primary: #4f46e5;
    --paper-bg: #fdfbf7;
    --gold-gradient: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
}

#rbg-frontend-wrapper {
    font-family: 'Plus Jakarta Sans', sans-serif;
    scroll-behavior: smooth;
    background-color: #fafafa;
    color: #0f172a;
    min-height: 100vh;
    position: relative;
}

.bg-mesh {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(at 0% 0%, hsla(234,100%,98%,1) 0, transparent 50%), 
        radial-gradient(at 100% 100%, hsla(234,100%,98%,1) 0, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.premium-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.04);
}

.command-input-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    padding: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 48rem;
    margin: 0 auto;
}

.command-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 20px 40px -20px rgba(79, 70, 229, 0.15);
    transform: translateY(-2px);
}

.rbg-input-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    padding-top: 0.5rem;
}

.rbg-input-label {
    font-size: 0.625rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.rbg-divider {
    height: 1px;
    flex: 1;
    background: #e2e8f0;
}

.rbg-branding {
    font-size: 0.5625rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    text-transform: uppercase;
}

.search-area-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.search-button-fixed {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 20;
}

#commandInput {
    width: 100%;
    padding: 1.5rem;
    padding-right: 12rem;
    min-height: 180px;
    background: transparent;
    outline: none;
    resize: none;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    color: #0f172a;
    border: none;
}

.btn-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-gradient:active {
    transform: scale(0.98);
}

.rbg-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.rbg-frontend-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 4rem;
}

.rbg-frontend-title {
    font-size: 3rem;
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    color: #0f172a;
}

.rbg-title-accent {
    background: linear-gradient(to right, #64748b, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rbg-main-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 2rem 10rem;
}

.rbg-command-section {
    margin-bottom: 3rem;
}

.rbg-showcase {
    max-width: 64rem;
    margin: 0 auto;
    padding: 1rem 0;
}

.rbg-showcase-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.rbg-showcase-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.rbg-line {
    height: 1px;
    flex: 1;
    background: #e2e8f0;
}

.rbg-showcase-title {
    font-size: 0.625rem;
    font-weight: 800;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5em;
}

.rbg-books-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4rem 6rem;
}

.mini-book-btn {
    perspective: 2500px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: block;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.mini-book-3d {
    width: 125px;
    height: 185px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-22deg) rotateX(4deg);
    transition: transform 0.6s ease;
}

.mini-book-btn:hover .mini-book-3d {
    transform: rotateY(-8deg) rotateX(0deg) translateY(-25px);
}

.mini-book-spine {
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 24px;
    background: #111;
    transform: rotateY(-90deg);
    transform-origin: right;
    border-radius: 12px 0 0 12px;
    box-shadow: inset 10px 0 10px rgba(0,0,0,0.5);
}

.mini-book-depth {
    position: absolute;
    top: 5px;
    right: -12px;
    bottom: 5px;
    width: 28px;
    background: #fff;
    background-image: 
        linear-gradient(to right, #ccc 0%, #fff 15%),
        repeating-linear-gradient(to bottom, transparent 0, transparent 1px, #e5e5e5 1px, #e5e5e5 2px);
    transform: rotateY(90deg);
    transform-origin: left;
    border-radius: 0 4px 4px 0;
}

.mini-book-top, .mini-book-bottom {
    position: absolute;
    left: 12px;
    right: -4px;
    height: 28px;
    background: #f8f8f8;
    background-image: linear-gradient(90deg, #d4af37 0%, #f7e08a 50%, #d4af37 100%);
    opacity: 0.15;
}

.mini-book-top {
    top: 5px;
    transform: rotateX(90deg);
    transform-origin: top;
}

.mini-book-bottom {
    bottom: 5px;
    transform: rotateX(-90deg);
    transform-origin: bottom;
}

.mini-cover-front {
    position: absolute;
    inset: 0;
    background: #1e293b;
    border-radius: 2px 8px 8px 2px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    box-shadow: 
        inset 1px 1px 0 rgba(255,255,255,0.15),
        15px 15px 40px rgba(0,0,0,0.5);
    backface-visibility: hidden;
    overflow: hidden;
}

.mini-cover-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/black-leather.png");
    opacity: 0.7;
    pointer-events: none;
}

.mini-spine-indent {
    position: absolute;
    top: 0;
    left: 14px;
    bottom: 0;
    width: 3px;
    background: rgba(0,0,0,0.5);
    box-shadow: 1px 0 2px rgba(255,255,255,0.1);
    z-index: 21;
}

.mini-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 13px;
    line-height: 1.3;
    color: #fff;
    position: relative;
    z-index: 22;
    text-shadow: 0 3px 6px rgba(0,0,0,0.8);
    letter-spacing: 0.01em;
}

.theme-astronomy {
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
}

.theme-ocean {
    background: linear-gradient(135deg, #042f2e 0%, #134e4a 100%);
}

.theme-seo {
    background: linear-gradient(135deg, #111 0%, #000 100%);
}

.theme-seo .mini-title {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Cinzel Decorative';
}

.rbg-placeholder {
    max-width: 48rem;
    margin: 0 auto;
    height: 250px;
    border: 2px dashed #e2e8f0;
    border-radius: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: rgba(248, 250, 252, 0.5);
    transition: opacity 0.3s ease;
}

.rbg-placeholder-icon {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.rbg-placeholder-text {
    color: #94a3b8;
    font-weight: 600;
    font-style: italic;
}

/* Full-screen loading overlay */
.rbg-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rbgFadeIn 0.3s ease;
}

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

.rbg-loading-popup {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
    animation: rbgPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rbgPopIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.rbg-loading-book-icon {
    color: #4f46e5;
    margin-bottom: 8px;
    animation: rbgFloat 2s ease-in-out infinite;
}

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

.rbg-loading-pulse {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #e2e8f0, #4f46e5, #e2e8f0);
    background-size: 200% 100%;
    border-radius: 4px;
    margin: 16px auto;
    animation: rbgPulseBar 1.5s ease-in-out infinite;
}

@keyframes rbgPulseBar {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.rbg-loading-heading {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 12px 0 8px;
}

.rbg-loading-message {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.rbg-loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.rbg-loading-dots span {
    width: 12px;
    height: 12px;
    background: #4f46e5;
    border-radius: 50%;
    animation: rbgBounce 1.4s ease-in-out infinite;
}

.rbg-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.rbg-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rbgBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.rbg-loading-tip {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.rbg-loading-subtitle {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.rbg-result-container {
    max-width: 80rem;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(2rem);
    transition: all 1s ease-out;
}

.rbg-result-container.show {
    opacity: 1;
    transform: translateY(0);
}

.rbg-download-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.rbg-download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #1e293b;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rbg-download-btn:hover {
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.book-container {
    perspective: 3000px;
    position: relative;
    width: 100%;
    height: 850px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-fab {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    z-index: 150;
    transition: all 0.3s ease;
    color: #1e293b;
}

.nav-fab:hover:not(:disabled) {
    background: #f8fafc;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.nav-fab:disabled {
    opacity: 0;
    pointer-events: none;
}

.nav-fab-left {
    left: -4rem;
}

.nav-fab-right {
    right: -4rem;
}

.book-object {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--paper-bg);
    border-radius: 2px 12px 12px 2px;
    box-shadow: 
        0 40px 100px -20px rgba(0,0,0,0.35),
        0 20px 40px -20px rgba(0,0,0,0.2);
    overflow: hidden;
}

.book-object::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent, rgba(0,0,0,0.05));
    z-index: 60;
}

.book-cover {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    transition: transform 1.3s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.7s ease-out;
    backface-visibility: hidden;
    background: radial-gradient(circle at 40% 40%, #1e293b, #020617);
    border-left: 22px solid #000;
    box-shadow: inset 20px 0 40px rgba(0,0,0,0.7), 25px 25px 50px rgba(0,0,0,0.4);
    z-index: 100;
    border-radius: 2px 12px 12px 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    padding: 3rem 5rem;
}

.book-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("https://www.transparenttextures.com/patterns/black-leather.png");
    opacity: 0.5;
    pointer-events: none;
    border-radius: inherit;
}

.book-cover.open {
    transform: rotateY(-120deg);
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.cover-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
    background-image: radial-gradient(circle at 2px 2px, white 1px, transparent 0);
    background-size: 32px 32px;
}

.cover-content {
    margin-top: 6rem;
    text-align: center;
    position: relative;
    z-index: 10;
}

.cover-publisher {
    color: #fbbf24;
    font-weight: 700;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-size: 0.625rem;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.cover-title {
    font-size: 5rem;
    font-weight: 900;
    font-family: 'Cinzel Decorative';
    line-height: 1.1;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.5));
    padding-bottom: 1rem;
}

.cover-divider {
    width: 6rem;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(251, 191, 36, 0.5), transparent);
    margin: 3rem auto 0;
}

.cover-footer {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 10;
}

.cover-author-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.cover-author {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: white;
    letter-spacing: 0.2em;
}

.page-view {
    flex: 1;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 3rem 5rem 10rem 8rem;
    z-index: 20;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg width='400' height='400' viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50%25' y='50%25' font-size='28' font-weight='900' fill='rgba(0,0,0,0.045)' font-family='Inter,Helvetica,Arial,sans-serif' text-anchor='middle' dominant-baseline='middle' letter-spacing='0.15em' transform='rotate(-45 200 200)'%3EWWW.REORK.COM%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}

.page-view::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 140px;
    background: linear-gradient(to right, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.02) 15%, transparent 100%);
    z-index: 20;
    pointer-events: none;
}

.page-content {
    max-width: 65ch;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    animation: pageFadeIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    font-family: 'Playfair Display', Georgia, serif !important;
}

/* ===== CONTENT TYPOGRAPHY — overrides Tailwind preflight ===== */
.page-content > * { display: block !important; }
.page-content > * + * { margin-top: 1.25em !important; }

.page-content h2,
#pageContent h2 {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1rem !important;
    border-bottom: 2px solid #e5e5e5 !important;
    line-height: 1.25 !important;
}

.page-content h3,
#pageContent h3 {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #2a2a2a !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem !important;
}

.page-content h4,
#pageContent h4 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #333 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-top: 1.5rem !important;
}

.page-content p,
#pageContent p {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.05rem !important;
    line-height: 1.9 !important;
    color: #2c2c2c !important;
    margin-bottom: 1.25rem !important;
    text-align: justify !important;
}

.page-content ul,
.page-content ol,
#pageContent ul,
#pageContent ol {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.05rem !important;
    line-height: 1.8 !important;
    color: #2c2c2c !important;
    padding-left: 2rem !important;
    margin-bottom: 1.25rem !important;
}

.page-content ul, #pageContent ul { list-style-type: disc !important; }
.page-content ol, #pageContent ol { list-style-type: decimal !important; }

.page-content li,
#pageContent li {
    margin-bottom: 0.5rem !important;
    display: list-item !important;
}

.page-content strong,
#pageContent strong {
    color: #111 !important;
    font-weight: 700 !important;
}

.page-content em,
#pageContent em {
    font-style: italic !important;
    color: #444 !important;
}

.page-content blockquote,
#pageContent blockquote {
    background: linear-gradient(135deg, #fefce8, #fef9c3) !important;
    border-left: 5px solid #ca8a04 !important;
    border-radius: 0 12px 12px 0 !important;
    padding: 1.5rem 2rem !important;
    margin: 2.5rem 0 !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
}

.page-content blockquote h3,
#pageContent blockquote h3 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    color: #854d0e !important;
    margin-top: 0 !important;
    border-bottom: none !important;
}

.page-content blockquote p,
.page-content blockquote li,
#pageContent blockquote p,
#pageContent blockquote li {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.95rem !important;
    color: #713f12 !important;
    text-align: left !important;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateX(30px) rotateY(2deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

/* Bottom Navigation Bar */
.book-nav-bottom {
    margin-top: 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.bnav-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bnav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.bnav-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.bnav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.bnav-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.bnav-select {
    width: 100%;
    max-width: 360px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    outline: none;
    transition: border 0.2s;
    text-overflow: ellipsis;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.bnav-select:focus {
    border-color: #4f46e5;
    background: white;
}

.bnav-page {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.rbg-toast {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translate(-50%, -8rem);
    z-index: 300;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.5s ease;
}

.rbg-toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.rbg-toast-icon {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: #6366f1;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ======================================================
   MOBILE RESPONSIVE — Phones & Small Tablets
   ====================================================== */

@media (max-width: 768px) {

    /* --- Layout & Spacing --- */
    .rbg-main-content {
        padding: 0 0.35rem 6rem;
    }

    /* --- Input / Search Area --- */
    .command-input-container {
        border-radius: 1rem;
        padding: 0.5rem;
    }

    .rbg-input-header {
        padding: 0.25rem 0.5rem;
    }

    .rbg-branding {
        display: none;
    }

    .search-area-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #commandInput {
        font-size: 1rem;
        padding: 0.75rem;
        padding-right: 0.75rem;
        min-height: 90px;
    }

    .search-button-fixed {
        position: static;
        margin-top: 0.5rem;
    }

    .btn-gradient {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        border-radius: 0.75rem;
    }

    .rbg-command-section {
        margin-bottom: 1.5rem;
    }

    /* --- Collections / Example Books --- */
    .rbg-showcase {
        padding: 0.5rem 0;
    }

    .rbg-showcase-inner {
        gap: 1.5rem;
    }

    .rbg-books-grid {
        gap: 1.5rem 2rem;
    }

    .mini-book-3d {
        width: 90px;
        height: 130px;
    }

    .mini-title {
        font-size: 10px;
    }

    .mini-book-spine { width: 16px; left: -5px; }
    .mini-book-depth { width: 18px; right: -8px; }
    .mini-spine-indent { left: 10px; }

    /* --- Placeholder --- */
    .rbg-placeholder {
        height: 150px;
        border-radius: 1.5rem;
        padding: 1.5rem;
    }

    .rbg-placeholder-icon svg {
        width: 32px;
        height: 32px;
    }

    .rbg-placeholder-text {
        font-size: 0.85rem;
    }

    /* --- Download Button --- */
    .rbg-download-section {
        justify-content: center;
    }

    .rbg-download-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.6rem;
    }

    /* --- Book Container & Pages --- */
    .book-container {
        height: auto;
        min-height: 500px;
        perspective: 1500px;
    }

    .book-object {
        border-radius: 2px 8px 8px 2px;
        min-height: 500px;
    }

    .book-object::before {
        left: 12px;
        width: 3px;
    }

    /* --- Book Cover (mobile) --- */
    .book-cover {
        padding: 1.5rem 1rem;
        border-left-width: 10px;
    }

    .cover-content {
        margin-top: 3rem;
    }

    .cover-publisher {
        font-size: 0.5rem;
        letter-spacing: 0.25em;
        margin-bottom: 1.25rem;
    }

    .cover-title {
        font-size: 2rem;
        padding-bottom: 0.5rem;
    }

    .cover-divider {
        margin: 1.5rem auto 0;
    }

    .cover-footer {
        margin-bottom: 1rem;
    }

    .cover-author-label {
        font-size: 0.5rem;
    }

    .cover-author {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }

    /* --- Page View (mobile) --- */
    .page-view {
        padding: 1rem 0.75rem 5rem 1.25rem;
    }

    .page-view::after {
        width: 20px;
    }

    .page-content h2,
    #pageContent h2 {
        font-size: 1.35rem !important;
    }

    .page-content h3,
    #pageContent h3 {
        font-size: 1.1rem !important;
    }

    .page-content p,
    #pageContent p {
        font-size: 0.95rem !important;
        line-height: 1.75 !important;
        text-align: left !important;
    }

    .page-content ul,
    .page-content ol,
    #pageContent ul,
    #pageContent ol {
        font-size: 0.95rem !important;
        padding-left: 1.25rem !important;
    }

    .page-content blockquote,
    #pageContent blockquote {
        padding: 1rem 1.25rem !important;
        margin: 1.5rem 0 !important;
    }

    /* --- Navigation Buttons (mobile) --- */
    .nav-fab {
        width: 2.25rem;
        height: 2.25rem;
    }

    .nav-fab svg {
        width: 16px;
        height: 16px;
    }

    .nav-fab-left {
        left: 0.15rem;
    }

    .nav-fab-right {
        right: 0.15rem;
    }

    /* --- Bottom Navigation (mobile) --- */
    .book-nav-bottom {
        margin-top: 1rem;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .bnav-row {
        gap: 6px;
    }

    .bnav-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 3px;
        border-radius: 6px;
    }

    .bnav-btn svg {
        width: 14px;
        height: 14px;
    }

    .bnav-select {
        font-size: 12px;
        padding: 7px 8px;
    }

    .bnav-page {
        font-size: 10px;
    }

    /* --- Loading Overlay (mobile) --- */
    .rbg-loading-popup {
        padding: 32px 24px;
        margin: 0 16px;
        border-radius: 20px;
    }

    .rbg-loading-book-icon svg {
        width: 48px;
        height: 48px;
    }

    .rbg-loading-heading {
        font-size: 20px;
    }

    .rbg-loading-message {
        font-size: 13px;
    }

    /* --- Toast (mobile) --- */
    .rbg-toast {
        left: 1rem;
        right: 1rem;
        transform: translateY(-8rem);
        max-width: none;
        font-size: 0.8rem;
    }

    .rbg-toast.show {
        transform: translateY(0);
    }
}

/* Extra small phones */
@media (max-width: 400px) {
    .rbg-frontend-title {
        font-size: 1.4rem;
    }

    #commandInput {
        font-size: 0.9rem;
        min-height: 80px;
    }

    .mini-book-3d {
        width: 70px;
        height: 105px;
    }

    .mini-title {
        font-size: 8px;
    }

    .cover-title {
        font-size: 1.5rem;
    }

    .book-container {
        min-height: 400px;
    }

    .book-object {
        min-height: 400px;
    }

    .page-view {
        padding: 0.75rem 0.5rem 4rem 0.75rem;
    }

    .page-view::after {
        width: 10px;
    }

    .book-cover {
        padding: 1.25rem 0.75rem;
        border-left-width: 8px;
    }
}
