#kp-memory-app * { box-sizing: border-box; }
        #kp-memory-app {
            font-kerning: normal;
            font-feature-settings: "kern" 1, "liga" 1;
            text-rendering: optimizeLegibility; max-width: 1100px; margin: 0 auto; padding: 0 1rem; font-family: 'Manrope', sans-serif; color: #1a1a2e; }

        /* Icon system — Lucide line style, unified stroke + sizing
         * All icons: stroke-width 1.75, stroke-linecap round, stroke-linejoin round.
         * They inherit currentColor so they switch with button hover state automatically.
         * Three sizing tiers: sm (14px in buttons), md (16px standalone), lg (20px prominent). */
        /* Icon sizing \u2014 !important defeats theme CSS that forces SVG to natural viewBox size */
        #kp-memory-app .kp-icon,
        #kp-memory-review-app .kp-icon {
            width: 15px !important;
            height: 15px !important;
            flex-shrink: 0;
            display: inline-block;
            vertical-align: -.18em;
            line-height: 1;
        }
        #kp-memory-app .kp-icon--sm,
        #kp-memory-review-app .kp-icon--sm { width: 13px !important; height: 13px !important; }
        #kp-memory-app .kp-icon--md,
        #kp-memory-review-app .kp-icon--md { width: 16px !important; height: 16px !important; }
        #kp-memory-app .kp-icon--lg,
        #kp-memory-review-app .kp-icon--lg { width: 20px !important; height: 20px !important; }
        #kp-memory-app .kp-icon--xl,
        #kp-memory-review-app .kp-icon--xl { width: 44px !important; height: 44px !important; }

        /* Buttons: lock icon size so it never exceeds the text height */
        #kp-memory-app .kp-mem-btn .kp-icon,
        #kp-memory-review-app .kp-mem-btn .kp-icon { width: 13px !important; height: 13px !important; margin-right: .2rem; }

        /* Mode tabs in the practice modal: small icon above the label */
        #kp-memory-app .kp-mem-mode-tab .kp-icon,
        #kp-memory-app .kp-rv-tab .kp-icon,
        #kp-memory-review-app .kp-rv-tab .kp-icon { width: 16px !important; height: 16px !important; margin-right: .35rem; }

        .kp-mem-hero { background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%); color: #fff; border-radius: 24px; padding: 3rem 2rem; margin: 1.5rem 0 2rem; text-align: center; }
        .kp-mem-hero-inner { max-width: 720px; margin: 0 auto; }
        .kp-mem-hero-icon { line-height: 0; margin-bottom: .5rem; }
        .kp-mem-hero-icon .kp-icon { color: rgba(255,255,255,.95); }
        .kp-mem-hero h1 { margin: 0 0 .5rem; font-size: 2.25rem; font-weight: 800; color: #fff; }
        .kp-mem-hero p { margin: 0 0 .25rem; font-size: 1.05rem; opacity: .92; }
        .kp-mem-hero-note { margin-top: .75rem !important; font-size: .92rem !important; opacity: .85; }
        .kp-mem-hero-note a { color: #fff; text-decoration: underline; }
        .kp-mem-streak {
            display: inline-flex; align-items: center; gap: .5rem;
            margin-top: 1.1rem; padding: .55rem 1.1rem;
            background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
            border-radius: 999px; border: 1px solid rgba(255,255,255,.22);
            font-size: .95rem; font-weight: 500;
        }
        .kp-mem-streak-flame { font-size: 1.15rem; line-height: 1; }
        .kp-mem-streak .kp-icon { color: #fb923c; }
        .kp-mem-streak-num { font-weight: 800; font-size: 1.15rem; }
        .kp-mem-streak-total { font-weight: 700; }
        .kp-mem-streak-label { opacity: .8; font-size: .85rem; }
        .kp-mem-streak-sep { opacity: .45; margin: 0 .3rem; }
        .kp-mem-streak.is-new-day { animation: kp-pulse 1.5s ease 2; }
        @keyframes kp-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); background: rgba(251,191,36,.35); } }

        /* ============================================================
         * Hero redesign — richer gradient + motif + typography hierarchy
         * Overrides earlier .kp-mem-hero rules via higher specificity.
         * ============================================================ */
        #kp-memory-app .kp-mem-hero {
            position: relative;
            overflow: hidden;
            background:
                radial-gradient(ellipse 80% 60% at 15% 0%, rgba(139,92,246,.55) 0%, transparent 60%),
                radial-gradient(ellipse 70% 50% at 85% 100%, rgba(79,70,229,.45) 0%, transparent 60%),
                linear-gradient(135deg, #6d28d9 0%, #4c1d95 55%, #3b1378 100%);
            padding: 4rem 2rem 3.25rem;
            isolation: isolate;
        }

        /* Faint motif backdrop — horizontal "manuscript lines" in subtle white */
        #kp-memory-app .kp-mem-hero-motif {
            position: absolute; inset: 0;
            background-image:
                linear-gradient(to right, transparent 49%, rgba(255,255,255,.04) 49%, rgba(255,255,255,.04) 51%, transparent 51%),
                repeating-linear-gradient(to bottom, transparent 0, transparent 48px, rgba(255,255,255,.035) 48px, rgba(255,255,255,.035) 49px);
            pointer-events: none;
            opacity: .8;
            z-index: 0;
            mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 0%, transparent 75%);
            -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 0%, transparent 75%);
        }

        /* Warm glow behind the icon for dimension */
        #kp-memory-app .kp-mem-hero-glow {
            position: absolute;
            top: 10%; left: 50%;
            transform: translateX(-50%);
            width: 260px; height: 260px;
            background: radial-gradient(circle, rgba(251,191,36,.25) 0%, rgba(251,191,36,0) 70%);
            pointer-events: none;
            z-index: 0;
            filter: blur(2px);
        }

        #kp-memory-app .kp-mem-hero-inner {
            position: relative;
            z-index: 2;
            max-width: 720px;
            margin: 0 auto;
            text-align: center;
        }

        /* Eyebrow: three words separated by dots in small caps */
        #kp-memory-app .kp-mem-hero-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: .65rem;
            font: 700 .68rem/1 'Manrope', sans-serif;
            letter-spacing: .28em;
            text-transform: uppercase;
            color: rgba(251,191,36,.95);
            margin-bottom: 1.25rem;
        }
        #kp-memory-app .kp-mem-dot {
            width: 3px; height: 3px;
            border-radius: 50%;
            background: rgba(251,191,36,.6);
        }

        /* Icon with subtle hover lift */
        #kp-memory-app .kp-mem-hero-icon {
            margin: 0 0 1rem;
            line-height: 0;
        }
        #kp-memory-app .kp-mem-hero-icon .kp-icon {
            color: rgba(255,255,255,.95);
            filter: drop-shadow(0 4px 20px rgba(251,191,36,.3));
        }

        /* Title with animated brass underline */
        #kp-memory-app .kp-mem-hero-title {
            display: inline-block;
            position: relative;
            margin: 0 0 1rem;
            font: 800 2.65rem/1.1 'Manrope', sans-serif;
            letter-spacing: -.02em;
            color: #fff;
        }
        #kp-memory-app .kp-mem-hero-title-text { position: relative; z-index: 2; }
        #kp-memory-app .kp-mem-hero-underline {
            display: block;
            position: absolute;
            left: 50%;
            bottom: -10px;
            width: 0;
            height: 3px;
            background: linear-gradient(90deg, transparent 0%, #fbbf24 20%, #f59e0b 50%, #fbbf24 80%, transparent 100%);
            transform: translateX(-50%);
            border-radius: 2px;
            animation: kp-hero-underline 1.1s cubic-bezier(.2,.8,.2,1) .3s forwards;
        }
        @keyframes kp-hero-underline {
            0%   { width: 0; opacity: 0; }
            40%  { opacity: 1; }
            100% { width: 140px; opacity: 1; }
        }

        #kp-memory-app .kp-mem-hero-lede {
            margin: 0 auto 1.5rem;
            max-width: 560px;
            font-size: 1.02rem;
            line-height: 1.6;
            color: rgba(255,255,255,.88);
            font-weight: 400;
        }

        /* Pair the streak + howto pills as one tight inline unit */
        #kp-memory-app .kp-mem-hero-meta {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 1rem;
            width: auto;
            max-width: 100%;
        }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak,
        #kp-memory-app .kp-mem-hero-meta .kp-mem-howto-btn {
            height: 64px;
            padding: 0 1.6rem;
            display: inline-flex;
            align-items: center;
            box-sizing: border-box;
            margin: 0;
            flex: 0 0 auto;
        }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak { gap: .95rem; padding: 0 1.8rem; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak-block { display: inline-flex; align-items: baseline; gap: .5rem; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak-num,
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak-total { font-size: 1.55rem; line-height: 1; font-weight: 800; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak-label { font-size: 1.05rem; line-height: 1; font-weight: 500; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak-divider { height: 28px; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-howto-btn { gap: .65rem; font-size: 1.15rem; font-weight: 600; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-streak .kp-icon { width: 26px !important; height: 26px !important; }
        #kp-memory-app .kp-mem-hero-meta .kp-mem-howto-btn .kp-icon { width: 22px !important; height: 22px !important; }
        /* Glass-morphism streak pill — more refined than the old pill */
        #kp-memory-app .kp-mem-streak {
            display: inline-flex;
            align-items: center;
            gap: .9rem;
            padding: .7rem 1.3rem;
            background: rgba(255,255,255,.08);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,.15);
            border-radius: 999px;
            box-shadow: 0 4px 20px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.1);
        }
        #kp-memory-app .kp-mem-streak .kp-icon { color: #fbbf24; }
        #kp-memory-app .kp-mem-streak-block {
            display: inline-flex;
            align-items: baseline;
            gap: .35rem;
        }
        #kp-memory-app .kp-mem-streak-num,
        #kp-memory-app .kp-mem-streak-total {
            font: 800 1.05rem/1 'Manrope', sans-serif;
            color: #fff;
            font-variant-numeric: tabular-nums;
        }
        #kp-memory-app .kp-mem-streak-label {
            font-size: .78rem;
            color: rgba(255,255,255,.75);
            font-weight: 500;
        }
        #kp-memory-app .kp-mem-streak-divider {
            width: 1px; height: 18px;
            background: rgba(255,255,255,.2);
        }
        #kp-memory-app .kp-mem-streak-sep { display: none; } /* replaced by .kp-mem-streak-divider */

        /* How it works button — ghost style that sits next to streak */
        #kp-memory-app .kp-mem-howto-btn {
            display: inline-flex;
            align-items: center;
            gap: .4rem;
            padding: .65rem 1rem;
            background: rgba(255,255,255,.06);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,.15);
            border-radius: 999px;
            color: rgba(255,255,255,.9);
            font: 600 .78rem/1 'Manrope', sans-serif;
            cursor: pointer;
            transition: all .18s ease;
        }
        #kp-memory-app .kp-mem-howto-btn:hover {
            background: rgba(255,255,255,.14);
            border-color: rgba(255,255,255,.28);
            color: #fff;
        }
        #kp-memory-app .kp-mem-howto-btn .kp-icon { color: #fbbf24; }
        #kp-memory-app .kp-mem-howto-btn[aria-expanded="true"] {
            background: rgba(251,191,36,.18);
            border-color: rgba(251,191,36,.4);
        }
        }

        /* Anonymous hero CTA (swap for the howto button when logged out) */
        #kp-memory-app .kp-mem-hero-cta {
            display: inline-block;
            padding: .7rem 1.5rem;
            background: #fbbf24;
            color: #1a1a2e;
            font: 700 .82rem/1 'Manrope', sans-serif;
            letter-spacing: .03em;
            text-transform: uppercase;
            border-radius: 999px;
            text-decoration: none;
            transition: all .18s ease;
        }
        #kp-memory-app .kp-mem-hero-cta:hover {
            background: #fff;
            transform: translateY(-1px);
        }
        #kp-memory-app .kp-mem-hero-note {
            display: block;
            margin-top: .75rem;
            font-size: .85rem;
            color: rgba(255,255,255,.75);
            font-weight: 400;
            text-align: center;
            width: 100%;
        }

        /* Mobile */
        @media (max-width: 640px) {
            #kp-memory-app .kp-mem-hero { padding: 2.5rem 1.25rem 2.25rem; }
            #kp-memory-app .kp-mem-hero-title { font-size: 2rem; }
            #kp-memory-app .kp-mem-hero-lede { font-size: .95rem; }
            #kp-memory-app .kp-mem-hero-eyebrow { font-size: .62rem; letter-spacing: .2em; }
            #kp-memory-app .kp-mem-streak { padding: .55rem 1rem; gap: .6rem; }
            #kp-memory-app .kp-mem-howto-panel { padding: 1rem 1.15rem; }
        }

        /* ============================================================
         * Hero v2 — Cinematic. Full-bleed, layered depth, motion.
         * All selectors scoped to .kp-mem-hero-v2 for a clean overlay
         * on top of the v1 hero CSS. Breaks out of the 1100px wrapper.
         * ============================================================ */

        #kp-memory-app .kp-mem-hero-v2 {
            /* Break out of the max-width: 1100px parent to go full-bleed */
            position: relative;
            width: 100vw;
            left: 50%;
            right: 50%;
            margin-left: -50vw;
            margin-right: -50vw;
            margin-top: 0;
            margin-bottom: 3rem;
            padding: 6rem 2rem 7rem;
            overflow: hidden;
            border-radius: 0;
            background: #1a0b3b;
            isolation: isolate;
            min-height: 520px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Layer 1: Deep multi-stop gradient sky */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-sky {
            position: absolute; inset: 0;
            background:
                radial-gradient(ellipse 120% 80% at 20% 0%, #8b5cf6 0%, transparent 50%),
                radial-gradient(ellipse 100% 70% at 80% 100%, #6d28d9 0%, transparent 55%),
                radial-gradient(ellipse 70% 50% at 50% 50%, #7c3aed 0%, transparent 60%),
                linear-gradient(180deg, #2a0f5b 0%, #1a0b3b 50%, #0f0526 100%);
            z-index: 1;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-sky::after {
            content: '';
            position: absolute; inset: 0;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .6 0 0 0 0 .4 0 0 0 0 .9 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
            opacity: .6;
            mix-blend-mode: overlay;
            pointer-events: none;
        }

        /* Layer 2: GHOST TYPOGRAPHY — the word "WORD" massive in the background */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-ghost {
            position: absolute;
            top: 52%;
            left: 50%;
            transform: translate(-50%, -50%);
            font: 900 clamp(9rem, 22vw, 22rem)/.9 'Manrope', sans-serif;
            letter-spacing: -.05em;
            color: transparent;
            -webkit-text-stroke: 1px rgba(251,191,36,.15);
            text-stroke: 1px rgba(251,191,36,.15);
            pointer-events: none;
            user-select: none;
            z-index: 2;
            white-space: nowrap;
            will-change: transform;
            animation: kp-ghost-drift 20s ease-in-out infinite alternate;
        }
        @keyframes kp-ghost-drift {
            0%   { transform: translate(-50%, -50%) scale(1); }
            100% { transform: translate(-48%, -52%) scale(1.04); }
        }

        /* Layer 3: Manuscript line motif (subtler now that ghost type carries texture) */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-motif {
            position: absolute; inset: 0;
            background-image:
                repeating-linear-gradient(to bottom, transparent 0, transparent 56px, rgba(255,255,255,.03) 56px, rgba(255,255,255,.03) 57px);
            pointer-events: none;
            mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 20%, transparent 80%);
            -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 50%, #000 20%, transparent 80%);
            z-index: 3;
        }

        /* Layer 4: Cursor-following spotlight (desktop only) */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-spotlight {
            position: absolute;
            top: 0; left: 0;
            width: 600px; height: 600px;
            background: radial-gradient(circle, rgba(251,191,36,.18) 0%, rgba(255,255,255,.08) 25%, transparent 60%);
            pointer-events: none;
            z-index: 4;
            transform: translate(-50%, -50%);
            opacity: 0;
            transition: opacity .4s ease;
            mix-blend-mode: screen;
        }
        #kp-memory-app .kp-mem-hero-v2:hover .kp-mem-hero-spotlight { opacity: 1; }
        @media (hover: none) { #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-spotlight { display: none; } }

        /* Layer 5: Rising particles (12 amber specks drifting upward) */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles {
            position: absolute; inset: 0;
            pointer-events: none;
            z-index: 5;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span {
            position: absolute;
            bottom: -20px;
            width: 4px; height: 4px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(251,191,36,.8) 0%, rgba(251,191,36,0) 70%);
            animation: kp-particle-rise 14s linear infinite;
            opacity: 0;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(1)  { left: 6%;  animation-duration: 16s; animation-delay: 0s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(2)  { left: 14%; animation-duration: 13s; animation-delay: 2s;  width: 3px; height: 3px; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(3)  { left: 22%; animation-duration: 18s; animation-delay: 4s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(4)  { left: 31%; animation-duration: 15s; animation-delay: 1s;  width: 2px; height: 2px; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(5)  { left: 40%; animation-duration: 17s; animation-delay: 6s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(6)  { left: 48%; animation-duration: 14s; animation-delay: 3s;  width: 5px; height: 5px; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(7)  { left: 58%; animation-duration: 19s; animation-delay: 5s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(8)  { left: 67%; animation-duration: 13s; animation-delay: 7s;  width: 3px; height: 3px; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(9)  { left: 76%; animation-duration: 16s; animation-delay: 2s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(10) { left: 84%; animation-duration: 15s; animation-delay: 8s;  }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(11) { left: 91%; animation-duration: 18s; animation-delay: 1s;  width: 4px; height: 4px; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles span:nth-child(12) { left: 97%; animation-duration: 14s; animation-delay: 5s;  }
        @keyframes kp-particle-rise {
            0%   { transform: translateY(0) translateX(0); opacity: 0; }
            10%  { opacity: .7; }
            50%  { transform: translateY(-50vh) translateX(20px); opacity: .8; }
            90%  { opacity: .3; }
            100% { transform: translateY(-100vh) translateX(-10px); opacity: 0; }
        }

        /* Layer 6: Amber glow behind icon */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-glow {
            position: absolute;
            top: 45%;
            left: 50%;
            width: 400px; height: 400px;
            background: radial-gradient(circle, rgba(251,191,36,.25) 0%, rgba(251,191,36,0) 60%);
            transform: translate(-50%, -50%);
            pointer-events: none;
            z-index: 6;
            filter: blur(8px);
        }

        /* Content: sits on top of every layer */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-inner {
            position: relative;
            z-index: 10;
            max-width: 760px;
            width: 100%;
            margin: 0 auto;
            text-align: center;
        }

        /* Staggered reveal on load */
        #kp-memory-app .kp-mem-hero-v2 [data-reveal] {
            opacity: 0;
            transform: translateY(24px);
            animation: kp-reveal .9s cubic-bezier(.2,.8,.2,1) forwards;
        }
        #kp-memory-app .kp-mem-hero-v2 [data-reveal="1"] { animation-delay: .05s; }
        #kp-memory-app .kp-mem-hero-v2 [data-reveal="2"] { animation-delay: .2s; }
        #kp-memory-app .kp-mem-hero-v2 [data-reveal="3"] { animation-delay: .35s; }
        #kp-memory-app .kp-mem-hero-v2 [data-reveal="4"] { animation-delay: .5s; }
        #kp-memory-app .kp-mem-hero-v2 [data-reveal="5"] { animation-delay: .65s; }
        @keyframes kp-reveal {
            0%   { opacity: 0; transform: translateY(24px); filter: blur(3px); }
            100% { opacity: 1; transform: translateY(0); filter: blur(0); }
        }

        /* Typography scale bumps */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-title {
            font: 800 clamp(2.4rem, 6vw, 4.25rem)/1.1 'Manrope', sans-serif;
            letter-spacing: -.025em;
            margin: 1.25rem 0 1.25rem;
            text-shadow: 0 4px 40px rgba(0,0,0,.45);
            font-kerning: normal;
            font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
            text-rendering: optimizeLegibility;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-lede {
            font-size: clamp(.98rem, 1.4vw, 1.12rem);
            max-width: 560px;
            margin: 0 auto 1.85rem;
            line-height: 1.65;
            color: rgba(255,255,255,.88);
            text-shadow: 0 2px 20px rgba(0,0,0,.3);
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-eyebrow {
            font-size: .72rem;
            letter-spacing: .32em;
            margin-bottom: 0;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon {
            margin: 0;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon {
            margin: 1.5rem 0 .5rem;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon .kp-icon {
            filter: drop-shadow(0 8px 30px rgba(251,191,36,.5));
            /* float animation removed to prevent drift into nearby text */
        }

        /* Underline made longer and more luminous */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-underline {
            bottom: -14px;
            height: 4px;
            box-shadow: 0 0 20px rgba(251,191,36,.5);
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-underline { animation-duration: 1.4s; animation-delay: .9s; }
        @keyframes kp-hero-underline { 0% { width: 0; opacity: 0; } 40% { opacity: 1; } 100% { width: 180px; opacity: 1; } }

        /* Scroll hint — animated arrow pulse at bottom */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-scrollhint {
            position: absolute;
            bottom: 1.5rem;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
            width: 24px;
            height: 38px;
            border: 1.5px solid rgba(255,255,255,.3);
            border-radius: 14px;
            pointer-events: none;
            animation: kp-reveal .9s cubic-bezier(.2,.8,.2,1) 1s forwards;
            opacity: 0;
        }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-scrollhint span {
            position: absolute;
            top: 6px;
            left: 50%;
            transform: translateX(-50%);
            width: 3px;
            height: 8px;
            background: rgba(251,191,36,.9);
            border-radius: 2px;
            animation: kp-scroll-pulse 1.8s ease-in-out infinite;
        }
        @keyframes kp-scroll-pulse {
            0%, 100% { opacity: 1; transform: translate(-50%, 0); }
            50%      { opacity: .3; transform: translate(-50%, 10px); }
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            #kp-memory-app .kp-mem-hero-v2 { padding: 4rem 1.5rem 5rem; min-height: 460px; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-ghost { font-size: 8rem; opacity: .6; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-title { letter-spacing: -.025em; }
        }
        @media (max-width: 480px) {
            #kp-memory-app .kp-mem-hero-v2 { padding: 3rem 1.25rem 4rem; min-height: 420px; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-ghost { font-size: 6rem; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-eyebrow { font-size: .62rem; letter-spacing: .24em; gap: .4rem; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-scrollhint { display: none; }
        }

        /* Respect reduced motion */
        @media (prefers-reduced-motion: reduce) {
            #kp-memory-app .kp-mem-hero-v2 [data-reveal] { animation: none; opacity: 1; transform: none; }
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles,
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-ghost,
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon .kp-icon,
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-scrollhint span { animation: none !important; }
        }

        /* ============================================================
         * Hero cleanup pass — cut ghost + particles, scale icon,
         * add asymmetric chapter marker for composition tension
         * ============================================================ */

        /* Cut the ghost WORD and particles entirely */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-ghost,
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-particles { display: none !important; }

        /* Double the book icon — real presence, not lost between eyebrow and title */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon { margin: 1.75rem 0 1rem; }
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon .kp-icon {
            width: 96px !important;
            height: 96px !important;
            stroke-width: 1.25;
            filter: drop-shadow(0 12px 40px rgba(251, 191, 36, .55));
        }

        /* Expand the amber glow behind the larger icon */
        #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-glow {
            width: 520px;
            height: 520px;
            top: 42%;
            filter: blur(12px);
        }

        /* Asymmetric chapter marker — top-left corner, breaks the center symmetry */
        #kp-memory-app .kp-mem-hero-v2 {
            position: relative;
        }
        #kp-memory-app
        #kp-memory-app
        #kp-memory-app
        #kp-memory-app

        /* Mobile: move chapter marker to top center so it doesn't crowd */
        @media (max-width: 640px) {
            #kp-memory-app
            #kp-memory-app
            #kp-memory-app
            #kp-memory-app .kp-mem-hero-v2 .kp-mem-hero-icon .kp-icon { width: 72px !important; height: 72px !important; }
        }

        /* ============================================================
         * How It Works modal — rich detailed popout
         * ============================================================ */
        .kp-howto-modal {
            position: fixed;
            inset: 0;
            z-index: 99999;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding: 2rem 1rem;
            background: rgba(15, 8, 38, .82);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            overflow-y: auto;
            animation: kp-howto-fade .3s ease;
        }
        .kp-howto-modal[hidden] { display: none !important; }
        @keyframes kp-howto-fade { from { opacity: 0; } to { opacity: 1; } }

        .kp-howto-modal-inner {
            position: relative;
            max-width: 780px;
            width: 100%;
            background: #fff;
            border-radius: 24px;
            box-shadow: 0 40px 100px rgba(0, 0, 0, .35);
            margin: 2rem 0 4rem;
            overflow: hidden;
            animation: kp-howto-rise .5s cubic-bezier(.2, .8, .2, 1);
        }
        @keyframes kp-howto-rise {
            from { opacity: 0; transform: translateY(30px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .kp-howto-close {
            position: absolute;
            top: 1.25rem;
            right: 1.25rem;
            width: 40px;
            height: 40px;
            border: none;
            border-radius: 50%;
            background: rgba(255, 255, 255, .95);
            color: #1a1a2e;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            z-index: 2;
            transition: all .2s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
        }
        .kp-howto-close:hover {
            background: #1a1a2e;
            color: #fff;
            transform: rotate(90deg);
        }

        /* Modal hero strip (top section) — on brand purple */
        .kp-howto-hero {
            background:
                radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 255, 255, .7) 0%, transparent 60%),
                radial-gradient(ellipse 70% 50% at 80% 100%, rgba(180, 180, 180, .25) 0%, transparent 60%),
                linear-gradient(135deg, #F2F2F2 0%, #DEDEDE 100%);
            color: #2a2a2a;
            padding: 3rem 2.5rem 2.5rem;
            text-align: center;
            position: relative;
        }
        .kp-howto-badge {
            display: inline-block;
            font: 700 .72rem/1 'Manrope', sans-serif;
            letter-spacing: .28em;
            text-transform: uppercase;
            color: #92400e;
            padding: .45rem 1rem;
            background: rgba(251, 191, 36, .3);
            border: 1px solid rgba(180, 130, 50, .45);
            border-radius: 999px;
            margin-bottom: 1.25rem;
        }
        .kp-howto-title {
            font: 800 clamp(1.75rem, 3.5vw, 2.35rem)/1.15 'Manrope', sans-serif;
            letter-spacing: -.02em;
            margin: 0 0 .75rem;
        }
        .kp-howto-sub {
            margin: 0;
            font-size: 1.02rem;
            color: rgba(42, 42, 42, .75);
            line-height: 1.55;
        }

        .kp-howto-body {
            padding: 2.5rem 2.5rem 3rem;
            color: #1a1a2e;
            font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
        }

        .kp-howto-section {
            margin-bottom: 2.5rem;
            padding-bottom: 2.5rem;
            border-bottom: 1px solid #f0e9ff;
        }
        .kp-howto-section:last-of-type {
            border-bottom: none;
            padding-bottom: 0;
            margin-bottom: 2rem;
        }

        .kp-howto-sec-title {
            display: flex;
            align-items: baseline;
            gap: 1rem;
            font: 800 1.35rem/1.25 'Manrope', sans-serif;
            color: #1a1a2e;
            margin: 0 0 1rem;
            letter-spacing: -.015em;
        }
        .kp-howto-sec-num {
            font: 400 1.15rem/1 'Fraunces', Georgia, serif;
            color: #7c3aed;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0;
            min-width: 2em;
        }

        .kp-howto-sec-intro {
            font-size: 1.02rem;
            color: #4b5563;
            line-height: 1.65;
            margin: 0 0 1.5rem;
        }
        .kp-howto-section p {
            font-size: .98rem;
            line-height: 1.7;
            color: #3b3b52;
            margin: 0 0 1rem;
        }
        .kp-howto-section p strong { color: #1a1a2e; }
        .kp-howto-section p em { color: #7c3aed; font-style: italic; }

        .kp-howto-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: .9rem;
            margin-top: 1.25rem;
        }
        .kp-howto-card {
            background: linear-gradient(135deg, #faf5ff, #f5effb);
            border: 1px solid #ede5fc;
            border-radius: 14px;
            padding: 1.15rem 1.25rem;
            transition: all .2s ease;
        }
        .kp-howto-card:hover {
            border-color: #c7b3fa;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(124, 58, 237, .12);
        }
        .kp-howto-card-label {
            font: 800 .72rem/1 'Manrope', sans-serif;
            color: #7c3aed;
            text-transform: uppercase;
            letter-spacing: .12em;
            margin-bottom: .5rem;
        }
        .kp-howto-card p {
            font-size: .92rem;
            line-height: 1.55;
            color: #4b5563;
            margin: 0;
        }

        .kp-howto-highlight {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border-left: 3px solid #f59e0b;
            padding: 1rem 1.25rem;
            border-radius: 0 12px 12px 0;
            margin-top: 1.25rem;
            font-size: .94rem;
            line-height: 1.6;
            color: #78350f;
        }
        .kp-howto-highlight strong { color: #5a2500; }

        .kp-howto-list {
            margin: 1rem 0;
            padding-left: 1.5rem;
            font-size: .98rem;
            line-height: 1.75;
            color: #3b3b52;
        }
        .kp-howto-list li { margin-bottom: .3rem; }
        .kp-howto-list li::marker { color: #7c3aed; }

        .kp-howto-close-section {
            text-align: center;
            padding: 1.5rem 0 0;
        }
        .kp-howto-closing {
            font: italic 400 1.1rem/1.55 'Fraunces', Georgia, serif;
            color: #6b21a8;
            margin: 0 0 1.5rem;
            max-width: 520px;
            margin-left: auto;
            margin-right: auto;
        }
        .kp-howto-cta {
            background: #1a1a2e;
            color: #fff;
            padding: .95rem 2rem;
            border: none;
            border-radius: 999px;
            font: 700 .92rem/1 'Manrope', sans-serif;
            letter-spacing: .04em;
            text-transform: uppercase;
            cursor: pointer;
            transition: all .2s ease;
        }
        .kp-howto-cta:hover {
            background: #7c3aed;
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(124, 58, 237, .3);
        }

        /* Responsive */
        @media (max-width: 640px) {
            .kp-howto-modal { padding: 1rem .5rem; }
            .kp-howto-modal-inner { margin: .5rem 0 2rem; border-radius: 18px; }
            .kp-howto-hero { padding: 2.25rem 1.5rem 2rem; }
            .kp-howto-body { padding: 1.75rem 1.5rem 2.25rem; }
            .kp-howto-sec-title { font-size: 1.2rem; flex-wrap: wrap; gap: .5rem; }
            .kp-howto-grid { grid-template-columns: 1fr; }
            .kp-howto-close { top: .75rem; right: .75rem; }
        }

        /* Reduced motion */
        @media (prefers-reduced-motion: reduce) {
            .kp-howto-modal, .kp-howto-modal-inner { animation: none; }
        }

        .kp-mem-toolbar-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

        .kp-mem-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; padding: 1rem 1.25rem; background: #faf5ff; border-radius: 16px; }
        .kp-mem-filters { display: flex; align-items: center; gap: .5rem; }
        .kp-mem-filters label { font-size: .82rem; font-weight: 600; color: #6d28d9; text-transform: uppercase; letter-spacing: .05em; }
        .kp-mem-filters select { padding: .5rem .85rem; border: 1.5px solid #e0d4ff; border-radius: 999px; background: #fff; font: inherit; color: #1a1a2e; cursor: pointer; }
        .kp-mem-search {
            padding: .5rem .95rem; border: 1.5px solid #e0d4ff; border-radius: 999px;
            background: #fff; font: inherit; color: #1a1a2e;
            width: 220px; max-width: 100%;
            transition: border-color .15s ease, box-shadow .15s ease;
        }
        .kp-mem-search:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
        .kp-mem-search::-webkit-search-cancel-button { cursor: pointer; }

        .kp-mem-pagination {
            display: flex; justify-content: center; align-items: center; gap: .35rem;
            margin: 0 0 3rem; flex-wrap: wrap;
        }
        .kp-mem-page-btn {
            min-width: 38px; height: 38px; padding: 0 .75rem;
            display: inline-flex; align-items: center; justify-content: center;
            background: #fff; border: 1.5px solid #e5e7eb; color: #4b5563;
            font: 600 .85rem/1 'Manrope', sans-serif; border-radius: 10px;
            cursor: pointer; transition: all .15s ease;
        }
        .kp-mem-page-btn:hover:not(:disabled):not(.is-active) { border-color: #7c3aed; color: #7c3aed; }
        .kp-mem-page-btn.is-active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
        .kp-mem-page-btn:disabled { opacity: .4; cursor: not-allowed; }
        .kp-mem-page-ellipsis { color: #9ca3af; padding: 0 .25rem; }
        .kp-mem-page-info { color: #6b7280; font-size: .82rem; margin-left: .75rem; }
        .kp-mem-stats { display: flex; gap: 1.25rem; font-size: .9rem; color: #4b5563; }
        .kp-mem-stat strong { color: #1a1a2e; font-size: 1.1rem; margin-right: .25rem; }
        .kp-mem-stat-mastered strong { color: #16a34a; }

        .kp-mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }

        /* Landing view: Verse of the Day + featured topic pills */
        .kp-mem-topics { margin: 0 0 3rem; }
        .kp-mem-votd {
            background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
            border: 1px solid #e0d4ff;
            border-radius: 20px;
            padding: 2rem 2.25rem;
            position: relative;
            overflow: hidden;
        }
        .kp-mem-votd::before {
            content: '“';
            position: absolute;
            top: -40px; right: 20px;
            font: 800 12rem/1 Georgia, serif;
            color: rgba(124, 58, 237, .08);
            pointer-events: none;
        }
        .kp-mem-votd-label {
            display: inline-block;
            font: 700 .72rem/1 'Manrope', sans-serif;
            color: #7c3aed;
            text-transform: uppercase;
            letter-spacing: .1em;
            background: #fff;
            padding: .4rem .75rem;
            border-radius: 999px;
            margin-bottom: 1rem;
            box-shadow: 0 2px 8px rgba(124, 58, 237, .15);
        }
        .kp-mem-votd-ref {
            font: 800 1.4rem/1.2 'Manrope', sans-serif;
            color: #1a1a2e;
            margin-bottom: .5rem;
        }
        .kp-mem-votd-text {
            font-family: Georgia, serif;
            font-size: 1.15rem;
            line-height: 1.7;
            color: #1a1a2e;
            margin: 0 0 1rem;
            max-width: 680px;
        }
        .kp-mem-votd-meta {
            font-size: .82rem;
            color: #6d28d9;
            font-weight: 600;
            margin-bottom: 1.25rem;
            text-transform: uppercase;
            letter-spacing: .05em;
        }
        .kp-mem-votd-actions {
            display: flex;
            gap: .5rem;
            flex-wrap: wrap;
        }

        .kp-mem-featured { margin-top: 2.25rem; }
        .kp-mem-featured-heading {
            font: 800 1.5rem/1.2 'Manrope', sans-serif;
            color: #1a1a2e;
            text-align: center;
            margin: 0 0 .35rem;
        }
        .kp-mem-featured-sub {
            text-align: center; color: #6b7280; margin: 0 0 1.5rem;
            font-size: .95rem;
        }
        .kp-mem-topic-cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
        }
        .kp-mem-topic-cards-card {
            background: #1f1a2e;
            border: 1px solid #2a2540;
            border-radius: 16px;
            padding: 1.75rem 1.5rem;
            text-align: left;
            cursor: pointer;
            transition: all .2s ease;
            color: #e5e1f0;
            display: flex;
            flex-direction: column;
            gap: .85rem;
            min-height: 170px;
        }
        .kp-mem-topic-cards-card:hover {
            transform: translateY(-2px);
            border-color: #7c3aed;
            background: #24203a;
        }
        .kp-mem-topic-cards-card.is-featured {
            background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
            border-color: #7c3aed;
        }
        .kp-mem-topic-cards-card .kp-topic-icon {
            width: 32px; height: 32px;
            color: #c4b5fd;
        }
        .kp-mem-topic-cards-card.is-featured .kp-topic-icon { color: #fff; }
        .kp-mem-topic-cards-name {
            font: 700 1.15rem/1.2 'Manrope', sans-serif;
            color: #fff;
            margin: 0;
        }
        .kp-mem-topic-cards-desc {
            font-size: .9rem;
            color: #a9a3c4;
            line-height: 1.55;
            margin: 0;
            flex: 1;
        }
        .kp-mem-topic-cards-card.is-featured .kp-mem-topic-cards-desc { color: #ddd6fe; }
        .kp-mem-topic-cards-count {
            font-size: .78rem;
            color: #a78bfa;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .06em;
            margin-top: .25rem;
        }
        .kp-mem-topic-cards-card.is-featured .kp-mem-topic-cards-count { color: rgba(255,255,255,.85); }

        /* Single-topic view */
        .kp-mem-verses-header {
            display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
            flex-wrap: wrap;
        }
        .kp-mem-verses-title {
            font: 800 1.5rem/1.2 'Manrope', sans-serif; color: #1a1a2e; margin: 0;
        }
        .kp-mem-card { background: #fff; border: 1.5px solid #f0e9ff; border-radius: 16px; padding: 1.25rem 1.25rem 1rem; transition: all .2s ease; position: relative; display: flex; flex-direction: column; }
        .kp-mem-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(124, 58, 237, .12); border-color: #c4b5fd; }
        .kp-mem-card.is-mastered { background: linear-gradient(135deg, #f0fdf4, #fff); border-color: #86efac; }
        .kp-mem-card.is-mastered::after { content: 'MASTERED'; position: absolute; top: 10px; right: 12px; font: 700 .65rem/1 'Manrope', sans-serif; color: #16a34a; letter-spacing: .08em; }
        .kp-mem-card-coll { font: 600 .7rem/1 inherit; color: #7c3aed; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem; }
        .kp-mem-card-ref { font: 800 1.15rem/1.2 inherit; color: #1a1a2e; margin-bottom: .5rem; }
        .kp-mem-card-text { font-family: Georgia, serif; font-size: .95rem; line-height: 1.55; color: #4b5563; margin: 0 0 1rem; max-height: 120px; overflow: hidden; position: relative; }
        .kp-mem-card-text::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 30px; background: linear-gradient(to bottom, transparent, #fff); }
        .kp-mem-card.is-mastered .kp-mem-card-text::after { background: linear-gradient(to bottom, transparent, #f0fdf4); }
        .kp-mem-card-meta { font-size: .78rem; color: #6b7280; margin-bottom: .75rem; display: flex; gap: .75rem; flex-wrap: wrap; }
        .kp-mem-card-meta-score { color: #7c3aed; font-weight: 700; }
        .kp-mem-card-actions { display: flex; gap: .5rem; margin-top: auto; }

        .kp-mem-btn { padding: .55rem 1.1rem; border-radius: 999px; font: 700 .78rem/1 'Manrope', sans-serif; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; border: none; transition: all .15s ease; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
        .kp-mem-btn.primary { background: #7c3aed; color: #fff; }
        .kp-mem-btn.primary:hover { background: #6d28d9; transform: translateY(-1px); }
        .kp-mem-btn.secondary { background: #fff; color: #7c3aed; border: 2px solid #7c3aed; }
        .kp-mem-btn.secondary:hover { background: #7c3aed; color: #fff; }
        .kp-mem-btn.ghost { background: transparent; color: #6b7280; }
        .kp-mem-btn.ghost:hover { background: #f3f4f6; color: #1a1a2e; }
        .kp-mem-btn.danger { background: transparent; color: #dc2626; font-size: .7rem; padding: .4rem .7rem; }
        .kp-mem-btn.danger:hover { background: #fee2e2; }

        /* Toolbar button sizing \u2014 keep Review and Add Verse from dominating the toolbar */
        #kp-memory-app .kp-mem-toolbar-actions .kp-mem-btn {
            padding: .45rem .9rem;
            font-size: .72rem;
            letter-spacing: .05em;
            gap: .35rem;
            line-height: 1;
        }
        #kp-memory-app .kp-mem-toolbar-actions .kp-mem-btn .kp-icon { width: 13px !important; height: 13px !important; }

        /* Ghost back button on the verses header */
        #kp-memory-app #kp-mem-back {
            padding: .4rem .85rem;
            font-size: .72rem;
            letter-spacing: .05em;
        }

        /* Mode tabs in the practice modal: vertical alignment + sane spacing */
        #kp-memory-app .kp-mem-mode-tab,
        #kp-memory-app .kp-rv-tab {
            display: inline-flex; align-items: center;
            padding: .5rem .75rem;
            font-size: .78rem;
            gap: .3rem;
        }

        /* Verse-of-the-Day action buttons should not be elephants either */
        #kp-memory-app .kp-mem-votd-actions .kp-mem-btn {
            padding: .55rem 1rem;
            font-size: .78rem;
        }
        #kp-memory-app .kp-mem-votd-actions .kp-mem-btn .kp-icon { width: 13px !important; height: 13px !important; }

        /* Modals */
        .kp-mem-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .65); z-index: 99999; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto; }
        .kp-mem-overlay.is-open { display: flex; }
        .kp-mem-modal { background: #fff; border-radius: 20px; max-width: 640px; width: 100%; box-shadow: 0 25px 60px rgba(0, 0, 0, .3); margin: auto; }
        .kp-mem-practice-modal { max-width: 720px; }
        .kp-mem-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem; border-bottom: 1px solid #f3f4f6; }
        .kp-mem-modal-head h3 { margin: 0; font-size: 1.15rem; }
        .kp-mem-practice-ref { font: 800 1.25rem/1.2 inherit; color: #1a1a2e; }
        .kp-mem-practice-coll { font: 600 .72rem/1 inherit; color: #7c3aed; text-transform: uppercase; letter-spacing: .08em; margin-top: .3rem; }
        .kp-mem-close { width: 34px; height: 34px; border: none; background: rgba(0,0,0,.08); color: #1a1a2e; border-radius: 50%; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
        .kp-mem-close:hover { background: #7c3aed; color: #fff; }

        .kp-mem-mode-tabs { display: flex; border-bottom: 1px solid #f3f4f6; padding: 0 1rem; gap: .25rem; overflow-x: auto; }
        .kp-mem-mode-tab { background: none; border: none; padding: 1rem 1.1rem; font: 700 .82rem/1 'Manrope', sans-serif; color: #6b7280; cursor: pointer; border-bottom: 3px solid transparent; letter-spacing: .02em; white-space: nowrap; }
        .kp-mem-mode-tab.is-active { color: #7c3aed; border-bottom-color: #7c3aed; }
        .kp-mem-mode-tab:hover:not(.is-active) { color: #1a1a2e; }

        .kp-mem-modal-body { padding: 1.5rem; }
        .kp-mem-modal-body label { display: block; font-size: .82rem; font-weight: 600; color: #4b5563; margin-bottom: .85rem; }
        .kp-mem-modal-body input[type="text"],
        .kp-mem-modal-body select,
        .kp-mem-modal-body textarea { width: 100%; margin-top: .35rem; padding: .65rem .85rem; border: 1.5px solid #e5e7eb; border-radius: 10px; font: inherit; font-size: .95rem; }
        .kp-mem-modal-body input:focus,
        .kp-mem-modal-body textarea:focus,
        .kp-mem-modal-body select:focus { outline: none; border-color: #7c3aed; }
        .kp-mem-modal-body textarea { resize: vertical; min-height: 100px; font-family: Georgia, serif; line-height: 1.55; }

        .kp-mem-mode { display: none; }
        .kp-mem-mode.is-active { display: block; }
        .kp-mem-verse-text { font-family: Georgia, serif; font-size: 1.2rem; line-height: 1.75; color: #1a1a2e; margin: 0 0 1rem; }
        .kp-mem-verse-meta { font-size: .82rem; color: #6b7280; margin: 0; }
        .kp-mem-helper { font-size: .88rem; color: #6b7280; margin: 0 0 1rem; padding: .75rem 1rem; background: #faf5ff; border-radius: 10px; border-left: 3px solid #7c3aed; }
        .kp-mem-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
        .kp-mem-result { margin-top: 1rem; padding: 1rem 1.25rem; border-radius: 12px; display: none; }
        .kp-mem-result.is-visible { display: block; }
        .kp-mem-result.is-success { background: #f0fdf4; border-left: 4px solid #16a34a; color: #166534; }
        .kp-mem-result.is-partial { background: #fef3c7; border-left: 4px solid #f59e0b; color: #78350f; }
        .kp-mem-result.is-fail { background: #fef2f2; border-left: 4px solid #dc2626; color: #991b1b; }
        .kp-mem-result-score { font-size: 2rem; font-weight: 800; margin-bottom: .25rem; }
        .kp-mem-result-diff { margin-top: .75rem; padding: .75rem; background: rgba(255,255,255,.5); border-radius: 8px; font-family: Georgia, serif; line-height: 1.6; font-size: .95rem; }
        .kp-mem-diff-correct { color: #16a34a; }
        .kp-mem-diff-wrong { color: #dc2626; text-decoration: line-through; }
        .kp-mem-diff-missing { color: #6b7280; background: #e5e7eb; padding: 0 .3em; border-radius: 4px; }

        /* First-letter mode words */
        .kp-fl-word { display: inline-block; margin: 0 .2em; padding: .15em .35em; border-radius: 6px; background: #f3f4f6; color: #7c3aed; font-weight: 700; cursor: pointer; transition: all .15s ease; }
        .kp-fl-word.is-revealed { background: transparent; color: #1a1a2e; font-weight: 400; cursor: default; }
        .kp-fl-word:hover:not(.is-revealed) { background: #7c3aed; color: #fff; }

        .kp-mem-empty { text-align: center; padding: 3rem 1rem; color: #6b7280; grid-column: 1 / -1; }
        .kp-mem-err { color: #dc2626; font-size: .88rem; margin: .75rem 0 0; min-height: 1.2em; }

        /* Typing-mode two-column layout: gauge on left, verse + input on right */
        .kp-mem-type-layout { display: grid; grid-template-columns: 150px 1fr; gap: 1.5rem; align-items: start; }
        .kp-mem-gauge { position: relative; width: 120px; height: 120px; margin: 0 auto; text-align: center; }
        .kp-mem-gauge svg { display: block; }
        .kp-mem-gauge-arc { transition: stroke-dashoffset .25s ease; }
        .kp-mem-gauge-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, calc(-50% - 8px)); font: 800 1.45rem/1 'Manrope', sans-serif; color: #1a1a2e; }
        .kp-mem-gauge-sub { font-size: .68rem; color: #6b7280; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-top: 8px; }
        .kp-mem-type-panel { min-width: 0; }
        .kp-mem-verse-display {
            font-family: Georgia, serif; font-size: 1.1rem; line-height: 1.8;
            padding: 1rem 1.15rem; background: #faf5ff; border-radius: 12px;
            border-left: 4px solid #7c3aed; margin: 0 0 1rem; min-height: 4em;
            word-break: break-word;
        }
        .kp-mem-type-panel textarea {
            width: 100%; padding: .85rem 1rem; border: 1.5px solid #e5e7eb; border-radius: 12px;
            font: inherit; font-size: 1rem; font-family: Georgia, serif; line-height: 1.6;
            resize: vertical; min-height: 100px; box-sizing: border-box;
        }
        .kp-mem-type-panel textarea:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
        /* Inline word tokens in the verse display */
        .kp-word { display: inline-block; margin: 0 .1em; padding: 0 .15em; border-radius: 4px; transition: all .15s ease; }
        .kp-word.is-pending { color: #1a1a2e; }
        .kp-word.is-correct { background: #dcfce7; color: #15803d; font-weight: 600; }
        .kp-word.is-wrong   { background: #fee2e2; color: #991b1b; }
        .kp-word.is-blank   { color: #c4b5fd; letter-spacing: 1px; }
        .kp-word.is-blank.is-correct { background: #dcfce7; color: #15803d; letter-spacing: 0; }

        /* Inline fill-in-the-blank inputs for Memorize It */
        .kp-mem-verse-display-inline { padding: 1.25rem 1.25rem; line-height: 2.2; }
        .kp-blank-input {
            display: inline-block;
            min-width: 3.5em;
            padding: .15em .35em;
            margin: 0 .15em;
            border: none;
            border-bottom: 2px solid #7c3aed;
            background: #fff;
            font: inherit;
            font-family: Georgia, serif;
            font-size: 1em;
            color: #1a1a2e;
            text-align: center;
            border-radius: 4px 4px 0 0;
            transition: all .15s ease;
        }
        .kp-blank-input:focus {
            outline: none;
            border-bottom-color: #4c1d95;
            background: #faf5ff;
            box-shadow: 0 2px 0 #4c1d95;
        }
        .kp-blank-input.is-correct {
            background: #dcfce7;
            color: #15803d;
            font-weight: 600;
            border-bottom-color: #16a34a;
            box-shadow: none;
        }
        .kp-blank-input.is-wrong {
            background: #fef2f2;
            color: #991b1b;
            border-bottom-color: #dc2626;
        }

        @media (max-width: 640px) {
            .kp-mem-hero { padding: 2rem 1.25rem; border-radius: 18px; }
            .kp-mem-hero h1 { font-size: 1.65rem; }
            .kp-mem-grid { grid-template-columns: 1fr; gap: 1rem; }
            .kp-mem-toolbar { padding: .85rem 1rem; gap: .75rem; }
            .kp-mem-verse-text { font-size: 1.05rem; }
            .kp-mem-modal-head { padding: 1rem; }
            .kp-mem-modal-body { padding: 1rem; }
            .kp-mem-type-layout { grid-template-columns: 1fr; gap: 1rem; }
            .kp-mem-gauge { width: 100px; height: 100px; }
            .kp-mem-gauge svg { width: 100px; height: 100px; }
            .kp-mem-gauge-label { font-size: 1.2rem; }
            .kp-mem-votd { padding: 1.5rem 1.25rem; }
            .kp-mem-votd-ref { font-size: 1.15rem; }
            .kp-mem-votd-text { font-size: 1.02rem; }
        }

/* ===== Record yourself reading — button states ===== */
#kp-mem-record { transition: background .15s ease, border-color .15s ease, color .15s ease; }
#kp-mem-record[data-state="recording"] {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
    animation: kp-mem-rec-pulse 1.4s ease-in-out infinite;
}
#kp-mem-record[data-state="has"],
#kp-mem-record[data-state="playing"] {
    background: #f0fdf4 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
}
#kp-mem-record-delete {
    padding: .4rem .55rem !important;
    color: #9ca3af !important;
}
#kp-mem-record-delete:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fecaca !important;
}
@keyframes kp-mem-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .35); }
    50%      { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}