:root {
    /* Varsayılan olarak kullanıcının istediği ayarlar */
    --bg-color: #181818;
    --container-bg: #333333;
    --text-color: #cca922;
    --font-size: 24px;
    --line-height: 2.0;
    --font-family: 'Inter', sans-serif;
    --max-width: 900px;
    --side-padding: 80px;
    --paragraph-spacing: 1.5em;

    /* UI Renkleri */
    --ui-primary: #5c6bc0;
    --ui-bg: rgba(30, 30, 30, 0.75);
    --ui-border: rgba(255, 255, 255, 0.1);
    --ui-text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Tarayıcının yatay kaydırma çubuğunu engeller */
html,
body {
    overflow-x: clip;
    width: 100%;
    min-height: 100vh;
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', sans-serif;
    transition: background-color 0.4s ease;
    /* Edge Read Aloud için font boyutu düzeltmeleri */
    -webkit-text-size-adjust: 100%;
}

/* --- ORTAK DÜĞMELER --- */
.upload-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    text-decoration: none;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* --- OKUYUCU (READER) KISMI --- */
#reader-container {
    min-height: 100vh;
    padding: 50px 0;
    background-color: var(--bg-color);
    /* Genel arka plan */
}

#book-viewport {
    width: 100%;
    margin: 0 auto;
}

/* Kitap içeriğinin sarıldığı ana div */
#book-content {
    background-color: var(--container-bg);
    color: var(--text-color);
    max-width: var(--max-width) !important;
    margin: 0 auto !important;
    padding: 60px var(--side-padding) !important;
    min-height: calc(100vh - 100px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    /* Derinlik hissi */

    font-family: var(--font-family);
    font-size: var(--font-size) !important;
    line-height: var(--line-height);
    text-align: start;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.epub-chapter {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#book-content:focus {
    outline: none;
}

/* Theme Overrides */
#book-content[data-theme-override="true"] {
    background-color: var(--container-bg) !important;
    color: var(--text-color) !important;
}

#book-content[data-theme-override="true"] :not(.katex, .katex *, msreadoutspan, .pdf-placed-page, .pdf-placed-page *, .placed-page, .placed-page *, .pdf-plain-picture *, .pdf-figure-words *) {
    color: var(--text-color) !important;
}



/* Typography Overrides */
#book-content[data-font="custom"],
#book-content[data-font="custom"] :not(.katex, .katex *) {
    font-family: var(--font-family) !important;
}

#book-content[data-line-height="custom"],
#book-content[data-line-height="custom"] :not(.katex, .katex *, .pdf-placed-page, .pdf-placed-page *, .placed-page, .placed-page *, .pdf-plain-word, .pdf-plain-picture *, .pdf-plain-box *) {
    line-height: var(--line-height) !important;
}

/* Calibre'nin görünmez kutularının renk bozmasını engellemek için */
#book-content div,
#book-content .calibre,
#book-content .calibre1 {
    background-color: transparent !important;
}

#book-content hr {
    border: none;
    border-bottom: 1px dashed var(--text-color);
    opacity: 0.3;
    margin: 30px 0;
}


#book-content p {
    margin-bottom: var(--paragraph-spacing);
}

#book-content h1,
#book-content h2,
#book-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
    line-height: 1.3;
}

#book-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* --- SAYFA SAYFA (PAGED) OKUMA MODU --- */
html:has(#reader-view.paged-mode),
body:has(#reader-view.paged-mode) {
    scrollbar-width: none;
}

html:has(#reader-view.paged-mode)::-webkit-scrollbar,
body:has(#reader-view.paged-mode)::-webkit-scrollbar,
#reader-view.paged-mode #book-viewport::-webkit-scrollbar {
    display: none;
}

#reader-view.paged-mode {
    --page-padding: clamp(0px, var(--side-padding), 12vw);
    height: 100dvh;
    overflow: hidden;
}

#reader-view.paged-mode #reader-container {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#reader-view.paged-mode #book-viewport {
    width: min(var(--max-width), calc(100vw - var(--page-gutter, 40px)));
    /* Whole pixels: page turns scroll by the rounded clientWidth, so a fractional page (a 3x phone's
       747.33px) drifted a third of a pixel a page and cut the page's right edge further into a chapter. */
    width: round(down, min(var(--max-width), calc(100vw - var(--page-gutter, 40px))), 1px);
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    margin: 0 auto;
    background-color: var(--container-bg);
    border-radius: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    scroll-behavior: auto;
    scrollbar-width: none;
    transition: background-color 0.4s ease;
}

#reader-view.paged-mode #book-content {
    box-sizing: content-box !important;
    height: calc(100dvh - 100px) !important;
    min-height: auto !important;
    width: calc(min(var(--max-width), calc(100vw - var(--page-gutter, 40px))) - (var(--page-padding) * 2)) !important;
    width: calc(round(down, min(var(--max-width), calc(100vw - var(--page-gutter, 40px))), 1px) - (var(--page-padding) * 2)) !important;
    max-width: none !important;
    column-width: calc(min(var(--max-width), calc(100vw - var(--page-gutter, 40px))) - (var(--page-padding) * 2)) !important;
    column-width: calc(round(down, min(var(--max-width), calc(100vw - var(--page-gutter, 40px))), 1px) - (var(--page-padding) * 2)) !important;
    column-gap: calc(var(--page-padding) * 2) !important;
    column-fill: auto !important;
    overflow: visible !important;
    /* A word wider than the page (a long URL in the notes) breaks instead of running into the next page. */
    overflow-wrap: break-word;
    padding: 50px var(--page-padding) !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Edge Read Aloud never enters a block whose computed overflow is exactly "hidden"
   while it overflows sideways, so it skipped the whole paged book. "hidden auto"
   keeps paging programmatic, and the content clips its own vertical overflow so
   the viewport never scrolls vertically. */
#reader-view.paged-mode #book-viewport:not(.pdf-paged-viewport) {
    overflow-y: auto;
}

#reader-view.paged-mode #book-viewport:not(.pdf-paged-viewport) #book-content {
    overflow-x: visible !important;
    overflow-y: clip !important;
}

/* CSS columns omit the last gutter from scrollWidth. Keep the last page aligned. */
#reader-view.paged-mode #book-viewport:not(.pdf-paged-viewport)::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(var(--rendered-pages, 1) * 100% - 1px);
    width: 1px;
    height: 1px;
    pointer-events: none;
}

#reader-view.paged-mode #book-content img,
#reader-view.paged-mode #book-content svg:not(.katex *) {
    max-width: 100%;
    max-height: calc(100dvh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    break-inside: avoid;
}

#reader-view.paged-mode #book-content h1,
#reader-view.paged-mode #book-content h2,
#reader-view.paged-mode #book-content h3 {
    break-after: avoid;
}

#reader-view.paged-mode #book-content p {
    break-inside: auto;
}

/* Page Indicator Badge */
.paged-indicator {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 22px;
    border-radius: 20px;
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.2;
    color: var(--ui-text);
    background: var(--ui-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border);
    z-index: 70;
    display: none;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
    appearance: none;
}

.paged-indicator:hover {
    transform: translateX(-50%) scale(1.06);
    background: rgba(45, 45, 55, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.paged-indicator:active {
    transform: translateX(-50%) scale(0.97);
}
.paged-indicator:focus-visible {
    outline: 2px solid #aab4ff;
    outline-offset: 3px;
}
#reader-view.paged-mode .paged-indicator {
    display: block;
}

/* Reading Mode Selector Buttons in Settings */
.reading-mode-presets {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: rgba(255, 255, 255, 0.05);
    color: #bbb;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.mode-btn.active {
    background: var(--ui-primary);
    color: #fff;
    border-color: var(--ui-primary);
    box-shadow: 0 4px 15px rgba(92, 107, 192, 0.4);
}

.mode-btn.danger-btn {
    background: rgba(229, 57, 53, 0.18);
    border-color: rgba(229, 57, 53, 0.45);
    color: #ff8a80;
}

.mode-btn.danger-btn:hover {
    background: #e53935;
    border-color: #d32f2f;
    color: #ffffff;
}

/* --- AYARLAR YAN MENÜSÜ --- */

/* Cam efekti sınıfı */
.glass-panel {
    background: var(--ui-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#settings-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ui-primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 50;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#settings-toggle:hover {
    transform: rotate(90deg) scale(1.1);
    background: #4a56a0;
}

#tts-toggle {
    position: fixed;
    bottom: 30px;
    right: 105px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tts-toggle:hover {
    transform: scale(1.1);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--ui-border);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.settings-content {
    padding: 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.setting-group {
    margin-bottom: 25px;
}

#original-pdf-setting small,
#pdf-text-setting small {
    display: block;
    margin: 10px 0;
    line-height: 1.5;
}

.setting-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #ccc;
    font-weight: 600;
}

hr {
    border: none;
    height: 1px;
    background: var(--ui-border);
    margin: 25px 0;
}

/* Tema Butonları */
.theme-presets {
    display: flex;
    gap: 10px;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid;
    transition: transform 0.2s;
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* Renk Seçiciler */
.color-picker-wrapper {
    display: flex;
    align-items: center;
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--ui-border);
    border-radius: 8px;
}

/* Slider (Range Input) Stilleri */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    margin-top: 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ui-primary);
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Select Stili */
select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid var(--ui-border);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

select option {
    background: #222;
    color: white;
}

/* Responsive (Küçük Ekranlar İçin) */
@media (max-width: 768px) {
    #book-content {
        padding: 30px 20px;
        border-radius: 0;
    }

    .sidebar {
        width: 100% !important;
        right: -100%;
    }

    #toc-sidebar {
        left: -100%;
        right: auto !important;
    }
}

/* --- KİMLİK DOĞRULAMA (AUTH) --- */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    padding: 40px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    border-radius: 16px;
    background: rgba(25, 27, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.auth-card h2 {
    margin-bottom: 10px;
    color: var(--ui-text);
    font-size: 1.8rem;
}

.auth-card p {
    color: var(--ui-text);
    opacity: 0.8;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#auth-form input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#auth-form input:focus {
    outline: none;
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.3);
}

#auth-submit-btn {
    margin-top: 10px;
    width: 100%;
    font-size: 1.1rem;
}

.auth-error {
    margin-top: 15px;
    padding: 12px;
    background: rgba(229, 57, 53, 0.2);
    border: 1px solid #e53935;
    color: #ff5252;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: left;
}

.library-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .library-header {
        flex-direction: column;
        gap: 15px;
    }
    .library-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .user-email {
        width: 100%;
        text-align: center;
    }
}

.library-message {
    grid-column: 1 / -1;
    margin-top: 50px;
    text-align: center;
    color: #888;
}

.library-message.library-error {
    color: #e53935;
}

.logout-btn {
    background: #d32f2f !important;
}

.logout-btn:hover {
    background: #b71c1c !important;
}

/* --- KÜTÜPHANE GÖRÜNÜMÜ --- */
#library-view {
    display: none;
    padding: 30px;
    min-height: 100vh;
}

#library-view.active {
    display: block;
}
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-radius: 15px;
    margin-bottom: 40px;
    color: white;
}

/* Not an <h1>: Edge Read Aloud's fallback start reads the page's first <h1>,
   which was this hidden title while a book was open. */
.library-header .library-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.book-card {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.book-cover {
    width: 100%;
    height: 280px;
    background-color: #222;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 3rem;
}

img.book-cover {
    object-fit: cover;
}

.book-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-title {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-progress-text {
    font-size: 0.85rem;
    color: #aaa;
    text-align: right;
}

.book-progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.book-progress-fill {
    height: 100%;
    background: var(--ui-primary);
    width: 0%;
    transition: width 0.3s;
}

.delete-book-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(229, 57, 53, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
    border: 0;
    cursor: pointer;
    z-index: 1;
}

.book-card:hover .delete-book-icon,
.delete-book-icon:focus-visible {
    opacity: 1;
}

/* The "…" beside the delete button opens the book's name and cover editor. */
.edit-book-icon {
    position: absolute;
    top: 10px;
    right: 48px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(40, 40, 48, 0.9);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 1;
}

.book-card:hover .edit-book-icon,
.edit-book-icon:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .delete-book-icon,
    .edit-book-icon {
        opacity: 1;
    }
}

#book-edit-name {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    padding: 10px 14px;
    outline: none;
}

#book-edit-name:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.25);
}

.book-edit-label {
    margin-top: 16px;
}

.book-edit-cover-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.book-edit-cover {
    width: 72px;
    height: 108px;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.book-edit-cover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-edit-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.book-edit-secondary[hidden] {
    display: none;
}

.book-edit-secondary:hover,
.book-edit-secondary:focus-within {
    background: rgba(255, 255, 255, 0.12);
}

/* The file input stays focusable (keyboard) but its own button is the label's. */
.book-edit-secondary input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.book-edit-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* A PDF's text (text-layer PDF and EPUB): an option on its own card (Local/VPS). */
.book-text-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: #2f6f4e;
    color: white;
    font: 700 0.75rem/1.2 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.book-text-toggle[data-state="running"] {
    background: #8a6d1d;
}

.book-text-toggle[data-state="failed"] {
    background: #8a2d2d;
}

.book-text-menu {
    position: absolute;
    top: 44px;
    left: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #1e1e1e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 70%;
    overflow-y: auto;
}

.book-text-menu[hidden] {
    display: none;
}

.book-text-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: white;
    font: inherit;
    font-size: 0.9rem;
    text-align: start;
    cursor: pointer;
}

.book-text-menu button:hover,
.book-text-menu button:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.book-text-menu button:disabled {
    color: #777;
    cursor: not-allowed;
    background: transparent;
}

.book-text-note {
    margin: 4px 10px 2px;
    color: #aaa;
    font-size: 0.75rem;
    line-height: 1.35;
}

/* --- YÜKLEME EKRANI (OVERLAY) --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

.loader-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--ui-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- PROGRESS BAR & READER NAV --- */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 90;
}

#progress-bar {
    height: 100%;
    background: var(--ui-primary);
    width: 0%;
    transition: width 0.2s;
}

#reader-nav {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 20px;
    border-radius: 30px;
    width: 90%;
    max-width: 1200px;
    z-index: 96;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    background: var(--ui-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ui-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* The bar opens when the mouse reaches the top edge (or on a tap in the middle of the
   page; see reader-app.js). The strip stays thin because it lies over the text: Edge
   Read Aloud counts a covered word as hidden and scrolls the page back. */
#reader-nav-hit-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    z-index: 75;
}

#reader-nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#toc-toggle {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ui-bg);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 95;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

#toc-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

#back-to-library {
    justify-self: start;
}

#current-book-title {
    color: var(--ui-text);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--ui-text);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ui-primary);
}

.nav-actions {
    justify-self: end;
    display: flex;
    gap: 10px;
}

/* --- SIDEBAR GENEL --- */
.sidebar {
    position: fixed;
    top: 0;
    width: 350px;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    color: var(--ui-text);
    visibility: hidden;
    transition: visibility 0.4s, transform 0.4s;
}

.close-btn {
    background: none;
    border: none;
    color: var(--ui-text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff5252;
}

/* Settings Sidebar overrides */
#settings-sidebar {
    right: -400px;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.4s;
}

#settings-sidebar.open {
    right: 0;
    visibility: visible;
}

/* TOC Sidebar */
#toc-sidebar {
    left: -400px;
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.4s;
    border-right: 1px solid var(--ui-border);
    border-left: none;
}

#toc-sidebar.open {
    left: 0;
    visibility: visible;
    /* Visible at once (Ctrl+F focuses its search box); closing still slides out before it hides. */
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0s;
}

.toc-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.toc-content::-webkit-scrollbar {
    width: 6px;
}

.toc-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

#toc-list {
    list-style: none;
    padding: 0;
}

#toc-list ul {
    list-style: none;
    margin: 6px 0 0;
    padding-left: 16px;
}

#toc-list .toc-group-title {
    display: block;
    padding: 8px 12px;
}

#toc-list li {
    margin-bottom: 10px;
}

#toc-list a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

#toc-list a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Kitapta ara: the search box above the contents; while it has text its results replace the list. */
.book-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 20px 0;
    padding: 0 6px 0 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.book-search:focus-within {
    border-color: var(--ui-primary);
}

.book-search > i {
    opacity: 0.7;
}

.book-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    outline: none;
    background: none;
    color: var(--ui-text);
    font: inherit;
    font-size: 0.95rem;
}

.book-search input::-webkit-search-cancel-button {
    display: none;
}

.book-search .close-btn {
    padding: 4px 6px;
    font-size: 1.05rem;
}

.book-search .close-btn[hidden],
.book-search-status[hidden],
.book-search-results[hidden],
.book-search-bar[hidden] {
    display: none;
}

.book-search-status {
    margin: 10px 22px 0;
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.75;
}

.book-search-results {
    list-style: none;
}

.book-search-results li {
    margin-bottom: 6px;
}

.book-search-hit {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #ccc;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.book-search-hit:hover,
.book-search-hit:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.book-search-place {
    display: block;
    margin-bottom: 2px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.book-search-hit mark {
    padding: 0 1px;
    border-radius: 2px;
    background: #ffe25a;
    color: #111;
}

/* The find bar: top right, clear of the contents button, the speech and settings buttons and the top bar (which
   covers it while open). */
.book-search-bar {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 94;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100vw - 140px);
    padding: 4px 6px 4px 14px;
    border-radius: 24px;
    color: var(--ui-text);
    font-size: 0.88rem;
}

.book-search-bar > i {
    margin-right: 6px;
    opacity: 0.7;
}

.book-search-bar-query {
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.book-search-bar-count {
    min-width: 4.5em;
    margin: 0 6px 0 10px;
    opacity: 0.8;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.book-search-bar .icon-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
}

/* --- APP SPEECH: settings above the orange button, which starts and pauses reading --- */
#tts-toggle[data-state="playing"] {
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.35), 0 4px 15px rgba(255, 152, 0, 0.4) !important;
}

.tts-player-card {
    position: fixed;
    /* Right edge aligned with the orange button; 12px above it. */
    right: 105px;
    bottom: 102px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 240px;
    max-width: calc(100vw - 32px);
    padding: 12px;
    border-radius: 18px;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.tts-player-card.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.tts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tts-btn {
    background: none;
    border: none;
    color: var(--ui-text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s, transform 0.2s, color 0.2s;
}

.tts-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: #ff9800;
    transform: scale(1.08);
}

.tts-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.tts-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.tts-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bbb;
    font-size: 0.9rem;
}

/* The voice source (TTS API or the browser) shows only where the server has the TTS API. */
.tts-control-group[hidden] {
    display: none;
}

.tts-control-group select optgroup {
    background: #181818;
    color: #ffb74d;
}

.tts-control-group select {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--ui-border);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    outline: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tts-control-group select:hover,
.tts-control-group select:focus-visible {
    border-color: #ff9800;
}

.tts-control-group select option {
    background: #181818;
    color: white;
}

.close-tts-btn:hover:not(:disabled) {
    color: #ff5252;
}

/* --- Sayfaya Git (Page Jump) Modal --- */
dialog.modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: transparent;
    color: inherit;
    overflow: auto;
    z-index: 300;
}

dialog.modal-overlay:not([open]) {
    display: none;
}

dialog.modal-overlay[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease-out;
}

dialog.modal-overlay::backdrop {
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: min(100%, 420px);
    max-height: 100%;
    overflow-y: auto;
    border-radius: 18px;
    padding: 24px 26px;
    color: var(--ui-text);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--ui-border);
    animation: modalSlideUp 0.22s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.modal-title h2 {
    font: inherit;
}

.modal-title i {
    color: var(--ui-primary);
    font-size: 1.1rem;
}

.jump-info {
    font-size: 0.9rem;
    color: #b0b0b0;
    margin-bottom: 8px;
    line-height: 1.4;
}

.jump-note {
    font-size: 0.78rem;
    color: #aaa;
    margin-bottom: 16px;
    line-height: 1.4;
}

.jump-field-label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 0.82rem;
    font-weight: 600;
}

.jump-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 0;
}

#page-jump-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 10px 14px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

#page-jump-input:focus {
    border-color: var(--ui-primary);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.25);
}

/* Chrome, Safari, Edge, Opera number arrows remove */
#page-jump-input::-webkit-outer-spin-button,
#page-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#page-jump-input[type=number] {
    -moz-appearance: textfield;
}

.jump-total-text {
    flex: 0 0 auto;
    font-size: 1.05rem;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}

.jump-submit-btn {
    flex: 0 0 auto;
    padding: 10px 22px;
    font: inherit;
    font-size: 0.98rem;
    border-radius: 10px;
    background: var(--ui-primary);
    color: white;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(92, 107, 192, 0.4);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.jump-submit-btn:hover {
    transform: translateY(-1px);
    background: #4a56a0;
    box-shadow: 0 6px 20px rgba(92, 107, 192, 0.5);
}

.page-jump-status {
    min-height: 1.25em;
    margin: 8px 0 14px;
    color: #ffb4ab;
    font-size: 0.82rem;
    line-height: 1.4;
}

.jump-slider-row {
    margin-bottom: 16px;
}

#page-jump-slider {
    display: block;
    width: 100%;
    accent-color: var(--ui-primary);
    height: 6px;
    cursor: pointer;
}

#page-jump-modal :is(button, input):focus-visible {
    outline: 2px solid #aab4ff;
    outline-offset: 3px;
}

#page-jump-modal :is(button, input):disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#page-jump-modal .jump-submit-btn:disabled:hover {
    transform: none;
    background: var(--ui-primary);
    box-shadow: 0 4px 15px rgba(92, 107, 192, 0.4);
}

.jump-hint {
    font-size: 0.78rem;
    color: #777;
    text-align: center;
    line-height: 1.4;
}

.jump-hint strong {
    color: #aaa;
}

/* --- Accounts: signing in and creating an account are separate --- */
.auth-switch {
    margin-top: 18px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth-link {
    background: none;
    border: none;
    padding: 2px 4px;
    color: #aab4ff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link:hover { color: #fff; }
.auth-link:focus-visible { outline: 2px solid #aab4ff; outline-offset: 2px; border-radius: 4px; }
.auth-link:disabled { opacity: 0.5; cursor: wait; }

.admin-link[hidden] { display: none !important; }

/* --- This device's settings --- */
.device-setting {
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.device-setting label { margin-bottom: 4px; }
.device-setting small { display: block; color: #aaa; line-height: 1.45; }
#device-settings-label { font-weight: 600; color: #fff; }

/* --- Ayraç (bookmark) --- */
.bookmark-card { width: min(100%, 460px); }

.bookmark-place-btn {
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
}

.bookmark-entry {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.bookmark-entry h3 {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #aab4ff;
    margin-bottom: 6px;
}

#bookmark-excerpt {
    margin: 0 0 6px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #eee;
    border-left: 3px solid #ffb300;
    padding-left: 10px;
}

.bookmark-meta {
    font-size: 0.82rem;
    color: #aaa;
    line-height: 1.4;
}

.bookmark-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#bookmark-saved-go { margin-top: 10px; width: 100%; }
#bookmark-modal :is(button):focus-visible { outline: 2px solid #aab4ff; outline-offset: 3px; }

/* Placing the bookmark: the next tap on the text picks its sentence. */
.bookmark-picker {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 32px);
    padding: 10px 12px 10px 16px;
    border-radius: 14px;
    color: var(--ui-text);
    font-size: 0.9rem;
}

.bookmark-picker[hidden] { display: none; }
.bookmark-picker i { color: #ffb300; }
.bookmark-picker .mode-btn { flex: 0 0 auto; padding: 7px 12px; }
body.bookmark-placing #book-content { cursor: text; }

/* Messages about other devices: top centre, over the paged layout's top margin and
   away from the speech, settings and link-return buttons. */
.reader-sync-toast {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 110;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: min(560px, calc(100vw - 32px));
    padding: 9px 10px 9px 14px;
    border-radius: 12px;
    color: var(--ui-text);
    font-size: 0.86rem;
    line-height: 1.4;
}

.reader-sync-toast[hidden] { display: none; }
.reader-sync-toast > i { margin-top: 3px; color: #aab4ff; }
.reader-sync-body { flex: 1; min-width: 0; }
.reader-sync-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.reader-sync-actions:empty { display: none; }
.reader-sync-actions .mode-btn { flex: 0 1 auto; padding: 7px 12px; font-size: 0.85rem; }
.reader-sync-close { font-size: 1.1rem; line-height: 1; padding: 2px; }

@media (max-width: 600px) {
    .reader-sync-toast { top: 6px; }
    .bookmark-picker { top: 8px; font-size: 0.85rem; }
}
#bookmark-modal [hidden], .reader-sync-toast [hidden] { display: none !important; }

/* Phone: every control sits in one bottom row within thumb reach (the top of the screen is the
   browser's address bar): contents and the page number on the left, speech and settings on the
   right, none over another. The book bar opens just above that row (a tap on the page number). */
@media (max-width: 768px) {
    #toc-toggle,
    #tts-toggle,
    #settings-toggle {
        top: auto;
        bottom: 14px;
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    #toc-toggle { left: 14px; }
    #settings-toggle { right: 14px; }
    #tts-toggle { right: 70px; }

    .book-search-bar {
        top: 8px;
        right: 8px;
        left: 8px;
        max-width: none;
    }

    .book-search-bar-query {
        flex: 1;
        max-width: none;
    }

    .paged-indicator,
    .paged-indicator:hover,
    .paged-indicator:active {
        left: 70px;
        right: auto;
        bottom: 20px;
        max-width: calc(100vw - 196px);
        transform: none;
        padding: 8px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #reader-nav {
        top: auto;
        bottom: 72px;
        width: calc(100% - 28px);
        padding: 6px 12px;
    }

    /* The hover strip follows the bar: at this width the bar opens from the bottom edge. */
    #reader-nav-hit-area {
        top: auto;
        bottom: 0;
    }

    .tts-player-card {
        right: 14px;
        bottom: 72px;
    }
}

/* Library order (reader-app.js): the grip shows only in the reader's own order. */
.library-sort {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--ui-border);
    background: var(--ui-bg);
    color: var(--ui-text);
    font: inherit;
}

.book-drag-handle {
    display: none;
    position: absolute;
    top: 44px; /* under the text-layer "Metin" badge */
    left: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    background: rgba(40, 40, 48, 0.9);
    color: white;
    cursor: grab;
    touch-action: none;
}

#library-grid[data-sort="custom"] .book-drag-handle {
    display: flex;
}

.book-card.dragging {
    opacity: 0.6;
    outline: 2px dashed var(--ui-primary);
}

/* A phone's paged book uses the whole screen width, without the 20px side gutters. */
@media (max-width: 768px) {
    :root {
        --page-gutter: 0px;
    }

    #reader-view.paged-mode #book-viewport {
        box-shadow: none;
    }

    /* The last lines end above the bottom row of controls. */
    #reader-view.paged-mode #book-content {
        height: calc(100dvh - 96px) !important;
        padding-top: 20px !important;
        padding-bottom: 76px !important;
    }
}

/* A phone's browser hides its address bar only while the page itself scrolls down. Paged reading
   stays fixed on screen over a slightly taller page, so a downward swipe hides the bar (and an
   upward one shows it) as in scroll mode; the book then fills the taller visible height (dvh). */
@media (pointer: coarse) {
    body:has(#reader-view.paged-mode) {
        min-height: calc(100lvh + 120px);
    }

    #reader-view.paged-mode {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
}

/* Hizalama: the reader's own alignment over the book's (code, formulas and placed PDF pages keep theirs). */
#book-content[data-text-align="left"] :is(p, li, dd, dt, blockquote, figcaption, h1, h2, h3, h4, h5, h6):not(.pdf-formula-text) { text-align: left !important; }
#book-content[data-text-align="justify"] :is(p, li, dd, dt, blockquote, figcaption):not(.pdf-formula-text) { text-align: justify !important; }
#book-content[data-text-align="right"] :is(p, li, dd, dt, blockquote, figcaption, h1, h2, h3, h4, h5, h6):not(.pdf-formula-text) { text-align: right !important; }
