:root {
    /* Colors: Dark Mode */
    --bg: #000000;
    --text: #ffffff;
    --dim: #64748b;
    --accent: #38bdf8;
    --border: #1e293b;
    --highlight: rgba(254, 240, 138, 0.9); 
    --overlay: rgba(10, 10, 10, 0.98);
    --card-bg: #111827;

    /* --- DEFAULT SIZE: SMALL --- */
    --size-main: 2.0rem;
    --size-sub: 1.3rem;
    --spacing-bullet: 18px;
    --img-height: 45vh;
}

/* --- OPTIONAL SIZE: NORMAL --- */
body.normal {
    --size-main: 3.0rem;
    --size-sub: 1.8rem;
    --spacing-bullet: 35px;
    --img-height: 40vh;
}

/* Colors: Light Mode */
body.light-mode {
    --bg: #f8fafc;
    --text: #0f172a;
    --accent: #0284c7;
    --border: #e2e8f0;
    --highlight: rgba(253, 224, 71, 0.8);
    --overlay: rgba(255, 255, 255, 0.98);
    --card-bg: #ffffff;
}

body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: -apple-system, system-ui, sans-serif;
    height: 100vh; width: 100vw; overflow: hidden;
    transition: background 0.3s; overscroll-behavior-x: none;
}

/* Navigation Zones */
.nav-zone {
    position: absolute; top: 0; bottom: 0; width: 12vw; cursor: pointer; z-index: 100;
    display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.nav-left { left: 0; } .nav-right { right: 0; }
.nav-zone span { font-size: 3rem; color: var(--accent); opacity: 0; transition: 0.2s; }
@media (hover: hover) { .nav-zone:hover span { opacity: 0.3; } }
.nav-zone:active span { opacity: 1; }

#main { height: 100%; display: flex; flex-direction: column; padding: 0 15vw; box-sizing: border-box; }

#header {
    height: 70px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border); color: var(--dim);
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem;
}

.header-ui { display: flex; align-items: center; gap: 12px; }
#counter { background: var(--accent); color: #000; padding: 4px 12px; border-radius: 20px; cursor: pointer; font-weight: bold; }

/* Size Switcher */
.size-selector { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.size-selector button {
    background: none; border: none; color: var(--text); padding: 5px 12px; 
    cursor: pointer; border-right: 1px solid var(--border); font-size: 0.8rem; text-transform: uppercase;
}
.size-selector button:last-child { border-right: none; }
.size-selector button.active { background: var(--accent); color: #000; font-weight: bold; }

.header-btn {
    background: none; border: 1px solid var(--border); color: var(--text);
    padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
}

/* Content */
#display { flex-grow: 1; display: flex; align-items: center; }
ul { list-style: none; padding: 0; margin: 0; width: 100%; }

li {
    font-size: var(--size-main); 
    line-height: 1.6; /* Prevents highlights from touching */
    margin-bottom: var(--spacing-bullet);
    position: relative; padding-left: 50px;
    animation: slideIn 0.3s ease-out;
}
li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
li.sub-bullet { font-size: var(--size-sub); margin-left: 60px; color: var(--dim); margin-top: -8px; }

/* --- NO-GLUE HIGHLIGHT --- */
mark { 
    background-color: var(--highlight);
    color: #000; 
    padding: 0 8px; /* Zero vertical padding is the key */
    border-radius: 6px;
    font-weight: 700;
    display: inline; 
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone; 
    animation: pulse-brightness 1.5s ease-in-out 1;
}

@keyframes pulse-brightness