/* ═══════════════════════════════════════════════════════════════════════════════
   KUENTRIX — Design System v2
   Warm, playful & modern educational platform
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    /* Primary - Teal/Cyan (professional but friendly) */
    --primary:      #0b7285;
    --primary-light: #6366f1;
    --primary-dark:  #065a6b;
    /* Accent - Green (growth, success) */
    --accent:       #0ea5e9;
    --accent-light: #38bdf8;
    --accent-dark:  #0284c7;
    /* Warm - Orange/Amber (playful accents) */
    --warm:         #f59e0b;
    --warm-light:   #fbbf24;
    --warm-dark:    #c2410c;
    /* Legacy aliases for backwards compatibility */
    --orange:       #f59e0b;
    --orange-light: #fbbf24;
    --orange-dark:  #c2410c;
    --teal:         #0b7285;
    --teal-light:   #6366f1;
    --teal-dark:    #065a6b;
    --yellow:       #f59e0b;
    --yellow-light: #fff7ed;
    --coral:        #ef4444;
    --coral-light:  #fca5a5;
    --pink:         #8b5cf6;
    --green:        #6366f1;
    --green-light:  #a5b4fc;
    --blue:         #0ea5e9;
    --blue-light:   #7dd3fc;
    --purple:       #8b5cf6;
    --purple-light: #a78bfa;
    /* Neutrals */
    --dark:         #0f172a;
    --gray:         #475569;
    --gray-light:   #94a3b8;
    --gray-lighter: #e2e8f0;
    --bg:           #f8fafc;
    --white:        #ffffff;
    /* Gradients - New teal-based scheme */
    --gradient-hero:    linear-gradient(135deg, #0b7285 0%, #6366f1 58%, #8b5cf6 100%);
    --gradient-primary: linear-gradient(135deg, #0b7285 0%, #6366f1 100%);
    --gradient-teal:    linear-gradient(135deg, #0b7285 0%, #0ea5e9 100%);
    --gradient-warm:    linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-sunset:  linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
    --gradient-card:    linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-accent:  linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    /* Shadows - Updated for teal */
    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:    0 4px 14px rgba(0, 0, 0, 0.07);
    --shadow-lg:    0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl:    0 20px 50px rgba(0, 0, 0, 0.14);
    --shadow-glow:  0 0 30px rgba(11, 114, 133, 0.25);
    --shadow-teal:  0 8px 25px rgba(11, 114, 133, 0.2);
    --shadow-coral: 0 8px 25px rgba(239, 68, 68, 0.2);
    /* Radii */
    --radius-sm:    8px;
    --radius-md:    12px;
    --radius-lg:    16px;
    --radius-xl:    24px;
    --radius-pill:  50px;
    --radius-round: 50%;
    /* Typography */
    --font-primary:  'Manrope', 'Segoe UI', sans-serif;
    --font-display:  'Sora', 'Manrope', sans-serif;
    /* Transitions */
    --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce:       all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

*, *::before, *::after { box-sizing: border-box; }

/* iOS/Mobile: Disable tap highlight and prevent zoom */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

body {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

body {
    font-family: var(--font-primary);
    background: var(--bg);
    color: var(--dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}
h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.35rem; }

p { line-height: 1.7; color: var(--gray); }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }

/* ── Navbar ── */
.t4k-navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(11, 114, 133, 0.12);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}
.t4k-navbar.navbar-transparent { background: transparent; backdrop-filter: none; border-bottom: none; }
.t4k-navbar .container { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.t4k-logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--dark); text-decoration: none !important; }
.t4k-logo:hover { color: var(--dark); transform: scale(1.03); }
.t4k-logo .kx-k { color: var(--primary); }
.t4k-logo-icon { font-size: 1.8rem; animation: float 3s ease-in-out infinite; }

.t4k-nav-links { display: flex; align-items: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.t4k-nav-link { padding: 0.5rem 1rem; border-radius: var(--radius-pill); font-weight: 700; font-size: 0.9rem; color: var(--gray); transition: var(--bounce); text-decoration: none !important; }
.t4k-nav-link i { margin-right: 0.15rem; font-size: 0.85em; width: 1.1em; text-align: center; }
.t4k-nav-link:hover { color: var(--primary); background: rgba(11, 114, 133, 0.08); transform: translateY(-1px); }

.t4k-menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; color: var(--orange); }

/* ── Buttons ── */
.btn-magic { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 2rem; border: none; border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: 700; font-size: 1rem; cursor: pointer; transition: var(--bounce); text-decoration: none !important; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn-magic::after { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; background: rgba(255, 255, 255, 0.2); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.6s, height 0.6s; }
.btn-magic:active::after { width: 300px; height: 300px; }
.btn-magic:hover { transform: translateY(-3px); text-decoration: none !important; }
.btn-magic:active { transform: translateY(-1px); }

.btn-primary-magic { background: var(--gradient-primary); color: white; box-shadow: var(--shadow-md); }
.btn-primary-magic:hover { box-shadow: var(--shadow-lg); color: white; }
.btn-secondary-magic { background: white; color: var(--orange); border: 2px solid var(--orange-light); box-shadow: var(--shadow-sm); }
.btn-secondary-magic:hover { background: var(--orange); color: white; border-color: var(--orange); box-shadow: var(--shadow-md); }
.btn-teal-magic { background: var(--gradient-teal); color: white; box-shadow: var(--shadow-teal); }
.btn-teal-magic:hover { box-shadow: 0 12px 35px rgba(6, 182, 212, 0.3); color: white; }
.btn-coral-magic { background: var(--gradient-warm); color: white; box-shadow: var(--shadow-coral); }
.btn-coral-magic:hover { box-shadow: 0 12px 35px rgba(239, 68, 68, 0.3); color: white; }
.btn-hero-primary { background: linear-gradient(135deg, #0b7285 0%, #6366f1 100%); color: white !important; box-shadow: 0 8px 25px rgba(11, 114, 133, 0.35); }
.btn-hero-primary:hover { box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45); color: white !important; background: linear-gradient(135deg, #0a6678 0%, #8b5cf6 100%); }
.btn-hero-secondary { background: rgba(255, 255, 255, 0.2); color: white !important; border: 2px solid rgba(255, 255, 255, 0.35); backdrop-filter: blur(8px); }
.btn-hero-secondary:hover { background: rgba(255, 255, 255, 0.3); color: white !important; border-color: rgba(255, 255, 255, 0.55); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.15rem; }
    .t4k-child-meta-row {
        margin: 0.25rem 0 0.65rem;
    }
    .t4k-child-last-played {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        color: var(--gray);
        font-size: 0.78rem;
        font-weight: 600;
    }

/* ── Cards ── */
.t4k-card { background: var(--gradient-card); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-md); transition: var(--bounce); border: 1px solid rgba(14, 165, 233, 0.06); position: relative; overflow: hidden; }
.t4k-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gradient-primary); opacity: 0; transition: opacity 0.3s ease; }
.t4k-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.t4k-card:hover::before { opacity: 1; }
.t4k-card-icon { width: 68px; height: 68px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.65rem; margin-bottom: 1.25rem; transition: var(--transition); }
.t4k-card:hover .t4k-card-icon { transform: scale(1.08); }
.t4k-card-icon.purple { background: rgba(14, 165, 233, 0.1); color: var(--orange); }
.t4k-card-icon.teal { background: rgba(99, 102, 241, 0.1); color: var(--teal-dark); }
.t4k-card-icon.coral { background: rgba(239, 68, 68, 0.1); color: var(--coral); }
.t4k-card-icon.yellow { background: rgba(245, 158, 11, 0.15); color: #c2410c; }
.t4k-card-icon.pink { background: rgba(236, 72, 153, 0.1); color: var(--pink); }
.t4k-card-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.t4k-card-icon i { font-size: inherit; }
.t4k-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.t4k-card p { font-size: 0.95rem; margin-bottom: 0; }

/* ── Forms ── */
.t4k-form-group { margin-bottom: 1.5rem; }
.t4k-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--dark); margin-bottom: 0.5rem; }
.t4k-input { width: 100%; padding: 0.85rem 1.25rem; border: 2px solid var(--gray-lighter); border-radius: var(--radius-md); font-family: var(--font-primary); font-size: 1rem; font-weight: 600; color: var(--dark); background: var(--white); transition: var(--transition); outline: none; }
.t4k-input::placeholder { color: var(--gray-light); font-weight: 400; }
.t4k-input:focus { border-color: var(--orange-light); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }
.t4k-input.input-error { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1); }
.t4k-input-code { text-align: center; font-size: 2rem; letter-spacing: 1rem; font-weight: 800; padding: 1rem; }
.t4k-error { color: var(--coral); font-size: 0.85rem; font-weight: 600; margin-top: 0.35rem; }

/* ── Hero ── */
.t4k-hero { background: var(--gradient-hero); min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 2rem; }
.t4k-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 70%); }
.t4k-hero-content { text-align: center; color: white; position: relative; z-index: 2; max-width: 800px; }
.t4k-hero-topbar { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 900px; margin: 0 auto 2rem; padding: 0 1rem; }
.t4k-hero-login-link { color: rgba(255,255,255,0.9); font-weight: 600; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: var(--radius-md); background: rgba(255,255,255,0.1); backdrop-filter: blur(8px); transition: var(--transition); border: 1px solid rgba(255,255,255,0.15); }
.t4k-hero-login-link:hover { background: rgba(255,255,255,0.2); color: white; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.t4k-hero-title { font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; color: white; margin-bottom: 0.5rem; text-shadow: 0 4px 20px rgba(0,0,0,0.15); animation: slideUp 0.8s ease-out; }
.t4k-hero-subtitle { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; color: rgba(255,255,255,0.92); margin-bottom: 2.5rem; line-height: 1.6; animation: slideUp 0.8s ease-out 0.15s both; }
.t4k-hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; animation: slideUp 0.8s ease-out 0.3s both; }
.t4k-hero-buttons .btn-magic { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* ── Stars & Clouds ── */
.t4k-stars { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
/* Stars with FA icons */
.t4k-star { position: absolute; animation: twinkle 3s ease-in-out infinite; opacity: 0.6; color: rgba(255,255,255,0.7); }
.t4k-star i { font-size: inherit; }
.t4k-star:nth-child(1) { top: 12%; left: 8%; animation-delay: 0s; font-size: 1.2rem; }
.t4k-star:nth-child(2) { top: 18%; right: 12%; animation-delay: 0.5s; font-size: 1.8rem; }
.t4k-star:nth-child(3) { top: 35%; left: 5%; animation-delay: 1s; font-size: 1rem; }
.t4k-star:nth-child(4) { top: 60%; right: 8%; animation-delay: 1.5s; font-size: 1.4rem; }
.t4k-star:nth-child(5) { bottom: 20%; left: 15%; animation-delay: 0.8s; font-size: 1.6rem; }
.t4k-star:nth-child(6) { bottom: 30%; right: 20%; animation-delay: 2s; font-size: 1.1rem; }
.t4k-star:nth-child(7) { top: 45%; left: 20%; animation-delay: 0.3s; font-size: 0.9rem; }
.t4k-star:nth-child(8) { top: 75%; right: 30%; animation-delay: 1.2s; font-size: 1.3rem; }
.t4k-cloud { position: absolute; font-size: 3rem; opacity: 0.12; animation: floatCloud 20s linear infinite; color: rgba(255,255,255,0.6); }
.t4k-cloud:nth-child(1) { top: 15%; animation-delay: 0s; font-size: 4rem; }
.t4k-cloud:nth-child(2) { top: 55%; animation-delay: -8s; font-size: 3rem; }
.t4k-cloud:nth-child(3) { top: 35%; animation-delay: -15s; font-size: 3.5rem; }

/* ── Sections ── */
.t4k-section { padding: 5rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.t4k-section-header { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 3.5rem; }
.t4k-section-header h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
.t4k-section-header p { font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

.t4k-badge { display: inline-block; padding: 0.35rem 1rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.t4k-badge.purple { background: rgba(14, 165, 233, 0.1); color: var(--orange); }
.t4k-badge.teal { background: rgba(99, 102, 241, 0.1); color: var(--teal-dark); }

.t4k-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.75rem; }

/* ── Steps ── */
.t4k-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; counter-reset: step; }
.t4k-step { text-align: center; padding: 2rem 1.5rem; }
.t4k-step-number { width: 56px; height: 56px; border-radius: var(--radius-round); background: var(--gradient-primary); color: white; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem; box-shadow: var(--shadow-md); }
.t4k-step-icon { font-size: 2.5rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: center; color: var(--orange); }
.t4k-step-icon i { font-size: inherit; }
.t4k-step h4 { margin-bottom: 0.5rem; }

/* ── Auth ── */
.t4k-auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gradient-hero); padding: 2rem; position: relative; overflow: hidden; }
.t4k-auth-card { background: white; border-radius: var(--radius-xl); padding: 2.5rem; width: 100%; max-width: 440px; box-shadow: var(--shadow-xl); position: relative; z-index: 2; animation: scaleIn 0.5s ease-out; }
.t4k-auth-header { text-align: center; margin-bottom: 2rem; }
.t4k-auth-header .t4k-logo { justify-content: center; font-size: 1.8rem; margin-bottom: 1rem; }
.t4k-auth-header h2 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.t4k-auth-header p { font-size: 0.95rem; }
.t4k-auth-footer { text-align: center; margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-lighter); }
.t4k-auth-footer a { font-weight: 700; }

.t4k-code-container { text-align: center; margin: 2rem 0; }
.t4k-email-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(14, 165, 233, 0.08); padding: 0.5rem 1rem; border-radius: var(--radius-pill); font-weight: 700; color: var(--orange); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Dashboard ── */
.t4k-dashboard { padding: 2.5rem 2rem; max-width: 1200px; margin: 0 auto; }
.t4k-welcome-banner { 
    background: var(--gradient-sunset); 
    border-radius: var(--radius-xl); 
    padding: 2.5rem 2rem; 
    color: white; 
    margin-bottom: 2.5rem; 
    position: relative; 
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.2);
}
.t4k-welcome-banner::before { content: ''; position: absolute; right: -30px; top: -30px; width: 180px; height: 180px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.t4k-welcome-banner::after { content: ''; position: absolute; right: 80px; bottom: -40px; width: 120px; height: 120px; background: rgba(255,255,255,0.05); border-radius: 50%; }
.t4k-welcome-banner h2 { color: white; margin-bottom: 0.5rem; position: relative; z-index: 1; font-size: 1.8rem; }
.t4k-welcome-banner p { color: rgba(255,255,255,0.9); font-size: 1.1rem; position: relative; z-index: 1; max-width: 600px; }
.t4k-welcome-eyebrow { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.16); color: rgba(255,255,255,0.95); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 0.8rem; position: relative; z-index: 1; }
.t4k-welcome-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; position: relative; z-index: 1; }
.t4k-welcome-pill { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.2); color: #fff; border-radius: 999px; padding: 0.45rem 0.85rem; font-size: 0.8rem; font-weight: 700; }
.t4k-children-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; grid-auto-rows: 1fr; }
.t4k-child-card { 
    background: #ffffff; 
    border-radius: var(--radius-xl); 
    padding: 1.25rem 1.5rem; 
    min-height: 120px; 
    display: flex; 
    align-items: center; 
    gap: 1.25rem; 
    text-align: left; 
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.06), 0 1px 3px rgba(0,0,0,0.03); 
    transition: var(--bounce); 
    border: 1.5px solid rgba(0, 0, 0, 0.05); 
    cursor: pointer; 
    position: relative; 
    overflow: hidden; 
}
.t4k-child-card.t4k-child-boy { 
    background: linear-gradient(135deg, #ffffff 0%, #EFF6FF 60%, #DBEAFE 100%); 
    border-color: rgba(99, 140, 230, 0.1); 
}
.t4k-child-card.t4k-child-girl { 
    background: linear-gradient(135deg, #ffffff 0%, #FDF2F8 60%, #FCE7F3 100%); 
    border-color: rgba(230, 99, 150, 0.1); 
}
.t4k-child-card.t4k-child-boy::before { background: linear-gradient(180deg, #6c9ce7, #a0c4f7); }
.t4k-child-card.t4k-child-girl::before { background: linear-gradient(180deg, #e76c9c, #f7a0c4); }
.t4k-child-card::before { 
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    bottom: 0; 
    width: 4px; 
    background: var(--gradient-sunset); 
    transition: width 0.3s ease; 
    border-radius: var(--radius-xl) 0 0 var(--radius-xl); 
}
.t4k-child-card::after { 
    content: ''; 
    position: absolute; 
    top: -50px; 
    right: -50px; 
    width: 120px; 
    height: 120px; 
    background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%); 
    border-radius: 50%; 
    pointer-events: none;
}
.t4k-child-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 8px 28px rgba(14, 165, 233, 0.12), 0 2px 6px rgba(0,0,0,0.04); 
    border-color: rgba(14, 165, 233, 0.15); 
}
.t4k-child-card:hover::before { width: 5px; }
.t4k-child-avatar { 
    width: 72px; 
    height: 72px; 
    min-width: 72px; 
    border-radius: var(--radius-round); 
    background: var(--gradient-primary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 2.2rem; 
    margin: 0; 
    box-shadow: 0 4px 14px rgba(11, 114, 133, 0.2), inset 0 0 0 3px rgba(255,255,255,0.5);
    transition: var(--bounce);
}
.t4k-child-avatar-icon {
    color: white;
}
.t4k-child-avatar-icon i {
    font-size: 1.8rem;
}
.t4k-child-avatar-img {
    padding: 0;
    overflow: hidden;
}
.t4k-child-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.t4k-child-body {
    flex: 1;
    min-width: 0;
}
.t4k-child-card:hover .t4k-child-avatar { transform: scale(1.08); }
.t4k-child-card h4 { 
    font-size: 1.1rem; 
    font-weight: 800; 
    color: var(--dark); 
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.t4k-add-child-card { border: 2px dashed var(--gray-lighter); background: linear-gradient(145deg, #F8FAFC 0%, #F1F5F9 100%); box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100px; color: var(--gray-light); transition: var(--bounce); text-align: center; gap: 0.25rem; padding: 1.5rem; }
.t4k-add-child-card::before { display: none; }
.t4k-add-child-card::after { display: none; }
.t4k-add-child-card:hover { border-color: var(--primary-light); color: var(--primary); background: rgba(11, 114, 133, 0.04); box-shadow: 0 8px 28px rgba(11, 114, 133, 0.12); transform: translateY(-5px); }
.t4k-add-child-card .add-icon { width: 48px; height: 48px; border-radius: var(--radius-round); background: linear-gradient(135deg, var(--gray-lighter) 0%, #E2E8F0 100%); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 0.25rem; transition: var(--bounce); }
.t4k-add-child-card:hover .add-icon { background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(162, 155, 254, 0.15) 100%); transform: scale(1.1); }

/* ── Footer ── */
.t4k-footer { background: var(--dark); color: rgba(255,255,255,0.7); padding: 3rem 1.5rem 1.5rem; margin-top: auto; }
.t4k-footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 2rem; }
.t4k-footer .t4k-logo { color: white; font-size: 1.3rem; }
.t4k-footer-links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; flex: 1; max-width: 700px; }
.t4k-footer-col h4 { color: white; font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.75rem; font-weight: 700; }
.t4k-footer-col h4 i { margin-right: 0.5rem; color: var(--orange-light); font-size: 0.85em; }
.t4k-footer-col ul { list-style: none; padding: 0; margin: 0; }
.t4k-footer-col li { margin-bottom: 0.5rem; }
.t4k-footer-links { display: flex; flex-direction: column; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.t4k-footer-links a { color: rgba(255,255,255,0.6); font-size: 0.9rem; font-weight: 600; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.4rem; }
.t4k-footer-links a:hover { color: var(--yellow); transform: translateX(3px); }
.t4k-footer-links a i { font-size: 0.85em; width: 1.2em; text-align: center; opacity: 0.7; }
.t4k-footer-copy { width: 100%; text-align: center; padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.t4k-footer-copy i { margin-left: 0.25rem; color: var(--orange-light); }

/* ── Landing Footer (compact) ── */
.t4k-landing-footer { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); padding: 2rem 1rem 1.5rem; }
.t4k-landing-footer-content { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.t4k-landing-footer-brand { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 700; color: white; }
.t4k-landing-footer-brand .t4k-logo-icon { background: var(--gradient-primary); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.3rem; }
.t4k-landing-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }
.t4k-landing-footer-links a { color: rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 500; transition: var(--transition); }
.t4k-landing-footer-links a:hover { color: var(--yellow); }
.t4k-landing-footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin-top: 0.5rem; }
.t4k-landing-footer-copy i { color: var(--orange-light); margin-left: 0.25rem; }
@media (max-width: 600px) {
    .t4k-landing-footer-links { flex-direction: column; gap: 0.75rem; }
}

/* ── Alerts ── */
.t4k-alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
.t4k-alert-success { background: rgba(16, 185, 129,0.1); color: var(--green); border: 1px solid rgba(16, 185, 129,0.2); }
.t4k-alert-error { background: rgba(239, 68, 68,0.1); color: var(--coral); border: 1px solid rgba(239, 68, 68,0.2); }
.t4k-alert-info { background: rgba(14, 165, 233,0.08); color: var(--orange); border: 1px solid rgba(14, 165, 233,0.15); }
.t4k-alert-warning { background: rgba(255,193,7,0.15); color: #856404; border: 1px solid rgba(255,193,7,0.3); }

/* ── CTA Section ── */
.t4k-cta-section { background: var(--gradient-primary); border-radius: var(--radius-xl); padding: 4rem 2rem; text-align: center; color: white; margin: 2rem auto; max-width: 1100px; position: relative; overflow: hidden; }
.t4k-cta-section.t4k-cta-fullwidth { margin-bottom: 0; border-radius: 0; max-width: 100%; }
.t4k-cta-section::before { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.t4k-cta-section::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 200px; height: 200px; background: rgba(255,255,255,0.06); border-radius: 50%; }
.t4k-cta-section h2 { color: white; font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.75rem; position: relative; z-index: 1; }
.t4k-cta-section p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.t4k-cta-section .btn-magic { position: relative; z-index: 1; display: inline-flex; width: auto; }
.t4k-cta-login-link { font-size: 0.85rem !important; margin-top: 1rem !important; margin-bottom: 0 !important; opacity: 0.8; }
.t4k-cta-login-link a { color: white; text-decoration: underline; }

/* ── Animations ── */
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%, 100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes floatCloud { from { left: -20%; } to { left: 120%; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.animate-on-scroll { opacity: 0; animation: fadeInUp 0.6s ease-out forwards; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-purple { color: var(--orange); }
.text-teal { color: var(--teal); }
.text-coral { color: var(--coral); }
.text-gray { color: var(--gray); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }

.t4k-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: white; animation: spin 0.6s linear infinite; }

/* ── Validation ── */
.field-validation-error { color: var(--coral); font-size: 0.85rem; font-weight: 600; margin-top: 0.35rem; display: block; }
.input-validation-error { border-color: var(--coral) !important; box-shadow: 0 0 0 4px rgba(239, 68, 68,0.1) !important; }
.validation-summary-errors ul { list-style: none; padding: 0; margin: 0; }
.validation-summary-errors { background: rgba(239, 68, 68,0.08); border: 1px solid rgba(239, 68, 68,0.2); border-radius: var(--radius-md); padding: 1rem; color: var(--coral); font-weight: 600; font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .t4k-menu-toggle { display: block; }
    .t4k-nav-links { 
        display: none; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        right: 0; 
        background: white; 
        flex-direction: column; 
        align-items: stretch;
        padding: 0.5rem 0.75rem 0.75rem; 
        box-shadow: var(--shadow-lg); 
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        gap: 0.15rem;
    }
    .t4k-nav-links.active { display: flex; }
    .t4k-nav-links .t4k-nav-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 0.65rem 1rem;
        border-radius: var(--radius-md);
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--dark);
        background: transparent;
        transition: background 0.2s, color 0.2s;
    }
    .t4k-nav-links .t4k-nav-link i {
        width: 1.25rem;
        margin-right: 0.65rem;
        font-size: 0.95rem;
        text-align: center;
        color: var(--orange);
    }
    .t4k-nav-links .t4k-nav-link:hover,
    .t4k-nav-links .t4k-nav-link:active {
        background: rgba(14, 165, 233, 0.08);
        color: var(--orange);
    }
    .t4k-nav-links .btn-magic {
        margin-top: 0.5rem;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        align-self: center;
    }
    .t4k-hero-buttons { flex-direction: column; align-items: center; }
    .t4k-hero-buttons .btn-magic { width: 100%; max-width: 300px; }
    .t4k-section { padding: 3rem 1rem; }
    .t4k-auth-card { padding: 2rem 1.5rem; }
    .t4k-welcome-banner::after { display: none; }
    .t4k-footer-content { flex-direction: column; text-align: center; gap: 1.5rem; }
    .t4k-footer-links-grid { grid-template-columns: repeat(2, 1fr); text-align: left; gap: 1.5rem; max-width: 100%; }
    .t4k-footer-col:last-child { grid-column: span 2; text-align: center; }
    .t4k-footer-col:last-child ul { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.5rem; }
    .t4k-footer-col h4 { font-size: 0.9rem; margin-bottom: 0.5rem; }
    .t4k-footer-links a { font-size: 0.85rem; }
    .t4k-form-row { grid-template-columns: 1fr; }
    .t4k-stats-row { grid-template-columns: repeat(2, 1fr); }
    .t4k-child-profile-banner { flex-direction: column; text-align: center; }
    .t4k-player-header { 
        display: flex !important;
        flex-wrap: wrap !important; 
        gap: 0.2rem; 
        padding: 0.25rem 0.6rem; 
        align-items: center;
        background: rgba(255,255,255,0.95) !important;
    }
    .t4k-player-title { 
        order: 10 !important; 
        flex: 0 0 100% !important;
        width: 100% !important;
        font-size: 0.75rem; 
        max-width: none; 
        justify-content: center; 
        text-align: center;
        padding-top: 0.15rem; 
        border-top: none; 
        margin-top: 0.1rem;
        background: rgba(255,255,255,0.6) !important;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        margin-left: -0.6rem;
        margin-right: -0.6rem;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        padding-bottom: 0.15rem;
    }
    .t4k-player-controls { order: 2; margin-left: auto; }
    .t4k-player-exit { order: 1; }
    .t4k-player-progress-bar { width: 50px; }
    .t4k-player-exit, .t4k-audio-toggle, .t4k-skip-btn { width: 28px; height: 28px; font-size: 0.75rem; }
    .t4k-player-progress-text { font-size: 0.7rem; }
     .t4k-features-grid { grid-template-columns: 1fr; gap: 1rem; }
     .t4k-steps { grid-template-columns: 1fr; gap: 1rem; }
     .t4k-card { padding: 1.25rem; margin-bottom: 0.5rem; }
     .t4k-step { padding: 1.25rem 0.75rem; }
     .t4k-children-grid { grid-template-columns: 1fr; gap: 1rem; }
     .t4k-child-card { padding: 1rem 1.25rem; margin-bottom: 0.5rem; }
     .t4k-welcome-banner { padding: 1.25rem; font-size: 1rem; }
     .t4k-welcome-banner h2 { font-size: 1.35rem; }
     .t4k-welcome-banner p { font-size: 0.92rem; }
     .t4k-welcome-pills { gap: 0.45rem; }
     .t4k-welcome-pill { font-size: 0.72rem; padding: 0.35rem 0.65rem; }
     .t4k-section-header { 
         flex-direction: column; 
         align-items: center; 
         gap: 1rem; 
         text-align: center;
         padding: 1.5rem 0.5rem;
         margin-bottom: 1.5rem;
     }
     .t4k-section-header h3 { 
         justify-content: center;
         font-size: 1.25rem;
     }
     .t4k-stats-row { margin-bottom: 1rem; gap: 1.5rem; }
     .t4k-stat-circle { width: 76px; height: 76px; }
     .t4k-stat-circle .t4k-stat-number { font-size: 1.25rem; }
     .t4k-stat-bubble .t4k-stat-label { font-size: 0.72rem; }
     .t4k-cta-section { padding: 2rem 1rem; border-radius: var(--radius-lg); }
     .t4k-hero-title { font-size: 2rem; }
     .t4k-hero-subtitle { font-size: 1rem; }
     .t4k-badge { font-size: 0.75rem; padding: 0.25rem 0.75rem; }
     .t4k-section-header h2 { font-size: 1.3rem; }
     .t4k-section-header p { font-size: 1rem; }
     .t4k-step h4 { font-size: 1rem; }
     .t4k-step p { font-size: 0.9rem; }
     .t4k-card h3 { font-size: 1.1rem; }
     .t4k-card p { font-size: 0.9rem; }
     .t4k-child-avatar { width: 56px; height: 56px; min-width: 56px; font-size: 1.6rem; }
    .t4k-child-last-played { font-size: 0.74rem; }
     .t4k-child-card-actions { flex-direction: row; gap: 0.5rem; }
     .t4k-child-card-actions .btn-magic { padding: 0.5rem 1.25rem; font-size: 0.85rem; flex: 0 0 auto; }
     .t4k-dashboard { padding: 1rem 0.5rem; }
     .t4k-cta-section h2 { font-size: 1.1rem; }
     .t4k-cta-section p { font-size: 0.9rem; }
     .btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
     .btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
     .t4k-hero-content { max-width: 95vw; }
     .t4k-stars, .t4k-cloud { display: none !important; }
}
@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .t4k-auth-card { padding: 1.5rem 1.25rem; border-radius: var(--radius-lg); }
    .t4k-stats-row { gap: 1rem; }
    .t4k-stat-circle { width: 68px; height: 68px; }
    .t4k-stat-circle .t4k-stat-number { font-size: 1.1rem; }
    .t4k-stat-circle i { font-size: 0.65rem; }
    .t4k-stat-bubble .t4k-stat-label { font-size: 0.68rem; max-width: 75px; }
     .t4k-section { padding: 1.5rem 0.5rem; }
     .t4k-dashboard { padding: 0.5rem 0.25rem; }
     .t4k-cta-section { padding: 1rem 0.5rem; }
     .t4k-hero-title { font-size: 1.3rem; }
     .t4k-hero-subtitle { font-size: 0.85rem; }
     .t4k-card { padding: 0.75rem; }
     .t4k-step { padding: 0.75rem 0.25rem; }
     .t4k-child-card { padding: 0.75rem; gap: 0.75rem; }
     .t4k-welcome-banner { padding: 0.75rem; font-size: 0.95rem; }
     .btn-lg { padding: 0.5rem 1rem; font-size: 0.9rem; }
     .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   NEW COMPONENTS — Child Management, Stories, Story Player
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Page Wrapper ── */
.t4k-page-wrapper { padding: 2rem 1.5rem; max-width: 1000px; margin: 0 auto; }
.t4k-page-header { margin-bottom: 2rem; }
.t4k-page-header h2 { margin-bottom: 0.25rem; }
.t4k-page-header p { font-size: 1rem; }
.t4k-back-link { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; font-size: 0.9rem; color: var(--orange); margin-bottom: 1rem; transition: var(--transition); text-decoration: none !important; }
.t4k-back-link:hover { color: var(--orange-dark); transform: translateX(-3px); }

/* ── Child Hub Section Cards ── */
.t4k-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.t4k-hub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1rem 1.5rem;
    border-radius: var(--radius-lg);
    background: white;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: var(--bounce);
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}
.t4k-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hub-color, var(--orange));
}
.t4k-hub-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--hub-color, var(--orange)) 30%, transparent);
}
.t4k-hub-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    background: color-mix(in srgb, var(--hub-color, var(--orange)) 10%, white);
    color: var(--hub-color, var(--orange));
    transition: var(--bounce);
}
.t4k-hub-card:hover .t4k-hub-icon { transform: scale(1.1); }
.t4k-hub-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.25rem;
}
.t4k-hub-stat {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray);
}
.t4k-hub-card[data-section="cuentos"]  { --hub-color: #0ea5e9; }
.t4k-hub-card[data-section="dictado"]  { --hub-color: #0ea5e9; }
.t4k-hub-card[data-section="math"]     { --hub-color: #6366f1; }
.t4k-hub-card[data-section="logros"]   { --hub-color: #f59e0b; }
.t4k-hub-card[data-section="amigos"]   { --hub-color: #8b5cf6; }

@media (max-width: 480px) {
    .t4k-hub-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .t4k-hub-card { padding: 1.25rem 0.75rem 1rem; }
    .t4k-hub-icon { width: 48px; height: 48px; font-size: 1.3rem; }
    .t4k-hub-title { font-size: 0.9rem; }
}

/* ── Section Headers (Dashboard) ── */
.t4k-dashboard .t4k-section-header { 
    display: flex !important; 
    flex-direction: row !important;
    align-items: center !important; 
    justify-content: space-between !important; 
    text-align: left !important;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(14, 165, 233, 0.08);
}
.t4k-dashboard .t4k-section-header h3 { 
    margin: 0; 
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark);
}
.t4k-dashboard .t4k-section-header h3 i {
    color: var(--orange);
    font-size: 0.9em;
}

/* ── Child Card Enhancements ── */
.t4k-child-age { 
    font-size: 0.95rem; 
    color: var(--gray); 
    margin-bottom: 1rem;
    font-weight: 600;
}
.t4k-child-info {
    display: flex;
    justify-content: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.t4k-child-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(14, 165, 233, 0.08);
    color: var(--orange);
    letter-spacing: 0.01em;
}
.t4k-child-badge i {
    font-size: 0.7rem;
    opacity: 0.8;
}
.t4k-child-badge-level {
    background: rgba(245, 158, 11, 0.15);
    color: #9a3412;
}
.t4k-child-badge-level i {
    color: #c2410c;
}
.t4k-child-badge-new {
    background: rgba(6, 182, 212, 0.14);
    color: #0E7490;
}
.t4k-child-badge-new i {
    color: #0891B2;
}
.t4k-child-story-strip {
    margin: 0.4rem 0 0.65rem;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(14, 165, 233, 0.08);
}
.t4k-child-story-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray);
}
.t4k-child-story-strip-header span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.t4k-child-story-strip-header a {
    color: var(--orange);
    text-decoration: none;
}
.t4k-child-story-covers {
    display: flex;
    gap: 0.45rem;
}
.t4k-mini-story {
    width: 46px;
    height: 60px;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #F5F3FF 0%, #EEF2FF 100%);
    border: 1px solid rgba(14, 165, 233, 0.15);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.08);
}
.t4k-mini-story img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.t4k-mini-story-fallback {
    color: var(--orange);
    font-size: 0.9rem;
}
.t4k-mini-status {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    right: 4px;
    top: 4px;
    border: 2px solid #fff;
}
.t4k-mini-status.new { background: #0ea5e9; }
.t4k-mini-status.progress { background: #F59E0B; }
.t4k-mini-status.done { background: #0ea5e9; }
.t4k-child-card-actions { 
    display: flex; 
    gap: 0.5rem; 
    justify-content: flex-start; 
    flex-wrap: wrap;
    margin-top: 0;
}
.t4k-child-card h4 { margin-bottom: 0.35rem; }
.t4k-add-child-card { text-decoration: none !important; color: var(--gray-light); }
.t4k-add-child-card h4 { color: inherit; font-size: 1.15rem; font-weight: 800; }
.t4k-add-child-card p { font-size: 0.9rem; margin-bottom: 0; color: var(--gray-light); }

/* ── Stats Row (Bubble) ── */
.t4k-stats-row { display: flex; justify-content: center; gap: 2.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.t4k-stat-bubble { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 0.6rem; 
    cursor: default;
    transition: var(--bounce);
}
.t4k-stat-bubble:hover { transform: translateY(-4px); }
.t4k-stat-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f8 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0,0,0,0.03);
    border: 2px solid rgba(0, 0, 0, 0.04);
    transition: var(--bounce);
    position: relative;
}
.t4k-stat-bubble:hover .t4k-stat-circle { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1); }
.t4k-stat-circle .t4k-stat-number { font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; color: var(--dark); line-height: 1; }
.t4k-stat-circle i { font-size: 0.75rem; opacity: 0.6; }
.t4k-stat-bubble .t4k-stat-label { font-size: 0.78rem; color: var(--gray); font-weight: 700; text-align: center; max-width: 100px; line-height: 1.2; }
.t4k-stat-bubble.purple .t4k-stat-circle { border-color: rgba(14, 165, 233, 0.2); background: linear-gradient(145deg, #ffffff 0%, #EEF2FF 100%); }
.t4k-stat-bubble.purple .t4k-stat-circle i { color: var(--orange); }
.t4k-stat-bubble.teal .t4k-stat-circle { border-color: rgba(6, 182, 212, 0.2); background: linear-gradient(145deg, #ffffff 0%, #ECFEFF 100%); }
.t4k-stat-bubble.teal .t4k-stat-circle i { color: var(--teal); }
.t4k-stat-bubble.yellow .t4k-stat-circle { border-color: rgba(245, 158, 11, 0.3); background: linear-gradient(145deg, #ffffff 0%, #FFFBEB 100%); }
.t4k-stat-bubble.yellow .t4k-stat-circle i { color: #c2410c; }
.t4k-stat-bubble.coral .t4k-stat-circle { border-color: rgba(239, 68, 68, 0.2); background: linear-gradient(145deg, #ffffff 0%, #FEF2F2 100%); }
.t4k-stat-bubble.coral .t4k-stat-circle i { color: var(--coral); }

/* ── Create/Edit Child Form ── */
.t4k-create-child-container { max-width: 800px; margin: 0 auto; }
.t4k-form-section { background: white; border-radius: var(--radius-lg); padding: 2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.t4k-form-section-title { font-size: 1.3rem; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--gray-lighter); }
.t4k-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.t4k-form-group { margin-bottom: 1rem; }
.t4k-form-group label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--dark); margin-bottom: 0.4rem; }
.t4k-form-hint { font-size: 0.9rem; color: var(--gray); margin-bottom: 1rem; margin-top: -0.5rem; }
.t4k-form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1rem; }
.btn-outline-magic { background: white; color: var(--orange); border: 2px solid var(--orange-light); box-shadow: var(--shadow-sm); }
.btn-outline-magic:hover { background: rgba(14, 165, 233,0.05); color: var(--orange-dark); }

/* ── Avatar Grid ── */
.t4k-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 0.75rem; }
.t4k-avatar-option { display: flex; flex-direction: column; align-items: center; padding: 0.75rem 0.5rem; border-radius: var(--radius-md); border: 2px solid var(--gray-lighter); cursor: pointer; transition: var(--bounce); background: white; }
.t4k-avatar-option:hover { border-color: var(--orange-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.t4k-avatar-option.selected { border-color: var(--orange); background: rgba(14, 165, 233,0.06); box-shadow: 0 0 0 3px rgba(14, 165, 233,0.15); }
.t4k-avatar-emoji { font-size: 2rem; margin-bottom: 0.25rem; }
.t4k-avatar-name { font-size: 0.65rem; font-weight: 700; color: var(--gray); text-align: center; line-height: 1.2; }

/* ── Preference Chips ── */
.t4k-pref-group { margin-bottom: 1.5rem; }
.t4k-pref-label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--dark); }
.t4k-chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.t4k-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.5rem 1rem; border-radius: var(--radius-pill); border: 2px solid var(--gray-lighter); background: white; font-family: var(--font-primary); font-weight: 700; font-size: 0.85rem; color: var(--gray); cursor: pointer; transition: var(--bounce); }
.t4k-chip:hover { border-color: var(--orange-light); color: var(--orange); background: rgba(14, 165, 233,0.04); }
.t4k-chip.active { border-color: var(--orange); background: rgba(14, 165, 233,0.1); color: var(--orange); box-shadow: 0 0 0 2px rgba(14, 165, 233,0.1); }
.t4k-chip-color.active { border-color: var(--chip-color, var(--orange)); background: color-mix(in srgb, var(--chip-color, var(--orange)) 12%, white); color: var(--dark); }

/* ── Range Input ── */
.t4k-range { -webkit-appearance: none; width: 100%; height: 8px; border-radius: 4px; background: var(--gray-lighter); outline: none; border: none; margin-top: 0.5rem; }
.t4k-range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gradient-primary); cursor: pointer; box-shadow: var(--shadow-md); }
.t4k-range-display { display: block; font-size: 0.85rem; color: var(--gray); margin-top: 0.5rem; }

/* ── Child Detail ── */
.t4k-child-detail { max-width: 900px; margin: 0 auto; }
.t4k-child-profile-banner { display: flex; align-items: center; gap: 1.5rem; background: var(--gradient-primary); border-radius: var(--radius-xl); padding: 2rem; color: white; margin-bottom: 2rem; }
.t4k-child-big-avatar { width: 100px; height: 100px; border-radius: var(--radius-round); background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; flex-shrink: 0; }
.t4k-child-profile-info h2 { color: white; margin-bottom: 0.25rem; }
.t4k-child-meta { color: rgba(255,255,255,0.8); font-weight: 600; margin-bottom: 0.75rem; }
.t4k-child-hero-eyebrow { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.95); font-size: 0.75rem; font-weight: 700; margin-bottom: 0.6rem; }
.t4k-child-hero-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.t4k-child-hero-pill { display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px; padding: 0.35rem 0.75rem; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22); color: white; font-size: 0.75rem; font-weight: 700; }
.t4k-child-profile-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.t4k-child-profile-actions .btn-outline-magic { border-color: rgba(255,255,255,0.4) !important; color: white !important; background: rgba(255,255,255,0.1) !important; }
.t4k-child-profile-actions .btn-outline-magic:hover { background: rgba(255,255,255,0.2) !important; border-color: white !important; }

.t4k-child-detail .t4k-stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.6rem; }
.t4k-stat-card { background: white; border-radius: var(--radius-lg); padding: 1rem 1.1rem; border: 1px solid rgba(0,0,0,0.05); box-shadow: var(--shadow-sm); display: flex; justify-content: space-between; align-items: center; }
.t4k-stat-card .t4k-stat-info { display: flex; flex-direction: column; gap: 0.2rem; }
.t4k-stat-card .t4k-stat-number { font-size: 1.35rem; font-weight: 900; color: var(--dark); line-height: 1; }
.t4k-stat-card .t4k-stat-label { font-size: 0.78rem; color: var(--gray); font-weight: 700; }
.t4k-stat-card .t4k-stat-icon { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.t4k-stat-card.purple .t4k-stat-icon { color: var(--orange); background: rgba(14, 165, 233,0.12); }
.t4k-stat-card.teal .t4k-stat-icon { color: var(--teal); background: rgba(6, 182, 212,0.12); }
.t4k-stat-card.yellow .t4k-stat-icon { color: #9a3412; background: rgba(245, 158, 11,0.2); }
.t4k-stat-card.coral .t4k-stat-icon { color: var(--coral); background: rgba(239, 68, 68,0.14); }

/* ── Section Block ── */
.t4k-section-block { background: white; border-radius: var(--radius-lg); padding: 1.75rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.t4k-section-block h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.t4k-section-subtitle { margin-top: -0.6rem; margin-bottom: 1rem; color: var(--gray); font-size: 0.9rem; }

/* ── Preference Display ── */
.t4k-pref-display { display: flex; flex-direction: column; gap: 0.75rem; }
.t4k-pref-category { display: flex; align-items: flex-start; gap: 0.75rem; }
.t4k-pref-cat-label { font-weight: 700; font-size: 0.85rem; color: var(--gray); min-width: 100px; padding-top: 0.3rem; }
.t4k-pref-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.t4k-tag { display: inline-block; padding: 0.3rem 0.75rem; border-radius: var(--radius-pill); background: rgba(14, 165, 233,0.08); color: var(--orange); font-size: 0.82rem; font-weight: 700; }

/* ── Achievement Grid ── */
.t4k-achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
.t4k-achievement-card { text-align: center; padding: 1rem 0.5rem; border-radius: var(--radius-md); background: var(--gray-lighter); transition: var(--transition); }
.t4k-achievement-card.unlocked { background: rgba(245, 158, 11,0.15); border: 1px solid rgba(245, 158, 11,0.3); }
.t4k-achievement-icon { font-size: 2rem; display: block; margin-bottom: 0.35rem; }
.t4k-achievement-name { font-size: 0.75rem; font-weight: 700; color: var(--dark); display: block; }
.t4k-achievement-date { font-size: 0.65rem; color: var(--gray-light); }

/* ── Session List ── */
.t4k-sessions-list { display: flex; flex-direction: column; gap: 0.75rem; }
.t4k-session-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: var(--bg); border-radius: var(--radius-md); gap: 1rem; }
.t4k-session-title { font-weight: 700; font-size: 0.9rem; color: var(--dark); display: block; }
.t4k-session-date { font-size: 0.78rem; color: var(--gray-light); }
.t4k-session-state { margin-top: 0.35rem; display: inline-flex; align-items: center; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.68rem; font-weight: 800; }
.t4k-session-state.done { color: var(--green); background: rgba(16, 185, 129,0.13); }
.t4k-session-state.progress { color: #2563EB; background: rgba(37, 99, 235,0.12); }
.t4k-session-progress { display: flex; align-items: center; gap: 0.5rem; min-width: 120px; }
.t4k-progress-bar { flex: 1; height: 8px; background: var(--gray-lighter); border-radius: 4px; overflow: hidden; }
.t4k-progress-fill { height: 100%; background: var(--gradient-primary); border-radius: 4px; transition: width 0.5s ease; }
.t4k-progress-text { font-size: 0.75rem; font-weight: 700; color: var(--orange); min-width: 35px; }

/* ── Empty State ── */
.t4k-empty-state { text-align: center; padding: 2.5rem 1rem; }
.t4k-empty-icon { font-size: 3rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; color: var(--orange-light); opacity: 0.6; }
.t4k-empty-icon i { font-size: inherit; }
.t4k-empty-state p { font-size: 0.95rem; margin-bottom: 1rem; }

/* ── Detail CTA ── */
.t4k-detail-cta { text-align: center; margin-top: 1rem; }

/* ── Danger Zone ── */
.t4k-danger-zone { background: rgba(239, 68, 68,0.05); border: 1px solid rgba(239, 68, 68,0.15); border-radius: var(--radius-lg); padding: 1.5rem; margin-top: 2rem; }
.t4k-danger-zone h4 { color: var(--coral); font-size: 1rem; margin-bottom: 0.5rem; }
.t4k-danger-zone p { font-size: 0.85rem; margin-bottom: 0.75rem; }

@media (max-width: 768px) {
    .t4k-child-detail .t4k-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .t4k-stat-card { padding: 0.9rem; }
    .t4k-stat-card .t4k-stat-number { font-size: 1.2rem; }
    .t4k-child-hero-pills { gap: 0.4rem; }
    .t4k-child-hero-pill { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
    .t4k-session-item { flex-direction: column; align-items: flex-start; }
    .t4k-session-progress { width: 100%; }
}

/* ── Create/Edit Form – Mobile ── */
@media (max-width: 600px) {
    .t4k-form-row { grid-template-columns: 1fr !important; }
    .t4k-form-section { padding: 1.25rem; }
    .t4k-form-section-title { font-size: 1.1rem; }
    .t4k-form-group { min-width: 0; }
    .t4k-input,
    select.t4k-input,
    input[type="date"].t4k-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        -webkit-appearance: none;
        appearance: none;
    }
    .t4k-page-wrapper { padding: 1rem 0.75rem; }
    .t4k-form-actions { flex-direction: column; }
    .t4k-form-actions .btn-magic { width: 100%; justify-content: center; text-align: center; }
    .t4k-avatar-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
    .t4k-danger-zone { padding: 1rem; }
}
@media (min-width: 601px) and (max-width: 768px) {
    .t4k-form-row { align-items: end; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STORY BROWSE
   ═══════════════════════════════════════════════════════════════════════════════ */
.t4k-browse-container { max-width: 1100px; margin: 0 auto; }
.t4k-browse-header { margin-bottom: 1.5rem; }
.t4k-browse-hero { display: flex; align-items: center; gap: 1.25rem; }
.t4k-browse-avatar { font-size: 3.5rem; width: 80px; height: 80px; background: var(--gradient-sunset); border-radius: var(--radius-round); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.t4k-browse-hero h2 { margin-bottom: 0.25rem; }
.t4k-browse-hero p { font-size: 0.95rem; }

/* ── Filter Bar ── */
.t4k-filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-lighter); }
.t4k-filter-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 1rem; border-radius: var(--radius-pill); font-weight: 700; font-size: 0.85rem; color: var(--gray); background: white; border: 2px solid var(--gray-lighter); transition: var(--bounce); text-decoration: none !important; }
.t4k-filter-chip i { font-size: 0.85em; width: 1.1em; text-align: center; }
.t4k-filter-chip:hover { border-color: var(--orange-light); color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.t4k-filter-chip.active { border-color: var(--orange); background: rgba(14, 165, 233,0.1); color: var(--orange); box-shadow: 0 2px 8px rgba(14, 165, 233,0.15); transform: translateY(-1px); }

/* ── Story Cards Grid ── */
.t4k-stories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.t4k-story-card { background: white; border-radius: var(--radius-lg); padding: 0; box-shadow: var(--shadow-md); transition: var(--bounce); border: 2px solid transparent; display: flex; flex-direction: column; overflow: hidden; }
.t4k-story-card-inner { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.t4k-story-card::before { content: ''; display: block; height: 5px; background: var(--gradient-primary); }
.t4k-story-card-cover { position: relative; width: 100%; height: 180px; overflow: hidden; background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%); }
.t4k-story-card-cover::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(to top, white, transparent); pointer-events: none; }
.t4k-story-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.t4k-story-card:hover .t4k-story-card-cover img { transform: scale(1.05); }
@media (max-width: 480px) { .t4k-story-card-cover { height: 150px; } }
.t4k-story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--orange-light); }
.t4k-story-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.t4k-story-genre-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); background: rgba(14, 165, 233,0.08); color: var(--orange); font-size: 0.75rem; font-weight: 700; text-transform: capitalize; }
.t4k-story-genre-badge i { font-size: 0.8em; }
.t4k-story-played-badge { font-size: 0.75rem; font-weight: 700; color: var(--green); display: inline-flex; align-items: center; gap: 0.25rem; }
.t4k-story-played-badge i { font-size: 0.9em; }
.t4k-story-new-badge { font-size: 0.75rem; font-weight: 700; color: #EA580C; display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(225,112,85,0.1); padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); animation: t4k-pulse-badge 2s ease-in-out infinite; }
.t4k-story-new-badge i { font-size: 0.9em; }
.t4k-story-continue-badge { font-size: 0.75rem; font-weight: 700; color: #2563EB; display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(37, 99, 235,0.1); padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); }
.t4k-story-continue-badge i { font-size: 0.9em; }
@keyframes t4k-pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.t4k-story-title { font-size: 1.2rem; margin-bottom: 0.5rem; line-height: 1.3; }
.t4k-story-desc { font-size: 0.88rem; color: var(--gray); line-height: 1.6; flex: 1; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.t4k-story-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.t4k-story-meta-item { font-size: 0.78rem; font-weight: 600; color: var(--gray); display: flex; align-items: center; gap: 0.3rem; }
.t4k-story-meta-item i { font-size: 0.9em; color: var(--orange-light); }
.t4k-difficulty-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gray-lighter); margin-left: 2px; }
.t4k-difficulty-dot.filled { background: var(--orange); }
.t4k-story-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--gray-lighter); }
.t4k-story-rating { font-weight: 800; font-size: 0.9rem; color: var(--yellow); display: inline-flex; align-items: center; gap: 0.25rem; }
.t4k-story-rating i { font-size: 0.85em; }

/* ═══════════════════════════════════════════════════════════════════════════════
   STORY PLAYER — Immersive Reading Experience
   ═══════════════════════════════════════════════════════════════════════════════ */
.t4k-story-player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; overscroll-behavior: none; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
/* Spacer that reserves 40vh at the bottom for the fixed image overlay.
   This makes .t4k-player-content (flex:1) fill ONLY the space between
   header and image — the narration never extends behind the image. */
.t4k-story-player::after { content: ''; flex-shrink: 0; height: 40vh; height: 40dvh; }

/* Prevent iOS body bounce when story player is active */
/* NOTE: Do NOT use position:fixed on body — it breaks touch hit-testing
   inside fixed-position modals on real iOS Safari. overflow:hidden +
   overscroll-behavior:none is sufficient to prevent bounce. */
body:has(.t4k-story-player) { overflow: hidden; width: 100%; height: 100%; height: 100dvh; overscroll-behavior: none; }

/* Player Header */
.t4k-player-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 1rem; background: rgba(255,255,255,0.95); border-bottom: none; flex-shrink: 0; z-index: 100; }
.t4k-player-exit { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-round); background: var(--gray-lighter); color: var(--gray); font-size: 0.85rem; transition: var(--transition); text-decoration: none !important; flex-shrink: 0; }
.t4k-player-exit i { font-size: 0.95rem; }
.t4k-player-exit:hover { background: var(--coral-light); color: var(--coral); }
.t4k-player-title { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; color: var(--dark); flex: 1; min-width: 0; }
.t4k-player-avatar { font-size: 1.3rem; flex-shrink: 0; }
.t4k-player-progress { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.t4k-player-progress-bar { width: 100px; height: 6px; background: var(--gray-lighter); border-radius: 3px; overflow: hidden; }
.t4k-player-progress-fill { height: 100%; background: var(--gradient-primary); border-radius: 3px; transition: width 0.5s ease; }
.t4k-player-progress-text { font-size: 0.75rem; font-weight: 700; color: var(--orange); }

/* Player Controls */
.t4k-player-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.t4k-audio-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid var(--gray-lighter); border-radius: var(--radius-round); background: white; cursor: pointer; transition: var(--bounce); font-size: 0.85rem; padding: 0; color: var(--gray); }
.t4k-audio-toggle:hover { border-color: var(--orange-light); background: rgba(14, 165, 233,0.04); transform: scale(1.08); color: var(--orange); }
.t4k-audio-toggle.active { border-color: var(--orange); background: rgba(14, 165, 233,0.08); box-shadow: 0 0 0 3px rgba(14, 165, 233,0.1); color: var(--orange); }
.t4k-audio-icon { line-height: 1; display: flex; align-items: center; justify-content: center; }
.t4k-skip-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: var(--radius-round); background: var(--gray-lighter); cursor: pointer; transition: var(--transition); font-size: 0.75rem; padding: 0; color: var(--gray); }
.t4k-skip-btn:hover { background: var(--orange-light); color: white; }

/* Loading & Error states */
.t4k-story-loading { text-align: center; padding: 3rem; }
.t4k-loading-icon { font-size: 3rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; color: var(--orange-light); animation: pulse 1.5s ease-in-out infinite; }
.t4k-loading-icon i { font-size: inherit; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } }
.t4k-story-error { text-align: center; padding: 3rem; }
.t4k-error-icon { font-size: 3rem; display: block; margin-bottom: 0.75rem; }
.t4k-story-error p { font-size: 1rem; color: var(--gray); margin-bottom: 1.5rem; }

/* Animated paragraphs */
/* Animated paragraphs - Compact for mobile */
.t4k-animated-p { font-size: 1.05rem; line-height: 1.7; color: var(--dark); font-weight: 500; margin-bottom: 0.75rem; }

/* Player Content — fills the space between header and image spacer.
   The ::after pseudo on .t4k-story-player reserves 40vh for the image,
   so this flex:1 area gets exactly (100vh - header - 40vh). Narration
   scrolls within this area and NEVER overlaps the image. */
.t4k-player-content { 
    flex: 1 1 auto;
    min-height: 0; /* allow flex shrink */
    display: flex; 
    align-items: flex-start; 
    justify-content: center; 
    padding: 1rem 1.25rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: transparent;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    z-index: 1; /* Low z-index so audio activation overlay (z-index: 10000) is clickable */
}
.t4k-player-content::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.t4k-story-text-wrapper { 
    max-width: 700px; 
    width: 100%;
}

/* Story Text - Compact for mobile 60% area */
.t4k-story-text { margin-bottom: 1rem; }
.t4k-story-text p { font-size: 1.05rem; line-height: 1.7; color: var(--dark); font-weight: 500; margin-bottom: 0.75rem; }

/* Karaoke Effect - Magical fairy dust reveal */
.karaoke-word {
    opacity: 0.3;
    color: #b8c0cc;
    display: inline-block;
    margin-right: 0.25em;
    position: relative;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.karaoke-word.highlighted {
    opacity: 1;
    color: var(--orange);
    font-weight: 700;
    animation: gentleReveal 0.35s ease-out;
}

/* Magic fairy dust sparkles */
.karaoke-word.highlighted::before,
.karaoke-word.highlighted::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Golden sparkle with twinkle */
.karaoke-word.highlighted::before {
    right: -10px;
    top: 30%;
    width: 5px;
    height: 5px;
    background: #fef08a;
    box-shadow: 
        0 0 3px 2px rgba(254, 240, 138, 0.9),
        0 0 8px 3px rgba(251, 191, 36, 0.5);
    animation: twinkle1 0.7s ease-out forwards;
}

/* Purple sparkle */
.karaoke-word.highlighted::after {
    right: -14px;
    top: 60%;
    width: 4px;
    height: 4px;
    background: #ddd6fe;
    box-shadow: 
        0 0 3px 2px rgba(221, 214, 254, 0.9),
        0 0 6px 2px rgba(167, 139, 250, 0.5);
    animation: twinkle2 0.65s ease-out 0.08s forwards;
}

@keyframes gentleReveal {
    0% {
        opacity: 0.3;
        color: #b8c0cc;
    }
    40% {
        color: #FBBF24;
    }
    100% {
        opacity: 1;
        color: var(--orange);
    }
}

@keyframes twinkle1 {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    25% {
        opacity: 1;
        transform: scale(1.2);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-5px) translateX(3px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-12px) translateX(8px) scale(0.3);
    }
}

@keyframes twinkle2 {
    0% {
        opacity: 1;
        transform: scale(0.4);
    }
    30% {
        opacity: 1;
        transform: scale(1.1);
    }
    60% {
        opacity: 0.7;
        transform: translateY(-6px) translateX(4px) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translateY(-14px) translateX(10px) scale(0.2);
    }
}

/* Educational Box - Compact for 60% area */
.t4k-edu-box { display: flex; gap: 0.6rem; background: rgba(6, 182, 212,0.08); border: 1px solid rgba(6, 182, 212,0.2); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.t4k-edu-icon { font-size: 1.25rem; flex-shrink: 0; }
.t4k-edu-content strong { display: block; color: var(--teal-dark); font-size: 0.8rem; margin-bottom: 0.15rem; }
.t4k-edu-content p { font-size: 0.85rem; color: var(--gray); margin: 0; line-height: 1.4; }

/* Choices - Compact for 60% area */
.t4k-choices { margin-top: 0.75rem; }
.t4k-choices-prompt { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--dark); margin-bottom: 0.75rem; text-align: center; }
.t4k-choice-form { margin-bottom: 0.5rem; }
.t4k-choice-btn { width: 100%; padding: 0.9rem 1.25rem; border: 2px solid var(--orange-light); border-radius: var(--radius-md); background: white; font-family: var(--font-primary); font-size: 0.95rem; font-weight: 700; color: var(--dark); cursor: pointer; transition: var(--bounce); text-align: left; }
.t4k-choice-btn:hover { border-color: var(--orange); background: rgba(14, 165, 233,0.06); transform: translateX(6px); box-shadow: var(--shadow-md); }
.t4k-choice-btn:active { transform: translateX(3px); }

/* Continue Button */
.t4k-continue { text-align: center; margin-top: 1rem; }
.t4k-continue-btn { min-width: 200px; }

/* Story Ending */
.t4k-story-ending { text-align: center; }
.t4k-ending-stars { font-size: 2rem; letter-spacing: 0.5rem; margin-bottom: 1.5rem; animation: twinkle 2s ease-in-out infinite; }
.t4k-story-ending .t4k-story-text { text-align: left; }
.t4k-moral-box { display: flex; gap: 0.75rem; background: rgba(245, 158, 11,0.12); border: 1px solid rgba(245, 158, 11,0.3); border-radius: var(--radius-md); padding: 1.25rem; margin: 2rem 0; text-align: left; }
.t4k-moral-icon { font-size: 1.5rem; flex-shrink: 0; }
.t4k-moral-box strong { display: block; color: var(--orange); font-size: 0.85rem; margin-bottom: 0.25rem; }
.t4k-moral-box p { font-size: 0.9rem; color: var(--gray); margin: 0; }

/* Story Image Display - Fixed 40% Bottom */
.t4k-story-image-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    height: 40dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    padding: 0.5rem 1rem 0.75rem 1rem;
    background: transparent;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}
.t4k-story-image-container.visible { opacity: 1; }
.t4k-story-image {
    max-height: 92%;
    max-width: 92%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 4px 16px rgba(14, 165, 233,0.12);
    animation: storyImageAppear 0.6s ease-out;
}
@keyframes storyImageAppear {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .t4k-story-image-container { background: transparent; }
    .t4k-story-image { box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 4px 16px rgba(14, 165, 233,0.3); }
}

/* Story Rating */
.t4k-rating-box { text-align: center; margin: 1.5rem 0; padding: 1.25rem; background: rgba(14, 165, 233, 0.05); border-radius: var(--radius-md); border: 1px solid rgba(14, 165, 233, 0.15); }
.t4k-rating-prompt { font-size: 1rem; color: var(--orange); font-weight: 600; margin: 0 0 0.75rem 0; }
.t4k-rating-stars { display: inline-flex; gap: 0.5rem; }
.t4k-star-btn { background: none; border: none; font-size: 2rem; color: var(--yellow); cursor: pointer; padding: 0.25rem; transition: var(--bounce); }
.t4k-star-btn:hover { transform: scale(1.25); }
.t4k-star-btn.active i { color: var(--yellow); }
.t4k-star-btn:disabled { cursor: default; opacity: 1; }
.t4k-star-btn:disabled:hover { transform: none; }
.t4k-rating-thanks { font-size: 1.1rem; color: var(--green); font-weight: 700; margin: 0.75rem 0 0 0; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Achievement Notifications */
.t4k-achievements-unlocked { 
    background: linear-gradient(135deg, rgba(245, 158, 11,0.15) 0%, rgba(239, 68, 68,0.12) 100%);
    border: 2px solid rgba(245, 158, 11,0.4);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
}
.t4k-achievement-header { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.t4k-achievement-header h4 { margin: 0; color: var(--orange); font-size: 1.2rem; }
.t4k-achievement-icon { font-size: 2rem; animation: achieveBounce 0.6s ease-out; }
@keyframes achieveBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.t4k-achievement-list { display: flex; flex-direction: column; gap: 0.75rem; }
.t4k-achievement-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-sm);
    animation: achieveSlide 0.4s ease-out backwards;
}
.t4k-achievement-item:nth-child(1) { animation-delay: 0.1s; }
.t4k-achievement-item:nth-child(2) { animation-delay: 0.2s; }
.t4k-achievement-item:nth-child(3) { animation-delay: 0.3s; }
@keyframes achieveSlide { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.t4k-achievement-emoji { font-size: 1.8rem; flex-shrink: 0; }
.t4k-achievement-info { flex: 1; text-align: left; }
.t4k-achievement-info strong { display: block; color: var(--dark); font-size: 0.95rem; }
.t4k-achievement-info span { font-size: 0.8rem; color: var(--gray); }
.t4k-achievement-points { 
    background: var(--gradient-warm); 
    color: white; 
    font-weight: 700; 
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-pill);
}

.t4k-ending-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

/* Emotion-based backgrounds */
.t4k-story-player[data-emotion="curiosidad"] { background: linear-gradient(180deg, #F8FAFC 0%, #E8F0FE 100%); }
.t4k-story-player[data-emotion="emocion"] { background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%); }
.t4k-story-player[data-emotion="asombro"] { background: linear-gradient(180deg, #F0F0FF 0%, #E0E0FF 100%); }
.t4k-story-player[data-emotion="empatia"] { background: linear-gradient(180deg, #FFF0F5 0%, #FFE0EB 100%); }
.t4k-story-player[data-emotion="ternura"] { background: linear-gradient(180deg, #F0FFF4 0%, #E0FFE8 100%); }
.t4k-story-player[data-emotion="aventura"] { background: linear-gradient(180deg, #FFF8E0 0%, #FFEFB0 100%); }
.t4k-story-player[data-emotion="determinacion"] { background: linear-gradient(180deg, #F0F8FF 0%, #D0E8FF 100%); }
.t4k-story-player[data-emotion="celebracion"] { background: linear-gradient(180deg, #FFFFF0 0%, #FDE68A 100%); }
.t4k-story-player[data-emotion="felicidad"] { background: linear-gradient(180deg, #F0FFF0 0%, #C0FFC0 100%); }
.t4k-story-player[data-emotion="alegria"] { background: linear-gradient(180deg, #FFFFF0 0%, #FFE4B5 100%); }

/* Story Animation */
@keyframes storyFadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.animate-story-in { animation: storyFadeIn 0.6s ease-out; }
.animate-story-in .t4k-story-text p { animation: storyFadeIn 0.5s ease-out both; }
.animate-story-in .t4k-story-text p:nth-child(1) { animation-delay: 0.1s; }
.animate-story-in .t4k-story-text p:nth-child(2) { animation-delay: 0.3s; }
.animate-story-in .t4k-story-text p:nth-child(3) { animation-delay: 0.5s; }
.animate-story-in .t4k-choices { animation: storyFadeIn 0.5s ease-out 0.6s both; }
.animate-story-in .t4k-continue { animation: storyFadeIn 0.5s ease-out 0.6s both; }
.animate-story-in .t4k-edu-box { animation: storyFadeIn 0.5s ease-out 0.4s both; }

/* ── Story Player: Responsive breakpoints ── */
@media (min-width: 768px) {
    .t4k-player-content {
        padding: 1.5rem 2rem;
    }
    .t4k-story-image-container {
        height: 40vh;
        height: 40dvh;
    }
    .t4k-story-text-wrapper {
        max-width: 700px;
    }
    .t4k-animated-p,
    .t4k-story-text p {
        font-size: 1.1rem;
        line-height: 1.75;
    }
}

@media (min-width: 1024px) {
    .t4k-player-header {
        padding: 0.5rem 2rem;
    }
    .t4k-player-content {
        padding: 2rem 3rem;
    }
    .t4k-story-image-container {
        height: 40vh;
        height: 40dvh;
        padding: 0.75rem 2rem 1rem 2rem;
    }
    .t4k-story-image {
        max-height: 90%;
        max-width: 60%;
    }
    .t4k-story-text-wrapper {
        max-width: 750px;
    }
    .t4k-animated-p,
    .t4k-story-text p {
        font-size: 1.15rem;
        line-height: 1.8;
    }
    .t4k-choice-btn {
        max-width: 600px;
        margin: 0 auto;
    }
    .t4k-choice-form {
        display: flex;
        justify-content: center;
    }
    .t4k-edu-box {
        max-width: 650px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1440px) {
    .t4k-player-content {
        padding: 2.5rem 4rem;
    }
    .t4k-story-player::after { height: 35vh; height: 35dvh; }
    .t4k-story-image-container {
        height: 35vh;
        height: 35dvh;
    }
    .t4k-story-image {
        max-width: 50%;
    }
    .t4k-story-text-wrapper {
        max-width: 800px;
    }
}

/* ══════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════ */
.t4k-admin { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* Header */
.t4k-admin-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.t4k-admin-header h1 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--dark); margin: 0; }
.t4k-admin-header p { color: var(--gray); font-size: 0.95rem; margin: 0.25rem 0 0; }
.t4k-admin-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Alerts */
.t4k-admin-alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-weight: 600; font-size: 0.95rem; }
.t4k-admin-alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.t4k-admin-alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* KPI Row */
.t4k-admin-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.t4k-admin-kpi { background: white; border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; text-align: center; box-shadow: var(--shadow-sm); border-top: 4px solid var(--gray-light); transition: var(--transition); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.t4k-admin-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.t4k-admin-kpi.purple { border-top-color: var(--orange); }
.t4k-admin-kpi.teal { border-top-color: var(--teal); }
.t4k-admin-kpi.yellow { border-top-color: var(--yellow); }
.t4k-admin-kpi.coral { border-top-color: var(--coral); }
.t4k-admin-kpi.green { border-top-color: #0b7285; }
.t4k-kpi-number { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1.1; text-align: center; }
.t4k-kpi-label { display: block; font-size: 0.85rem; color: var(--gray); font-weight: 600; margin-top: 0.25rem; text-align: center; }
.t4k-kpi-detail { display: block; font-size: 0.75rem; color: var(--gray-light); margin-top: 0.35rem; text-align: center; }

/* Grid */
.t4k-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { .t4k-admin-grid { grid-template-columns: 1fr; } }

/* Panel */
.t4k-admin-panel { background: white; border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.t4k-admin-panel.full { grid-column: 1 / -1; }
.t4k-admin-panel h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--dark); margin: 0 0 1rem; }
.t4k-admin-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.t4k-admin-panel-header h3 { margin: 0; }

/* Stat lists */
.t4k-admin-stat-list { display: flex; flex-direction: column; gap: 0.5rem; }
.t4k-admin-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-lighter); font-size: 0.9rem; }
.t4k-admin-stat-row:last-child { border-bottom: none; }
.t4k-admin-stat-row span { color: var(--gray); }
.t4k-admin-stat-row strong { color: var(--dark); font-weight: 700; }
.status-ok { color: #0b7285 !important; }
.status-warn { color: #e67e22 !important; }

/* Bar charts */
.t4k-admin-bar-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.t4k-bar-item { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.t4k-bar-label { min-width: 80px; color: var(--gray); font-weight: 600; text-transform: capitalize; }
.t4k-bar-track { flex: 1; height: 20px; background: var(--gray-lighter); border-radius: 10px; overflow: hidden; }
.t4k-bar-fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; min-width: 8px; }
.t4k-bar-fill.purple { background: linear-gradient(90deg, var(--orange-light), var(--orange)); }
.t4k-bar-fill.teal { background: linear-gradient(90deg, rgba(6, 182, 212,0.4), var(--teal)); }
.t4k-bar-value { min-width: 25px; text-align: right; font-weight: 700; color: var(--dark); }

/* Tables */
.t4k-admin-table-wrap { overflow-x: auto; }
.t4k-admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.t4k-admin-table thead th { background: var(--gray-lighter); padding: 0.75rem 0.6rem; text-align: left; font-weight: 700; color: var(--dark); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.t4k-admin-table tbody td { padding: 0.7rem 0.6rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.t4k-admin-table tbody tr:hover { background: rgba(14, 165, 233,0.03); }
.t4k-admin-table tbody tr.inactive { opacity: 0.55; }
.t4k-admin-table .mono { font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--gray); }
.t4k-admin-table .center { text-align: center; }
.t4k-admin-table .muted, .muted { color: var(--gray-light); font-size: 0.8rem; }

/* Badges */
.t4k-admin-badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.t4k-admin-badge.genre { background: rgba(14, 165, 233,0.12); color: var(--orange); }
.t4k-admin-badge.focus { background: rgba(6, 182, 212,0.12); color: var(--teal-dark); }
.t4k-admin-badge.plan { background: rgba(245, 158, 11,0.2); color: #9a3412; }
.t4k-admin-badge.ai { background: rgba(14, 165, 233,0.12); color: var(--orange); }
.t4k-admin-badge.human { background: rgba(6, 182, 212,0.12); color: var(--teal-dark); }
.t4k-admin-badge.admin { background: rgba(255,107,107,0.12); color: var(--coral); margin-left: 0.35rem; }
.t4k-admin-badge.gift { background: linear-gradient(135deg, #0b7285, #0ea5e9); color: white; font-size: 0.85rem; padding: 0.25rem 0.65rem; }

/* Voice selector */
.t4k-voice-select { padding: 0.2rem 0.4rem; border-radius: 8px; border: 1.5px solid rgba(14, 165, 233,0.3); background: rgba(14, 165, 233,0.06); font-size: 0.75rem; font-weight: 600; color: var(--orange); cursor: pointer; outline: none; transition: border-color 0.2s; }
.t4k-voice-select:hover, .t4k-voice-select:focus { border-color: var(--orange); }

/* Status dot */
.t4k-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.t4k-status-dot.active { background: #0b7285; box-shadow: 0 0 4px rgba(39,174,96,0.4); }
.t4k-status-dot.inactive { background: var(--gray-light); }

/* Admin action buttons */
.t4k-admin-actions-cell { white-space: nowrap; }
.t4k-admin-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; transition: var(--transition); }
.t4k-admin-btn.ok { background: rgba(39,174,96,0.1); }
.t4k-admin-btn.ok:hover { background: rgba(39,174,96,0.25); }
.t4k-admin-btn.warn { background: rgba(230,126,34,0.1); }
.t4k-admin-btn.warn:hover { background: rgba(230,126,34,0.25); }
.t4k-admin-btn.danger { background: rgba(255,107,107,0.1); }
.t4k-admin-btn.danger:hover { background: rgba(255,107,107,0.3); }
.t4k-admin-link { color: var(--orange); font-weight: 700; text-decoration: none; }
.t4k-admin-link:hover { text-decoration: underline; }

/* Form elements */
.t4k-admin-form-group { margin-bottom: 1.25rem; }
.t4k-admin-form-group label { display: block; font-weight: 700; color: var(--dark); margin-bottom: 0.4rem; font-size: 0.9rem; }
.t4k-admin-form-group.half { flex: 1; }
.t4k-admin-form-row { display: flex; gap: 1rem; }
.t4k-admin-input { width: 100%; padding: 0.7rem 1rem; border: 2px solid var(--gray-lighter); border-radius: var(--radius-md); font-family: var(--font-primary); font-size: 0.95rem; transition: var(--transition); background: white; box-sizing: border-box; }
.t4k-admin-input:focus { outline: none; border-color: var(--orange-light); box-shadow: 0 0 0 3px rgba(14, 165, 233,0.1); }
select.t4k-admin-input { cursor: pointer; }
textarea.t4k-admin-input { resize: vertical; min-height: 60px; }
.t4k-admin-range { width: 100%; accent-color: var(--orange); }
.t4k-admin-range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--gray-light); margin-top: 0.25rem; }

/* Radio cards (gender selector etc.) */
.t4k-admin-radio-card { cursor: pointer; }
.t4k-admin-radio-card input[type="radio"] { display: none; }
.t4k-admin-radio-card .radio-card-content { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.75rem 0.5rem; border-radius: 12px; border: 2px solid var(--gray-lighter, #e0e0e0); background: rgba(255,255,255,0.6); transition: all 0.2s; text-align: center; }
.t4k-admin-radio-card .radio-card-content strong { font-size: 0.85rem; color: var(--dark); }
.t4k-admin-radio-card .radio-card-content small { font-size: 0.7rem; color: var(--gray-light); }
.t4k-admin-radio-card input[type="radio"]:checked + .radio-card-content { border-color: var(--orange); background: rgba(14, 165, 233,0.08); box-shadow: 0 0 0 3px rgba(14, 165, 233,0.15); }
.t4k-admin-radio-card:hover .radio-card-content { border-color: var(--purple-light, #FF9A76); }

/* Info card */
.t4k-admin-info-card { display: flex; flex-direction: column; gap: 1.25rem; }
.t4k-admin-info-step { display: flex; gap: 1rem; align-items: flex-start; }
.t4k-admin-info-step .step-num { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: white; font-weight: 800; font-size: 0.9rem; flex-shrink: 0; }
.t4k-admin-info-step strong { display: block; color: var(--dark); font-size: 0.95rem; margin-bottom: 0.15rem; }
.t4k-admin-info-step p { font-size: 0.85rem; color: var(--gray); margin: 0; }
.t4k-admin-note { background: rgba(245, 158, 11,0.12); border: 1px solid rgba(245, 158, 11,0.3); border-radius: var(--radius-md); padding: 1rem; font-size: 0.85rem; color: var(--gray); }
.t4k-admin-note code { background: rgba(14, 165, 233,0.08); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.82rem; color: var(--orange); }

/* Loading overlay */
.t4k-admin-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.t4k-admin-loader { background: white; border-radius: var(--radius-xl); padding: 3rem; text-align: center; max-width: 400px; box-shadow: var(--shadow-lg); }
.t4k-admin-loader h3 { font-family: var(--font-display); margin: 1.5rem 0 0.5rem; color: var(--dark); }
.t4k-admin-loader p { color: var(--gray); font-size: 0.9rem; margin: 0.25rem 0; }
.t4k-loader-steps { font-weight: 600; color: var(--orange) !important; }
.t4k-loader-spinner { width: 50px; height: 50px; border: 4px solid var(--gray-lighter); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Story detail: node tree */
.t4k-node-tree { display: flex; flex-direction: column; gap: 1rem; }
.t4k-node-card { border: 2px solid var(--gray-lighter); border-radius: var(--radius-md); padding: 1rem 1.25rem; transition: var(--transition); }
.t4k-node-card:hover { border-color: var(--orange-light); box-shadow: var(--shadow-sm); }
.t4k-node-card.decision { border-left: 4px solid var(--orange); }
.t4k-node-card.ending { border-left: 4px solid var(--coral); background: rgba(255,107,107,0.03); }
.t4k-node-card.narrative { border-left: 4px solid var(--teal); }
.t4k-node-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.t4k-node-id { font-family: 'Courier New', monospace; font-size: 0.75rem; color: var(--gray); }
.t4k-node-type-badge { padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.t4k-node-type-badge.narrative { background: rgba(6, 182, 212,0.12); color: var(--teal-dark); }
.t4k-node-type-badge.decision { background: rgba(14, 165, 233,0.12); color: var(--orange); }
.t4k-node-type-badge.ending { background: rgba(255,107,107,0.12); color: var(--coral); }
.t4k-node-order { font-size: 0.75rem; color: var(--gray-light); }
.t4k-node-emotion { font-size: 0.75rem; color: var(--orange); font-weight: 600; margin-left: auto; }
.t4k-node-image-badge { font-size: 0.75rem; color: var(--green); margin-left: 0.25rem; }
.t4k-node-content p { font-size: 0.88rem; color: var(--dark); line-height: 1.5; margin: 0; }
.t4k-node-image-preview { margin-top: 0.75rem; }
.t4k-node-image-preview img { max-width: 200px; max-height: 120px; border-radius: var(--radius-sm); border: 2px solid var(--gray-lighter); object-fit: cover; }
.t4k-node-choices { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--gray-lighter); }

/* Admin header actions */
.t4k-admin-header-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.t4k-image-gen-form { display: flex; align-items: center; gap: 0.5rem; }
.t4k-image-gen-form .form-select { height: 34px; font-size: 0.85rem; border-radius: var(--radius-sm); border: 2px solid var(--gray-lighter); }

/* Admin KPI orange variant */
.t4k-admin-kpi.orange { border-top-color: var(--orange); }
.t4k-admin-kpi.orange .t4k-kpi-number { color: var(--orange); }
.t4k-admin-kpi.green { border-top-color: var(--green); }
.t4k-admin-kpi.green .t4k-kpi-number { color: var(--green); }

.t4k-choices-label { font-size: 0.8rem; font-weight: 700; color: var(--orange); display: block; margin-bottom: 0.4rem; }
.t4k-choice-item { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.5rem; background: rgba(14, 165, 233,0.04); border-radius: var(--radius-sm); margin-bottom: 0.3rem; font-size: 0.82rem; }
.t4k-choice-text { color: var(--dark); font-weight: 600; }
.t4k-choice-arrow { color: var(--gray); font-family: 'Courier New', monospace; font-size: 0.75rem; }

/* Story ending cards */
.t4k-story-ending-card { padding: 0.75rem 1rem; border-radius: var(--radius-md); margin-bottom: 0.5rem; border-left: 3px solid var(--gray-light); }
.t4k-story-ending-card.positive { border-left-color: #0b7285; background: rgba(39,174,96,0.05); }
.t4k-story-ending-card.negative { border-left-color: var(--coral); background: rgba(255,107,107,0.05); }
.t4k-story-ending-card.neutral { border-left-color: var(--yellow); background: rgba(245, 158, 11,0.08); }
.t4k-ending-type { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--gray); margin-bottom: 0.2rem; }
.t4k-ending-desc { display: block; font-size: 0.85rem; color: var(--dark); font-weight: 600; }

/* Button variants for admin */
.btn-sm { padding: 0.45rem 1rem !important; font-size: 0.85rem !important; }
.btn-outline-magic { background: transparent !important; border: 2px solid var(--primary-light) !important; color: var(--primary) !important; }
.btn-outline-magic:hover { background: rgba(11, 114, 133, 0.08) !important; border-color: var(--primary) !important; }
.btn-primary-magic { background: var(--gradient-primary) !important; color: white !important; }
.btn-primary-magic:hover { background: var(--primary-dark) !important; }

/* ── Audio Toast Animations ── */
@keyframes slideUpFade {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideDownFade {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ── Modal Styles ── */
.t4k-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.t4k-modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.t4k-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.t4k-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--orange);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.t4k-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.t4k-modal-close:hover {
    color: var(--dark);
}

.t4k-modal-body {
    padding: 1.5rem;
}

.t4k-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(14, 165, 233, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.t4k-form-group {
    margin-bottom: 1rem;
}

.t4k-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 0.9rem;
}

.t4k-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.t4k-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

textarea.t4k-input {
    resize: vertical;
    min-height: 80px;
}

/* Gift button specific style */
.btn-gift {
    padding: 0.4rem 0.6rem !important;
}

/* Search bar styles */
.t4k-search-bar {
    background: white;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.08);
}

.t4k-search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.t4k-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.t4k-search-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--orange);
    opacity: 0.6;
}

.t4k-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
}

.t4k-search-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Plan badge styles */
.t4k-plan-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.t4k-plan-badge.free {
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    color: #666;
}

.t4k-plan-badge.basic {
    background: linear-gradient(135deg, var(--teal), #0ac8b9);
    color: white;
}

.t4k-plan-badge.premium {
    background: linear-gradient(135deg, var(--orange), #FF8C5A);
    color: white;
}

.t4k-plan-badge.unlimited {
    background: linear-gradient(135deg, var(--gold), #f39c12);
    color: white;
}

.t4k-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.t4k-status-badge.canceled {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
}

/* Pagination styles */
.t4k-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(14, 165, 233, 0.1);
    margin-top: 1rem;
}

.t4k-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: 8px;
    background: rgba(14, 165, 233, 0.08);
    color: var(--orange);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.t4k-page-link:hover {
    background: var(--orange);
    color: white;
    transform: translateY(-2px);
}

.t4k-page-link.active {
    background: linear-gradient(135deg, var(--orange), #FF8C5A);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.t4k-page-dots {
    color: var(--orange);
    opacity: 0.5;
    padding: 0 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FINANCIAL PANEL STYLES
   ═══════════════════════════════════════════════════════════════════ */

/* Info alert */
.t4k-admin-alert.info {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* Finance breakdown */
.t4k-finance-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.t4k-finance-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
    margin: 0.5rem 0 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px dashed var(--gray-lighter);
}

.t4k-finance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-lighter);
}

.t4k-finance-row:last-child {
    border-bottom: none;
}

.t4k-finance-row.subtotal {
    background: rgba(14, 165, 233, 0.05);
    margin: 0.5rem -1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-bottom: none;
}

.t4k-finance-row.total {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(6, 182, 212, 0.1));
    margin: 0.75rem -1rem 0;
    padding: 1rem;
    border-radius: 10px;
    border-bottom: none;
}

.t4k-finance-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark);
}

.t4k-finance-label i {
    width: 20px;
    text-align: center;
}

.t4k-finance-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.t4k-finance-rate {
    font-size: 0.7rem;
    color: var(--gray);
    background: var(--gray-lighter);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.35rem;
}

.t4k-finance-values {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: right;
}

.t4k-finance-count {
    font-size: 0.8rem;
    color: var(--gray);
}

.t4k-finance-amount {
    font-size: 1rem;
    color: var(--dark);
    font-weight: 700;
    min-width: 80px;
    text-align: right;
}

.t4k-finance-amount.highlight {
    color: var(--orange);
    font-size: 1.1rem;
}

/* Metrics cards */
.t4k-finance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.t4k-metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(14, 165, 233, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.2s;
}

.t4k-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.t4k-metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.t4k-metric-icon.purple { background: linear-gradient(135deg, var(--orange), #FF8C5A); }
.t4k-metric-icon.teal { background: linear-gradient(135deg, var(--teal), #0ac8b9); }
.t4k-metric-icon.yellow { background: linear-gradient(135deg, var(--yellow), #f39c12); }
.t4k-metric-icon.coral { background: linear-gradient(135deg, var(--coral), #EA580C); }

.t4k-metric-content {
    display: flex;
    flex-direction: column;
}

.t4k-metric-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
}

.t4k-metric-label {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
}

/* P&L Statement */
.t4k-pl-statement {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem 0;
}

.t4k-pl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.t4k-pl-row.income {
    background: rgba(39, 174, 96, 0.05);
}

.t4k-pl-row.expense {
    background: rgba(231, 76, 60, 0.05);
}

.t4k-pl-row.subtotal {
    background: rgba(14, 165, 233, 0.08);
    margin-top: 0.5rem;
}

.t4k-pl-row.total {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
}

.t4k-pl-row.total.profit {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.15), rgba(46, 204, 113, 0.1));
}

.t4k-pl-row.total.loss {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(192, 57, 43, 0.1));
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KUENTRIX LANDING PAGE v2 — Entirely new design
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Landing Hero ── */
.kx-landing-hero {
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.kx-hero-bg {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 0;
}
.kx-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}
.kx-blob-1 { width: 500px; height: 500px; top: -10%; right: -5%; background: var(--orange); animation: blobFloat 12s ease-in-out infinite; }
.kx-blob-2 { width: 400px; height: 400px; bottom: -5%; left: -8%; background: var(--teal); animation: blobFloat 15s ease-in-out infinite reverse; }
.kx-blob-3 { width: 300px; height: 300px; top: 40%; left: 50%; background: var(--yellow); animation: blobFloat 18s ease-in-out infinite 3s; }
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -25px) scale(1.08); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.kx-landing-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 2rem;
    position: relative; z-index: 10;
    max-width: 1200px; margin: 0 auto; width: 100%;
}
.kx-nav-login {
    font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
    color: var(--dark); display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.4rem; border-radius: var(--radius-pill);
    border: 2px solid var(--gray-lighter); background: white;
    transition: var(--transition);
}
.kx-nav-login:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.kx-hero-body {
    flex: 1; display: flex; align-items: center; gap: 4rem;
    max-width: 1200px; margin: 0 auto; padding: 2rem 2rem 4rem;
    position: relative; z-index: 2;
}
.kx-hero-text { flex: 1; max-width: 560px; }
.kx-eyebrow {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-display); font-size: 0.85rem; font-weight: 600;
    color: var(--orange); background: rgba(14, 165, 233, 0.08);
    padding: 0.4rem 1rem; border-radius: var(--radius-pill);
    margin-bottom: 1.25rem;
}
.kx-hero-text h1 {
    font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 700;
    line-height: 1.15; color: var(--dark); margin-bottom: 1rem;
}
.kx-hero-text > p {
    font-size: 1.15rem; line-height: 1.7; color: var(--gray);
    margin-bottom: 2rem; max-width: 480px;
}
.kx-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.btn-hero-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 1rem 2.5rem; border: 2px solid var(--gray-lighter); border-radius: var(--radius-pill);
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    color: var(--dark); background: white; transition: var(--bounce);
    text-decoration: none !important; cursor: pointer;
}
.btn-hero-outline:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-3px); box-shadow: var(--shadow-md); }

.kx-hero-trust {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem; color: var(--gray); font-weight: 500;
}
.kx-trust-avatars {
    display: flex;
}
.kx-trust-avatars span {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gradient-sunset); font-size: 1.1rem;
    border: 2px solid white; margin-left: -8px;
}
.kx-trust-avatars span:first-child { margin-left: 0; }

/* Device mockup */
.kx-hero-visual { flex: 1; display: flex; justify-content: center; }
.kx-device-frame {
    width: 340px; background: white; border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.06);
    overflow: hidden; transform: perspective(800px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.6s ease;
}
.kx-device-frame:hover { transform: perspective(800px) rotateY(0deg) rotateX(0deg) translateY(-8px); }
.kx-device-screen { padding: 0; }
.kx-screen-header {
    display: flex; gap: 6px; padding: 12px 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #f59e0b 100%);
}
.kx-dot { width: 10px; height: 10px; border-radius: 50%; }
.kx-dot-r { background: #ff5f56; }
.kx-dot-y { background: #ffbd2e; }
.kx-dot-g { background: #0ea5e9; }
.kx-screen-body { padding: 24px 20px 30px; }
.kx-screen-title { width: 60%; height: 14px; background: var(--gray-lighter); border-radius: 7px; margin-bottom: 16px; }
.kx-screen-line { height: 10px; border-radius: 5px; margin-bottom: 10px; }
.kx-screen-line.w80 { width: 80%; background: rgba(99, 102, 241, 0.15); }
.kx-screen-line.w60 { width: 60%; background: rgba(245, 158, 11, 0.2); }
.kx-screen-line.w70 { width: 70%; background: rgba(14, 165, 233, 0.12); }
.kx-screen-buttons { display: flex; gap: 10px; margin-top: 20px; }
.kx-screen-btn { display: block; width: 80px; height: 32px; border-radius: 16px; background: var(--gradient-sunset); }
.kx-screen-btn.alt { background: var(--gradient-teal); }

/* ── Sections ── */
.kx-section { padding: 6rem 1.5rem; }
.kx-section-inner { max-width: 1100px; margin: 0 auto; }
.kx-section-head { text-align: center; margin-bottom: 3.5rem; }
.kx-section-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 0.75rem; }
.kx-section-head p { font-size: 1.1rem; color: var(--gray); max-width: 600px; margin: 0 auto; }

.kx-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 0.4rem 1rem; border-radius: var(--radius-pill);
    background: rgba(14, 165, 233, 0.1); color: var(--orange);
    margin-bottom: 1rem;
}
.kx-pill.teal { background: rgba(99, 102, 241, 0.1); color: var(--teal-dark); }

/* ── Modules Grid ── */
.kx-modules { background: white; }
.kx-modules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.kx-module-card {
    border-radius: var(--radius-xl); padding: 2rem 1.75rem; position: relative;
    overflow: hidden; border: 2px solid transparent; transition: var(--bounce);
}
.kx-module-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.kx-mod-stories { background: linear-gradient(145deg, #FFF7ED 0%, #FFFAF5 100%); border-color: rgba(14, 165, 233, 0.1); }
.kx-mod-stories::before { background: var(--gradient-sunset); }
.kx-mod-stories .kx-module-icon { color: var(--orange); background: rgba(14, 165, 233, 0.12); }
.kx-mod-dictation { background: linear-gradient(145deg, #EFF6FF 0%, #F8FAFC 100%); border-color: rgba(59, 130, 246, 0.1); }
.kx-mod-dictation::before { background: linear-gradient(135deg, #0ea5e9, #60A5FA); }
.kx-mod-dictation .kx-module-icon { color: #0ea5e9; background: rgba(59, 130, 246, 0.1); }
.kx-mod-math { background: linear-gradient(145deg, #ECFDF5 0%, #F0FDF4 100%); border-color: rgba(16, 185, 129, 0.1); }
.kx-mod-math::before { background: var(--gradient-teal); }
.kx-mod-math .kx-module-icon { color: var(--teal); background: rgba(99, 102, 241, 0.1); }
.kx-module-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.kx-module-icon {
    width: 56px; height: 56px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 1rem;
}
.kx-module-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.kx-module-card p { font-size: 0.92rem; color: var(--gray); margin-bottom: 1rem; line-height: 1.6; }
.kx-feature-list { list-style: none; padding: 0; margin: 0; }
.kx-feature-list li {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; font-weight: 600; color: var(--dark);
    padding: 0.4rem 0;
}
.kx-feature-list li i { color: var(--teal); font-size: 0.75rem; }

/* ── Features Grid ── */
.kx-why { background: var(--bg); }
.kx-features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.kx-feature-item {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1.25rem; border-radius: var(--radius-lg);
    background: white; border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--bounce);
}
.kx-feature-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kx-feat-icon {
    width: 48px; height: 48px; min-width: 48px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.kx-feat-icon.orange { background: rgba(14, 165, 233, 0.1); color: var(--orange); }
.kx-feat-icon.teal { background: rgba(99, 102, 241, 0.1); color: var(--teal); }
.kx-feat-icon.yellow { background: rgba(245, 158, 11, 0.15); color: #c2410c; }
.kx-feat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.kx-feat-icon.pink { background: rgba(236, 72, 153, 0.1); color: var(--pink); }
.kx-feat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.kx-feature-item h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.kx-feature-item p { font-size: 0.88rem; color: var(--gray); margin: 0; line-height: 1.5; }

/* ── Steps ── */
.kx-how { background: white; }
.kx-steps { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.kx-step-card {
    text-align: center; padding: 2rem 1.5rem; flex: 1; max-width: 280px;
    border-radius: var(--radius-xl); background: var(--bg);
    border: 2px solid transparent; transition: var(--bounce); position: relative;
}
.kx-step-card:hover { transform: translateY(-5px); border-color: var(--orange-light); box-shadow: var(--shadow-md); }
.kx-step-num {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gradient-sunset); color: white;
    font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}
.kx-step-icon { font-size: 2.2rem; color: var(--orange); margin-bottom: 0.75rem; display: block; }
.kx-step-card h4 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.kx-step-card p { font-size: 0.88rem; color: var(--gray); margin: 0; line-height: 1.5; }
.kx-step-connector {
    color: var(--gray-lighter); font-size: 1.2rem;
    display: flex; align-items: center; padding: 0 0.5rem;
}

/* ── Pricing Teaser ── */
.kx-pricing-teaser { background: var(--bg); }
.kx-pricing-card {
    display: flex; align-items: stretch; gap: 0;
    background: white; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg); overflow: hidden;
    border: 2px solid rgba(14, 165, 233, 0.08);
}
.kx-pricing-free, .kx-pricing-pro { flex: 1; padding: 2.5rem 2rem; }
.kx-pricing-free { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kx-pricing-divider { width: 2px; background: var(--gray-lighter); margin: 1.5rem 0; }
.kx-price-badge {
    display: inline-block; font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 0.35rem 1rem; border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, 0.1); color: var(--teal-dark);
    margin-bottom: 0.75rem;
}
.kx-price-badge.pro { background: rgba(14, 165, 233, 0.1); color: var(--orange); }
.kx-pricing-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.kx-pricing-free p { font-size: 0.92rem; color: var(--gray); margin-bottom: 1.5rem; line-height: 1.5; }
.kx-pricing-features { list-style: none; padding: 0; margin: 0; }
.kx-pricing-features li {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0; font-size: 0.92rem; font-weight: 600; color: var(--dark);
}
.kx-pricing-features li i { color: var(--orange); font-size: 0.85rem; width: 1.2rem; }

/* ── Final CTA ── */
.kx-final-cta {
    background: var(--gradient-hero); padding: 5rem 1.5rem;
    text-align: center; color: white; position: relative; overflow: hidden;
}
.kx-final-cta::before { content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.kx-final-cta h2 { color: white; font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.75rem; }
.kx-final-cta > .kx-section-inner > p { color: rgba(255,255,255,0.9); font-size: 1.1rem; margin-bottom: 2rem; }
.kx-cta-sub { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-top: 1rem; }

/* ── Landing Footer v2 ── */
.kx-landing-footer { background: linear-gradient(135deg, #1A202C 0%, #2D3748 100%); padding: 2.5rem 1.5rem 2rem; }
.kx-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.kx-footer-brand { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: white; }
.kx-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }
.kx-footer-links a { color: rgba(255,255,255,0.55); font-size: 0.85rem; font-weight: 500; transition: var(--transition); }
.kx-footer-links a:hover { color: var(--yellow); }
.kx-footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.3); }

/* ── Landing Responsive ── */
@media (max-width: 768px) {
    .kx-hero-body { flex-direction: column; gap: 2rem; padding: 1rem 1rem 2rem; text-align: center; }
    .kx-hero-text { max-width: 100%; }
    .kx-hero-text > p { max-width: 100%; }
    .kx-hero-actions { justify-content: center; }
    .kx-hero-trust { justify-content: center; }
    .kx-hero-visual { display: none; }
    .kx-modules-grid { grid-template-columns: 1fr; }
    .kx-features-grid { grid-template-columns: 1fr; }
    .kx-steps { flex-direction: column; gap: 1.5rem; }
    .kx-step-connector { transform: rotate(90deg); }
    .kx-step-card { max-width: 100%; }
    .kx-pricing-card { flex-direction: column; }
    .kx-pricing-divider { width: 100%; height: 2px; margin: 0; }
    .kx-section { padding: 3.5rem 1rem; }
    .kx-landing-nav { padding: 1rem; }
    .kx-footer-links { flex-direction: column; gap: 0.75rem; }
}
@media (max-width: 480px) {
    .kx-hero-text h1 { font-size: 1.8rem; }
    .kx-hero-actions { flex-direction: column; align-items: center; }
    .kx-hero-actions .btn-magic,
    .kx-hero-actions .btn-hero-outline { width: 100%; max-width: 300px; }
    .kx-section-head h2 { font-size: 1.35rem; }
}

.t4k-pl-label {
    font-size: 0.9rem;
    color: var(--dark);
}

.t4k-pl-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.t4k-pl-value.highlight-green {
    color: #0b7285;
}

.t4k-pl-value.highlight-red {
    color: #ef4444;
}

.t4k-pl-separator {
    height: 1px;
    background: var(--gray-lighter);
    margin: 0.75rem 0;
}

.t4k-pl-separator.thick {
    height: 2px;
    background: linear-gradient(90deg, var(--orange), var(--teal));
}

/* Cost Reference */
.t4k-cost-reference {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.t4k-cost-ref-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(14, 165, 233, 0.04);
    border-radius: 8px;
    font-size: 0.85rem;
}

.t4k-cost-ref-item strong {
    color: var(--dark);
}

.t4k-cost-ref-item span {
    color: var(--gray);
    font-family: monospace;
}

.t4k-cost-disclaimer {
    font-size: 0.8rem;
    color: var(--gray);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0;
}

.t4k-cost-disclaimer i {
    color: var(--yellow);
    margin-right: 0.35rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER — Global (loaded in _Layout, needs to be in site.css)
   ═══════════════════════════════════════════════════════════════════════════════ */


/* ============================================================================
   KUENTRIX LANDING v3 - Professional EdTech direction
   ============================================================================ */

:root {
    --nx-primary: #0b7285;
    --nx-primary-2: #6366f1;
    --nx-accent: #0ea5e9;
    --nx-warm: #f59e0b;
    --nx-warm-soft: #fff7ed;
    --nx-ink: #0f172a;
    --nx-muted: #475569;
    --nx-surface: #f8fafc;
    --nx-surface-2: #eef6f8;
    --nx-card: #ffffff;
    --nx-line: #d7e2e9;
    --nx-gradient: linear-gradient(130deg, #0b7285 0%, #6366f1 55%, #8b5cf6 100%);
}

.nx-landing {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.12), transparent 35%),
                radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.16), transparent 40%),
                linear-gradient(180deg, #f4fbfd 0%, #f8fafc 100%);
    color: var(--nx-ink);
}

.nx-grid-bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(11, 114, 133, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(11, 114, 133, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.nx-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.45;
    pointer-events: none;
}

.nx-orb-a {
    width: 420px;
    height: 420px;
    right: -120px;
    top: -90px;
    background: rgba(20, 184, 166, 0.45);
}

.nx-orb-b {
    width: 300px;
    height: 300px;
    left: -100px;
    bottom: -80px;
    background: rgba(132, 204, 22, 0.35);
}

.nx-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.nx-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.25rem;
    max-width: 1140px;
    margin: 0 auto;
}

.nx-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--nx-ink);
    font-family: 'Sora', var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nx-brand img {
    width: 34px;
    height: 34px;
}

.nx-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.nx-link {
    color: var(--nx-muted);
    font-weight: 700;
    font-size: 0.92rem;
}

.nx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--nx-gradient);
    color: #fff;
    font-family: 'Sora', var(--font-display);
    font-weight: 700;
    padding: 0.78rem 1.5rem;
    box-shadow: 0 12px 28px rgba(11, 114, 133, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nx-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(11, 114, 133, 0.34);
}

.nx-btn-sm {
    padding: 0.56rem 1rem;
    font-size: 0.88rem;
}

.nx-btn-lg {
    padding: 0.95rem 2rem;
    font-size: 1rem;
}

.nx-btn-ghost {
    background: transparent;
    color: var(--nx-primary);
    border-color: var(--nx-line);
    box-shadow: none;
}

.nx-btn-ghost:hover {
    color: var(--nx-primary);
    border-color: var(--nx-primary-2);
    background: rgba(20, 184, 166, 0.08);
}

.nx-hero {
    max-width: 1140px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4.5rem;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.2rem;
    align-items: center;
}

.nx-kicker {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nx-primary);
    font-weight: 800;
    margin-bottom: 0.8rem;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.12), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

.nx-hero-copy h1 {
    font-family: 'Sora', var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    color: var(--nx-ink);
}

.nx-lead {
    color: var(--nx-muted);
    font-size: 1.08rem;
    max-width: 60ch;
    margin-bottom: 1.45rem;
}

.nx-cta-row {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.nx-trust {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--nx-muted);
    font-size: 0.9rem;
}

.nx-trust strong {
    color: var(--nx-ink);
}

.nx-hero-panel {
    background: var(--nx-card);
    border: 1px solid var(--nx-line);
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.nx-story-band {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.nx-story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.nx-story-card {
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.08), rgba(245, 158, 11, 0.09));
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 1.15rem;
    position: relative;
}

.nx-story-card::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--nx-warm);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.15);
}

.nx-story-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
}

.nx-story-card p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 0.92rem;
}

.nx-panel-head {
    background: #f1f8fa;
    border-bottom: 1px solid var(--nx-line);
    padding: 0.8rem 0.9rem;
    display: flex;
    gap: 0.4rem;
}

.nx-panel-head span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #9ecad1;
}

.nx-panel-body {
    padding: 1.1rem;
}

.nx-stat-card {
    background: linear-gradient(135deg, rgba(11, 114, 133, 0.1), rgba(14, 165, 233, 0.16));
    border: 1px solid rgba(11, 114, 133, 0.16);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
}

.nx-stat-card p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 0.85rem;
}

.nx-stat-card h3 {
    margin: 0.25rem 0 0;
    font-size: 1.45rem;
    color: var(--nx-ink);
}

.nx-bars {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.nx-bars div {
    height: 10px;
    width: var(--w);
    border-radius: 999px;
    background: var(--nx-gradient);
}

.nx-chip-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.nx-chip-row span {
    background: #f1f5f9;
    color: var(--nx-muted);
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    border: 1px solid #e2e8f0;
}

.nx-section {
    padding: 4.75rem 0;
}

.nx-section-light {
    background: var(--nx-surface);
    border-top: 1px solid #e8eef3;
    border-bottom: 1px solid #e8eef3;
}

.nx-section-head {
    text-align: center;
    margin-bottom: 2.1rem;
}

.nx-section-head h2,
.nx-method h2,
.nx-final-cta h2 {
    font-family: 'Sora', var(--font-display);
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--nx-ink);
}

.nx-pillars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.nx-pillar {
    background: var(--nx-card);
    border: 1px solid var(--nx-line);
    border-radius: 16px;
    padding: 1.2rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nx-pillar:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.nx-pillar i {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(20, 184, 166, 0.12);
    color: var(--nx-primary);
    margin-bottom: 0.75rem;
}

.nx-pillar h3 {
    margin: 0 0 0.45rem;
    font-size: 1.08rem;
}

.nx-pillar p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 0.92rem;
}

.nx-method {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.2rem;
    align-items: stretch;
}

.nx-method p,
.nx-method li {
    color: var(--nx-muted);
}

.nx-method ul {
    margin: 0.9rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.38rem;
}

.nx-metrics {
    display: grid;
    gap: 0.8rem;
}

.nx-metrics > div {
    background: var(--nx-card);
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    padding: 0.95rem 1rem;
}

.nx-metrics span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.85rem;
}

.nx-metrics strong {
    font-size: 1.55rem;
    color: var(--nx-ink);
}

.nx-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.nx-price-card {
    background: var(--nx-card);
    border-radius: 16px;
    border: 1px solid var(--nx-line);
    padding: 1.35rem;
}

.nx-price-card h3 {
    margin: 0 0 0.45rem;
}

.nx-price-card p {
    margin-top: 0;
    color: var(--nx-muted);
}

.nx-price-card ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1rem;
    display: grid;
    gap: 0.32rem;
    color: var(--nx-muted);
}

.nx-price-pro {
    border-color: rgba(11, 114, 133, 0.35);
    box-shadow: 0 12px 30px rgba(11, 114, 133, 0.15);
}

.nx-final-cta {
    background: #0f172a;
    padding: 4.25rem 0;
    text-align: center;
}

.nx-final-cta h2 {
    color: #f8fafc;
    margin-bottom: 0.65rem;
}

.nx-final-cta p {
    color: #cbd5e1;
    margin: 0 auto 1.2rem;
    max-width: 58ch;
}

.nx-footer {
    background: #020617;
    border-top: 1px solid #0f172a;
    padding: 1.3rem 0 2rem;
}

.nx-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.nx-footer .nx-brand {
    color: #e2e8f0;
}

.nx-footer nav {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.nx-footer nav a {
    color: #94a3b8;
    font-size: 0.86rem;
}

.nx-footer nav a:hover {
    color: #f8fafc;
}

@media (max-width: 960px) {
    .nx-hero,
    .nx-method,
    .nx-story-grid,
    .nx-pillars,
    .nx-pricing {
        grid-template-columns: 1fr;
    }

    .nx-hero {
        padding-top: 1.25rem;
    }
}

@media (max-width: 560px) {
    .nx-topbar {
        padding: 1rem 0.9rem;
    }

    .nx-topbar-actions {
        gap: 0.4rem;
    }

    .nx-link {
        display: none;
    }

    .nx-cta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .nx-btn {
        width: 100%;
    }

    .nx-trust {
        flex-direction: column;
        gap: 0.4rem;
    }
}

/* ============================================================================
   KUENTRIX LANDING v4 - Child-friendly + Professional Balance
   ============================================================================ */

/* Floating decorative elements */
.nx-floaties {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.nx-float-star,
.nx-float-book,
.nx-float-sparkle {
    position: absolute;
    opacity: 0.15;
    animation: nx-float 6s ease-in-out infinite;
}

.nx-float-star {
    top: 15%;
    left: 8%;
    font-size: 2.5rem;
    color: var(--nx-warm);
    animation-delay: 0s;
}

.nx-float-book {
    top: 55%;
    right: 12%;
    font-size: 2rem;
    color: var(--nx-primary);
    animation-delay: -2s;
}

.nx-float-sparkle {
    bottom: 25%;
    left: 15%;
    font-size: 1.8rem;
    color: var(--nx-accent);
    animation-delay: -4s;
}

@keyframes nx-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.nx-orb-c {
    width: 200px;
    height: 200px;
    left: 50%;
    top: 60%;
    background: rgba(245, 158, 11, 0.25);
}

/* Highlight text animation */
.nx-highlight {
    background: linear-gradient(120deg, rgba(245, 158, 11, 0.2) 0%, rgba(132, 204, 22, 0.2) 100%);
    border-radius: 4px;
    padding: 0 0.15em;
}

/* Kicker with icon */
.nx-kicker i {
    margin-right: 0.35rem;
}

/* Trust badges with icons */
.nx-trust li i {
    color: var(--nx-primary-2);
    margin-right: 0.25rem;
}

/* Enhanced stat card */
.nx-stat-streak {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nx-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.nx-streak-emoji {
    font-size: 1rem;
    margin-left: 0.25rem;
}

/* Bars with labels */
.nx-bars div {
    position: relative;
}

.nx-bars div::after {
    content: attr(data-label);
    position: absolute;
    right: calc(100% - var(--w) + 8px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: white;
    font-weight: 600;
}

/* Chips with icons */
.nx-chip-row span i {
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

/* Section icons (replacing emojis) */
.nx-section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-2));
    color: white;
    font-size: 1.5rem;
}

/* Story cards with icons */
.nx-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-2));
    display: grid;
    place-items: center;
    color: white;
    margin-bottom: 0.65rem;
}

.nx-card-icon i {
    font-size: 1.1rem;
}

/* Pillar enhancements */
.nx-pillar {
    position: relative;
    overflow: visible;
}

.nx-pillar-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nx-pillar-stories i { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.nx-pillar-writing i { color: #8b5cf6; background: rgba(139, 92, 246, 0.12); }
.nx-pillar-math i { color: #0ea5e9; background: rgba(6, 182, 212, 0.12); }

/* Method section enhancements */
.nx-method ul {
    list-style: none;
    padding: 0;
}

.nx-method ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nx-method ul li i {
    color: var(--nx-accent);
}

.nx-metric-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--nx-card);
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    padding: 0.95rem 1rem;
}

.nx-metric-card i {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(20, 184, 166, 0.12);
    color: var(--nx-primary);
    flex-shrink: 0;
}

.nx-metric-card span {
    display: block;
    color: var(--nx-muted);
    font-size: 0.82rem;
}

.nx-metric-card strong {
    font-size: 1.4rem;
    color: var(--nx-ink);
}

/* ============================================================================
   PRICING GRID - All plans
   ============================================================================ */

.nx-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.nx-price-card {
    background: var(--nx-card);
    border-radius: 18px;
    border: 1px solid var(--nx-line);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nx-price-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.nx-price-header {
    margin-bottom: 1rem;
}

.nx-price-header h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--nx-ink);
}

.nx-price-header h3 span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nx-muted);
}

.nx-price-desc {
    margin: 0.25rem 0 0;
    color: var(--nx-muted);
    font-size: 0.88rem;
}

.nx-price-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex-grow: 1;
}

.nx-price-card ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    color: var(--nx-muted);
    font-size: 0.88rem;
}

.nx-price-card ul li i {
    color: var(--nx-accent);
    font-size: 0.8rem;
}

.nx-price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-2));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nx-price-pro {
    border-color: var(--nx-primary);
    box-shadow: 0 8px 30px rgba(11, 114, 133, 0.18);
}

.nx-price-free .nx-price-header h3 { color: var(--nx-muted); }

/* ============================================================================
   SCHOOL BANNER
   ============================================================================ */

.nx-school-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 2rem;
}

.nx-school-content {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.nx-school-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.nx-school-content h3 {
    margin: 0 0 0.35rem;
    color: var(--nx-ink);
}

.nx-school-content p {
    margin: 0;
    color: var(--nx-muted);
    font-size: 0.92rem;
}

.nx-school-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.nx-school-tier {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.nx-school-tier strong {
    display: block;
    color: var(--nx-ink);
    margin-bottom: 0.25rem;
}

.nx-school-tier span {
    display: block;
    font-size: 0.82rem;
    color: var(--nx-muted);
}

.nx-school-price {
    font-size: 1.25rem !important;
    font-weight: 700;
    color: var(--nx-primary) !important;
    margin-top: 0.5rem;
}

.nx-btn-school {
    background: linear-gradient(135deg, #f97316, #f59e0b);
    display: block;
    text-align: center;
}

/* ============================================================================
   FINAL CTA enhancements
   ============================================================================ */

.nx-cta-icon {
    background: linear-gradient(135deg, var(--nx-warm), #f97316) !important;
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
}

.nx-btn-glow {
    animation: nx-glow 2s ease-in-out infinite;
}

@keyframes nx-glow {
    0%, 100% { box-shadow: 0 12px 28px rgba(11, 114, 133, 0.28); }
    50% { box-shadow: 0 12px 40px rgba(11, 114, 133, 0.45), 0 0 20px rgba(20, 184, 166, 0.3); }
}

/* ============================================================================
   RESPONSIVE - Pricing and School
   ============================================================================ */

@media (max-width: 1100px) {
    .nx-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nx-pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .nx-school-plans {
        grid-template-columns: 1fr;
    }
    
    .nx-school-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 560px) {
    .nx-section-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .nx-floaties {
        display: none;
    }
}

.t4k-cookie-banner {
    position: fixed !important;
    bottom: 0 !important;
    left: 0;
    right: 0;
    z-index: 10001 !important;
    background: var(--white, #FFFFFF);
    border-top: 3px solid var(--purple, #0ea5e9);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    padding: 1.5rem 2rem;
    animation: t4k-slide-up 0.4s ease-out;
}
@keyframes t4k-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.t4k-cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}
.t4k-cookie-text { max-width: 700px; }
.t4k-cookie-text p { margin: 0; font-size: 0.9rem; color: var(--dark, #1E293B); line-height: 1.6; }
.t4k-cookie-text p:first-child { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.t4k-cookie-text a { color: var(--purple, #0ea5e9); text-decoration: underline; font-weight: 600; }
.t4k-cookie-actions { display: flex; gap: 0.75rem; flex-shrink: 0; align-items: center; justify-content: center; }
.t4k-cookie-actions button { padding: 0.7rem 1.5rem; font-size: 0.9rem; font-weight: 700; border-radius: 10px; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
@media (max-width: 767px) {
    .t4k-cookie-banner { padding: 1.25rem 1rem; }
    .t4k-cookie-content { gap: 1rem; }
    .t4k-cookie-text p { font-size: 0.85rem; }
    .t4k-cookie-text p:first-child { font-size: 0.92rem; }
    .t4k-cookie-actions button { padding: 0.6rem 1.2rem; font-size: 0.85rem; }
}

.t4k-cost-disclaimer a {
    color: var(--orange);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PWA Install Banner
   ═══════════════════════════════════════════════════════════════════════════════ */

.t4k-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #0ea5e9 0%, #FF9A76 100%);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(14, 165, 233, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.t4k-install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.t4k-install-icon {
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.t4k-install-text {
    flex: 1;
    color: white;
}

.t4k-install-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
}

.t4k-install-text span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.t4k-install-banner .btn-magic {
    flex-shrink: 0;
    background: white;
    color: var(--orange);
    font-weight: 800;
    border: none;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
}

.t4k-install-banner .btn-magic:hover {
    background: var(--yellow-light);
    transform: translateY(-1px);
}

.t4k-install-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    flex-shrink: 0;
}

.t4k-install-close:hover { color: white; }

@media (max-width: 480px) {
    .t4k-install-content { flex-wrap: wrap; gap: 0.5rem; }
    .t4k-install-text { min-width: 60%; }
}

/* ── PWA standalone mode overrides ── */
@media (display-mode: standalone) {
    /* Hide browser-specific elements when running as installed PWA */
    .t4k-install-banner { display: none !important; }
}


