/* ============================================================================
   SayItColorIt / ColorMe — Cosmic Magic Playground Design System
   Hand-authored CSS. Dark-themed on index.html (app); light pages self-style.
   ============================================================================ */

/* ---------- 1. Tokens ---------- */
:root {
    --primary: #a855f7;
    --primary-glow: rgba(168, 85, 247, 0.55);
    --primary-2: #ec4899;

    --neon-cyan: #06f6ff;
    --neon-gold: #ffbe0b;
    --neon-magenta: #d946ef;
    --neon-violet: #7c3aed;

    --bg-deep: #0a041e;
    --bg-mid: #1a0a2e;

    --surface-light: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-strong: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);

    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.5);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 28px;

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 10px 40px rgba(168, 85, 247, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    --shadow-gold-glow: 0 10px 40px rgba(255, 190, 11, 0.4);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

a:hover {
    color: var(--text);
}

body.no-scroll,
html.no-scroll {
    overflow: hidden !important;
}

/* ---------- 3. Cosmic Background ---------- */
.app-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(ellipse at 20% 10%, #6c5ce7 0%, transparent 45%),
        radial-gradient(ellipse at 80% 20%, #ec4899 0%, transparent 45%),
        radial-gradient(ellipse at 60% 90%, #7c3aed 0%, transparent 50%),
        linear-gradient(180deg, #10012a 0%, #1a0a2e 45%, #2a0a3e 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%, 100% 100%;
    animation: cosmicShift 24s ease-in-out infinite alternate;
}

.app-bg::before,
.app-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.6;
    pointer-events: none;
}

.app-bg::before {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--neon-magenta), transparent 70%);
    top: -80px;
    left: -80px;
    animation: floatOrb 18s ease-in-out infinite;
}

.app-bg::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--neon-cyan), transparent 70%);
    bottom: -120px;
    right: -120px;
    opacity: 0.35;
    animation: floatOrb 22s ease-in-out infinite reverse;
}

@keyframes cosmicShift {
    0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
    100% { background-position: 100% 50%, 0% 50%, 30% 60%, 0 0; }
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(40px, 60px) scale(1.12); }
}

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
    mix-blend-mode: overlay;
}

/* ---------- 4. Layout ---------- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 28px 40px;
    position: relative;
    z-index: 1;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 4px 32px;
}

.logo {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
}

/* ---------- 5. Typography ---------- */
.heading-xl,
.heading-lg {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.heading-xl {
    font-size: clamp(2.4rem, 5.6vw, 4rem);
}

.heading-lg {
    font-size: clamp(1.6rem, 3.4vw, 2.25rem);
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(110deg, var(--neon-cyan) 0%, #b794f4 40%, var(--neon-magenta) 70%, var(--neon-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.gradient-gold {
    background: linear-gradient(120deg, #ffe066 0%, var(--neon-gold) 50%, #ff9e00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-muted      { color: var(--text-muted); }
.text-center     { text-align: center; }
.text-sm         { font-size: 0.88rem; }
.text-xs         { font-size: 0.76rem; }
.font-bold       { font-weight: 700; }
.font-semibold   { font-weight: 600; }
.font-medium     { font-weight: 500; }
.font-sans       { font-family: 'Inter', system-ui, sans-serif; }

.highlight {
    background: linear-gradient(110deg, var(--neon-cyan), var(--neon-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.effective-date {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ---------- 6. Utility ---------- */
.hidden          { display: none !important; }
.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;
}
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.mx-auto         { margin-left: auto; margin-right: auto; }
.max-w-md        { max-width: 28rem; }
.w-full          { width: 100%; }
.flex-1          { flex: 1 1 0%; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 28px; }

/* ---------- 7. Hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px 48px;
    position: relative;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
}

.hero-visual {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 8px auto 20px;
}

.hero-img-card {
    width: 160px;
    height: 200px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.hero-img-card:hover {
    box-shadow: 0 25px 70px rgba(168, 85, 247, 0.45);
}

.hero-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- 8. Glass & Surfaces ---------- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
}

.glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%);
    pointer-events: none;
    opacity: 0.7;
}

.section {
    padding: 32px 40px;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.info-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-muted);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.info-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-weight: 600;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px 8px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text);
}

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(255, 190, 11, 0.15), rgba(255, 190, 11, 0.05));
    border: 1px solid rgba(255, 190, 11, 0.35);
    border-radius: 999px;
    color: var(--neon-gold);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 6px 20px rgba(255, 190, 11, 0.15);
}

.credit-badge i { font-size: 1.05rem; }

/* ---------- 9. Buttons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    outline: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    color: var(--text);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 10px 40px rgba(168, 85, 247, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 55%, #f472b6 100%);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 50px rgba(236, 72, 153, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    padding: 10px 14px;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---------- 10. Omni Bar (prompt input) ---------- */
.omni-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.omni-bar-wrap:focus-within {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.18), 0 10px 40px rgba(168, 85, 247, 0.25);
}

.nudge-glow {
    animation: nudgePulse 3.2s ease-in-out infinite;
}

@keyframes nudgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
    50%      { box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.16), 0 10px 36px rgba(236, 72, 153, 0.18); }
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
    font-size: 1.05rem;
    line-height: 1.5;
    resize: none;
    padding: 10px 6px;
    max-height: 160px;
    min-height: 48px;
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.mic-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.5);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.mic-btn:hover { transform: scale(1.05); }
.mic-btn:active { transform: scale(0.96); }

.mic-btn.listening {
    background: linear-gradient(135deg, #ef4444, #ec4899);
    animation: micPulse 1.2s ease-out infinite;
}

@keyframes micPulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6), 0 8px 24px rgba(239, 68, 68, 0.5); }
    70%  { box-shadow: 0 0 0 18px rgba(239, 68, 68, 0), 0 8px 24px rgba(239, 68, 68, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 8px 24px rgba(239, 68, 68, 0.5); }
}

.voice-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* ---------- 11. Forms ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-family: inherit;
}

/* ---------- 12. Pricing Cards ---------- */
.pricing-card {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius-lg);
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.pricing-card:hover {
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.pricing-card.popular {
    transform: scale(1.03);
    border-color: rgba(255, 190, 11, 0.5);
    background: linear-gradient(135deg, rgba(255, 190, 11, 0.12), rgba(255, 158, 0, 0.05));
    box-shadow: 0 12px 40px rgba(255, 190, 11, 0.22);
}

.pricing-card.popular:hover {
    transform: scale(1.04) translateY(-2px);
}

.popular-tag {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(120deg, var(--neon-gold), #ff9e00);
    color: #1a0a2e;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-gold-glow);
}

/* ---------- 13. Modals ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 5, 30, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.25s var(--ease);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 28px;
    background: linear-gradient(160deg, rgba(42, 18, 70, 0.92), rgba(18, 8, 38, 0.92));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    animation: modalRise 0.32s var(--ease);
}

.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.img-modal-content {
    max-width: 900px;
    padding: 20px;
    background: rgba(10, 5, 30, 0.95);
}

.img-modal-content img {
    max-width: 100%;
    max-height: 75vh;
    margin: 0 auto;
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.img-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

@keyframes modalRise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 14. Book Spread (coloring page display) ---------- */
.book-spread {
    gap: 16px;
    min-height: 480px;
}

.book-page {
    flex: 1 1 0;
    min-width: 0;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.book-page.page-left  { transform: rotateY(1.5deg); transform-origin: right center; }
.book-page.page-right { transform: rotateY(-1.5deg); transform-origin: left center; }

.book-page img {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    cursor: zoom-in;
    border-radius: 6px;
    flex: 1 1 auto;
    background: #fafafa;
}

.book-page-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(100, 100, 130, 0.35);
    border-radius: 8px;
    color: #94a3b8;
    font-weight: 500;
    min-height: 420px;
    background: repeating-linear-gradient(
        45deg,
        #f8fafc,
        #f8fafc 12px,
        #f1f5f9 12px,
        #f1f5f9 24px
    );
}

.book-page-empty::before {
    content: '✨';
    font-size: 2.2rem;
    margin-right: 8px;
}

/* ---------- 15. Dino + Bunny Loader ---------- */
.dino-bunny-loader {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 32px;
}

.dino,
.bunny {
    position: absolute;
    font-size: 1.4rem;
    line-height: 1;
    bottom: 0;
}

.dino {
    left: 0;
    animation: dinoRun 0.5s ease-in-out infinite alternate;
}

.bunny {
    right: 0;
    animation: bunnyHop 0.9s ease-in-out infinite, bunnyDart 2.4s ease-in-out infinite;
}

@keyframes dinoRun {
    from { transform: translateY(0) rotate(-3deg); }
    to   { transform: translateY(-6px) rotate(3deg); }
}

@keyframes bunnyHop {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes bunnyDart {
    0%, 100% { right: 0; }
    50%      { right: 34px; }
}

/* ---------- 16. Banners & Disclosure ---------- */
.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08));
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: var(--radius-md);
    color: #fecaca;
    font-weight: 500;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link::before {
    content: '←';
    transition: transform 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.back-link:hover::before {
    transform: translateX(-3px);
}

.disclosure {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.disclosure summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    list-style: none;
}

.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.2s;
}

.disclosure[open] summary::before {
    transform: rotate(90deg);
}

/* ---------- 17. Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s var(--ease) both;
}

/* ---------- 18. Responsive ---------- */
@media (max-width: 768px) {
    .app-container { padding: 16px 16px 32px; }
    .app-header { padding-bottom: 20px; }
    .logo { font-size: 1.35rem; }

    .hero { padding: 20px 4px 32px; }
    .heading-xl { font-size: clamp(2rem, 9vw, 2.75rem) !important; }

    .hero-visual { gap: 0; }
    .hero-img-card { width: 120px !important; height: 150px !important; }

    .section { padding: 20px 18px; }
    .omni-bar-wrap { padding: 8px 8px 8px 10px; }
    .input-field { font-size: 1rem; }

    .pricing-card { flex-direction: column; align-items: stretch; text-align: center; padding: 16px; }
    .pricing-card.popular { transform: none; }
    .pricing-card.popular:hover { transform: translateY(-2px); }

    .book-spread { flex-direction: column; }
    .book-page { min-height: 320px; }

    .modal-content { padding: 24px 18px; }
    .img-modal-actions { flex-direction: column; }
    .img-modal-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .hero-img-card:nth-child(3) { display: none; }
}

/* ---------- 19. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .app-bg,
    .app-bg::before,
    .app-bg::after {
        animation: none !important;
    }
}

/* ---------- 20. Light-page safety (purchase-credits.html, etc.) ---------- */
/* Those pages set body.bg-gray-100. Provide minimal neutral overrides. */
body.bg-gray-100 {
    background: #f3f4f6;
    color: #111827;
}

body.bg-gray-100 .container {
    max-width: 1100px;
    margin: 0 auto;
}

body.bg-gray-100 a { color: #6d28d9; }
body.bg-gray-100 .back-link { color: #475569; }
body.bg-gray-100 .back-link:hover { color: #111827; }

/* ---------- 21. Creator actions + Build a Scene ---------- */
.creator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.creator-idea-btn { flex: 1 1 0%; padding: 18px; }

.creator-go-btn {
    flex: 2 1 0%;
    font-size: 1.15rem;
    padding: 18px;
}

.scene-builder {
    margin: 4px 0 20px;
    padding: 16px 18px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.scene-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-progress {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--neon-gold);
}

.scene-question {
    margin: 2px 0 14px;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    outline: none;
}

.scene-choices {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.scene-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding: 10px 6px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
    font: 600 0.88rem/1.2 'Inter', system-ui, sans-serif;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.scene-chip:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-2px);
}

.scene-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.scene-chip[aria-pressed="true"] {
    border-color: var(--neon-gold);
    background: rgba(255, 190, 11, 0.16);
    box-shadow: 0 0 0 3px rgba(255, 190, 11, 0.25);
}

.scene-emoji { font-size: 2rem; line-height: 1; }

.scene-own {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 6px 6px 6px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xl);
}

.scene-own:focus-within { border-color: rgba(168, 85, 247, 0.55); }

.scene-mic {
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
}

.scene-own-input {
    min-height: 40px;
    padding: 6px;
    font-size: 1rem;
}

.scene-so-far {
    min-height: 1.5em;
    margin: 12px 0 0;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.scene-nav {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.scene-nav .btn { flex: 1 1 0%; }

@media (max-width: 640px) {
    .creator-idea-btn {
        flex: 1 1 calc(50% - 6px);
        padding: 14px 8px;
        font-size: 0.95rem;
    }

    .creator-go-btn { flex: 1 1 100%; }

    .scene-builder { padding: 14px 10px 16px; }

    .scene-question { font-size: 1.35rem; }

    .scene-choices { gap: 8px; }

    .scene-chip {
        min-height: 76px;
        padding: 8px 2px;
        font-size: 0.74rem;
    }

    .scene-emoji { font-size: 1.7rem; }
}
