        :root {
            --bg: #0a0a0e;
            --surface: #111116;
            --surface2: #18181e;
            --border: #2a2a32;
            --text: #fff8f2;
            --text2: #98949f;
            --text3: #5a5868;
            --amber: #e8a435;
            --amber-glow: rgba(232,164,53,0.25);
            --amber-dim: #a07020;
            --teal: #4ecdb4;
            --teal-glow: rgba(78,205,180,0.18);
            --red: #ff6644;
            --chunk-before: #b8c4b0;
            --chunk-after: #8a8a96;
            --chunk-opacity-before: 0.88;
            --chunk-opacity-after: 0.72;
        }
        *, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

        /* Kill mobile font boosting: Chrome inflates text blocks past even
           inline !important sizes, which breaks ORP layout and shrink-to-fit.
           text-size-adjust alone does not stop it everywhere; the max-height
           opt-out makes the autosizer skip the whole page. */
        html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
        body { max-height: 999999px; }

        body {
            font-family: 'Outfit', sans-serif;
            background: var(--bg);
            color: var(--text);
            height: 100vh; height: 100dvh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0;
            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
            overflow: hidden;
            overflow-y: auto;
        }

        .app-shell {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            max-width: 960px;
            height: 100%;
            padding: 6px 0 6px;
            position: relative;
        }

        /* Textured chrome overlay — subtle machined surface */
        .app-shell::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            pointer-events: none;
            z-index: 0;
            opacity: 0.4;
            transition: opacity 0.4s ease;
            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 type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
                repeating-linear-gradient(
                    90deg,
                    transparent,
                    transparent 1px,
                    rgba(255,255,255,0.008) 1px,
                    rgba(255,255,255,0.008) 2px
                ),
                repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 3px,
                    rgba(78,205,180,0.006) 3px,
                    rgba(78,205,180,0.006) 4px
                );
            mix-blend-mode: overlay;
        }
        /* Micro-dot grid — like perforated speaker mesh */
        .app-shell::after {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            pointer-events: none;
            z-index: 0;
            opacity: 0.3;
            transition: opacity 0.4s ease;
            background-image:
                radial-gradient(circle 0.5px at 4px 4px, rgba(255,255,255,0.04) 0%, transparent 100%),
                radial-gradient(circle 0.4px at 12px 8px, rgba(78,205,180,0.025) 0%, transparent 100%),
                radial-gradient(circle 0.3px at 8px 14px, rgba(232,164,53,0.02) 0%, transparent 100%);
            background-size: 16px 16px;
            mix-blend-mode: screen;
        }

        /* Fall away on play */
        body.is-playing .app-shell::before,
        body.is-playing .app-shell::after {
            opacity: 0;
        }
        body.force-landscape .app-shell::before,
        body.force-landscape .app-shell::after {
            opacity: 0;
        }

        /* ---- HEADER ---- */
        .app-header {
            width: 100%;
            display: flex;
            flex-direction: column;
            padding: 8px 20px 0;
            flex-shrink: 0;
            position: relative;
            z-index: 50;
        }
        .top-bar {
            display: flex;
            align-items: center;
            padding: 0 0 0;
            width: 100%;
        }
        .header-stats {
            display: flex;
            gap: 16px;
            align-items: center;
            flex: 0 0 auto;
            min-width: 120px;
        }
        .stat { text-align: center; }
        .stat-val {
            font-size: 15px;
            font-weight: 600;
            color: var(--teal);
            font-variant-numeric: tabular-nums;
            line-height: 1.2;
            text-shadow: 0 0 8px rgba(78,205,180,0.08);
        }
        .stat-lbl {
            font-size: 8px;
            color: var(--text3);
            text-transform: uppercase;
            letter-spacing: 0.14em;
        }
        .logo-center {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .logo {
            display: flex;
            align-items: baseline;
            gap: 1px;
            font-size: 34px;
            font-weight: 600;
            letter-spacing: -0.02em;
            flex-shrink: 0;
            transform: rotate(-2deg);
            transform-origin: center;
            position: relative;
        }
        .logo .lex {
            color: var(--teal);
            text-shadow: 0 0 20px rgba(78,205,180,0.15), 0 0 40px rgba(78,205,180,0.05);
            font-weight: 500;
        }
        .logo .rom {
            color: var(--amber);
            font-weight: 700;
            text-shadow: 0 0 20px rgba(232,164,53,0.15), 0 0 40px rgba(232,164,53,0.05);
        }
        /* Genus face (PLAN-genus T3): its name in Cormorant Garamond, amber.
           The full Genus look lands in T4. */
        body.site-genus .logo { font-family: 'Cormorant Garamond', 'Playfair Display', serif; font-style: italic; letter-spacing: 0; transform: none; }
        body.site-genus .logo .lex { color: #d4a030; font-weight: 600; text-shadow: 0 0 20px rgba(212,160,48,0.18), 0 0 40px rgba(212,160,48,0.06); }
        /* The Genus look (T4): the March palette. Warm dark browns under cream
           text, amber for the accent; the green CRT screen stays, as in March. */
        body.site-genus {
            --bg: #0f0c08;
            --surface: #1a1510;
            --surface2: #211c14;
            --border: #2a231a;
            --text: #f0e6d0;
            --text2: #a89878;
            --text3: #685838;
            --amber: #d4a030;
            --amber-glow: rgba(212,160,48,0.25);
            --amber-dim: #8a6a20;
        }
        body.site-genus .tagline { font-family: 'Source Serif 4', serif; font-style: italic; letter-spacing: 2px; text-transform: none; font-size: 13px; }
        body.site-genus .tagline .t-load { color: rgba(240,230,208,0.6); }
        body.site-genus .tagline .t-flow { color: rgba(212,160,48,0.7); }
        body.site-genus .tagline .t-know { color: rgba(138,173,90,0.7); }
        body.site-genus .font-serif .word-box,
        body.site-genus .font-serif #static-view { font-family: 'Source Serif 4', 'Playfair Display', serif; }
        body.site-genus .context-band { font-family: 'Source Serif 4', serif; }
        body:not(.site-genus) .site-only[data-site="genus"] { display: none !important; }
        /* The Handheld look (B 13 Nov): the February lexROM's console face, from
           its own styles. Same controls; A and B and two lights appear. */
        body:not(.look-handheld) .look-only { display: none !important; }
        .led-cluster { display: flex; gap: 8px; align-items: center; padding: 4px 8px; background: linear-gradient(180deg, #08060e 0%, #100e18 100%);
            border-radius: 10px; border: 1px solid #040306; box-shadow: inset 0 3px 8px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.02); }
        .led { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(ellipse at 40% 30%, #3a4540 0%, #1a2520 100%);
            border: 1px solid #0a0f0d; box-shadow: inset 0 2px 3px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05); transition: all 0.3s; }
        .led.on { background: radial-gradient(ellipse at 35% 30%, #90ffee 0%, var(--teal) 40%, #2a9080 100%); border-color: #1a5048;
            box-shadow: 0 0 12px var(--teal-glow), 0 0 24px rgba(78,205,180,0.3), inset 0 -2px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5); }
        .led.amber { background: radial-gradient(ellipse at 40% 30%, #5a4530 0%, #2a2015 100%); }
        body.is-playing .led.play-led { background: radial-gradient(ellipse at 35% 30%, #ffe080 0%, var(--amber) 40%, #a06818 100%); border-color: #705010;
            box-shadow: 0 0 12px var(--amber-glow), 0 0 24px rgba(232,164,53,0.3), inset 0 -2px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.5); }
        .ab-area { display: flex; flex-direction: column; align-items: center; gap: 4px; }
        .ab-buttons { display: flex; gap: 10px; transform: rotate(-25deg); }
        .ab-labels { display: flex; gap: 22px; transform: rotate(-25deg); font-family: 'Press Start 2P', monospace; font-size: 7px; text-transform: uppercase;
            color: #5a5870; text-shadow: 0 1px 0 rgba(255,255,255,0.12), 0 -1px 0 rgba(0,0,0,0.4); }
        .ab-btn { width: 44px; height: 44px; border-radius: 50%; font-family: 'Press Start 2P', monospace; font-size: 12px; cursor: pointer;
            display: flex; align-items: center; justify-content: center; transition: all 0.1s; outline: 3px solid rgba(0,0,0,0.5); outline-offset: 2px; }
        .btn-a { color: #3a2208; background: radial-gradient(ellipse at 35% 25%, rgba(255,255,255,0.4) 0%, transparent 45%), linear-gradient(180deg, #f0b840 0%, var(--amber) 30%, #c08820 70%, #906010 100%);
            border: 2px solid #a07018; border-top-color: #f0c860; border-bottom: 5px solid #6a4808; box-shadow: 0 6px 16px rgba(0,0,0,0.4); }
        .btn-a:active { transform: translateY(3px); border-bottom-width: 2px; }
        .btn-b { color: var(--text2); background: radial-gradient(ellipse at 35% 25%, rgba(255,255,255,0.2) 0%, transparent 45%), linear-gradient(180deg, #5a5868 0%, #4a4858 30%, #3a3848 70%, #2a2838 100%);
            border: 2px solid #2a2838; border-top-color: rgba(255,255,255,0.1); border-bottom: 5px solid #121018; box-shadow: 0 6px 16px rgba(0,0,0,0.45); }
        .btn-b:active { transform: translateY(3px); border-bottom-width: 2px; }
        body.look-handheld .top-bar { gap: 10px; }
        /* The light (T5): the March Genus border, flashing in steps (no fade)
           at the period the breathing set gives it. */
        .hz-frame { position: fixed; inset: 0; z-index: 60; pointer-events: none; border: 16px solid transparent; }
        .hz-frame.active { animation: hzFlash var(--hz-period, 25ms) step-end infinite; }
        .hz-frame.active::after { content: ''; position: absolute; inset: -8px; border: 8px solid transparent; animation: hzGlow var(--hz-period, 25ms) step-end infinite; }
        @keyframes hzFlash { 0% { border-color: var(--hz-on); } 50% { border-color: var(--hz-off); } }
        @keyframes hzGlow { 0% { box-shadow: inset 0 0 160px var(--hz-glow), 0 0 160px var(--hz-glow); } 50% { box-shadow: none; } }
        .hz-dot i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
        .light-item { flex-wrap: wrap; max-width: 300px; }
        .light-note { flex-basis: 100%; font-size: 11px; line-height: 1.35; color: var(--text2); margin-top: 4px; }
        .light-note span:not(:empty) { display: block; color: var(--amber); margin-top: 2px; }
        /* The Library (T6): a second view of the Shelf panel on Genus. */
        body.site-genus #panel-shelf.open { max-height: calc(44vh + 200px); }
        #panel-shelf.view-library > :not(.shelf-tabs):not(.lib-wrap) { display: none !important; }
        #panel-shelf:not(.view-library) > .lib-wrap { display: none !important; }
        /* The shared shelf (T14): a third view of the Shelf panel on Genus. */
        #panel-shelf.view-shared > :not(.shelf-tabs):not(.shared-wrap) { display: none !important; }
        #panel-shelf:not(.view-shared) > .shared-wrap { display: none !important; }
        .shared-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px 8px; }
        .cash-line { padding: 10px 8px 4px; font-size: 12px; line-height: 1.5; color: var(--text2); text-align: center; border-top: 1px solid rgba(212,175,85,0.14); margin-top: 6px; }
        .cash-line a, .cash-note a { color: var(--amber); font-weight: 600; text-decoration: none; }
        .cash-line a:hover, .cash-note a:hover { text-decoration: underline; }
        .cash-note { position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 31; width: min(620px, 86%);
            display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--text);
            background: rgba(26,21,16,0.95); border: 1px solid rgba(212,175,85,0.3); }
        .cash-note[hidden] { display: none; }
        .shelf-tabs { display: flex; justify-content: center; padding: 2px 0 8px; }
        .lib-form { display: flex; gap: 8px; padding: 0 4px 8px; }
        .lib-form input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; outline: none; }
        .lib-form input:focus { border-color: rgba(212,160,48,0.45); }
        .lib-topics { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
        .lib-topics .seg-btn { font-size: 12px; padding: 5px 10px; }
        .lib-list { max-height: 44vh; }
        .lib-sub { padding: 8px 10px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); }
        .lib-row { gap: 12px; }
        .lib-cover { width: 34px; height: 50px; object-fit: cover; border-radius: 3px; background: var(--surface2); flex: 0 0 auto; }
        .lib-meta { min-width: 0; }
        .lib-title { font-family: 'Source Serif 4', serif; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .lib-author { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .lib-more { display: block; margin: 6px auto 2px; }
        .lib-more[hidden] { display: none; }
        /* The book picker (T6): a tap on a book. Remix modes join it in T12. */
        .book-picker { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
        .book-picker[hidden] { display: none; }
        .pick-box { display: flex; gap: 18px; width: 100%; max-width: 560px; padding: 18px; border-radius: 10px; background: var(--surface); border: 1px solid rgba(212,175,85,0.2); box-shadow: 0 16px 50px rgba(0,0,0,0.6); }
        .pick-cover { width: 120px; height: 180px; object-fit: cover; border-radius: 4px; background: var(--surface2); flex: 0 0 auto; }
        .pick-meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
        .pick-title { font-family: 'Source Serif 4', serif; font-size: 22px; line-height: 1.25; color: var(--text); }
        .pick-author { font-size: 14px; color: var(--text2); }
        .pick-status { font-size: 13px; color: var(--amber); min-height: 18px; }
        .pick-actions { margin-top: auto; display: flex; gap: 8px; justify-content: flex-end; }
        /* The remix part of the picker (T12). */
        body.site-genus .pick-box { max-width: 820px; max-height: calc(100vh - 40px); }
        body.site-genus .pick-meta { overflow-y: auto; }
        .pick-remix { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
        .pick-groups { display: flex; flex-direction: column; gap: 8px; }
        .pick-label { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); margin-bottom: 4px; }
        .pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
        .pick-chips .seg-btn { font-size: 12px; padding: 5px 10px; }
        .pick-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .pick-row .pick-label { margin: 0; min-width: 52px; }
        .pick-note { font-size: 12px; color: var(--text2); }
        #pick-remix:disabled { opacity: 0.4; cursor: default; }
        /* What the remix is doing, at the top of the screen (T12). */
        .remix-status { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 8; max-width: 80%;
            padding: 6px 14px; border-radius: 999px; font-size: 12px; color: var(--text); text-align: center;
            background: rgba(26,21,16,0.86); border: 1px solid rgba(212,175,85,0.25); pointer-events: none; }
        .remix-status[hidden] { display: none; }
        /* The choice card (T13): Choose Your Own at the end of a part. */
        .choice-card { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
            padding: 24px; background: rgba(10,8,5,0.88); text-align: center; }
        .choice-card[hidden] { display: none; }
        .choice-q { font-family: 'Cormorant Garamond', 'Playfair Display', serif; font-style: italic; font-size: 30px; line-height: 1.25; color: var(--amber); max-width: 720px; }
        .choice-opts { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 560px; }
        .choice-opts .seg-btn { font-family: 'Source Serif 4', serif; font-size: 17px; padding: 12px 16px; text-align: left; white-space: normal;
            color: var(--text); background: rgba(42,35,26,0.9); border: 1px solid rgba(212,175,85,0.35); }
        .choice-opts .seg-btn:hover { border-color: rgba(212,160,48,0.7); }
        .choice-opts .seg-btn:disabled { opacity: 0.5; }
        .choice-status { font-size: 13px; color: var(--text2); min-height: 18px; }
        .divider {
            width: 100%;
            height: 0;
            border-top: 1px solid rgba(78,205,180,0.2);
            border-bottom: 1px solid rgba(232,164,53,0.12);
            box-shadow: 0 0 14px rgba(78,205,180,0.05);
        }
        .divider.lower {
            border-top: 1px solid rgba(232,164,53,0.2);
            border-bottom: 1px solid rgba(78,205,180,0.12);
            box-shadow: 0 0 14px rgba(232,164,53,0.05);
        }

        /* TAGLINE — Load. Flow. Know. */
        .tagline {
            font-family: 'Outfit', sans-serif;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 3px;
            text-transform: uppercase;
            text-align: center;
            padding: 0 0 8px;
            margin: -3px 0 0;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
        }
        @keyframes tagGlow { 0%,100%{opacity:.75} 50%{opacity:1} }
        .tagline .t-load {
            color: rgba(78,205,180,0.65);
            text-shadow:
                0 -0.5px 0 rgba(0,0,0,0.6),
                0 0.5px 0 rgba(78,205,180,0.25),
                0 0 8px rgba(78,205,180,0.12),
                0 0 20px rgba(78,205,180,0.04);
            animation: tagGlow 5s ease-in-out infinite;
        }
        .tagline .t-flow {
            color: rgba(232,164,53,0.65);
            text-shadow:
                0 -0.5px 0 rgba(0,0,0,0.6),
                0 0.5px 0 rgba(232,164,53,0.25),
                0 0 8px rgba(232,164,53,0.12),
                0 0 20px rgba(232,164,53,0.04);
            animation: tagGlow 5s ease-in-out infinite 1.6s;
        }
        .tagline .t-know {
            color: rgba(200,120,170,0.65);
            text-shadow:
                0 -0.5px 0 rgba(0,0,0,0.6),
                0 0.5px 0 rgba(200,120,170,0.25),
                0 0 8px rgba(200,120,170,0.12),
                0 0 20px rgba(200,120,170,0.04);
            animation: tagGlow 5s ease-in-out infinite 3.2s;
        }
        body.is-playing .tagline { display: none; }
        body.force-landscape .tagline { display: none; }

        .drop-panel {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.3s ease;
            opacity: 0;
            width: 100%;
            padding: 0 4px;
        }
        .drop-panel.open {
            max-height: 300px;
            opacity: 1;
            padding: 8px 4px;
        }
        .panel-inner {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            flex-wrap: wrap;
            padding: 2px 0;
        }


        /* ---- READING VIEWPORT ---- */
        .reader {
            width: 100%;
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            position: relative;
            padding: 8px 20px;
            min-height: 100px;
            z-index: 1;
        }
        .screen {
            width: 100%;
            flex: 1;
            min-height: 0;
            background:
                url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='1.5' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.015'/%3E%3C/svg%3E"),
                radial-gradient(ellipse at center, #080a08 0%, #030504 100%);
            border-radius: 10px;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            border: none;
            transition: box-shadow 0.6s ease, border-color 0.4s ease;
            box-shadow:
                inset 0 12px 30px rgba(0,0,0,0.85),
                inset 8px 0 20px rgba(0,0,0,0.5),
                inset -8px 0 20px rgba(0,0,0,0.5),
                inset 0 6px 15px rgba(0,0,0,0.9),
                inset 0 0 20px rgba(0,0,0,0.5),
                inset 0 0 80px rgba(0,0,0,0.6),
                inset 8px 8px 25px rgba(0,0,0,0.35),
                inset -8px 8px 25px rgba(0,0,0,0.35),
                inset -6px -6px 20px rgba(0,0,0,0.25),
                inset 6px -6px 20px rgba(0,0,0,0.25),
                inset 0 -2px 8px rgba(72,232,120,0.015),
                0 4px 12px rgba(0,0,0,0.8),
                0 12px 40px rgba(0,0,0,0.5),
                0 0 80px rgba(78,205,180,0.03);
        }

        /* Deep screen layers */
        .screen-depth {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: 10px;
            pointer-events: none;
            z-index: 0;
            transition: all 0.6s ease;
        }
        /* Top line: teal left → gold right */
        .screen-depth.layer1::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; height: 1px;
            background: linear-gradient(to right, rgba(78,205,180,0.5), rgba(232,164,53,0.5));
            z-index: 10;
        }
        /* Bottom line: gold left → teal right */
        .screen-depth.layer1::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0; height: 1px;
            background: linear-gradient(to right, rgba(232,164,53,0.5), rgba(78,205,180,0.5));
            z-index: 10;
        }
        .screen-depth.layer1 {
            background: linear-gradient(180deg,
                rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.25) 6%, rgba(0,0,0,0.08) 14%,
                transparent 22%, transparent 78%,
                rgba(0,0,0,0.1) 86%, rgba(0,0,0,0.3) 94%, rgba(0,0,0,0.45) 100%);
        }
        .screen-depth.layer2 {
            background: linear-gradient(90deg,
                rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 5%, rgba(0,0,0,0.06) 12%,
                transparent 18%, transparent 82%,
                rgba(0,0,0,0.08) 88%, rgba(0,0,0,0.25) 95%, rgba(0,0,0,0.45) 100%);
        }
        .screen-depth.layer3 {
            box-shadow:
                inset 0 0 90px rgba(0,0,0,0.5),
                inset 0 0 160px rgba(0,0,0,0.3),
                inset 8px 8px 35px rgba(0,0,0,0.35);
        }

        /* Deepen when playing — tunnel focus */
        .playing .screen-depth.layer1 {
            background: linear-gradient(180deg,
                rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.15) 12%, transparent 24%,
                transparent 76%, rgba(0,0,0,0.2) 88%, rgba(0,0,0,0.6) 100%);
        }
        .playing .screen-depth.layer2 {
            background: linear-gradient(90deg,
                rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 12%, transparent 20%,
                transparent 80%, rgba(0,0,0,0.15) 88%, rgba(0,0,0,0.6) 100%);
        }
        .playing .screen-depth.layer3 {
            box-shadow:
                inset 0 0 110px rgba(0,0,0,0.65),
                inset 0 0 200px rgba(0,0,0,0.4),
                inset 12px 12px 45px rgba(0,0,0,0.35);
        }

        /* CRT scanlines */
        .screen::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background:
                repeating-linear-gradient(0deg,
                    transparent, transparent 1.2px,
                    rgba(0,0,0,0.10) 1.2px, rgba(0,0,0,0.10) 2.4px),
                repeating-linear-gradient(0deg,
                    transparent, transparent 0.5px,
                    rgba(0,0,0,0.03) 0.5px, rgba(0,0,0,0.03) 1px);
            pointer-events: none;
            z-index: 10;
        }

        /* Phosphor glow */
        .screen::after {
            content: '';
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 92%; height: 75%;
            background:
                radial-gradient(ellipse 70% 55% at 50% 48%,
                    rgba(30,80,55,0.09) 0%, rgba(20,60,40,0.05) 35%, transparent 65%),
                radial-gradient(ellipse 85% 70% at 50% 50%,
                    rgba(78,205,180,0.04) 0%, rgba(78,205,180,0.02) 40%, transparent 75%),
                radial-gradient(ellipse 40% 30% at 50% 45%,
                    rgba(255,240,200,0.012) 0%, transparent 100%);
            pointer-events: none;
            z-index: 1;
        }

        /* Red light mode screen overrides */
        .screen.redlight-mode {
            background: radial-gradient(ellipse at center, #0a0404 0%, #040202 100%);
        }
        .screen.redlight-mode::after {
            background: radial-gradient(ellipse, rgba(255,50,30,0.04) 0%, transparent 70%);
        }
        .screen.redlight-mode .screen-depth.layer3 {
            box-shadow: inset 0 0 80px rgba(20,0,0,0.6), inset 0 0 150px rgba(10,0,0,0.4);
        }
        .playing .screen.redlight-mode .screen-depth.layer1 {
            background: linear-gradient(180deg,
                rgba(15,0,0,0.6) 0%, transparent 22%, transparent 78%, rgba(15,0,0,0.5) 100%);
        }
        .playing .screen.redlight-mode .screen-depth.layer2 {
            background: linear-gradient(90deg,
                rgba(15,0,0,0.55) 0%, transparent 18%, transparent 82%, rgba(15,0,0,0.55) 100%);
        }

        /* Breathing (JOB 6): two registered properties the reader animates with
           per-phase durations. The room is the CRT glow, the words are the lane. */
        @property --bhue { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
        .playing .crt-glow { filter: blur(20px) hue-rotate(var(--bhue, 0deg)); }
        @property --bglow { syntax: '<number>'; inherits: true; initial-value: 1; }
        @property --bsat { syntax: '<number>'; inherits: true; initial-value: 1; }
        @property --bpace { syntax: '<number>'; inherits: true; initial-value: 1; }
        .reader { --bglow: 1; --bsat: 1; --bpace: 1; }
        /* body .reader.playing outranks '.playing .crt-glow { opacity: 1 }' and
           '.reader:hover .crt-glow' further down, which silently held the room
           at full since JOB 6 (only the words ever dimmed). */
        body .reader.playing .crt-glow { opacity: calc(var(--bglow, 1) * var(--bpace, 1)); transition: none; }
        .marks-breathe .word-box {
            filter: saturate(var(--bsat, 1)) brightness(calc(0.5 + 0.5 * var(--bsat, 1)));
            transition: none;
        }
        .marks-breathe .playing .screen-depth.layer3 { opacity: calc(0.35 + 0.65 * var(--bglow, 1) * var(--bpace, 1)); transition: box-shadow 0.6s; } /* opacity follows the properties directly: .screen-depth's 'transition: 0.6s' restarted on every change and held it near 1 */

        /* CRT edge glow — activated when playing */
        .crt-glow {
            position: absolute;
            top: -8px; left: -8px; right: -8px; bottom: -8px;
            border-radius: 16px;
            pointer-events: none;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.8s ease;
            background:
                radial-gradient(ellipse 80% 40% at 50% 0%,
                    rgba(78,205,180,0.06) 0%, transparent 70%),
                radial-gradient(ellipse 80% 40% at 50% 100%,
                    rgba(78,205,180,0.04) 0%, transparent 70%),
                radial-gradient(ellipse 40% 80% at 0% 50%,
                    rgba(78,205,180,0.05) 0%, transparent 70%),
                radial-gradient(ellipse 40% 80% at 100% 50%,
                    rgba(78,205,180,0.05) 0%, transparent 70%);
            filter: blur(20px);
        }
        .reader:hover .crt-glow { opacity: 0.4; transition: opacity 0.5s ease; }
        .playing .crt-glow { opacity: 1; }
        .screen.redlight-mode ~ .crt-glow,
        .playing .screen.redlight-mode + .crt-glow {
            background:
                radial-gradient(ellipse 80% 40% at 50% 0%,
                    rgba(180,60,50,0.05) 0%, transparent 70%),
                radial-gradient(ellipse 80% 40% at 50% 100%,
                    rgba(180,60,50,0.03) 0%, transparent 70%),
                radial-gradient(ellipse 40% 80% at 0% 50%,
                    rgba(180,60,50,0.04) 0%, transparent 70%),
                radial-gradient(ellipse 40% 80% at 100% 50%,
                    rgba(180,60,50,0.04) 0%, transparent 70%);
        }

        /* Flipped mode */
        .screen.flipped {
            background: radial-gradient(ellipse at center, #12100a 0%, #0a0806 100%) !important;
        }
        .screen.flipped .word-box, .screen.flipped #rsvp-view {
            color: #f0e8d8 !important;
            text-shadow: 0 0 20px rgba(232,200,150,0.15) !important;
        }
        .screen.flipped .word-box .before { color: #c8b898 !important; }
        .screen.flipped .word-box .orp {
            color: #4ecdb4 !important;
            text-shadow: 0 0 30px rgba(78,205,180,0.4), 0 0 60px rgba(78,205,180,0.2) !important;
        }
        .screen.flipped .word-box .after { color: #a89878 !important; }
        .screen.flipped b { color: #f0e8d8 !important; }
        .screen.flipped #static-view { color: #d8ccb8 !important; }

        /* Foveated blur layers */
        .foveated-blur {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: 10px;
            pointer-events: none;
            z-index: 100;
            opacity: 0;
            transition: opacity 0.5s ease;
        }
        .playing .foveated-blur { opacity: 1; }

        .foveated-blur::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: inherit;
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
            mask-image: radial-gradient(ellipse 70% 34% at 50% 42%, transparent 0%, transparent 60%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.85) 90%, black 100%);
            -webkit-mask-image: radial-gradient(ellipse 70% 34% at 50% 42%, transparent 0%, transparent 60%, rgba(0,0,0,0.3) 70%, rgba(0,0,0,0.6) 80%, rgba(0,0,0,0.85) 90%, black 100%);
        }
        .foveated-blur::after {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: inherit;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            mask-image: radial-gradient(ellipse 65% 30% at 50% 42%, transparent 0%, transparent 55%, rgba(0,0,0,0.15) 63%, rgba(0,0,0,0.35) 71%, rgba(0,0,0,0.55) 79%, rgba(0,0,0,0.75) 87%, rgba(0,0,0,0.9) 94%, black 100%);
            -webkit-mask-image: radial-gradient(ellipse 65% 30% at 50% 42%, transparent 0%, transparent 55%, rgba(0,0,0,0.15) 63%, rgba(0,0,0,0.35) 71%, rgba(0,0,0,0.55) 79%, rgba(0,0,0,0.75) 87%, rgba(0,0,0,0.9) 94%, black 100%);
        }
        .foveated-darkness {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: 10px;
            pointer-events: none;
            z-index: 101;
            opacity: 0;
            transition: opacity 0.5s ease;
            background: radial-gradient(ellipse 68% 32% at 50% 42%, transparent 0%, transparent 50%, rgba(0,0,0,0.03) 60%, rgba(0,0,0,0.08) 70%, rgba(0,0,0,0.18) 80%, rgba(0,0,0,0.32) 90%, rgba(0,0,0,0.5) 97%, rgba(0,0,0,0.6) 100%);
        }
        .playing .foveated-darkness { opacity: 1; }

        /* Static modes: lighter blur, instant engage, gentle slope */
        .static-active .foveated-blur {
            transition: none;
            opacity: 1;
        }
        .static-active .foveated-darkness {
            transition: none;
            opacity: 1;
        }
        .static-active .foveated-blur::before {
            backdrop-filter: blur(1px);
            -webkit-backdrop-filter: blur(1px);
            mask-image: radial-gradient(ellipse 90% 42% at 50% 36%, transparent 0%, transparent 65%, rgba(0,0,0,0.1) 74%, rgba(0,0,0,0.25) 82%, rgba(0,0,0,0.5) 90%, rgba(0,0,0,0.8) 96%, black 100%);
            -webkit-mask-image: radial-gradient(ellipse 90% 42% at 50% 36%, transparent 0%, transparent 65%, rgba(0,0,0,0.1) 74%, rgba(0,0,0,0.25) 82%, rgba(0,0,0,0.5) 90%, rgba(0,0,0,0.8) 96%, black 100%);
        }
        .static-active .foveated-blur::after {
            backdrop-filter: blur(3px);
            -webkit-backdrop-filter: blur(3px);
            mask-image: radial-gradient(ellipse 88% 40% at 50% 36%, transparent 0%, transparent 62%, rgba(0,0,0,0.06) 72%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.35) 88%, rgba(0,0,0,0.65) 94%, rgba(0,0,0,0.9) 98%, black 100%);
            -webkit-mask-image: radial-gradient(ellipse 88% 40% at 50% 36%, transparent 0%, transparent 62%, rgba(0,0,0,0.06) 72%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.35) 88%, rgba(0,0,0,0.65) 94%, rgba(0,0,0,0.9) 98%, black 100%);
        }
        .static-active .foveated-darkness {
            background: radial-gradient(ellipse 88% 40% at 50% 36%, transparent 0%, transparent 58%, rgba(0,0,0,0.01) 68%, rgba(0,0,0,0.04) 76%, rgba(0,0,0,0.1) 84%, rgba(0,0,0,0.2) 91%, rgba(0,0,0,0.35) 96%, rgba(0,0,0,0.45) 100%);
        }

        /* RSVP view */
        #rsvp-view {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            width: 100%;
            z-index: 2;
            padding: 16px 0 30px 0;
            overflow: hidden;
        }
        #rsvp-view.paused #wb { opacity: 0.4; }
        #rsvp-view.empty #wb { display: none; }

        .empty-msg {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            font-size: 11px;
            color: var(--text3);
            letter-spacing: 0.25em;
            text-transform: uppercase;
            cursor: pointer;
            animation: blink-cursor 2s ease-in-out infinite;
            padding: 16px 24px;
            font-weight: 400;
        }
        .empty-msg:hover { color: var(--teal); text-shadow: 0 0 20px rgba(78,205,180,0.3); }
        #rsvp-view:not(.empty) .empty-msg { display: none; }
        /* Genus screensaver (T4): its words through the focus letter at
           reading size, breathing slowly, with TAP TO LOAD under them. */
        .ss-word { display: none; }
        body.screensaver #rsvp-view.empty .ss-word {
            display: flex; justify-content: center; align-items: baseline;
            position: absolute; top: 42%; left: 0; right: 0; transform: translateY(-50%);
            font-family: 'Source Serif 4', serif; font-size: clamp(34px, 6vw, 64px);
            color: var(--text); pointer-events: none;
            animation: ssBreathe 6s ease-in-out infinite;
        }
        .ss-word .before { text-align: right; flex: 0 0 45%; }
        .ss-word .orp { color: #d4a030; }
        .ss-word .after { flex: 1 1 0; }
        @keyframes ssBreathe { 0%,100% { opacity: 0.35; } 50% { opacity: 0.75; } }
        body.screensaver .empty-msg { top: 72%; }
        /* The rest card (T4): the 20-20-20 rest and the end of an hour. */
        .rest-card {
            position: absolute; inset: 0; z-index: 30;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
            background: rgba(10,8,5,0.86); color: var(--text); text-align: center;
        }
        .rest-card[hidden] { display: none; }
        .rest-title { font-family: 'Cormorant Garamond', 'Playfair Display', serif; font-style: italic; font-size: 34px; color: var(--amber); }
        .rest-line { font-size: 15px; color: var(--text2); letter-spacing: 0.04em; }
        .rest-count { font-size: 48px; font-weight: 300; color: var(--text); font-variant-numeric: tabular-nums; }
        .rest-count[hidden] { display: none; }
        @keyframes blink-cursor { 0%,100%{opacity:0.7} 50%{opacity:0.25} }
        @keyframes appFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
        .app-shell { animation: appFadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1); }

        /* ORP tick marks */
        .tick {
            position: absolute;
            left: 40%;
            transform: translateX(-50%);
            width: 2px;
            height: 14px;
            z-index: 5;
        }
        .tick.mirror {
            left: 60%;
            height: 10px;
            width: 1.5px;
        }
        .tick-top { top: 0; border-radius: 0 0 2px 2px; }
        .tick-bot { bottom: 36px; border-radius: 2px 2px 0 0; }
        /* Top-left = gold, bottom-left = teal */
        .tick.tick-top:not(.mirror) {
            background: var(--amber);
            opacity: 0.5;
            box-shadow: 0 0 8px rgba(232,164,53,0.25);
        }
        .tick.tick-bot:not(.mirror) {
            background: var(--teal);
            opacity: 0.5;
            box-shadow: 0 0 8px rgba(78,205,180,0.25);
        }
        /* Top-right = teal, bottom-right = gold */
        .tick.tick-top.mirror {
            background: var(--teal);
            opacity: 0.35;
            box-shadow: 0 0 6px rgba(78,205,180,0.2);
        }
        .tick.tick-bot.mirror {
            background: var(--amber);
            opacity: 0.35;
            box-shadow: 0 0 6px rgba(232,164,53,0.2);
        }

        /* Word display */
        .font-sans .word-box,
        .font-sans #static-view { font-family: 'Outfit', sans-serif; font-weight: 500; }
        .font-serif .word-box,
        .font-serif #static-view { font-family: 'Playfair Display', serif; font-weight: 400; }
        .size-small .word-box { font-size: clamp(24px, 5vw, 36px); }
        .size-normal .word-box { font-size: clamp(32px, 7vw, 48px); }
        .size-large .word-box { font-size: clamp(42px, 9vw, 64px); }
        .size-xl .word-box { font-size: clamp(52px, 11vw, 80px); }
        .size-small #static-view { font-size: 14px; }
        .size-normal #static-view { font-size: 16px; }
        .size-large #static-view { font-size: 20px; }
        .size-xl #static-view { font-size: 24px; }
        .size-small .word-box.chunk-mode { font-size: var(--chunk-font-size, 16px); }
        .size-normal .word-box.chunk-mode { font-size: var(--chunk-font-size, 20px); }
        .size-large .word-box.chunk-mode { font-size: var(--chunk-font-size, 22px); }
        .size-xl .word-box.chunk-mode { font-size: var(--chunk-font-size, 24px); }

        .word-box {
            display: flex;
            width: 100%;
            align-items: baseline;
            font-size: clamp(32px, 7vw, 48px);
            font-weight: 500;
            line-height: 1.25;
            white-space: nowrap;
            overflow: hidden;
            padding: 4px 0 12px 0;
            transition: font-size 0.15s ease;
        }
        .word-box .before {
            flex: 0 0 40%;
            text-align: right;
            color: var(--text);
            overflow: hidden;
            padding-right: 1px;
            font-kerning: none;
        }
        .word-box .orp {
            color: var(--amber);
            text-shadow: 0 0 20px rgba(232,164,53,0.3), 0 0 40px rgba(232,164,53,0.15);
            display: inline-block;
            text-align: center;
            font-kerning: none;
        }
        .word-box .after {
            display: inline-block;
            min-width: 2.5em;
            text-align: left;
            color: var(--text2);
        }

        .screen.redlight-mode .tick { background: #ff4433; box-shadow: 0 0 8px rgba(255,68,51,0.4); }
        .screen.redlight-mode .tick.mirror { background: #aa4433; opacity: 0.18; box-shadow: 0 0 6px rgba(170,68,51,0.25); }
        .screen.redlight-mode .word-box .before { color: #cc8080; }
        .screen.redlight-mode .word-box .orp {
            color: #ff4433;
            text-shadow: 0 0 30px rgba(255,68,51,0.5), 0 0 60px rgba(255,68,51,0.3);
        }
        .screen.redlight-mode .word-box .after { color: #884444; }
        .screen.redlight-mode .progress-bar {
            background: linear-gradient(90deg, #aa3020, #ff4433);
            box-shadow: 0 0 10px rgba(255,68,51,0.3);
        }

        /* Red + chunk */
        .word-box.chunk-mode {
            font-size: var(--chunk-font-size, 20px);
            max-width: 92%;
            margin: 0 auto;
            text-align: center;
            justify-content: center;
            gap: 0;
            line-height: 1.3;
            transition: opacity 0.15s ease-out;
            white-space: nowrap;
        }
        .word-box.chunk-mode .before {
            color: var(--chunk-before);
            opacity: var(--chunk-opacity-before);
            font-weight: 400;
            flex: 1 1 0;
            text-align: right;
            padding-right: 0.15em;
            overflow: hidden;
            text-overflow: clip;
        }
        .word-box.chunk-mode .orp {
            color: var(--amber);
            font-weight: 500;
            text-shadow: 0 0 2px rgba(232,164,53,0.8), 0 0 15px rgba(232,164,53,0.6), 0 0 35px rgba(232,164,53,0.4);
            flex: 0 0 auto;
            text-align: center;
        }
        .word-box.chunk-mode .after {
            color: var(--chunk-after);
            opacity: var(--chunk-opacity-after);
            font-weight: 400;
            flex: 1 1 0;
            text-align: left;
            padding-left: 0.15em;
            overflow: hidden;
            text-overflow: clip;
        }
        .word-box.chunk-mode.fade-out { opacity: 0; }
        .word-box.chunk-mode.fade-in { opacity: 1; }

        /* ---- Red + chunk ---- */
        .screen.redlight-mode .word-box.chunk-mode .before { color: #a07868; opacity: 0.85; }
        .screen.redlight-mode .word-box.chunk-mode .orp {
            color: #ff6644;
            text-shadow: 0 0 2px rgba(255,80,50,0.8), 0 0 15px rgba(255,68,51,0.6), 0 0 35px rgba(255,68,51,0.4);
        }
        .screen.redlight-mode .word-box.chunk-mode .after { color: #7a5050; opacity: 0.7; }

        /* Static view (bionic/beeline) */
        #static-view {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 40px;
            display: none;
            padding: 28px 32px;
            padding-top: 36%;
            padding-bottom: 60%;
            overflow-y: auto;
            overflow-x: hidden;
            color: var(--text2);
            line-height: 1.85;
            font-size: 16px; /* fallback, overridden by .size-* classes */
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
            z-index: 6;
        }
        .playing #static-view { user-select: none; -webkit-user-select: none; }
        /* Pure black bg behind bionic/beeline — no CRT green bleed */
        .screen.static-active {
            background: #030303 !important;
        }
        .screen.static-active::after {
            opacity: 0 !important;
        }
        .screen.static-active .screen-depth {
            opacity: 0.3;
        }
        #static-view::-webkit-scrollbar { width: 4px; }
        #static-view::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
        #static-view.active { opacity: 0; animation: fadeInView 0.3s ease forwards; }
        @keyframes fadeInView { to { opacity: 1; } }

        /* Bionic mode */
        #static-view.bionic-mode { line-height: 2.0; letter-spacing: 0.01em; word-spacing: 0.08em; }
        #static-view.bionic-mode b {
            color: #f4f0ea;
            font-weight: 700;
        }
        #static-view.bionic-mode .bionic-word {
            display: inline;
            color: rgba(180,176,168,0.55);
        }
        #static-view.bionic-mode .bionic-para { margin-bottom: 1.2em; display: block; }

        /* Beeline mode */
        #static-view.beeline-mode { line-height: 1.9; letter-spacing: 0.005em; }
        .beeline-line { display: block; padding: 1px 0; }
        .beeline-para { margin-bottom: 1.1em; display: block; }

        /* Red filter for static modes */
        .screen.redlight-mode #static-view.bionic-mode b { color: #cc8888; }
        .screen.redlight-mode #static-view.bionic-mode .bionic-word { color: rgba(120,68,68,0.5); }

        /* Flipped for static modes */
        .screen.flipped #static-view.bionic-mode b { color: #f0e8d8 !important; }
        .screen.flipped #static-view.bionic-mode .bionic-word { color: rgba(168,152,120,0.5) !important; }
        .screen.flipped #static-view.beeline-mode { color: #d8ccb8 !important; }

        /* Progress bar */
        .progress-area {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            padding: 6px 16px 10px;
            z-index: 10;
        }
        .progress-track {
            width: 100%;
            height: 3px;
            background: rgba(255,255,255,0.06);
            border-radius: 2px;
            cursor: pointer;
            overflow: hidden;
        }
        .progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, var(--teal) 0%, var(--amber) 100%);
            box-shadow: 0 0 8px rgba(78,205,180,0.12);
            border-radius: 2px;
            transition: width 0.15s ease;
        }
        .progress-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 4px;
            font-size: 10px;
            color: var(--text3);
        }
        .playing .progress-area { opacity: 0; pointer-events: none; }
        .screen.static-active .progress-area { opacity: 1 !important; pointer-events: auto !important; }

        /* Tap hint — below progress bar */
        .tap-hint {
            position: absolute;
            bottom: 6px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 9px;
            color: var(--teal);
            letter-spacing: 0.22em;
            text-transform: uppercase;
            font-weight: 500;
            opacity: 0;
            z-index: 5;
            pointer-events: none;
            text-shadow: 0 0 10px rgba(78,205,180,0.2);
            animation: hintFadeIn 1.2s 0.6s ease forwards, hintPulse 4s 2s ease-in-out infinite;
            white-space: nowrap;
        }
        @keyframes hintFadeIn { to { opacity: 0.5; } }
        @keyframes hintPulse {
            0%,100% { opacity: 0.5; }
            50% { opacity: 0.25; }
        }
        .playing .tap-hint { display: none; }
        #rsvp-view.empty ~ .progress-area ~ .tap-hint { display: none; }
        .static-active .tap-hint { bottom: 6px; }

        /* Coffee button — inline, matches Paste/Opts */
        .sq-btn.coffee-btn {
            text-decoration: none;
            padding: 0 14px;
        }
        .sq-btn.coffee-btn svg {
            width: 20px; height: 20px;
            stroke: var(--teal);
            filter: drop-shadow(0 0 4px rgba(78,205,180,0.15));
        }
        .sq-btn.coffee-btn:hover svg { stroke: #6ee0cc; }

        /* Opts sun — ROM amber at half opacity */
        .opts-btn svg {
            stroke: rgba(232,164,53,0.75);
            filter: drop-shadow(0 0 3px rgba(232,164,53,0.1));
        }
        .opts-btn:hover svg {
            stroke: rgba(232,164,53,0.85);
        }


        /* ---- CONTROLS ---- */
        .controls {
            width: 100%;
            display: flex; flex-direction: column; align-items: center;
            padding: 0 8px 8px; gap: 0;
            flex-shrink: 0;
            position: relative;
            z-index: 50;
        }
        .main-row {
            display: flex; align-items: center; justify-content: center;
            gap: 10px; flex-wrap: wrap;
            width: 100%; padding: 12px 0 6px;
        }
        /* ── Squircle base ── */
        .sq-btn {
            height: 52px; min-width: 52px;
            border-radius: 8px;
            background: linear-gradient(180deg, #161620 0%, #111118 100%);
            border: 1px solid rgba(78,205,180,0.1);
            color: var(--text2); cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 7px;
            transition: all 0.15s ease; font-family: inherit;
            box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
            padding: 0 6px;
        }
        .sq-btn:hover { color: var(--text); border-color: rgba(78,205,180,0.2); }
        .sq-btn.icon-label:hover svg {
            stroke: currentColor;
        }
        /* Load button green glow */
        label.sq-btn.icon-label:hover {
            color: rgba(50,205,50,0.7);
            text-shadow: 0 0 4px rgba(50,205,50,0.15);
        }
        label.sq-btn.icon-label:hover svg {
            stroke: rgba(50,205,50,0.7);
            filter: drop-shadow(0 0 4px rgba(50,205,50,0.15));
        }
        .sq-btn:active { transform: scale(0.93); }
        .sq-btn svg { width: 22px; height: 22px; }
        .sq-btn.icon-label {
            padding: 0 16px; gap: 8px;
            font-size: 14px; font-weight: 500; letter-spacing: 0.04em;
        }
        .sq-btn.icon-label svg { width: 16px; height: 16px; }

        .wpm-pill {
            display: flex; align-items: center; gap: 3px;
            background: linear-gradient(180deg, #131318 0%, #0e0e14 100%);
            border: 1px solid rgba(78,205,180,0.1);
            border-radius: 8px; padding: 4px 5px; height: 52px;
        }
        .wpm-pill .wpm-adj {
            width: 38px; height: 40px; border-radius: 6px;
            background: none; border: 1px solid rgba(255,255,255,0.06); color: var(--text3);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            font-size: 20px; transition: all 0.15s; font-family: inherit;
        }
        /* ── Gold wire accent — unifying metallic thread ── */
        .gold-wire {
            box-shadow:
                0 0 0 0.5px rgba(212,175,85,0.28),
                0 0 4px rgba(212,175,85,0.1);
        }
        .screen.gold-wire {
            outline: 0.5px solid rgba(212,175,85,0.25);
            outline-offset: 3px;
            box-shadow:
                inset 0 12px 30px rgba(0,0,0,0.85),
                inset 8px 0 20px rgba(0,0,0,0.5),
                inset -8px 0 20px rgba(0,0,0,0.5),
                inset 0 6px 15px rgba(0,0,0,0.9),
                inset 0 0 20px rgba(0,0,0,0.5),
                inset 0 0 80px rgba(0,0,0,0.6),
                inset 8px 8px 25px rgba(0,0,0,0.35),
                inset -8px 8px 25px rgba(0,0,0,0.35),
                inset -6px -6px 20px rgba(0,0,0,0.25),
                inset 6px -6px 20px rgba(0,0,0,0.25),
                inset 0 -2px 8px rgba(72,232,120,0.015),
                0 6px 16px rgba(0,0,0,0.9),
                0 16px 50px rgba(0,0,0,0.6),
                0 30px 80px rgba(0,0,0,0.4),
                0 0 80px rgba(78,205,180,0.03),
                0 0 0 0.5px rgba(212,175,85,0.2);
        }
        .sq-btn.gold-wire {
            border-color: rgba(212,175,85,0.25);
            box-shadow:
                0 3px 8px rgba(0,0,0,0.5),
                0 8px 20px rgba(0,0,0,0.3),
                inset 0 1px 0 rgba(255,255,255,0.04),
                0 0 0 0.5px rgba(212,175,85,0.18),
                0 0 3px rgba(212,175,85,0.08);
        }
        .wpm-pill.gold-wire {
            border-color: rgba(212,175,85,0.25);
            box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(212,175,85,0.18), 0 0 3px rgba(212,175,85,0.08);
        }
        .wpm-pill .wpm-adj:hover { color: var(--text); background: rgba(255,255,255,0.05); }
        .wpm-pill .wpm-adj:active { transform: scale(0.9); }
        .wpm-pill .wpm-center {
            display: flex; align-items: baseline; gap: 4px;
            padding: 0 8px; min-width: 76px; justify-content: center;
        }
        .wpm-num { font-size: 18px; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
        .wpm-unit { font-size: 8px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }
        .wpm-pill.prog-active .wpm-num { color: var(--amber); }
        .btn-group {
            display: flex;
            background: linear-gradient(180deg, #131318 0%, #0f0f14 100%);
            border: 1px solid rgba(78,205,180,0.1);
            border-radius: 8px; overflow: hidden;
        }
        .seg-btn {
            background: none; border: none; color: #797688;
            padding: 9px 18px; font-family: inherit; font-size: 13px; font-weight: 500;
            cursor: pointer; transition: all 0.2s; letter-spacing: 0.04em;
            border-right: 1px solid rgba(255,255,255,0.04);
        }
        .seg-btn:last-child { border-right: none; }
        .seg-btn:hover { color: var(--text2); background: rgba(255,255,255,0.04); }
        .seg-btn:active { transform: scale(0.96); }
        .seg-btn.active { background: rgba(232,164,53,0.1); }

        /* RSVP: amber text, red ORP when active */
        .seg-btn[data-m="rsvp"].active { color: var(--amber); }
        .orp-letter { color: var(--amber); }
        .seg-btn.active .orp-letter { color: #ff4433; text-shadow: 0 0 6px rgba(255,68,51,0.3); }

        /* Chunk: treat like mini RSVP display - brighter default, amber active with red ORP */
        .seg-btn[data-m="chunk"] { color: #8e8c9a; }
        .seg-btn[data-m="chunk"].active { color: var(--amber); }
        .chunk-orp { color: var(--amber); }
        .seg-btn[data-m="chunk"].active .chunk-orp { color: #ff4433; text-shadow: 0 0 6px rgba(255,68,51,0.3); }
        .chunk-dash { opacity: 0.5; letter-spacing: -0.5px; }
        .seg-btn[data-m="chunk"].active .chunk-dash { opacity: 0.7; }

        /* Bionic: bold/light split. When active, swap — light becomes bright, bold becomes dim */
        .seg-btn[data-m="bionic"] { color: #8e8c9a; }
        .seg-btn[data-m="bionic"] .bio-bold { font-weight: 700; }
        .seg-btn[data-m="bionic"] .bio-light { opacity: 0.55; font-weight: 400; }
        .seg-btn[data-m="bionic"].active { color: var(--text); background: rgba(255,255,255,0.06); }
        .seg-btn[data-m="bionic"].active .bio-bold { opacity: 0.5; }
        .seg-btn[data-m="bionic"].active .bio-light { opacity: 1; font-weight: 700; }

        /* Flip label: shows color you'll switch TO */
        .flip-label { color: rgba(78,205,180,0.7); }
        #b-flip.active .flip-label { color: rgba(232,164,53,0.7); }

        /* Help ? button */
        .help-btn {
            width: 22px; height: 22px;
            border-radius: 50%;
            border: 1px solid rgba(78,205,180,0.25);
            background: rgba(78,205,180,0.06);
            color: rgba(78,205,180,0.5);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 6px;
            flex-shrink: 0;
            transition: all 0.3s ease;
            box-shadow: 0 0 6px rgba(78,205,180,0.08);
            align-self: center;
        }
        .help-btn:hover {
            color: rgba(78,205,180,0.8);
            border-color: rgba(78,205,180,0.4);
            box-shadow: 0 0 10px rgba(78,205,180,0.15), 0 0 20px rgba(78,205,180,0.06);
        }

        /* Help overlay */
        .help-overlay {
            display: none;
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(6,6,10,0.92);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            z-index: 50;
            padding: 14px 16px;
            overflow-y: auto;
            border-radius: 10px;
            animation: helpFade 0.25s ease;
        }
        .help-overlay.open { display: block; }
        @keyframes helpFade { from { opacity: 0; } to { opacity: 1; } }
        .help-overlay h3 {
            font-size: 13px;
            font-weight: 500;
            color: rgba(78,205,180,0.7);
            margin: 0 0 10px 0;
            letter-spacing: 0.06em;
        }
        .help-item {
            margin-bottom: 10px;
            font-size: 12px;
            line-height: 1.5;
            color: var(--text2);
        }
        .help-item strong {
            color: var(--text);
            font-weight: 500;
        }
        .help-close {
            position: absolute;
            top: 10px; right: 12px;
            background: none; border: none;
            color: rgba(255,255,255,0.3);
            font-size: 16px;
            cursor: pointer;
        }
        .help-close:hover { color: rgba(255,255,255,0.6); }


        .s-item { display: flex; align-items: center; gap: 10px; }
        .s-item label { font-size: 14px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 400; }
        .sw {
            width: 50px; height: 28px;
            background: linear-gradient(180deg, #0e0e14 0%, #141419 100%);
            border: 1px solid rgba(78,205,180,0.08); border-radius: 8px;
            cursor: pointer; position: relative; transition: all 0.25s ease;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
        }
        .sw::after {
            content: ''; position: absolute; top: 3px; left: 3px;
            width: 20px; height: 20px;
            background: linear-gradient(180deg, #6a6872 0%, #55535e 100%);
            border-radius: 5px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 1px rgba(0,0,0,0.2);
        }
        .sw:active::after { width: 23px; }
        .sw.on {
            background: linear-gradient(180deg, rgba(78,205,180,0.18) 0%, rgba(78,205,180,0.1) 100%);
            border-color: rgba(78,205,180,0.3); box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 10px rgba(78,205,180,0.1);
        }
        .sw.on::after {
            left: 26px;
            background: linear-gradient(180deg, #5ee0c8 0%, var(--teal) 100%);
            border-radius: 5px;
            box-shadow: 0 0 8px rgba(78,205,180,0.35), 0 1px 3px rgba(0,0,0,0.3);
        }
        .sw.on:active::after { left: 23px; }
        .sw.red-sw.on {
            background: linear-gradient(180deg, rgba(255,100,68,0.2) 0%, rgba(255,100,68,0.1) 100%);
            border-color: rgba(255,100,68,0.35); box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 10px rgba(255,100,68,0.1);
        }
        .sw.red-sw.on::after {
            background: linear-gradient(180deg, #ff7755 0%, #ee5533 100%);
            border-radius: 4px;
            box-shadow: 0 0 8px rgba(255,100,68,0.4), 0 1px 3px rgba(0,0,0,0.3);
        }
        .seg-group { display: flex; align-items: center; gap: 8px; }
        .seg-group label { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
        .bright-pair { display: flex; gap: 4px; }
        .sq-btn.sm { height: 34px; min-width: 34px; font-size: 18px; border-radius: 7px; padding: 0; }
        .chunk-row { display: none; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; width: 100%; padding: 6px 0 0; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 6px; }
        .chunk-row.visible { display: flex; }
        .breath-row { gap: 14px 20px; padding: 8px 12px 4px; }
        .breath-row .seg-group label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; color: var(--text3); }
        .range-set { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text3); }
        .range-set label { text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; font-size: 14px; }
        .range-set input[type=range] {
            -webkit-appearance: none; width: 110px; height: 5px;
            background: linear-gradient(180deg, #1e1e28 0%, #252530 100%);
            border-radius: 3px; outline: none;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
        }
        .range-set input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none; width: 20px; height: 20px;
            background: linear-gradient(180deg, #5ee0c8 0%, var(--teal) 100%);
            border-radius: 4px; cursor: pointer;
            box-shadow: 0 0 10px rgba(78,205,180,0.3), 0 2px 4px rgba(0,0,0,0.4);
            border: 1px solid rgba(78,205,180,0.4);
            transition: box-shadow 0.15s ease;
        }
        .range-set input[type=range]::-webkit-slider-thumb:hover {
            box-shadow: 0 0 16px rgba(78,205,180,0.4), 0 2px 6px rgba(0,0,0,0.4);
        }
        .rv { font-variant-numeric: tabular-nums; min-width: 3em; color: var(--text2); font-size: 15px; }
        .prog-row { display: none; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; width: 100%; padding: 6px 0 0; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 6px; }
        .prog-row.visible { display: flex; }
        .file-input { display: none; }

        /* ═══ FULLSCREEN PLAYING STATE ═══ */
        body.is-playing { padding: 0; }
        body.is-playing .app-header { display: none; }
        body.is-playing .controls { display: none; }
        body.is-playing .divider { display: none; }
        body.is-playing .app-shell { max-width: none; max-height: none; }
        body.is-playing .reader {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            max-width: none; max-height: none; padding: 0; z-index: 999;
        }
        body.is-playing .screen {
            border-radius: 0; border: none;
            height: 100%; min-height: 100%; max-height: none;
        }
        /* While playing the reader is edge-to-edge, so the glow moves
           inside the frame: an inset phosphor bloom hugging the edges. */
        body.is-playing .crt-glow {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            border-radius: 0;
            z-index: 1000;
            filter: blur(14px);
            background:
                radial-gradient(ellipse 85% 22% at 50% 0%,
                    rgba(78,205,180,0.055) 0%, transparent 70%),
                radial-gradient(ellipse 85% 22% at 50% 100%,
                    rgba(78,205,180,0.04) 0%, transparent 70%),
                radial-gradient(ellipse 22% 85% at 0% 50%,
                    rgba(78,205,180,0.045) 0%, transparent 70%),
                radial-gradient(ellipse 22% 85% at 100% 50%,
                    rgba(78,205,180,0.045) 0%, transparent 70%);
        }
        body.is-playing .screen.redlight-mode ~ .crt-glow {
            background:
                radial-gradient(ellipse 85% 22% at 50% 0%,
                    rgba(180,60,50,0.05) 0%, transparent 70%),
                radial-gradient(ellipse 85% 22% at 50% 100%,
                    rgba(180,60,50,0.035) 0%, transparent 70%),
                radial-gradient(ellipse 22% 85% at 0% 50%,
                    rgba(180,60,50,0.04) 0%, transparent 70%),
                radial-gradient(ellipse 22% 85% at 100% 50%,
                    rgba(180,60,50,0.04) 0%, transparent 70%);
        }

        /* ORP true-center in fullscreen modes — RSVP only, not chunk */
        body.is-playing .word-box:not(.chunk-mode) .before,
        body.force-landscape .word-box:not(.chunk-mode) .before { flex: 0 0 45%; }
        body.is-playing .tick:not(.mirror),
        body.force-landscape .tick:not(.mirror) { left: 45%; }
        body.is-playing .tick.mirror,
        body.force-landscape .tick.mirror { display: none; }

        /* Edge to edge the word must grow with the room, or the same 48px
           word sits in four times the dark and reads as a zoom out. Width
           bound (vw) because the word is a line; the size picker still
           chooses the register, chunk mode keeps its own measure. */
        body.is-playing .size-small .word-box:not(.chunk-mode),
        body.force-landscape .size-small .word-box:not(.chunk-mode) { font-size: clamp(36px, 7vw, 72px); }
        body.is-playing .size-normal .word-box:not(.chunk-mode),
        body.force-landscape .size-normal .word-box:not(.chunk-mode) { font-size: clamp(44px, 9vw, 96px); }
        body.is-playing .size-large .word-box:not(.chunk-mode),
        body.force-landscape .size-large .word-box:not(.chunk-mode) { font-size: clamp(54px, 11.5vw, 124px); }
        body.is-playing .size-xl .word-box:not(.chunk-mode),
        body.force-landscape .size-xl .word-box:not(.chunk-mode) { font-size: clamp(64px, 14vw, 150px); }

        /* ═══ FULL MODE — edge-to-edge immersive landscape ═══ */
        body.force-landscape { padding: 0; }
        body.force-landscape .app-header { display: none; }
        body.force-landscape .controls { display: none; }
        body.force-landscape .divider { display: none; }
        body.force-landscape .app-shell { max-width: none; max-height: none; padding: 0; }
        body.force-landscape .reader {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            max-width: none; max-height: none; padding: 0; z-index: 999;
        }
        body.force-landscape .screen {
            border-radius: 0; border: none; outline: none;
            height: 100%; min-height: 100%; max-height: none;
            width: 100%;
        }
        body.force-landscape .crt-glow { display: none; } /* Full mode keeps a clean frame */
        body.force-landscape .progress-area { padding: 0 24px; }

        /* Exit full button */
        .exit-full-btn {
            display: none;
            position: fixed;
            bottom: 14px;
            right: 16px;
            z-index: 1001;
            width: 36px; height: 36px;
            border-radius: 6px;
            border: 1px solid rgba(180,60,60,0.25);
            background: rgba(30,8,8,0.6);
            color: rgba(180,60,60,0.5);
            font-size: 18px;
            cursor: pointer;
            transition: all 0.25s ease;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }
        .exit-full-btn:hover {
            color: rgba(220,80,80,0.8);
            border-color: rgba(220,80,80,0.4);
            background: rgba(60,12,12,0.7);
        }
        body.force-landscape .exit-full-btn { display: flex; align-items: center; justify-content: center; }



        /* ---- RESPONSIVE ---- */
        @media (max-width: 640px) {
            .app-shell { padding: 6px 0 8px; }
            .app-header { padding: 4px 12px 0; }
            .app-header .logo { font-size: 26px; }
            .header-stats { gap: 10px; min-width: 80px; }
            .stat-val { font-size: 13px; }
            .divider { opacity: 0.28; }
            .tagline { font-size: 10px; letter-spacing: 2.5px; }

            .btn-group { border-radius: 7px; }

            .seg-btn { padding: 8px 12px; font-size: 12px; }
            .seg-group label { font-size: 0; width: 0; overflow: hidden; padding: 0; margin: 0; }
            .seg-group { gap: 0; }
            .reader { padding: 4px 10px; }
            .controls { padding: 0 6px 8px; gap: 0; }


            .sq-btn { height: 46px; min-width: 46px; border-radius: 7px; }
            .sq-btn svg { width: 20px; height: 20px; }
            .sq-btn.icon-label { padding: 0 12px; font-size: 13px; }
            .sq-btn.sm { height: 34px; min-width: 34px; font-size: 17px; }

            .wpm-pill { height: 46px; border-radius: 7px; padding: 3px 4px; }
            .wpm-pill .wpm-adj { width: 34px; height: 34px; font-size: 18px; border-radius: 5px; }
            .wpm-pill .wpm-center { min-width: 64px; padding: 0 6px; }
            .wpm-num { font-size: 16px; }

            .s-item { gap: 8px; }
            .s-item label { font-size: 13px; }
            .sw { width: 38px; height: 22px; border-radius: 5px; }
            .sw::after { width: 14px; height: 14px; border-radius: 3px; }
            .sw.on::after { left: 20px; }

            .bright-pair { gap: 3px; }
            .range-set { gap: 9px; }
            .range-set input[type=range] { width: 80px; }
            .range-set input[type=range]::-webkit-slider-thumb { width: 20px; height: 20px; border-radius: 5px; }

            .chunk-row { gap: 22px; padding: 2px 6px; }
            .prog-row { gap: 22px; padding: 2px 6px; }
        }

        /* ═══ CONTEXT BAND (JOB 3, ported from CASH Reader) ═══ */
        /* The paragraph rides under the word lane with the current word
           marked. Fixed 6-line window, stepped line scroll (never smooth,
           motion beside fixation pulls the eye), taps pass through. */
        .context-band {
            position: absolute;
            left: 28px; right: 28px;
            bottom: 46px;
            /* B 2026-11-11: taller, same text. A third of the screen, never
               under the old six lines. */
            height: clamp(126px, 34%, 360px);
            overflow: hidden;
            /* B 2026-11-13: the letters themselves bigger. They follow the
               Size buttons with the word: S 16, M 20, L 24, XL 28 px. */
            font-size: 20px;
            line-height: 30px;
            text-align: center;
            color: rgba(150,148,158,0.55);
            z-index: 3;
            pointer-events: none;
            display: none;
            -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
        }
        .context-band.on { display: block; }
        .size-small .context-band { font-size: 16px; line-height: 24px; }
        .size-large .context-band { font-size: 24px; line-height: 34px; }
        .size-xl .context-band { font-size: 28px; line-height: 40px; }
        /* Playing: the band rides above the foveated blur and darkness so it
           can be read by choice, and dims so it never competes with the word. */
        .playing .context-band { z-index: 102; color: rgba(150,148,158,0.38); }
        .playing .context-band .cw { opacity: 0.8; }
        .context-band .cw {
            color: var(--teal);
            font-weight: 600;
        }
        /* Word lane clears the band so the centered word never collides */
        .screen.band-on #rsvp-view { padding-bottom: 190px; }
        /* Band follows the palette modes */
        .screen.redlight-mode .context-band { color: rgba(120,68,68,0.5); }
        .screen.redlight-mode .context-band .cw { color: #cc8888; }
        .screen.flipped .context-band { color: rgba(168,152,120,0.6) !important; }
        .screen.flipped .context-band .cw { color: #2a8a74 !important; }
        /* Never over the static modes */
        .screen.static-active .context-band { display: none; }

        /* ═══ JOB 4: shelf ═══ */
        /* Recent docs under the main row. The panel rides the existing
           .drop-panel open/close animation; only its open height is raised
           so a 40vh list is not clipped by the 300px default. */
        #panel-shelf.open { max-height: calc(40vh + 96px); }

        /* Shelf tab: icon stays currentColor like Load and Paste (the
           .opts-btn sun tint is for Opts), teal wake when its panel is open */
        #tab-shelf svg { stroke: currentColor; filter: none; }
        #tab-shelf.open {
            color: var(--text);
            border-color: rgba(78,205,180,0.3);
            box-shadow:
                0 3px 8px rgba(0,0,0,0.5),
                0 8px 20px rgba(0,0,0,0.3),
                inset 0 1px 0 rgba(255,255,255,0.04),
                0 0 0 0.5px rgba(212,175,85,0.18),
                0 0 10px rgba(78,205,180,0.12);
        }
        #tab-shelf.open svg { stroke: var(--teal); }

        .shelf-head {
            display: flex; align-items: center; gap: 8px;
            padding: 2px 10px 6px;
            margin: 0 2px 2px;
            font-size: 12px; font-weight: 500;
            letter-spacing: 0.08em; text-transform: uppercase;
            color: var(--text3);
            border-bottom: 1px solid rgba(212,175,85,0.14);
        }
        .shelf-count {
            font-size: 10px; font-weight: 600;
            color: rgba(78,205,180,0.85);
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.04em;
            padding: 1px 7px;
            border-radius: 999px;
            border: 1px solid rgba(78,205,180,0.25);
            background: rgba(78,205,180,0.06);
            line-height: 1.5;
        }
        .shelf-count:empty { display: none; }

        .shelf-list {
            max-height: 40vh;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
            border-radius: 8px;
        }
        .shelf-list::-webkit-scrollbar { width: 4px; }
        .shelf-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

        /* Empty state: visible by default, WIRE hides it (attribute, class, or inline) */
        .shelf-empty {
            padding: 12px 12px 8px;
            text-align: center;
            font-size: 12px; line-height: 1.6;
            letter-spacing: 0.03em;
            color: var(--text3);
        }
        .shelf-empty[hidden], .shelf-empty.hidden { display: none !important; }

        .shelf-row {
            display: flex; align-items: center; gap: 4px;
            min-height: 44px;
            padding: 6px 2px 6px 10px;
            border-left: 2px solid transparent;
            cursor: pointer;
            user-select: none; -webkit-user-select: none;
            -webkit-tap-highlight-color: transparent;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .shelf-row + .shelf-row { border-top: 1px solid rgba(255,255,255,0.04); }
        .shelf-row:hover { background: rgba(255,255,255,0.03); }
        .shelf-row:active { background: rgba(255,255,255,0.05); }
        .shelf-row:hover .shelf-title { color: var(--text); }
        /* The doc currently loaded */
        .shelf-row.now {
            border-left-color: var(--amber);
            background: linear-gradient(90deg, rgba(232,164,53,0.09) 0%, rgba(78,205,180,0.03) 100%);
        }
        .shelf-row.now .shelf-title { color: var(--text); }
        .shelf-row.now .shelf-meta { color: rgba(232,164,53,0.6); }

        .shelf-main {
            flex: 1 1 auto; min-width: 0;
            display: flex; flex-direction: column; gap: 3px;
            padding-right: 4px;
        }
        .shelf-title {
            font-size: 14px; font-weight: 500;
            letter-spacing: 0.01em;
            color: var(--text2);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            transition: color 0.15s ease;
        }
        .shelf-meta {
            font-size: 11px;
            letter-spacing: 0.02em;
            color: var(--text3);
            font-variant-numeric: tabular-nums;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .shelf-meta .dot { color: rgba(212,175,85,0.45); padding: 0 1px; }

        /* Progress hairline, same teal-to-amber thread as the reader bar */
        .shelf-bar {
            height: 2px; width: 100%;
            margin-top: 1px;
            background: rgba(255,255,255,0.06);
            border-radius: 2px; overflow: hidden;
        }
        .shelf-bar-fill {
            height: 100%; width: 0;
            background: linear-gradient(90deg, var(--teal) 0%, var(--amber) 100%);
            box-shadow: 0 0 6px rgba(78,205,180,0.12);
            border-radius: 2px;
            transition: width 0.25s ease;
        }

        /* Remove: dim until hover, red when armed and reads "Sure?" */
        .shelf-del {
            flex: 0 0 auto;
            min-width: 44px; height: 44px;
            padding: 0 8px;
            border: none; background: none;
            border-radius: 7px;
            color: rgba(255,255,255,0.22);
            font-family: inherit; font-size: 14px; font-weight: 500;
            letter-spacing: 0.04em;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent;
            transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
        }
        .shelf-del:hover { color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.04); }
        .shelf-del:active { transform: scale(0.93); }
        .shelf-del.armed {
            min-width: 58px;
            color: #ff6644;
            background: rgba(255,100,68,0.1);
            box-shadow: 0 0 0 1px rgba(255,100,68,0.35), 0 0 8px rgba(255,100,68,0.12);
            font-size: 12px; font-weight: 600;
        }
        .shelf-del.armed:hover { color: #ff7755; background: rgba(255,100,68,0.16); }

        @media (max-width: 640px) {
            .shelf-list { max-height: 40vh; }
            .shelf-title { font-size: 13px; }
            .shelf-meta { font-size: 10.5px; }
        }

        /* ═══ JOB 5: chapters + source emphasis ═══ */
        .toc-wrap[hidden] { display: none !important; }
        .toc-wrap { margin-bottom: 6px; }
        .toc-list { max-height: 26vh; }
        /* When a book is open the two lists share the panel */
        #panel-shelf .toc-wrap:not([hidden]) ~ .shelf-list { max-height: 24vh; }
        #panel-shelf.open { max-height: calc(60vh + 160px); }
        .toc-row { gap: 10px; padding-right: 12px; min-height: 40px; }
        .toc-num {
            flex: 0 0 auto; min-width: 22px; text-align: right;
            font-size: 11px; color: var(--text3);
            font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
        }
        .toc-row.now .toc-num { color: var(--amber); }
        /* Emphasis carried from the source (em/i, strong/b) into the word lane
           and the band. Dwell and ORP are untouched. */
        .word-box.em .before, .word-box.em .orp, .word-box.em .after { font-style: italic; }
        .word-box.strong .before, .word-box.strong .orp, .word-box.strong .after { font-weight: 600; }
        .context-band span.em { font-style: italic; }
        .context-band span.strong { font-weight: 600; color: var(--text2); }
        .bm { color: var(--teal); text-decoration: none; border: 1px dashed rgba(78,205,180,0.4); border-radius: 6px; padding: 1px 8px; cursor: grab; }
        .bm:hover { background: rgba(78,205,180,0.08); }
        #b-install { margin-left: 4px; }
        /* Save as cartridge, beside Remove */
        .shelf-exp {
            flex: 0 0 auto;
            min-width: 40px; height: 44px;
            padding: 0 6px;
            border: none; background: none;
            border-radius: 7px;
            color: rgba(255,255,255,0.22);
            font-family: inherit; font-size: 16px; line-height: 1;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent;
            transition: color 0.15s ease, background 0.15s ease;
        }
        .shelf-exp:hover { color: var(--teal); background: rgba(78,205,180,0.06); }
        .shelf-exp:active { transform: scale(0.93); }
