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

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

/* -- CSS Variables - Unified brand (matches landing page) -- */
:root {
    /* Primary - Brand Green (landing CTA buttons) */
    --primary:      #22C55E;
    --primary-light: #4ade80;
    --primary-dark:  #16a34a;
    /* Secondary - Brand Blue (icons, accents, gradients) */
    --secondary:    #1a56db;
    --secondary-light: #3b82f6;
    --secondary-dark: #1e40af;
    /* Accent - Brand Purple (highlights, gradient end) */
    --accent:       #7c3aed;
    --accent-light: #a78bfa;
    --accent-dark:  #6d28d9;
    /* Warm - Amber (icon accents) */
    --warm:         #f59e0b;
    --warm-light:   #fbbf24;
    --warm-dark:    #d97706;
    /* Legacy aliases (mapped to unified palette) */
    --orange:       #f59e0b;
    --orange-light: #fbbf24;
    --orange-dark:  #d97706;
    --teal:         #1a56db;
    --teal-light:   #3b82f6;
    --teal-dark:    #1e40af;
    --yellow:       #f59e0b;
    --yellow-light: #fef3c7;
    --coral:        #ef4444;
    --coral-light:  #fca5a5;
    --pink:         #ec4899;
    --green:        #22C55E;
    --green-light:  #bbf7d0;
    --blue:         #1a56db;
    --blue-light:   #93c5fd;
    --purple:       #7c3aed;
    --purple-light: #c4b5fd;
    /* Neutrals (matching landing) */
    --dark:         #0f172a;
    --text-heading: #334155;
    --gray:         #64748b;
    --gray-light:   #94a3b8;
    --gray-lighter: #e2e8f0;
    --bg:           #f8fafc;
    --white:        #ffffff;
    /* Gradients - Blue/Purple brand scheme (matching landing) */
    --gradient-hero:    linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    --gradient-primary: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    --gradient-teal:    linear-gradient(135deg, #1a56db 0%, #3b82f6 100%);
    --gradient-warm:    linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-sunset:  linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    --gradient-card:    linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    --gradient-accent:  linear-gradient(135deg, #1a56db 0%, #22C55E 100%);
    /* Shadows - refined to match landing subtlety */
    --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(26, 86, 219, 0.25);
    --shadow-teal:  0 8px 25px rgba(26, 86, 219, 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 - Fredoka headings, Nunito body (matching landing) */
    --font-primary:  'Nunito', 'Segoe UI', sans-serif;
    --font-display:  'Fredoka', 'Nunito', 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(--secondary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--secondary-light); }

/* -- Navbar -- */
.t4k-navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(26, 86, 219, 0.1);
    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(--secondary); background: rgba(26, 86, 219, 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(--secondary); }

/* -- Buttons -- */
.btn-magic { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-lg); font-family: var(--font-display); font-weight: 700; font-size: 1rem; cursor: pointer; transition: var(--transition); 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(-2px); text-decoration: none !important; }
.btn-magic:active { transform: translateY(1px); }

/* Duolingo-style 3D buttons - matches landing page */
.btn-primary-magic { background: #22C55E; color: white; box-shadow: 0 4px 0 #16a34a; }
.btn-primary-magic:hover { box-shadow: 0 6px 0 #16a34a; color: white; }
.btn-primary-magic:active { box-shadow: 0 2px 0 #16a34a; }
.btn-secondary-magic { background: white; color: var(--secondary); border: 2px solid var(--gray-lighter); box-shadow: 0 4px 0 var(--gray-lighter); }
.btn-secondary-magic:hover { background: rgba(26, 86, 219, 0.04); color: var(--secondary); border-color: var(--secondary-light); box-shadow: 0 6px 0 var(--gray-lighter); }
.btn-secondary-magic:active { box-shadow: 0 2px 0 var(--gray-lighter); }
.btn-teal-magic { background: var(--secondary); color: white; box-shadow: 0 4px 0 var(--secondary-dark); }
.btn-teal-magic:hover { box-shadow: 0 6px 0 var(--secondary-dark); color: white; }
.btn-teal-magic:active { box-shadow: 0 2px 0 var(--secondary-dark); }
.btn-coral-magic { background: var(--coral); color: white; box-shadow: 0 4px 0 #dc2626; }
.btn-coral-magic:hover { box-shadow: 0 6px 0 #dc2626; color: white; }
.btn-coral-magic:active { box-shadow: 0 2px 0 #dc2626; }
.btn-hero-primary { background: #22C55E; color: white !important; box-shadow: 0 4px 0 #16a34a; }
.btn-hero-primary:hover { box-shadow: 0 6px 0 #16a34a; color: white !important; }
.btn-hero-secondary { background: white; color: var(--secondary) !important; border: 2px solid var(--gray-lighter); box-shadow: 0 4px 0 var(--gray-lighter); }
.btn-hero-secondary:hover { background: rgba(26, 86, 219, 0.04); color: var(--secondary) !important; box-shadow: 0 6px 0 var(--gray-lighter); }
.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: #fff; border-radius: var(--radius-xl); padding: 2rem; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06); transition: var(--transition); border: 1px solid #dbe4f0; position: relative; overflow: hidden; border-left: 4px solid transparent; }
.t4k-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-left-color: var(--secondary); }
.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(124, 58, 237, 0.1); color: var(--accent); }
.t4k-card-icon.teal { background: rgba(26, 86, 219, 0.1); color: var(--secondary); }
.t4k-card-icon.coral { background: rgba(239, 68, 68, 0.1); color: var(--coral); }
.t4k-card-icon.yellow { background: rgba(245, 158, 11, 0.12); color: var(--warm-dark); }
.t4k-card-icon.pink { background: rgba(236, 72, 153, 0.1); color: var(--pink); }
.t4k-card-icon.green { background: rgba(34, 197, 94, 0.1); color: var(--primary); }
.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(--secondary-light); box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.1); }
.t4k-input.input-error { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(229, 57, 53, 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(124, 58, 237, 0.1); color: var(--accent); }
.t4k-badge.teal { background: rgba(26, 86, 219, 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(--secondary); }
.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(26, 86, 219, 0.08); padding: 0.5rem 1rem; border-radius: var(--radius-pill); font-weight: 700; color: var(--secondary); 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(26, 86, 219, 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(26, 86, 219, 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(26, 86, 219, 0.12), 0 2px 6px rgba(0,0,0,0.04); 
    border-color: rgba(26, 86, 219, 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(26, 86, 219, 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-avatar-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
}
.t4k-child-avatar-emoji .emoji-avatar {
    font-size: 2.2rem;
    line-height: 1;
}
.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(26, 86, 219, 0.04); box-shadow: 0 8px 28px rgba(26, 86, 219, 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(26, 86, 219, 0.12) 0%, rgba(124, 58, 237, 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(--secondary-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(--secondary-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(--secondary-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(229, 57, 53,0.1); color: var(--coral); border: 1px solid rgba(229, 57, 53,0.2); }
.t4k-alert-info { background: rgba(26, 86, 219,0.08); color: var(--secondary); border: 1px solid rgba(26, 86, 219,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(--accent); }
.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(229, 57, 53,0.1) !important; }
.validation-summary-errors ul { list-style: none; padding: 0; margin: 0; }
.validation-summary-errors { background: rgba(229, 57, 53,0.08); border: 1px solid rgba(229, 57, 53,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(--secondary);
    }
    .t4k-nav-links .t4k-nav-link:hover,
    .t4k-nav-links .t4k-nav-link:active {
        background: rgba(26, 86, 219, 0.08);
        color: var(--secondary);
    }
    .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(--secondary); margin-bottom: 1rem; transition: var(--transition); text-decoration: none !important; }
.t4k-back-link:hover { color: var(--secondary-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 {
    border-left: 4px solid var(--hub-color, var(--secondary));
}
.t4k-hub-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--hub-color, var(--secondary)) 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(--secondary)) 10%, white);
    color: var(--hub-color, var(--secondary));
    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: #1a56db; }
.t4k-hub-card[data-section="dictado"]  { --hub-color: #1a56db; }
.t4k-hub-card[data-section="math"]     { --hub-color: #7c3aed; }
.t4k-hub-card[data-section="logros"]   { --hub-color: #f59e0b; }
.t4k-hub-card[data-section="amigos"]   { --hub-color: #7c3aed; }

@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(26, 86, 219, 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(--secondary);
    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(26, 86, 219, 0.08);
    color: var(--secondary);
    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: #d97706;
}
.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(26, 86, 219, 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(--secondary);
    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(26, 86, 219, 0.15);
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.08);
}
.t4k-mini-story img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.t4k-mini-story-fallback {
    color: var(--secondary);
    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: #1a56db; }
.t4k-mini-status.progress { background: #f59e0b; }
.t4k-mini-status.done { background: #1a56db; }
.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(124, 58, 237, 0.2); background: linear-gradient(145deg, #ffffff 0%, #EDE9FE 100%); }
.t4k-stat-bubble.purple .t4k-stat-circle i { color: var(--accent); }
.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: #d97706; }
.t4k-stat-bubble.coral .t4k-stat-circle { border-color: rgba(229, 57, 53, 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(--secondary); border: 2px solid var(--secondary-light); box-shadow: 0 3px 0 var(--gray-lighter); border-radius: var(--radius-lg); font-weight: 700; }
.btn-outline-magic:hover { background: rgba(26, 86, 219,0.05); color: var(--secondary-dark); transform: translateY(-1px); }
.btn-outline-magic:active { box-shadow: none; transform: translateY(2px); }

/* -- 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(--secondary-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.t4k-avatar-option.selected { border-color: var(--secondary); background: rgba(26, 86, 219,0.06); box-shadow: 0 0 0 3px rgba(26, 86, 219,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(--secondary-light); color: var(--secondary); background: rgba(26, 86, 219,0.04); }
.t4k-chip.active { border-color: var(--secondary); background: rgba(26, 86, 219,0.1); color: var(--secondary); box-shadow: 0 0 0 2px rgba(26, 86, 219,0.1); }
.t4k-chip-color.active { border-color: var(--chip-color, var(--secondary)); background: color-mix(in srgb, var(--chip-color, var(--secondary)) 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(--accent); background: rgba(124, 58, 237, 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(229, 57, 53,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(26, 86, 219,0.08); color: var(--secondary); 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(--secondary); 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(--secondary-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(229, 57, 53,0.05); border: 1px solid rgba(229, 57, 53,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(--secondary-light); color: var(--secondary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.t4k-filter-chip.active { border-color: var(--secondary); background: rgba(26, 86, 219,0.1); color: var(--secondary); box-shadow: 0 2px 8px rgba(26, 86, 219,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 { border-left: 4px solid var(--secondary); }
.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(--secondary-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(26, 86, 219,0.08); color: var(--secondary); 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(--secondary-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(--secondary); }
.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(--secondary); }

/* 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(--secondary-light); background: rgba(26, 86, 219,0.04); transform: scale(1.08); color: var(--secondary); }
.t4k-audio-toggle.active { border-color: var(--secondary); background: rgba(26, 86, 219,0.08); box-shadow: 0 0 0 3px rgba(26, 86, 219,0.1); color: var(--secondary); }
.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(--secondary-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(--secondary-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(--secondary);
    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: #F8B800;
    }
    100% {
        opacity: 1;
        color: var(--secondary);
    }
}

@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(--secondary-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(--secondary); background: rgba(26, 86, 219,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(--secondary); 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(26, 86, 219,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(26, 86, 219,0.3); }
}

/* Story Rating */
.t4k-rating-box { text-align: center; margin: 1.5rem 0; padding: 1.25rem; background: rgba(26, 86, 219, 0.05); border-radius: var(--radius-md); border: 1px solid rgba(26, 86, 219, 0.15); }
.t4k-rating-prompt { font-size: 1rem; color: var(--secondary); 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(229, 57, 53,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(--secondary); 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(--accent); }
.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: #1a56db; }
.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: #1a56db !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(--accent-light), var(--accent)); }
.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(26, 86, 219,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(26, 86, 219,0.12); color: var(--secondary); }
.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(26, 86, 219,0.12); color: var(--secondary); }
.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, #1a56db, #1a56db); 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(26, 86, 219,0.3); background: rgba(26, 86, 219,0.06); font-size: 0.75rem; font-weight: 600; color: var(--secondary); cursor: pointer; outline: none; transition: border-color 0.2s; }
.t4k-voice-select:hover, .t4k-voice-select:focus { border-color: var(--secondary); }

/* 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: #1a56db; box-shadow: 0 0 4px rgba(34, 197, 94,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(34, 197, 94,0.1); }
.t4k-admin-btn.ok:hover { background: rgba(34, 197, 94,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(--secondary); 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(--secondary-light); box-shadow: 0 0 0 3px rgba(26, 86, 219,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(--secondary); }
.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(--secondary); background: rgba(26, 86, 219,0.08); box-shadow: 0 0 0 3px rgba(26, 86, 219,0.15); }
.t4k-admin-radio-card:hover .radio-card-content { border-color: var(--purple-light, #a78bfa); }

/* 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(--secondary); 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(26, 86, 219,0.08); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.82rem; color: var(--secondary); }

/* 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(--secondary) !important; }
.t4k-loader-spinner { width: 50px; height: 50px; border: 4px solid var(--gray-lighter); border-top-color: var(--secondary); 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(--secondary-light); box-shadow: var(--shadow-sm); }
.t4k-node-card.decision { border-left: 4px solid var(--secondary); }
.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(26, 86, 219,0.12); color: var(--secondary); }
.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(--secondary); 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(--warm); }
.t4k-admin-kpi.orange .t4k-kpi-number { color: var(--warm); }
.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(--secondary); 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(26, 86, 219,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: #1a56db; background: rgba(34, 197, 94,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(--secondary-light) !important; color: var(--secondary) !important; }
.btn-outline-magic:hover { background: rgba(26, 86, 219, 0.08) !important; border-color: var(--secondary) !important; }
.btn-primary-magic { background: var(--primary) !important; color: white !important; box-shadow: 0 4px 0 var(--primary-dark) !important; }
.btn-primary-magic:hover { background: var(--primary-dark) !important; }

.t4k-admin-page-icon { color: var(--primary); margin-right: 0.45rem; }
.t4k-admin-inline-form { display: inline; }
.t4k-admin-section-spacer { margin-top: 1.5rem; }

.t4k-admin-card {
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.t4k-admin-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.98));
}

.t4k-admin-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.t4k-admin-stack {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.t4k-admin-stack-tight {
    padding: 1.25rem;
}

.t4k-admin-kpi.red { border-top-color: var(--coral); }
.t4k-admin-kpi.blue { border-top-color: var(--accent); }
.t4k-admin-kpi.gray { border-top-color: var(--gray-light); }

.t4k-admin-kpi .kpi-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(26, 86, 219, 0.08);
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
}

.t4k-admin-kpi.red .kpi-icon {
    background: rgba(255, 107, 107, 0.12);
    color: var(--coral);
}

.t4k-admin-kpi.blue .kpi-icon {
    background: rgba(26, 86, 219, 0.12);
    color: var(--accent);
}

.t4k-admin-kpi.gray .kpi-icon {
    background: rgba(148, 163, 184, 0.16);
    color: var(--gray);
}

.t4k-admin-kpi .kpi-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--dark);
}

.t4k-admin-kpi .kpi-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
}

.t4k-admin-radio-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.t4k-admin-radio-card.flex-fill {
    flex: 1;
    min-width: 120px;
}

.t4k-admin-radio-icon {
    font-size: 1.5rem;
}

.t4k-admin-radio-icon.primary { color: var(--primary); }
.t4k-admin-radio-icon.accent { color: var(--coral); }

.t4k-admin-empty-panel {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.t4k-admin-empty-panel i {
    display: block;
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.t4k-admin-muted-icon {
    color: var(--purple);
    opacity: 0.6;
}

.t4k-admin-inline-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.t4k-admin-inline-meta small {
    margin: 0;
}

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

.t4k-admin-select-auto {
    width: auto;
}

.t4k-admin-card-block {
    margin-bottom: 1.5rem;
}

.t4k-admin-card-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: #7c3aed;
}

.t4k-admin-chip-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.t4k-admin-chip {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.t4k-admin-form-grid {
    display: grid;
    gap: 0.75rem;
    align-items: end;
}

.t4k-admin-form-grid.music-upload {
    grid-template-columns: 1fr 1fr 1fr auto auto;
}

.t4k-admin-form-grid.music-url {
    grid-template-columns: 1fr 1fr 2fr auto auto auto;
}

.t4k-admin-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.t4k-admin-checkbox-lg {
    width: 20px;
    height: 20px;
}

.t4k-admin-input-xs {
    width: 80px;
}

.t4k-admin-url-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t4k-admin-danger-button {
    background: #E53935;
    color: white;
    border: none;
}

.t4k-admin-image-action {
    border-color: #1a56db;
    color: #1a56db;
}

.t4k-admin-rank-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
}

.t4k-admin-rank-icon.gold { color: #d97706; }
.t4k-admin-rank-icon.silver { color: #64748b; }
.t4k-admin-rank-icon.bronze { color: #d97706; }

.t4k-admin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.t4k-admin-note-ok {
    color: #1a56db;
}

.t4k-admin-note-muted {
    color: #94a3b8;
}

.t4k-admin-code-inline {
    font-size: 11px;
    word-break: break-all;
}

.t4k-admin-text-error {
    color: #c62828;
}

.t4k-admin-hidden {
    display: none;
}

.t4k-admin-col-time,
.t4k-admin-col-user {
    width: 150px;
}

.t4k-admin-col-level {
    width: 80px;
}

.t4k-admin-col-category {
    width: 120px;
}

.t4k-admin-col-ip {
    width: 100px;
}

.t4k-admin-meta-block {
    display: block;
    font-size: 0.8em;
}

.t4k-admin-meta-block.tight {
    font-size: 0.75em;
}

.t4k-admin-icon-inline-gap {
    margin-left: 0.5rem;
}

.t4k-admin-icon-sky { color: #1a56db; }
.t4k-admin-icon-lavender { color: #9b59b6; }
.t4k-admin-icon-orange { color: #e67e22; }
.t4k-admin-icon-teal { color: #00cec9; }
.t4k-admin-icon-coral { color: #e17055; }
.t4k-admin-icon-indigo { color: #7c3aed; }

.t4k-admin-mono-xs {
    font-size: 0.75em;
}

@media (max-width: 900px) {
    .t4k-admin-form-grid.music-upload,
    .t4k-admin-form-grid.music-url {
        grid-template-columns: 1fr;
    }
}

.t4k-admin-progress {
    display: none;
    margin-bottom: 1.5rem;
}

.t4k-admin-progress-card {
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.09), rgba(26, 86, 219, 0.04));
    border-radius: 20px;
    padding: 1.2rem 1.5rem;
    border: 1px solid rgba(26, 86, 219, 0.2);
    box-shadow: 0 8px 24px rgba(26, 86, 219, 0.12);
}

.t4k-admin-progress-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.t4k-admin-progress-title {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.t4k-admin-progress-percent {
    margin-left: auto;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

.t4k-admin-progress-track {
    background: rgba(26, 86, 219, 0.14);
    border-radius: 10px;
    height: 28px;
    overflow: hidden;
    position: relative;
}

.t4k-admin-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #1a56db, #1a56db, #7c3aed);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t4k-admin-progress-fill span {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.t4k-admin-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #64748b;
}

.t4k-admin-progress-images {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.t4k-admin-progress-error {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(229, 57, 53, 0.15);
    color: #E53935;
    border-radius: 8px;
    font-size: 0.85rem;
}

.t4k-admin-platform-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #f8fafc;
}

.t4k-admin-platform-card.active {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.t4k-admin-platform-card.pending {
    background: rgba(241, 245, 249, 0.9);
}

.t4k-admin-platform-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: white;
    color: var(--dark);
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.t4k-admin-platform-meta {
    flex: 1;
}

.t4k-admin-platform-meta strong {
    display: block;
    color: var(--dark);
}

.t4k-admin-platform-detail {
    font-size: 13px;
    color: var(--gray);
    margin-top: 0.2rem;
}

.t4k-admin-platform-detail.ok { color: #15803d; }
.t4k-admin-platform-detail.off { color: #64748b; }

.t4k-admin-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: white;
}

.t4k-admin-status-pill.on { background: #16a34a; }
.t4k-admin-status-pill.off { background: #94a3b8; }

.t4k-admin-button-block {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    cursor: pointer;
}

.t4k-admin-button-block.secondary {
    background: linear-gradient(135deg, #1a56db, #1a56db);
    color: white;
}

.t4k-admin-button-block.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.t4k-admin-callout {
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.t4k-admin-callout-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    color: #92400e;
}

.t4k-admin-callout p {
    font-size: 12px;
    color: #92400e;
    margin-bottom: 10px;
}

.t4k-admin-callout a,
.t4k-admin-details a {
    color: #1d4ed8;
    font-weight: 600;
}

.t4k-admin-details {
    margin-top: 8px;
}

.t4k-admin-details summary {
    cursor: pointer;
    font-size: 12px;
    color: #92400e;
    font-weight: 600;
}

.t4k-admin-details ol {
    font-size: 11px;
    color: #78350f;
    margin: 8px 0 0 16px;
    line-height: 1.8;
}

.t4k-admin-flow {
    display: flex;
    justify-content: space-between;
    text-align: center;
    gap: 8px;
    flex-wrap: wrap;
}

.t4k-admin-flow-step {
    flex: 1;
    min-width: 120px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.t4k-admin-flow-step.lavender { background: #f8f4ff; }
.t4k-admin-flow-step.sky { background: #f0f9ff; }
.t4k-admin-flow-step.mint { background: #f0fdf4; }
.t4k-admin-flow-step.sun { background: #fef9c3; }

.t4k-admin-flow-step i {
    font-size: 28px;
    margin-bottom: 0.25rem;
}

.t4k-admin-flow-step strong {
    display: block;
    margin: 4px 0;
}

.t4k-admin-flow-step span {
    font-size: 12px;
    color: #666;
}

.t4k-admin-flow-arrow {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: #cbd5e1;
}

.t4k-admin-stat-chip {
    border-radius: 12px;
    padding: 12px 20px;
    text-align: center;
    min-width: 120px;
}

.t4k-admin-stat-chip-icon {
    font-size: 24px;
}

.t4k-admin-stat-chip-value {
    font-weight: 700;
    font-size: 20px;
}

.t4k-admin-stat-chip-label {
    font-size: 12px;
    color: #666;
}

.t4k-admin-pre {
    background: #f5f7fb;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
}

.t4k-admin-table-tag {
    background: #f0f4f8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.t4k-admin-platform-label {
    font-size: 1rem;
    color: var(--dark);
}

.t4k-admin-platform-link {
    color: #1a56db;
}

.t4k-admin-status-text {
    font-weight: 700;
    font-size: 12px;
}

.t4k-admin-status-text.posted { color: #15803d; }
.t4k-admin-status-text.failed { color: #dc2626; }
.t4k-admin-status-text.pending { color: #d97706; }

@media (max-width: 900px) {
    .t4k-admin-split-grid {
        grid-template-columns: 1fr;
    }
}

/* -- 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(26, 86, 219, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.t4k-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary);
    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(26, 86, 219, 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(26, 86, 219, 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(--secondary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 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(26, 86, 219, 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(--secondary);
    opacity: 0.6;
}

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

.t4k-search-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 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(--secondary), #7c3aed);
    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(26, 86, 219, 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(26, 86, 219, 0.08);
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

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

.t4k-page-link.active {
    background: linear-gradient(135deg, var(--secondary), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.t4k-page-dots {
    color: var(--secondary);
    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(26, 86, 219, 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(26, 86, 219, 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(--secondary);
    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(26, 86, 219, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(26, 86, 219, 0.1);
    transition: all 0.2s;
}

.t4k-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 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(--accent), var(--accent-light)); }
.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(26, 86, 219, 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 - Clean Duolingo-style
   ------------------------------------------------------------------------------- */

/* -- Landing container -- */
.kx-landing {
    background: #fff;
    color: #1e293b;
}

/* -- Topbar -- */
.kx-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.kx-brand {
    display: inline-flex;
    align-items: center;
}

.kx-brand-logo {
    height: 42px;
    width: auto;
}

.kx-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kx-link {
    color: #475569;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
}

.kx-link:hover {
    color: #1a56db;
}

/* -- Buttons -- */
.kx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    background: #22C55E;
    color: #fff;
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 0 #16a34a;
}

.kx-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #16a34a;
    color: #fff;
    text-decoration: none;
}

.kx-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #16a34a;
}

.kx-btn-sm {
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    border-radius: 12px;
    box-shadow: 0 3px 0 #16a34a;
}

.kx-btn-lg {
    padding: 0.95rem 2rem;
    font-size: 1.05rem;
    border-radius: 16px;
    min-width: 200px;
}

.kx-btn-outline {
    background: #fff;
    color: #22C55E;
    border: 2px solid #d1d5db;
    box-shadow: 0 4px 0 #d1d5db;
}

.kx-btn-outline:hover {
    border-color: #22C55E;
    color: #22C55E;
    box-shadow: 0 6px 0 #d1d5db;
}

.kx-btn-outline:active {
    box-shadow: 0 2px 0 #d1d5db;
}

.kx-btn-white {
    background: #fff;
    color: #22C55E;
    box-shadow: 0 4px 0 #d1d5db;
}

.kx-btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #d1d5db;
    color: #16a34a;
    text-decoration: none;
}

/* -- Hero section -- */
.kx-hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 720px;
    margin: 0 auto;
}

.kx-hero h1 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    color: #334155;
    line-height: 1.15;
    margin: 0 0 1.5rem;
}

.kx-hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.kx-hero-mascot {
    display: flex;
    justify-content: center;
}

.kx-hero-mascot img {
    width: 300px;
    height: auto;
    animation: kx-float 4s ease-in-out infinite;
}

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

/* -- Feature sections (Duolingo alternating left/right) -- */
.kx-feature {
    padding: 4.5rem 1.5rem;
}

.kx-feature-alt {
    background: #f7f7f7;
}

.kx-feature-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
}

.kx-feature-reverse {
    direction: rtl;
}

.kx-feature-reverse > * {
    direction: ltr;
}

.kx-feature-text h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #334155;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.kx-feature-text p {
    font-size: 1rem;
    line-height: 1.65;
    color: #64748b;
    margin: 0;
    max-width: 450px;
}

.kx-feature-img {
    display: flex;
    justify-content: center;
    align-items: center;
}

.kx-feature-img img {
    max-width: 240px;
    height: auto;
}

/* -- Icon grid inside feature sections -- */
.kx-feature-icon-grid {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.kx-icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kx-icon-green {
    background: #22C55E;
}

.kx-icon-blue {
    background: #1a56db;
}

.kx-icon-purple {
    background: #7c3aed;
}

.kx-icon-amber {
    background: #f59e0b;
}

/* -- Stats banner -- */
.kx-stats {
    background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    padding: 3rem 1.5rem;
}

.kx-stats-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.kx-stat-number {
    display: block;
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.kx-stat-label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    margin-top: 0.25rem;
}

/* -- How it works -- */
.kx-how {
    padding: 5rem 1.5rem;
    background: #fff;
}

.kx-how-inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.kx-how-inner > h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #334155;
    margin: 0 0 3rem;
}

.kx-how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.kx-step {
    text-align: center;
}

.kx-step-num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a56db, #7c3aed);
    color: #fff;
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.kx-step h3 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.5rem;
}

.kx-step p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #64748b;
    margin: 0;
}

/* -- Deeper value section -- */
.kx-eyebrow {
    display: inline-block;
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a56db;
    background: rgba(26, 86, 219, 0.08);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    margin-bottom: 1rem;
}

.kx-deep-dive {
    padding: 5rem 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.kx-deep-dive-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: start;
}

.kx-deep-dive-copy h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.7rem, 3.7vw, 2.4rem);
    font-weight: 700;
    color: #334155;
    line-height: 1.15;
    margin: 0 0 1rem;
}

.kx-deep-dive-copy p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.75;
    margin: 0 0 1rem;
    max-width: 58ch;
}

.kx-deep-dive-points {
    display: grid;
    gap: 1rem;
}

.kx-point-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.4rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.kx-point-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.9rem;
}

.kx-point-icon-blue { background: #1a56db; }
.kx-point-icon-green { background: #22C55E; }
.kx-point-icon-purple { background: #7c3aed; }

.kx-point-card h3 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.05rem;
    color: #334155;
    margin: 0 0 0.5rem;
}

.kx-point-card p {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* -- Subjects breakdown -- */
.kx-subjects {
    padding: 5rem 1.5rem;
    background: #f8fafc;
}

.kx-subjects-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.kx-subjects-inner > h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #334155;
    margin: 0 0 3rem;
}

.kx-subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.kx-subject-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border-top: 4px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kx-subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.kx-subject-reading { border-top-color: #1a56db; }
.kx-subject-writing { border-top-color: #7c3aed; }
.kx-subject-math { border-top-color: #22C55E; }

.kx-subject-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1.25rem;
}

.kx-subject-reading .kx-subject-icon { background: #1a56db; }
.kx-subject-writing .kx-subject-icon { background: #7c3aed; }
.kx-subject-math .kx-subject-icon { background: #22C55E; }

.kx-subject-card h3 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.75rem;
}

.kx-subject-card p {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0;
}

/* -- Pricing -- */
.kx-pricing {
    padding: 5rem 1.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4ff 100%);
}

.kx-pricing-inner {
    max-width: 1120px;
    margin: 0 auto;
}

.kx-pricing-heading {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 3rem;
}

.kx-pricing-heading h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.7rem, 3.7vw, 2.5rem);
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.9rem;
}

.kx-pricing-heading p {
    color: #64748b;
    line-height: 1.75;
    margin: 0;
}

.kx-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.kx-plan-card {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid #dbe4f0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
}

.kx-plan-highlight {
    border-color: #7c3aed;
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.16);
    transform: translateY(-6px);
}

.kx-plan-ribbon {
    position: absolute;
    top: -12px;
    right: 18px;
    background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    color: #fff;
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
}

.kx-plan-top h3 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.35rem;
    color: #334155;
    margin: 0 0 0.45rem;
}

.kx-plan-top p {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 1rem;
    min-height: 4.4rem;
}

.kx-plan-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    margin-bottom: 0.9rem;
}

.kx-plan-badge-blue {
    background: rgba(26, 86, 219, 0.1);
    color: #1a56db;
}

.kx-plan-badge-purple {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.kx-plan-badge-green {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.kx-plan-price {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 2.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.kx-plan-price span {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
}

.kx-plan-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.4rem;
    display: grid;
    gap: 0.75rem;
    flex: 1;
}

.kx-plan-list li {
    position: relative;
    padding-left: 1.5rem;
    color: #475569;
    font-size: 0.93rem;
    line-height: 1.5;
}

.kx-plan-list li::before {
    content: '\2022';
    position: absolute;
    left: 0.35rem;
    color: #22C55E;
    font-size: 1rem;
}

/* -- FAQ -- */
.kx-faq {
    padding: 5rem 1.5rem;
    background: #fff;
}

.kx-faq-inner {
    max-width: 1040px;
    margin: 0 auto;
}

.kx-faq-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.kx-faq-heading h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.6rem, 3.5vw, 2.3rem);
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.kx-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.kx-faq-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.4rem;
}

.kx-faq-item h3 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: 1.05rem;
    color: #334155;
    margin: 0 0 0.55rem;
}

.kx-faq-item p {
    color: #64748b;
    line-height: 1.65;
    margin: 0;
}

/* -- Social proof / testimonials -- */
.kx-social-proof {
    padding: 5rem 1.5rem;
    background: #fff;
}

.kx-social-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.kx-social-inner > h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: #334155;
    margin: 0 0 3rem;
}

.kx-testimonials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.kx-testimonial {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    position: relative;
}

.kx-testimonial::before {
    content: '\201C';
    font-size: 3rem;
    font-family: Georgia, serif;
    color: #1a56db;
    opacity: 0.3;
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    line-height: 1;
}

.kx-testimonial p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 1rem;
    font-style: italic;
}

.kx-testimonial-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7c3aed;
}

/* -- Final CTA -- */
.kx-final-cta {
    background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    padding: 5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.kx-final-wrap {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.kx-final-cta h2 {
    font-family: 'Fredoka', var(--font-display, sans-serif);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
}

.kx-final-cta p {
    color: rgba(255,255,255,0.85);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 2rem;
}

.kx-final-mascot {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.kx-final-mascot img {
    width: 160px;
    height: auto;
    animation: kx-float 4s ease-in-out infinite;
}

/* -- Footer -- */
.kx-footer {
    background: #1e293b;
    padding: 1.5rem;
}

.kx-footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.kx-footer-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.kx-footer nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.kx-footer nav a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
}

.kx-footer nav a:hover {
    color: #fff;
}

/* -- Landing responsive -- */
@media (max-width: 768px) {
    .kx-hero h1 {
        font-size: 1.65rem;
    }

    .kx-hero-mascot img {
        width: 200px;
    }

    .kx-feature-wrap {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .kx-feature-reverse {
        direction: ltr;
    }

    .kx-feature-text p {
        max-width: 100%;
    }

    .kx-stats-inner {
        grid-template-columns: repeat(2, 1fr);
    }

    .kx-how-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .kx-deep-dive-inner {
        grid-template-columns: 1fr;
    }

    .kx-subjects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .kx-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kx-testimonials {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .kx-faq-grid {
        grid-template-columns: 1fr;
    }

    .kx-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .kx-footer nav {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .kx-topbar {
        padding: 0.75rem 1rem;
    }

    .kx-link {
        display: none;
    }

    .kx-hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .kx-btn-lg {
        width: 100%;
        max-width: 280px;
    }

    .kx-hero-mascot img {
        width: 170px;
    }

    .kx-feature {
        padding: 3rem 1rem;
    }

    .kx-feature-text h2 {
        font-size: 1.35rem;
    }

    .kx-pricing-grid {
        grid-template-columns: 1fr;
    }

    .kx-plan-highlight {
        transform: none;
    }

    .kx-stats-inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .kx-stat-number {
        font-size: 1.6rem;
    }
}

.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, #1a56db);
    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, #1a56db); 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(--secondary);
}

/* -------------------------------------------------------------------------------
   PWA Install Banner
   ------------------------------------------------------------------------------- */

.t4k-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #1a56db 0%, #a78bfa 100%);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(26, 86, 219, 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(--secondary);
    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; }
}

/* -- Cross-App Design Corrections -- */
.t4k-logo-image {
    display: block;
    width: auto;
    max-width: 100%;
}

.t4k-logo-image-lg { height: 44px; }
.t4k-logo-image-md { height: 36px; }
.t4k-logo-image-sm { height: 28px; }

.t4k-inline-form { display: inline; }

.t4k-build-stamp {
    display: block;
    margin-top: 0.4rem;
    opacity: 0.45;
    font-size: 0.7rem;
}

.t4k-hidden-assist {
    position: absolute;
    left: -9999px;
}

.t4k-cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.96);
    color: var(--dark);
    border: 1px solid rgba(26, 86, 219, 0.2);
    box-shadow: var(--shadow-sm);
}

.t4k-cookie-btn-secondary:hover {
    color: var(--primary);
    border-color: rgba(26, 86, 219, 0.35);
}

.t4k-navbar {
    padding: 0.9rem 0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.t4k-navbar .container { gap: 1rem; }

.t4k-logo { gap: 0.75rem; }

.t4k-logo img {
    transition: transform 0.25s ease;
}

.t4k-logo:hover img {
    transform: scale(1.03);
}

.t4k-nav-links { gap: 0.4rem; }

.t4k-footer {
    background: linear-gradient(180deg, #09131f 0%, #0f172a 100%);
}

.t4k-footer-content { gap: 2.4rem; }

.t4k-footer-links-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 860px;
}

.t4k-auth-card {
    border: 1px solid rgba(255, 255, 255, 0.45);
    overflow: hidden;
}

.t4k-auth-card {
    border-left: 4px solid var(--secondary);
}

.t4k-auth-brand {
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.3rem;
}

.t4k-auth-subcopy,
.t4k-auth-footer p { margin: 0; }

.t4k-auth-helper { margin: 0 0 0.75rem; }

.alert-flat {
    margin: 0 !important;
    border-radius: 0 !important;
}

.newsletter-signup-widget {
    border-radius: 28px;
    overflow: hidden;
}

.empty-icon i,
.friend-chip-icon i {
    font-size: inherit;
}

.nx-topbar {
    padding: 1.5rem 1.25rem 1rem;
}

.nx-brand {
    gap: 0.8rem;
    font-size: 1.08rem;
}

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

.nx-hero {
    gap: 2.8rem;
    padding: 2rem 1.25rem 5rem;
}

.nx-hero-copy h1 { max-width: 13ch; }

.nx-lead {
    font-size: 1.06rem;
    max-width: 58ch;
}

.nx-trust li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(26, 86, 219, 0.09);
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    backdrop-filter: blur(16px);
}

.nx-story-card,
.nx-pillar,
.nx-price-card,
.nx-metrics > div,
.nx-hero-panel,
.nx-school-banner {
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.t4k-page-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.t4k-page-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.t4k-page-hero-copy h1,
.t4k-page-hero-copy h2 {
    margin: 0 0 0.45rem;
}

.t4k-page-hero-copy p {
    margin: 0;
    max-width: 64ch;
}

.t4k-section-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.t4k-section-card + .t4k-section-card { margin-top: 1.5rem; }

.t4k-section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.t4k-section-card-header h2,
.t4k-section-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.t4k-section-card-header p { margin: 0.35rem 0 0; }

.t4k-icon-bullet-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.8rem;
}

.t4k-icon-bullet-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.t4k-icon-bullet-list i {
    width: 1.1rem;
    margin-top: 0.2rem;
    color: var(--primary);
    text-align: center;
}

.t4k-faq-grid {
    display: grid;
    gap: 1rem;
}

.t4k-faq-item {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    padding: 1.25rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.t4k-faq-item h3 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.75rem;
    font-size: 1.08rem;
}

.t4k-faq-item p:last-child,
.t4k-faq-item ul:last-child,
.t4k-faq-item ol:last-child { margin-bottom: 0; }

.t4k-faq-pricing {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.9rem;
}

.t4k-faq-pricing th,
.t4k-faq-pricing td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
}

.t4k-faq-pricing th {
    color: var(--gray);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.t4k-cta-panel {
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.08), rgba(26, 86, 219, 0.1));
    border: 1px solid rgba(26, 86, 219, 0.14);
    border-radius: 24px;
    padding: 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.t4k-referral-hero {
    background: linear-gradient(135deg, #1a56db 0%, #1a56db 48%, #7c3aed 100%);
    color: #fff;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 24px 48px rgba(26, 86, 219, 0.22);
}

.t4k-referral-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 0.9rem 1.4rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.t4k-referral-link {
    margin-top: 0.85rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.82);
    word-break: break-word;
}

.t4k-referral-actions,
.t4k-social-actions,
.t4k-inline-form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.t4k-referral-steps,
.t4k-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.t4k-referral-step,
.t4k-stat-card-alt {
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 1.2rem;
}

.t4k-referral-step-number {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.t4k-referral-step-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(26, 86, 219, 0.08);
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.t4k-stat-card-alt strong {
    display: block;
    font-size: 2rem;
    color: var(--dark);
}

.t4k-stat-card-alt span {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gray);
    font-size: 0.92rem;
}

.t4k-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1rem;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
}

.t4k-share-btn:hover {
    color: #fff;
    transform: translateY(-2px);
}

.t4k-share-whatsapp { background: #25d366; }
.t4k-share-telegram { background: #0891b2; }
.t4k-share-facebook { background: #2563eb; }
.t4k-share-twitter { background: #111827; }

.t4k-table-wrap { overflow-x: auto; }

.t4k-referral-table {
    width: 100%;
    border-collapse: collapse;
}

.t4k-referral-table th,
.t4k-referral-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    text-align: left;
}

.t4k-toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    background: #0f172a;
    color: #fff;
    padding: 0.85rem 1.2rem;
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
    z-index: 9999;
}

.friend-chip-icon {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(26, 86, 219, 0.12);
    color: #7c3aed;
}

.legal-title i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.legal-contact-list,
.legal-plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.legal-contact-list li,
.legal-plain-list li {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.legal-contact-list i,
.legal-plain-list i {
    width: 1rem;
    color: var(--primary);
    margin-top: 0.25rem;
    text-align: center;
}

@media (max-width: 900px) {
    .t4k-footer-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
    }

    .t4k-page-hero,
    .t4k-cta-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .t4k-logo-image-lg { height: 38px; }
    .t4k-logo-image-md { height: 32px; }

    .nx-brand img { height: 42px; }

    .t4k-referral-hero,
    .t4k-section-card,
    .t4k-faq-item { padding: 1.2rem; }

    .t4k-referral-code {
        min-width: 100%;
        font-size: 1.35rem;
        letter-spacing: 0.12em;
    }
}

@media (max-width: 560px) {
    .t4k-footer-links-grid {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .t4k-page-shell {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}


