:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --header-bg: rgba(30, 41, 59, 0.5);
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger-color: #ef4444;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.3s;

    /* Button surfaces – glass / depth */
    --btn-surface: rgba(255, 255, 255, 0.08);
    --btn-surface-hover: rgba(255, 255, 255, 0.14);
    --btn-border: rgba(255, 255, 255, 0.12);
    --btn-border-hover: rgba(255, 255, 255, 0.22);
    --btn-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    --btn-shadow-accent: 0 4px 20px rgba(56, 189, 248, 0.4);

    /* Isolated Reader Variables */
    --reader-bg: #1e293b;
    --reader-text: #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: #0f172a;
    /* Hardcoded Dark */
    color: #f8fafc;
    /* Hardcoded Light Text for App Shell */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    padding-left: calc(2rem + env(safe-area-inset-left));
    padding-right: calc(2rem + env(safe-area-inset-right));
    perspective: 1000px;
    position: relative;
    min-height: 450px;
}

@media (max-width: 768px) {
    .container {
        min-height: auto;
    }
}

/* Views */
.view {
    transition: opacity 0.5s ease, transform 0.5s ease;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.view.active {
    opacity: 1;
    pointer-events: all;
    z-index: 1;
}

/* Upload Card */
.upload-card {
    background: #1e293b;
    /* Solid Dark Card */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.4);
}

.app-logo {
    width: 140px;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-color);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Tier banner (upload view – free tier only) */
.tier-banner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.tier-banner.hidden {
    display: none !important;
}

/* Tier badge (reader top bar) */
.tier-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tier-badge.tier-free {
    background: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.tier-badge.tier-premium {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(129, 140, 248, 0.35));
    color: #e0e7ff;
    border: 1px solid rgba(56, 189, 248, 0.5);
}

/* Upgrade to Premium button (reader top bar, free tier only; hidden in fullscreen) */
.upgrade-to-premium-btn {
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: linear-gradient(to right, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.upgrade-to-premium-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.4);
}

.upgrade-to-premium-btn.hidden {
    display: none !important;
}

.tier-presets {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 12px;
}

.tier-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tier-tab.active {
    background: var(--accent-color);
    color: #0f172a;
}

.upload-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    /* Solid visibility on dark card */
    margin-bottom: 3rem;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input {
    display: none;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(to right, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.4);
}

/* Reader Interface */
.reader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.word-display {
    font-size: 4.5rem;
    font-weight: 700;
    height: 380px;
    width: 1100px;
    max-width: 98vw;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--reader-text);
    text-shadow: none;
    position: relative;
    background: var(--reader-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    word-break: break-word;
    /* Right padding clears the bookmark button so long words never overlap it */
    padding: 0 3rem;
    padding-right: 4rem;
    flex-shrink: 0;
    line-height: 1.1;
    flex-direction: column;
}

.german-text {
    font-size: 4.5rem;
    font-weight: 800;
    display: block;
}

.english-text {
    font-size: 2rem;
    color: inherit;
    opacity: 0.7;
    margin-top: 1rem;
    font-weight: 500;
    display: block;
}

.word-display::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 20px;
    width: 100%;
    border-top: 2px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

/* Paused Overlay */
.paused-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    border-radius: 32px;
    transition: opacity 0.3s ease;
    padding-bottom: 2rem;
}

/* List finished: overlay at bottom so last word stays visible above */
.paused-overlay.list-finished {
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(to top, var(--reader-bg, #0f172a) 0%, var(--reader-bg, #0f172a) 38%, rgba(15, 23, 42, 0.6) 55%, transparent 100%);
}

.paused-overlay.list-finished .paused-content {
    padding-bottom: 0.5rem;
}

.paused-overlay-free-upgrade {
    font-size: 0.85rem;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.paused-overlay-free-upgrade.hidden {
    display: none;
}

/* Ensure "Saved word list finished" / "Word list completed" message is always visible in list-finished overlay */
.paused-overlay.list-finished .paused-text {
    display: block;
    visibility: visible;
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.paused-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.resume-full-list-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: none;
}

.resume-full-list-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: none;
}

.paused-overlay.hidden {
    display: none;
}

/* Toast notification (e.g. no bookmarked words) – uses reader theme so visible in Day and Night */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(90vw, 360px);
    padding: 0.75rem 1.25rem;
    background: var(--reader-bg, #1e293b);
    color: var(--reader-text, #f8fafc);
    font-size: 0.9rem;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 100000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
    display: none;
}

.paused-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0 1.5rem;
    max-width: 100%;
    box-sizing: border-box;
}

.paused-text {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    /* Pill background so "PAUSED" is readable on both light and dark reader themes */
    background: rgba(0, 0, 0, 0.65);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: normal;
    word-break: break-word;
    text-align: center;
}

/* Fullscreen Paused Progress Bar */
.fs-text-progress {
    width: 100%;
    max-width: 1100px;
    margin-top: 1rem;
}

.resume-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--btn-shadow-accent);
}

.resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.5);
    border-color: rgba(255, 255, 255, 0.35);
}

.resume-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.4);
}

.resume-btn svg {
    width: 18px;
    height: 18px;
}

/* Controls Card - Root Level Style */
.controls-card {
    position: relative;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 1rem;
    width: 90%;
    max-width: 500px;
    margin: 1.5rem auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Close button at top of panel (fullscreen); prominent so it’s easy to see */
.controls-card-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #0f172a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.controls-card-close:hover {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.controls-card-close:active {
    transform: scale(1.02);
}

.controls-card-close svg {
    width: 40px;
    height: 40px;
    stroke-width: 3;
}

.controls-card-close.hidden {
    display: none;
}

@media (max-width: 768px) {
    .controls-card-close {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .controls-card-close svg {
        width: 48px;
        height: 48px;
        stroke-width: 3.5;
    }
}

.playback-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: var(--btn-surface);
    border: 1px solid var(--btn-border);
    color: #f8fafc;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--btn-shadow);
}

.control-btn:hover {
    background: var(--btn-surface-hover);
    border-color: var(--btn-border-hover);
    transform: scale(1.06);
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn.main-play {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--btn-shadow-accent);
}

.control-btn.main-play:hover {
    box-shadow: 0 6px 28px rgba(56, 189, 248, 0.5);
    transform: scale(1.08);
}

.control-btn.main-play:active {
    transform: scale(1.02);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.settings-row>span:first-child,
.settings-row>label:first-child {
    min-width: 85px;
    text-align: left;
}

.saved-only-row {
    margin-bottom: 0.25rem;
}

.saved-only-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.saved-only-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.settings-row>span:last-child,
.wpm-display,
#current-page {
    min-width: 65px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chrome/Safari Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1e293b;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

/* Firefox Thumb */
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #1e293b;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.progress-info {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
    font-size: 0.8rem;
}

.wpm-display {
    min-width: 80px;
    text-align: right;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Shared style for WPM, page, and word number inputs (dark box, light text, rounded) */
.control-input,
.wpm-input {
    padding: 0.25rem 0.35rem;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary, #f8fafc);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}

.control-input::-webkit-outer-spin-button,
.control-input::-webkit-inner-spin-button,
.wpm-input::-webkit-outer-spin-button,
.wpm-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.control-input[type="number"],
.wpm-input[type="number"] {
    -moz-appearance: textfield;
    appearance: none;
}

.control-input:hover,
.wpm-input:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.control-input:focus,
.wpm-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.wpm-input {
    width: 3.5rem;
}

#page-input.control-input {
    width: 2.75rem;
}

#word-input.control-input {
    width: 3.5rem;
}

.back-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    box-sizing: border-box;
}

.continue-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.75rem max(1rem, env(safe-area-inset-right)) 0.75rem max(0.5rem, env(safe-area-inset-left));
    margin-bottom: 1rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.continue-banner.hidden {
    display: none !important;
}

.continue-banner-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.continue-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.continue-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.continue-btn-primary {
    background: var(--accent-color);
    color: #fff;
    border: none;
}

.continue-btn-primary:hover {
    background: var(--accent-hover);
}

.continue-btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.continue-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Continue-where-you-left-off popup modal */
.continue-modal-content {
    max-width: 340px;
    text-align: center;
}

.continue-modal-text {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.continue-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.continue-modal-actions .continue-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.view-toggles {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.7rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    gap: 0;
}

.toggle-btn .toggle-line {
    display: block;
    white-space: nowrap;
}

.toggle-btn.active {
    background: var(--accent-color);
    color: white;
}

/* Browser (desktop) only: restore top-bar to previous layout – larger Free/Upgrade, single-line Speed Reader / Normal Text */
@media (min-width: 769px) {
    .tier-badge {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
    }

    .upgrade-to-premium-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }

    .toggle-btn {
        padding: 0.5rem 1.25rem;
        font-size: inherit;
        flex-direction: row;
    }

    .toggle-btn .toggle-line {
        display: inline;
    }

    .toggle-btn .toggle-line:first-child::after {
        content: '\00a0';
    }
}

.mode-container {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
}

.mode-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text Mode Styles */
.text-reader-card {
    background: var(--reader-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2rem;
    height: 55vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Desktop non-fullscreen: taller text reader to show more words */
@media (min-width: 769px) {
    body:not(.fullscreen) .text-reader-card {
        height: 72vh;
    }
}

/* Mobile: text reader card fills remaining space below top-bar + progress */
@media (max-width: 768px) {
    body:not(.fullscreen) #text-mode-container.mode-container.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    body:not(.fullscreen) #text-mode-container .text-mode-progress {
        flex-shrink: 0;
    }

    body:not(.fullscreen) #text-mode-container .text-reader-card {
        flex: 1;
        min-height: 0;
        max-height: none;
        border-radius: 16px;
        padding: 1rem;
        margin-bottom: 0.5rem;
        overflow-y: auto;
    }
}

.text-mode-progress {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.progress-item .label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.progress-item span:not(.label) {
    color: var(--text-primary);
    font-weight: 600;
}

.text-content {
    font-family: 'Georgia', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--reader-text);
    white-space: pre-wrap;
}

.text-content span {
    cursor: pointer;
    padding: 0 2px;
    border-radius: 3px;
}

.vocab-pair-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    margin: 0.4rem 0;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: var(--reader-text);
    opacity: 0.85;
}

.vocab-text {
    flex: 1;
}

.vocab-pair-row b {
    color: var(--reader-text);
    opacity: 1;
}

.vocab-pair-row:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: rgba(56, 189, 248, 0.3);
}

.vocab-pair-row.highlight-word {
    background: var(--accent-color);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.vocab-pair-row.highlight-word .text-bookmark-btn {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.vocab-pair-row.highlight-word .text-bookmark-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.vocab-pair-row.highlight-word .text-bookmark-btn.saved {
    background: rgba(0, 0, 0, 0.15);
}


.para-break {
    display: block;
    height: 1.5em;
}

#page-input:not(.control-input),
#word-input:not(.control-input) {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc !important;
    text-align: center;
    font-size: inherit;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    width: 50px;
    padding: 2px 0;
}

#word-input:not(.control-input) {
    width: 80px;
    /* Slightly wider for large word counts */
}

/* Settings & Fullscreen Buttons */
.top-controls {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    padding-right: 0.25rem;
}

.saved-words-wrap {
    position: relative;
    display: inline-flex;
}

.saved-words-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent-color, #3b82f6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    pointer-events: none;
}

.saved-words-count.hidden {
    display: none;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

.modal-content {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 24px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
}

/* Settings modal: scrollable when content doesn't fit */
#settings-modal .modal-content {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#settings-modal .modal-header {
    flex-shrink: 0;
}

#settings-modal .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#settings-modal .modal-footer {
    flex-shrink: 0;
    margin-top: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}

.theme-presets {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 12px;
}

.theme-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.theme-tab.active {
    background: var(--accent-color);
    color: #0f172a;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.color-trigger {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
}

.settings-tier-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-upgrade-btn {
    background: linear-gradient(to right, var(--accent-color, #3b82f6), #1e40af);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.settings-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.settings-upgrade-btn:active {
    transform: translateY(0);
}

.settings-upgrade-btn.hidden {
    display: none;
}

.reset-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.save-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--accent-color);
    border-radius: 10px;
    cursor: pointer;
    color: white;
    border: none;
    font-weight: 600;
}

/* Custom Picker */
.picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-picker {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sat-val-box {
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
    border-radius: 10px;
    position: relative;
    cursor: crosshair;
}

.sat-val-cursor {
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
}

.hue-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 6px;
    background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}

.picker-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.current-color {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.picker-inputs {
    display: flex;
    gap: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.input-group input {
    width: 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    padding: 4px;
    text-align: center;
}

.picker-ok-btn {
    width: 100%;
    background: white;
    color: #0f172a;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* FULLSCREEN REINFORCED LOGIC - THE FIX */

body.fullscreen {
    padding: 0;
    justify-content: center;
}

/* Force container and view to stay centralized without breaking children positioning */
body.fullscreen .container,
body.fullscreen .view.active {
    position: relative;
    top: auto;
    left: auto;
    transform: none !important;
    perspective: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    min-height: auto;
    width: 100%;
}

/* Premium Success Modal */
.success-premium {
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.premium-star-decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
    top: -20px;
    border-radius: 50%;
}

.premium-star-decoration.left {
    left: -20px;
}

.premium-star-decoration.right {
    right: -20px;
}

.payment-result-icon.success.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    color: #fbbf24;
    margin-bottom: 1.5rem;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.premium-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.premium-text {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.premium-features-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    text-align: left;
    margin-bottom: 2.5rem;
}

.feat-item {
    font-size: 0.85rem;
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.start-learning-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.start-learning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.3);
}

/* Position reader card vertically in fullscreen Speed mode */
body.fullscreen.speed-view-active .reader-container {
    transform: translateY(-40px) !important;
}

/* Control visibility logic */
body:not(.speed-view-active) .controls-card,
#upload-view.active~.controls-card {
    display: none !important;
}

/* Floating behavior in FS (safe now because parents have no transforms) */
body.fullscreen.speed-view-active .controls-card {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    margin: 0;
    transform: translateX(-50%) translateY(150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.6);
}

body.fullscreen.speed-view-active .controls-card.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 10010;
}

/* When controls panel is open: panel in foreground, hide other fullscreen buttons to avoid overlap */
body.fullscreen.controls-panel-open .fullscreen-action-bar,
body.fullscreen.controls-panel-open #fullscreen-controls-toggle,
body.fullscreen.controls-panel-open .fullscreen-toggle-btn,
body.fullscreen.controls-panel-open .view-toggles-fullscreen,
body.fullscreen.controls-panel-open .fullscreen-word-step-btn,
body.fullscreen.controls-panel-open .fullscreen-display-lock-btn {
    display: none !important;
}

/* Fullscreen Centering */
body.fullscreen .container {
    max-width: none;
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.fullscreen .view {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 90%;
    margin: 0 auto;
    display: none;
    flex-direction: column;
    align-items: center;
}

body.fullscreen .view.active {
    display: flex;
}

body.fullscreen.text-view-active .container {
    justify-content: flex-start;
    padding-top: 2rem;
}

body.fullscreen.text-view-active .view.active {
    max-width: 1000px;
    width: 94%;
}

body.fullscreen.text-view-active .text-reader-card {
    width: 100%;
    height: 75vh;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

/* Responsive elements in FS */
body.fullscreen.speed-view-active .top-bar {
    display: none;
}

body.fullscreen.text-view-active .top-bar {
    display: none;
}

/* Hide the top-bar fullscreen button in fullscreen mode (use floating button instead) */
body.fullscreen .top-controls #fullscreen-btn {
    display: none;
}

/* Show view toggles as fixed element in fullscreen for both modes */
body.fullscreen .view-toggles-fullscreen {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
}

.fullscreen-toggle-btn {
    position: fixed;
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s;
}

.fullscreen-toggle-btn.hidden {
    display: none;
}

.fullscreen-toggle-btn:hover {
    background: var(--accent-color);
    transform: translateX(-50%) scale(1.1);
}

/* When controls panel is visible, position button on top of the panel */
.fullscreen-toggle-btn.controls-open {
    bottom: calc(max(2rem, env(safe-area-inset-bottom) + 1rem) + 200px);
}

/* Floating Search Button (fullscreen - bottom right, left of settings) */
.fullscreen-search-btn {
    position: fixed;
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    right: 8.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
}

.fullscreen-search-btn.hidden {
    display: none;
}

.fullscreen-search-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Search Modal Styles */
#search-modal {
    z-index: 10003;
}

.search-modal-content {
    max-width: 500px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#search-modal .modal-header {
    flex-shrink: 0;
}

#search-modal .modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#search-modal .search-input-wrapper {
    flex-shrink: 0;
}

#search-modal .search-results {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-input-wrapper {
    margin-bottom: 1rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
    border-color: var(--accent-color);
}

.search-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.search-result-item .german {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
}

.search-result-item .english {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-top: 0.2rem;
}

.search-result-item .match-type {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-top: 0.3rem;
}

.search-result-bookmark-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-result-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.search-result-bookmark-btn.saved {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.2);
}

.search-result-bookmark-btn.saved svg {
    fill: var(--accent-color);
}

.search-no-results {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
}

/* Free tier completion modal */
#free-complete-modal {
    z-index: 10003;
}

.free-complete-modal-content {
    max-width: 420px;
}

.free-complete-body {
    padding: 0.5rem 0 0;
}

.free-complete-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.free-complete-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.free-complete-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.free-complete-btn {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.free-complete-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.free-complete-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.free-complete-btn.primary {
    background: linear-gradient(to right, var(--accent-color), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.free-complete-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

/* Floating Settings Button (fullscreen - bottom right) */
.fullscreen-settings-btn {
    position: fixed;
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    right: max(1.5rem, calc(env(safe-area-inset-right) + 0.5rem));
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
}

.fullscreen-settings-btn.hidden {
    display: none;
}

.fullscreen-settings-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Bookmark Button on Word Card */
.bookmark-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 101;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    box-shadow: var(--btn-shadow);
}

.bookmark-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.bookmark-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.bookmark-btn:active {
    transform: scale(0.98);
}

.bookmark-btn.saved {
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.bookmark-btn.saved svg {
    fill: var(--accent-color);
}

/* Text Mode Bookmark Button */
.text-bookmark-btn {
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.1);
    color: inherit;
    opacity: 0.5;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.text-bookmark-btn:hover {
    background: rgba(128, 128, 128, 0.2);
    opacity: 1;
}

.text-bookmark-btn.saved {
    color: var(--accent-color);
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--accent-color);
}

.bookmark-btn.saved {
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.bookmark-btn.saved svg {
    fill: var(--accent-color);
}

/* Fullscreen action bar: four buttons in one row, same width as upper row (controls card), symmetric */
.fullscreen-action-bar {
    display: none;
    position: fixed;
    bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.5rem));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    z-index: 10001;
    padding: 0.5rem max(1rem, env(safe-area-inset-right)) 0.5rem max(1rem, env(safe-area-inset-left));
    box-sizing: border-box;
}

body.fullscreen .fullscreen-action-bar {
    display: flex;
}

body.fullscreen .fullscreen-action-bar .fullscreen-saved-btn,
body.fullscreen .fullscreen-action-bar .fullscreen-search-btn,
body.fullscreen .fullscreen-action-bar .fullscreen-exit-btn,
body.fullscreen .fullscreen-action-bar .fullscreen-settings-btn {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

/* Floating Saved Words Button (fullscreen - bottom left; when not in action bar) */
.fullscreen-saved-btn {
    position: fixed;
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    left: max(1.5rem, calc(env(safe-area-inset-left) + 0.5rem));
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

.fullscreen-saved-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
}

.fullscreen-saved-btn.hidden {
    display: none;
}

.fullscreen-saved-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

/* Fullscreen word step << >> (mobile only; in bottom control bar, not on word display) */
.fullscreen-word-step-btn {
    display: none;
    position: fixed;
    bottom: max(5.25rem, calc(env(safe-area-inset-bottom) + 4rem));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
    box-sizing: border-box;
}

.fullscreen-word-step-btn:hover {
    background: var(--accent-color);
    transform: scale(1.08);
}

#fs-word-back {
    left: max(1.25rem, calc(env(safe-area-inset-left) + 0.5rem));
}

#fs-word-fwd {
    right: max(1.25rem, calc(env(safe-area-inset-right) + 0.5rem));
}

.fullscreen-word-step-btn.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    body.fullscreen.speed-view-active .fullscreen-word-step-btn:not(.hidden) {
        display: flex !important;
    }
}

/* Landscape: show << >> word-step buttons (viewport width often > 768px in landscape) */
@media (orientation: landscape) {
    body.fullscreen.speed-view-active .fullscreen-word-step-btn:not(.hidden) {
        display: flex !important;
    }
}

/* Saved Words Modal */
#saved-modal {
    z-index: 10003;
}

.saved-modal-content {
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#saved-modal .modal-header.saved-modal-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.saved-modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

#saved-modal .saved-modal-close {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

#saved-modal .saved-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.saved-modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-modal-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.15);
    border-radius: 999px;
}

.saved-modal-count:empty {
    display: none;
}

.saved-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.saved-btn-primary {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background: var(--accent-color, #3b82f6);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s ease, box-shadow 0.2s ease;
}

.saved-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover, #0ea5e9);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
}

.saved-btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.saved-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.saved-btn-primary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.saved-btn-secondary {
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.saved-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.saved-btn-secondary:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

#saved-modal .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 0.75rem;
}

.saved-words-list {
    max-height: none;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Fullscreen: keep Saved Words modal top visible (header + list start) */
body.fullscreen .modal-overlay {
    align-items: flex-start;
    padding-top: max(1rem, env(safe-area-inset-top));
    overflow-y: auto;
}

body.fullscreen .modal-content.saved-modal-content,
body.fullscreen .modal-content.search-modal-content {
    margin-top: 0.5rem;
    max-height: calc(100vh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.fullscreen .saved-modal-content .modal-body,
body.fullscreen .saved-modal-content .saved-words-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.saved-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    min-width: 0;
}

.saved-word-item:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.1);
}

.saved-word-info {
    flex: 1;
    min-width: 0;
    /* allow shrink so long words can wrap */
}

.saved-word-info .german {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    overflow-wrap: break-word;
    word-break: break-word;
}

.saved-word-info .english {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-top: 0.2rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.remove-saved-btn {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.remove-saved-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Saved Words Modal – mobile */
@media (max-width: 768px) {
    #saved-modal {
        align-items: flex-end;
        padding-bottom: 0;
    }

    #saved-modal .modal-content.saved-modal-content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 1.25rem;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
        max-height: calc(100dvh - 2rem);
        border-radius: 16px 16px 0 0;
    }

    #saved-modal .modal-header.saved-modal-header {
        margin-bottom: 0;
        padding-bottom: 1rem;
    }

    .saved-modal-title {
        font-size: 1.25rem;
        padding-right: 0.5rem;
    }

    .saved-modal-actions {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .saved-btn-primary,
    .saved-btn-secondary {
        flex: 1;
        min-height: 44px;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    #saved-modal .saved-modal-close {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
}

.saved-word-item {
    padding: 1rem;
}

.saved-word-info .german {
    font-size: 1.05rem;
}

.remove-saved-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.saved-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem 1rem;
}

/* Fullscreen Mode Toggle Button */
.fullscreen-mode-toggle-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.fullscreen-mode-toggle-btn.hidden {
    display: none;
}

.fullscreen-mode-toggle-btn:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

/* Floating exit fullscreen button (bottom-right, next to settings) */
.fullscreen-exit-btn {
    position: fixed;
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    right: 5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s;
}

.fullscreen-exit-btn.hidden {
    display: none;
}

.fullscreen-exit-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.view-toggles-fullscreen {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
    z-index: 10002;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.view-toggles-fullscreen.hidden {
    display: none !important;
}

/* Fullscreen display lock button (speed mode only): lock = only word display visible */
.fullscreen-display-lock-btn {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10003;
    transition: all 0.3s;
    padding: 0;
}

.fullscreen-display-lock-btn.hidden {
    display: none;
}

.fullscreen-display-lock-btn:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.fullscreen-display-lock-btn svg {
    width: 24px;
    height: 24px;
}

/* When display is locked: only unlock icon + word display + << >> buttons visible; hide all other fullscreen UI */
body.fullscreen.display-lock .fullscreen-action-bar,
body.fullscreen.display-lock #fullscreen-controls-toggle,
body.fullscreen.display-lock .fullscreen-toggle-btn,
body.fullscreen.display-lock .view-toggles-fullscreen,
body.fullscreen.display-lock .controls-card {
    display: none !important;
}

/* Keep unlock button (lock btn showing unlock icon) visible and clickable when locked */
body.fullscreen.display-lock .fullscreen-display-lock-btn {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    z-index: 10010;
}

/* Keep << >> word step buttons visible in lock mode */
body.fullscreen.display-lock #fs-word-back,
body.fullscreen.display-lock #fs-word-fwd {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 0.8 !important;
    z-index: 10010;
}

/* Mobile Portrait Fullscreen: Center words nicely in display box */
@media (max-width: 768px) and (orientation: portrait) {
    body.fullscreen.speed-view-active .word-display {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding-top: 80px !important;
        padding-bottom: 160px !important;
        box-sizing: border-box !important;
    }

    body.fullscreen.speed-view-active .word-display .german-text {
        text-align: center !important;
        margin: 0 0 0.75rem 0 !important;
        padding: 0 1.5rem !important;
    }

    body.fullscreen.speed-view-active .word-display .english-text {
        text-align: center !important;
        margin: 0 !important;
        padding: 0 1.5rem !important;
    }
}

/* Mobile Optimizations */
/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        /* Prevent body scroll */
        position: fixed;
        /* Lock body */
        width: 100%;
    }

    .container {
        padding: 0;
        padding-top: max(0.25rem, env(safe-area-inset-top));
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Top Bar Redesign for Mobile - Full Width */
    .top-bar {
        margin-bottom: 0.5rem;
        margin-left: 0;
        margin-right: 0;
        padding: 0.5rem 0.75rem;
        width: 100%;
        flex-shrink: 0;
        gap: 0.25rem;
        flex-wrap: nowrap;
        justify-content: space-between;
        background: rgba(30, 41, 59, 0.7);
        border-radius: 0;
        overflow: visible;
        box-sizing: border-box;
    }

    .top-bar::-webkit-scrollbar {
        display: none;
    }

    .top-controls {
        gap: 0.2rem;
        padding-right: 0.25rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .icon-btn {
        padding: 0.3rem;
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .tier-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.35rem;
        flex-shrink: 0;
    }

    .upgrade-to-premium-btn {
        font-size: 0.55rem;
        padding: 0.15rem 0.35rem;
        flex-shrink: 0;
    }

    .view-toggles {
        padding: 2px;
        gap: 1px;
        flex: 0 1 auto;
        min-width: fit-content;
        /* Prevent text overlap */
    }

    .toggle-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-width: fit-content;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* Main Content Area: active view takes space above controls-card (no centering, no overlap) */
    .view.active {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Upload view: allow scroll so CTA button is never cut off on short screens */
    #upload-view.active {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 1rem;
    }

    .reader-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        gap: 0.5rem;
        padding-top: 0.5rem;
    }

    .word-display-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 0;
    }

    /* Maximize Word Display - Fixed Layout */
    .word-display {
        width: 100%;
        height: 100%;
        max-width: none;
        flex: 1;
        min-height: 0;
        margin: 0;
        border-radius: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 1.25rem 1rem 1rem 1rem;
        padding-right: 2.75rem;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* When list finished: reserve bottom for bar so word and button don't overlap */
    .word-display:has(.paused-overlay.list-finished:not(.hidden)) {
        justify-content: flex-start;
        padding-top: 1.25rem;
        padding-bottom: 7rem;
    }

    .word-display:has(.paused-overlay.list-finished:not(.hidden)) .german-text {
        margin-top: 0;
    }

    .german-text {
        font-size: 2.2rem;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }

    .english-text {
        font-size: 1.5rem;
    }

    /* Bookmark: keep inside card on mobile (avoid clipping) */
    .word-display .bookmark-btn {
        top: 0.75rem;
        right: 0.75rem;
    }

    /* Paused / List finished overlay – bar at bottom on mobile */
    .paused-overlay {
        align-items: center;
        justify-content: center;
        padding: 1rem;
        border-radius: 20px;
    }

    .paused-overlay.list-finished {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
        background: linear-gradient(to top, var(--reader-bg, #0f172a) 0%, var(--reader-bg, #0f172a) 42%, rgba(15, 23, 42, 0.85) 58%, transparent 100%);
    }

    .paused-overlay.list-finished .paused-content {
        width: 100%;
        min-height: 5.5rem;
        padding: 1rem 1rem 1.25rem;
        gap: 1rem;
        justify-content: center;
        background: var(--reader-bg, #0f172a);
        border-radius: 0 0 20px 20px;
        box-sizing: border-box;
    }

    .paused-overlay.list-finished .paused-text {
        display: block;
        visibility: visible;
        flex-shrink: 0;
        font-size: 0.85rem;
    }

    .paused-content {
        padding: 0 1rem;
        gap: 1.25rem;
    }

    .paused-text {
        font-size: 0.85rem;
        letter-spacing: 0.06em;
        padding: 0.5rem 0.75rem;
        line-height: 1.3;
    }

    .resume-btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    /* Controls Bottom Sheet */
    .controls-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        margin-top: auto;
        border-radius: 20px 20px 0 0;
        padding: 1rem 0.75rem 1.5rem 0.75rem;
        background: rgba(30, 41, 59, 0.98);
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
        gap: 0.75rem;
    }

    .playback-controls {
        gap: 2rem;
        margin-bottom: 0.5rem;
    }

    .control-btn {
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.05);
    }

    .control-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .control-btn.main-play {
        width: 64px;
        height: 64px;
        box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    }

    .settings-row {
        gap: 1rem;
    }

    /* Hide labels on mobile to save space if needed, or keep them compact */
    .settings-row>span:first-child {
        min-width: auto;
        font-size: 0.8rem;
    }

    /* Range Sliders Touch Area */
    input[type="range"] {
        height: 20px;
        /* Larger touch target */
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .progress-info {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.9rem;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    #page-input,
    #word-input {
        width: 50px;
        font-size: 1rem;
        padding: 0.2rem;
    }

    /* Adjust Upload View for Mobile */
    .upload-card {
        padding: 2rem 1.5rem;
        width: 95%;
        margin: auto;
    }

    h1 {
        font-size: 2.5rem;
    }

    .app-logo {
        width: 100px;
    }

    /* Fullscreen Mobile Overrides */
    body.fullscreen .word-display {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        padding-bottom: 150px;
        /* Space for floating controls */
    }

    body.fullscreen .controls-card {
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        border: none;
        padding-bottom: 1rem;
        pointer-events: none;
        /* Let clicks pass through container */
    }

    body.fullscreen .controls-card>* {
        background: rgba(15, 23, 42, 0.9);
        /* Give backgrounds to actual rows */
        backdrop-filter: blur(10px);
        padding: 0.5rem 1rem;
        border-radius: 12px;
        pointer-events: auto;
        margin-bottom: 0.5rem;
    }

    body.fullscreen .controls-card.visible {
        transform: translateX(-50%) translateY(0);
        bottom: 5.5rem;
        /* Above floating action buttons (saved, search, exit, settings) to prevent overlap */
    }

    /* Fullscreen floating buttons: four in a row, consistent padding from bottom edge */
    body.fullscreen .fullscreen-saved-btn,
    body.fullscreen .fullscreen-search-btn,
    body.fullscreen .fullscreen-exit-btn,
    body.fullscreen .fullscreen-settings-btn {
        bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem));
    }

    /* Toggle above the four buttons on mobile to avoid overlap (narrow screens) */
    .fullscreen-toggle-btn {
        bottom: 5.5rem;
    }

    .fullscreen-toggle-btn.controls-open {
        bottom: 19rem;
        /* Above the visible controls panel */
    }

    /* Left button: safe area + margin */
    body.fullscreen .fullscreen-saved-btn {
        left: max(1.25rem, calc(env(safe-area-inset-left) + 0.5rem));
    }

    /* Right-side buttons: safe area + spacing */
    body.fullscreen .fullscreen-settings-btn {
        right: max(1.25rem, calc(env(safe-area-inset-right) + 0.5rem));
    }

    body.fullscreen .fullscreen-exit-btn {
        right: max(5rem, calc(4rem + env(safe-area-inset-right)));
    }

    body.fullscreen .fullscreen-search-btn {
        right: max(8.5rem, calc(7.5rem + env(safe-area-inset-right)));
    }

    /* Ensure standard top-bar is hidden in fullscreen to prevent overlap */
    body.fullscreen .top-bar {
        display: none !important;
    }
}

/* Short viewports (e.g. mobile landscape 360px tall): compact upload view so button fits */
@media (max-width: 768px) and (max-height: 500px) {
    #upload-view .tier-banner {
        margin-bottom: 0.5rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    #upload-view .upload-card {
        padding: 1.25rem 1rem;
    }

    #upload-view .app-logo {
        width: 72px;
        margin-bottom: 0.5rem;
    }

    #upload-view h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }

    #upload-view .upload-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    #upload-view .upload-btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Narrow viewport fullscreen: put toggle above button row to prevent overlap */
@media (max-width: 900px) {
    body.fullscreen .fullscreen-toggle-btn {
        bottom: 5.5rem;
    }

    body.fullscreen .fullscreen-toggle-btn.controls-open {
        bottom: 19rem;
    }
}

/* Landscape fullscreen: ensure bottom-left bookmark is fully visible (no left-edge clipping) */
@media (max-width: 768px) and (orientation: landscape) {
    body.fullscreen .fullscreen-saved-btn {
        /* Safe area + margin so the full 48px button is never cut off on the left */
        left: calc(env(safe-area-inset-left, 0px) + 1.5rem);
    }

    /* When controls panel is open, hide Speed Reader / Normal Text toggle behind it */
    body.fullscreen .controls-card.visible~.view-toggles-fullscreen {
        visibility: hidden;
        pointer-events: none;
    }
}

/* Landscape: ensure top-right bookmark (Saved Words) and other icons are fully visible */
@media (orientation: landscape) {
    .top-bar {
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }

    .top-controls {
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 768px) {
    /* Keep current mobile styles as they are dark-focused */
}

/* Free Tier Reminder Modal */
.free-reminder-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 420px;
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #451a03;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.free-reminder-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #f8fafc, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.free-reminder-subtitle {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.free-reminder-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.free-reminder-btn {
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.free-reminder-btn.primary {
    background: linear-gradient(to right, #38bdf8, #818cf8);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(56, 189, 248, 0.3);
}

.free-reminder-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(56, 189, 248, 0.4);
    filter: brightness(1.1);
}

.free-reminder-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.free-reminder-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

@media (max-width: 480px) {
    .free-reminder-modal-content {
        padding: 2rem 1.5rem;
    }

    .free-reminder-title {
        font-size: 1.5rem;
    }
}

/* CONSOLIDATED LANDSCAPE FIX (Short Screens) */
@media (max-height: 450px) and (orientation: landscape) {
    .container {
        padding: 0.25rem;
    }

    .top-bar {
        margin-bottom: 0.25rem !important;
        padding: 0.2rem 0.4rem !important;
        gap: 0.25rem !important;
    }

    .view-toggles {
        transform: scale(0.9);
    }

    .word-display {
        height: auto !important;
        min-height: 120px !important;
        padding: 0.5rem !important;
        justify-content: flex-start !important;
        padding-top: 0.5rem !important;
    }

    .german-text {
        font-size: 2.2rem !important;
        margin-bottom: 0.3rem !important;
    }

    .english-text {
        font-size: 1.5rem !important;
        margin-top: 0.2rem !important;
    }

    .controls-card {
        padding: 0.4rem 0.6rem 0.6rem 0.6rem !important;
        gap: 0.25rem !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .playback-controls {
        gap: 1.5rem !important;
        margin-bottom: 0.2rem !important;
    }

    .control-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .control-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .control-btn.main-play {
        width: 42px !important;
        height: 42px !important;
    }

    .settings-row {
        gap: 0.5rem !important;
    }

    input[type="range"] {
        height: 16px !important;
    }

    .progress-info {
        font-size: 0.75rem !important;
        margin-top: 0.1rem !important;
        gap: 0.25rem !important;
    }

    #page-input,
    #word-input {
        width: 35px !important;
        font-size: 0.8rem !important;
        padding: 0.1rem !important;
    }

    /* Fullscreen specific in Landscape */
    body.fullscreen .word-display {
        padding-top: 3.5rem !important;
        padding-bottom: 50px !important;
    }

    .view-toggles-fullscreen {
        top: 0.25rem !important;
        transform: translateX(-50%) scale(0.75) !important;
    }

    .bookmark-btn {
        top: 2px !important;
        right: 2px !important;
        padding: 3px !important;
    }

    .bookmark-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* List-finished overlay: compact layout so "Saved word list finished" message fits in short height */
    .paused-overlay.list-finished {
        padding: 0.5rem;
        align-items: center;
        justify-content: center;
    }

    .paused-overlay.list-finished .paused-content {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem;
        min-height: auto;
    }

    .paused-overlay.list-finished .paused-text {
        display: block !important;
        visibility: visible !important;
        flex-shrink: 0;
        font-size: 0.7rem !important;
        letter-spacing: 0.04em;
        padding: 0.35rem 0.5rem !important;
        margin: 0;
        order: 1;
        width: 100%;
        text-align: center;
    }

    .paused-overlay.list-finished .paused-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        order: 2;
        width: 100%;
    }

    .paused-overlay.list-finished .resume-btn,
    .paused-overlay.list-finished .resume-full-list-btn {
        min-height: 36px;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================================================
   AUTHENTICATION STYLES
   ============================================================================ */

/* Auth Button on Home Screen */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.25rem;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-primary, #f1f5f9);
    border-color: var(--text-secondary, #94a3b8);
}

.auth-btn.hidden {
    display: none;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal.hidden {
    display: none;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: authModalIn 0.2s ease-out;
}

@keyframes authModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.auth-modal-close:hover {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-primary, #f1f5f9);
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-form.hidden {
    display: none;
}

.auth-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    text-align: center;
}

.auth-subtitle {
    margin: -0.75rem 0 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    text-align: center;
}

/* Auth Input Group */
.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.auth-input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #94a3b8);
}

.auth-input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary, #f1f5f9);
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.auth-input-group input::placeholder {
    color: var(--text-muted, #64748b);
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--accent-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Auth Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Auth Link Button */
.auth-link-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    padding: 0.25rem;
    transition: color 0.15s ease;
}

.auth-link-btn:hover {
    color: var(--accent-color, #3b82f6);
}

/* Auth Switch */
.auth-switch {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    text-align: center;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--accent-color, #3b82f6);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.auth-switch-btn:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Auth Error */
.auth-error {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.85rem;
    text-align: center;
}

.auth-error.hidden {
    display: none;
}

/* Auth Success */
.auth-success {
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #4ade80;
    font-size: 0.85rem;
    text-align: center;
}

.auth-success.hidden {
    display: none;
}

/* User Menu (inline in top-bar) */
.user-menu-inline {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.user-menu-inline.hidden {
    display: none;
}

.user-avatar-btn {
    padding: 0 !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    border-radius: 50% !important;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
}

.user-avatar-small svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.user-avatar-small svg.hidden,
.user-avatar-small span.hidden {
    display: none;
}

#user-avatar-letter {
    font-size: 0.8rem;
    font-weight: 600;
}

/* User Dropdown */
.user-dropdown {
    position: fixed;
    top: auto;
    right: 0.5rem;
    min-width: 200px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    animation: dropdownIn 0.15s ease-out;
    z-index: 10000;
    margin-top: 0.5rem;
}

.user-dropdown.hidden {
    display: none;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown-header {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-dropdown-header span:first-child {
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

.user-dropdown-divider {
    border: none;
    border-top: 1px solid var(--border-color, #334155);
    margin: 0.25rem 0;
}

.user-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.user-dropdown-item:hover {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-primary, #f1f5f9);
}

/* Mobile Auth Adjustments */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .user-avatar-btn {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px;
    }

    .user-avatar-small {
        font-size: 0.7rem;
    }

    .user-avatar-small svg {
        width: 14px;
        height: 14px;
    }
}

/* Hide user menu in fullscreen */
body.fullscreen .user-menu-inline {
    display: none !important;
}

/* Auth Required Overlay - blocks app when not signed in */
.auth-required-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.auth-required-overlay.hidden {
    display: none;
}

.auth-required-content {
    text-align: center;
    max-width: 320px;
}

.auth-required-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 50%;
    color: #60a5fa;
}

.auth-required-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.auth-required-text {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
}

.auth-required-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-required-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Disable pointer events on app when auth required */
body.auth-required .container {
    pointer-events: none;
    opacity: 0.3;
}

/* Email verification overlay icon */
.verify-icon {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
}

.auth-required-subtext {
    margin: 0 0 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}

#verify-email-address {
    color: var(--accent-color, #3b82f6);
}

/* Very narrow screens (360px and below) */
@media (max-width: 380px) {
    .top-bar {
        padding: 0.35rem 0.5rem !important;
        gap: 0.15rem !important;
    }

    .tier-badge {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.25rem !important;
    }

    .upgrade-to-premium-btn {
        font-size: 0.5rem !important;
        padding: 0.1rem 0.25rem !important;
    }

    .view-toggles {
        padding: 1px !important;
    }

    .toggle-btn {
        padding: 0.25rem 0.35rem !important;
        font-size: 0.6rem !important;
    }

    .top-controls {
        gap: 0.1rem !important;
    }

    .icon-btn {
        padding: 0.2rem !important;
    }

    .icon-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    .user-avatar-btn {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
    }

    .user-avatar-small svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* ============================================
   PAYMENT SUCCESS/RESULT MODAL
   ============================================ */
.payment-result-modal {
    text-align: center;
    padding: 2.5rem 2rem;
    max-width: 400px;
}

.payment-result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.payment-result-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.payment-result-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.payment-result-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--reader-text, #f8fafc);
}

.payment-result-modal p {
    font-size: 0.95rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.payment-result-modal .auth-required-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Sync Indicator */
.user-dropdown-header {
    position: relative;
}

.sync-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    opacity: 0.7;
}

.sync-indicator svg {
    animation: spin 3s linear infinite;
    /* Slower spin to be less distracting */
}

.sync-indicator.hidden {
    display: none !important;
}

/* User Menu Tier Badge */
.user-name-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}

#user-display-name {
    font-weight: 700;
    color: var(--text-primary);
}

.tier-status-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-block;
}

.tier-status-badge.tier-free {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.tier-status-badge.tier-premium {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
    color: var(--accent-color);
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}