/* ========================================
   QuickTTS — sleek, glassy, neon-accented
   ======================================== */

:root {
    --bg-base: #05060d;
    --bg-panel: rgba(20, 24, 38, 0.55);
    --bg-panel-solid: #141826;
    --bg-input: rgba(10, 12, 22, 0.65);
    --border: rgba(120, 140, 180, 0.14);
    --border-strong: rgba(120, 140, 180, 0.28);
    --text: #e8ecf5;
    --text-dim: #8a93a8;
    --text-faint: #5a6278;
    --accent: #7c5cff;
    --accent-2: #29d3ff;
    --accent-warm: #ff6b9d;
    --accent-orange: #ff8c42;
    --accent-orange-2: #ff5e3d;
    --danger: #ff4d6d;
    --radius: 14px;
    --radius-sm: 8px;
    --blur: saturate(180%) blur(18px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg-base);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient gradient background — subtle, slow-moving aurora */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -2;
    background:
        radial-gradient(40% 60% at 15% 20%, rgba(124, 92, 255, 0.22), transparent 60%),
        radial-gradient(50% 50% at 85% 75%, rgba(41, 211, 255, 0.18), transparent 60%),
        radial-gradient(35% 40% at 55% 50%, rgba(255, 107, 157, 0.10), transparent 70%);
    filter: blur(60px);
    animation: aurora 24s ease-in-out infinite alternate;
    pointer-events: none;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 60%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 60%, transparent 100%);
    pointer-events: none;
}
@keyframes aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(2%, -1%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}

/* ========================================
   Layout grid: top/bottom banners + side rails
   ======================================== */
.layout {
    min-height: 100vh;
    display: grid;
    grid-template-areas:
        "top top top"
        "left main right"
        "bot bot bot"
        "foot foot foot";
    grid-template-columns: 200px minmax(0, 1fr) 200px;
    grid-template-rows: auto 1fr auto auto;
    gap: 16px;
    padding: 16px;
    max-width: 1480px;
    margin: 0 auto;
}
.site-footer-wrap { grid-area: foot; }

/* ========================================
   Ad slots
   ======================================== */
.ad {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,92,255,0.04), rgba(41,211,255,0.04));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.ad::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, rgba(124,92,255,0.3), rgba(41,211,255,0.15), transparent);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}
.ad-top    { grid-area: top;   min-height: 90px; }
.ad-bottom { grid-area: bot;   min-height: 90px; }
.ad-left   { grid-area: left;  min-height: 612px; position: sticky; top: 16px; align-self: start; }
.ad-right  { grid-area: right; min-height: 612px; position: sticky; top: 16px; align-self: start; }

.ad-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 90px;
}
.ad-placeholder-label {
    position: absolute;
    color: var(--text-faint);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0.6;
}
.adsbygoogle { position: relative; z-index: 1; background: transparent; }

/* Collapse side rails on narrow viewports */
@media (max-width: 1100px) {
    .layout {
        grid-template-areas:
            "top"
            "main"
            "bot"
            "foot";
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }
    .ad-left, .ad-right { display: none; }
}

/* ========================================
   Main column
   ======================================== */
.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 0 4px;
}

.banner {
    text-align: center;
    padding: 4px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.banner .brand-mark {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    text-transform: lowercase;
}
.banner h1 {
    margin: 2px 0 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a8b5d1 50%, #7c5cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 50px rgba(124, 92, 255, 0.25);
    line-height: 1.15;
}
.banner .tagline {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    max-width: 520px;
    line-height: 1.5;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ========================================
   Textarea
   ======================================== */
.input-text {
    width: 100%;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 200px;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    caret-color: var(--accent-2);
}
.input-text::placeholder {
    color: var(--text-faint);
    font-style: italic;
}
.input-text:focus {
    outline: none;
    border-color: rgba(124, 92, 255, 0.5);
    background: rgba(15, 18, 32, 0.75);
    box-shadow:
        0 0 0 4px rgba(124, 92, 255, 0.08),
        0 10px 40px -10px rgba(124, 92, 255, 0.25);
}

/* Visually hidden, still announced by screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Unified controls bar (play | voice+AI | sliders)
   ======================================== */
.controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-panel);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
    position: relative;
}

/* Voice + AI toggle sits between play and sliders, grows to fill */
.voice-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    min-width: 200px;
}
.voice-inline .voice-select {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 32px 8px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
        linear-gradient(-45deg, transparent 50%, var(--text-dim) 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.voice-inline .voice-select:hover { border-color: rgba(124, 92, 255, 0.4); }
.voice-inline .voice-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.voice-help-link {
    color: var(--accent-2);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.voice-help-link:hover {
    border-color: var(--accent-2);
    color: var(--text);
}

/* Segmented engine toggle: Browser TTS ↔ Kokoro TTS */
.engine-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.engine-toggle {
    position: relative;
    display: inline-flex;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 3px;
    isolation: isolate;
}
.engine-option {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
}
.engine-option:hover { color: var(--text); }
.engine-option[aria-checked="true"] {
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.22);
}
.engine-option:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
}
.engine-option:disabled {
    color: var(--text-faint);
    cursor: not-allowed;
    opacity: 0.5;
}
.engine-option[data-loading="true"] {
    cursor: wait;
}
.engine-option[data-loading="true"] .engine-name::after {
    content: " …";
    opacity: 0.7;
}

/* The animated highlight that slides between the three options.
   Browser TTS = blue gradient, Piper = warm pink, Kokoro = orange. */
.engine-toggle-glow {
    position: absolute;
    z-index: 1;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(33.333% - 2px);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 6px -1px rgba(124, 92, 255, 0.4);
    border-radius: 999px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s ease, box-shadow 0.28s ease;
}
.engine-toggle[data-active="piper"] .engine-toggle-glow {
    transform: translateX(100%);
    background: linear-gradient(135deg, var(--accent-warm), #c44d8c);
    box-shadow: 0 0 6px -1px rgba(255, 107, 157, 0.4);
}
.engine-toggle[data-active="kokoro"] .engine-toggle-glow {
    transform: translateX(200%);
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-2));
    box-shadow: 0 0 6px -1px rgba(255, 140, 66, 0.4);
}

/* HQ badge inside Kokoro option */
.engine-hq {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
    margin-left: 2px;
    vertical-align: 1px;
}

/* Size hint shown below name when model is not yet installed */
.engine-size {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    margin-top: 1px;
    line-height: 1;
}
.engine-option[aria-checked="true"] .engine-size {
    color: rgba(255, 255, 255, 0.7);
}
.engine-option[data-installed="true"] .engine-size {
    display: none;
}
.engine-option[data-installed="true"] .engine-name {
    line-height: 1;
}

/* AI download / error status bar — sits directly under controls, connected */
.ai-tts-status-inline {
    padding: 10px 16px;
    background: var(--bg-panel);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -18px; /* overlap the controls' bottom border */
    padding-top: 14px;
    font-size: 0.85rem;
}
.ai-tts-status-inline .ai-tts-status-text {
    color: var(--text-dim);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.button-group { display: flex; gap: 12px; align-items: center; }

.play-pause-button {
    background: var(--bg-panel-solid);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.play-pause-button::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-warm), var(--accent));
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: -1;
    filter: blur(8px);
}
.play-pause-button:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 6px 24px -6px rgba(124, 92, 255, 0.5);
}
.play-pause-button:hover::before { opacity: 0.6; }
.play-pause-button:active { transform: translateY(0); }

.play-pause-button.playing {
    background: linear-gradient(135deg, rgba(255, 77, 109, 0.2), rgba(255, 107, 157, 0.15));
    border-color: var(--danger);
    color: var(--danger);
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.35), 0 6px 24px -6px rgba(255, 77, 109, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(255, 77, 109, 0), 0 6px 24px -6px rgba(255, 77, 109, 0.5); }
}

.slider-group { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.slider-container { display: flex; align-items: center; gap: 8px; }
.slider-icon {
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.slider-icon:hover { opacity: 1; }

input[type="range"] {
    --slider-color: #7c5cff;
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 5px;
    background: rgba(120, 140, 180, 0.25);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: background 0.15s;
}
input[type="range"]:hover { background: rgba(120, 140, 180, 0.3); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--slider-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.3), 0 0 12px -2px var(--slider-color);
    transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--slider-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.3), 0 0 12px -2px var(--slider-color);
}

/* Narrow: voice-inline takes a full row, sliders another, play stays up top */
@media (max-width: 720px) {
    .controls { gap: 12px; padding: 10px 12px; }
    .voice-inline { flex-basis: 100%; order: 2; }
    .slider-group { flex-basis: 100%; order: 3; justify-content: center; }
    #playPauseButton { order: 1; }
    input[type="range"] { width: 110px; }
}
@media (max-width: 540px) {
    input[type="range"] { width: 90px; }
}

/* ========================================
   Toggle switch
   ======================================== */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}
.toggle-label {
    flex: 1;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 500;
    cursor: pointer;
}

.toggle-input { display: none; }
.toggle-slider {
    position: relative;
    width: 42px;
    height: 24px;
    background: rgba(120, 140, 180, 0.2);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px -2px var(--accent);
}
.toggle-input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-input:disabled + .toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* ========================================
   AI TTS status bars
   ======================================== */
.ai-tts-progress-track {
    height: 4px;
    background: rgba(120, 140, 180, 0.2);
    border-radius: 2px;
    overflow: hidden;
}
.ai-tts-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0%;
    transition: width 0.2s;
    box-shadow: 0 0 8px -1px var(--accent-2);
}

.ai-generating-bar {
    height: 3px;
    background: rgba(120, 140, 180, 0.15);
    overflow: hidden;
    border-radius: 2px;
    margin-bottom: 10px;
    position: relative;
}
.ai-generating-bar-fill {
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    animation: ai-gen-slide 1.4s linear infinite;
}
@keyframes ai-gen-slide {
    0%   { left: -30%; }
    100% { left: 100%; }
}

/* ========================================
   Scrollbar (desktop)
   ======================================== */
@media (pointer: fine) {
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
        background: rgba(120, 140, 180, 0.2);
        border-radius: 10px;
        border: 2px solid var(--bg-base);
    }
    ::-webkit-scrollbar-thumb:hover { background: rgba(120, 140, 180, 0.4); }
}

/* ========================================
   Mobile polish
   ======================================== */
@media (max-width: 640px) {
    .main { gap: 18px; }
    .banner { padding-top: 8px; }
    .banner h1 { font-size: 2rem; }
    .input-text { padding: 16px; font-size: 1rem; min-height: 200px; }
}

/* ========================================
   Main-page intro / "what is this" block
   ======================================== */
.intro {
    background: var(--bg-panel);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dim);
}
.intro strong { color: var(--text); }
.intro p { margin: 0 0 10px; }
.intro p:last-child { margin-bottom: 0; }
.intro a { color: var(--accent-2); text-decoration: none; }
.intro a:hover { text-decoration: underline; }


/* ========================================
   Site footer (appears on every page)
   ======================================== */
.site-footer {
    padding: 20px 16px 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.site-footer nav {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.site-footer nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.site-footer nav a:hover { color: var(--accent-2); }
.site-footer .copyright {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Make the footer span the full layout grid */
.site-footer-wrap {
    grid-column: 1 / -1;
    grid-row: auto;
}

/* ========================================
   Article-style content pages
   (privacy, terms, faq, etc.)
   ======================================== */
.article {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    line-height: 1.7;
    color: var(--text);
}
.article .back-link {
    display: inline-block;
    color: var(--accent-2);
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 24px;
    transition: color 0.15s;
}
.article .back-link:hover { color: var(--text); }

.article h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff 0%, #a8b5d1 50%, #7c5cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.article h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 36px 0 8px;
    color: var(--text);
    letter-spacing: -0.01em;
}
.article .lede {
    font-size: 1.05rem;
    color: var(--text-dim);
    margin: 0 0 16px;
}
.article p {
    color: var(--text-dim);
    margin: 10px 0;
}
.article p strong { color: var(--text); font-weight: 600; }
.article ul {
    color: var(--text-dim);
    padding-left: 22px;
}
.article ul li { margin: 4px 0; }
.article a {
    color: var(--accent-2);
    text-decoration: none;
}
.article a:hover { text-decoration: underline; }
.article code {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
}
.article-footer {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.article-footer a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.article-footer a:hover { color: var(--accent-2); }

/* ========================================
   Cookie consent banner
   ======================================== */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 560px;
    margin: 0 auto;
    z-index: 200;
    background: linear-gradient(180deg, rgba(30, 34, 52, 0.98), rgba(20, 24, 38, 0.98));
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.6);
    animation: cookie-rise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner p { margin: 0; flex: 1; }
.cookie-banner p strong { color: var(--text); }
.cookie-banner a {
    color: var(--accent-2);
    text-decoration: none;
    white-space: nowrap;
}
.cookie-banner a:hover { text-decoration: underline; }
.cookie-banner button {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.cookie-banner button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -2px rgba(124, 92, 255, 0.5);
}

@keyframes cookie-rise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cookie-banner button { width: 100%; }
}

/* AI engine first-use install confirmation panel.
   Slots in below the controls bar like the download/error status, but with action buttons. */
.ai-tts-install-prompt {
    padding: 14px 16px;
    background: var(--bg-panel);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    margin-top: -8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-tts-install-prompt p {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.45;
}
.ai-tts-install-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.install-btn {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.install-btn-cancel {
    background: transparent;
    color: var(--text-dim);
}
.install-btn-cancel:hover { color: var(--text); border-color: var(--text-faint); }
.install-btn-confirm {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 16px -3px rgba(124, 92, 255, 0.45);
}
.install-btn-confirm:hover { filter: brightness(1.1); }

/* ========================================
   ADS-DISABLED-PRE-APPROVAL
   Hide ad slots and collapse the layout to single-column until AdSense
   approval lands and real slot IDs replace the placeholders. To re-enable:
   delete this block AND uncomment the adsbygoogle.push loop in index.html.
   ======================================== */
.ad { display: none !important; }
.layout {
    grid-template-areas:
        "main"
        "foot";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
}
