/* Dark only: ink black, paper-white text, one acid yellow accent */
:root {
    --bg: #0b0b0a;
    --surface: #141412;
    --surface-2: #1c1c19;
    --surface-3: #262622;
    --line: rgba(242, 238, 226, .09);
    --line-strong: rgba(242, 238, 226, .18);
    --text: #f2eee2;
    --muted: #a39f93;
    --faint: #6c695f;
    --accent: #f4e04d;
    --accent-ink: #15140c;
    --accent-soft: rgba(244, 224, 77, .13);
    --danger: #ff6b5e;
    --danger-soft: rgba(255, 107, 94, .13);
    --shadow: 0 18px 50px -12px rgba(0, 0, 0, .7);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: dark;
}

html {
    min-height: 100%;
    background: var(--bg);
    accent-color: var(--accent);
    caret-color: var(--accent);
    scrollbar-color: var(--surface-3) var(--bg);
    -webkit-text-size-adjust: 100%;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Condensed heavy cut of Archivo: the tankōbon spine voice */
.display,
.wordmark,
.section-title,
.continue-name,
.empty-library h2,
.offline-head h2 {
    font-family: var(--font);
    font-stretch: 62.5%;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: .95;
    text-transform: uppercase;
}

a {
    color: inherit;
}

a:hover {
    color: var(--text);
    text-decoration: none;
}

hr {
    border-color: var(--line);
}

ul {
    list-style-type: none;
    padding-left: 0;
}

.content-wrapper {
    min-height: 100vh;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 650;
    transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}

.btn:focus,
.btn.focus {
    box-shadow: none;
}

.btn-manga,
.btn-secondary {
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}

.btn-manga:hover,
.btn-secondary:hover {
    border-color: var(--line-strong);
    background: var(--surface-3);
    color: var(--text);
}

.btn-accent {
    border: 0;
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-accent:hover,
.btn-accent:focus {
    background: #fff07a;
    color: var(--accent-ink);
}

.btn-accent:active {
    background: #e6d23f;
}

.btn-danger {
    border: 0;
    background: var(--danger);
    color: #1a0806;
}

.btn-danger:hover {
    background: #ff8478;
    color: #1a0806;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    border-color: transparent;
    background: var(--surface-2);
    color: var(--text);
}

/* Forms */
.form-control,
.custom-select {
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
}

.custom-select {
    /* Bootstrap ships a dark arrow; redraw it in the muted ink */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%23a39f93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e");
    background-size: 10px 6px;
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--accent);
    background-color: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder {
    color: var(--faint);
}

.custom-select option,
select option {
    background: var(--surface);
    color: var(--text);
}

label,
.modal-label {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.label-optional {
    margin-left: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-top: .2rem;
}

.form-check-label {
    padding-left: 6px;
    color: var(--muted);
    font-weight: 450;
}

/* Modals */
.modal-backdrop.show {
    opacity: .72;
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-title {
    font-size: 19px;
    font-weight: 700;
}

.close {
    color: var(--muted);
    text-shadow: none;
    opacity: 1;
}

.close:hover {
    color: var(--text);
}

.text-danger {
    color: var(--danger) !important;
}

/* Library */
.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 0 64px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
}

.wordmark {
    margin: 0;
    color: var(--text);
    font-size: 44px;
}

.wordmark span {
    color: var(--accent);
}

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

.library-actions .btn-accent {
    min-height: 40px;
    padding: 0 16px;
}

.library-section {
    margin-top: 40px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 26px;
}

.section-head .section-title {
    margin: 0;
}

.section-count {
    color: var(--faint);
    font-stretch: 100%;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

/* Continue reading */
.continue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.continue-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
    isolation: isolate;
    transition: border-color .2s ease-out, background-color .2s ease-out, transform .25s var(--ease);
}

/* Screentone corner: halftone dots fading out from the top right */
.continue-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 150px;
    height: 120px;
    background: radial-gradient(circle, rgba(244, 224, 77, .22) 1.1px, transparent 1.6px) 0 0 / 7px 7px;
    -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 72%);
    mask-image: radial-gradient(circle at 100% 0, #000, transparent 72%);
    opacity: .7;
    transition: opacity .25s ease-out;
}

.continue-card:hover,
.continue-card:focus-visible {
    border-color: var(--line-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
}

.continue-card:hover::before {
    opacity: 1;
}

.continue-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    padding-right: 8px;
    font-size: 30px;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.continue-meta,
.library-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.continue-meta {
    margin-top: auto;
    color: var(--text);
    font-weight: 600;
}

.library-meta > span:empty,
.continue-meta > span:empty {
    display: none;
}

/* Separator only after a visible sibling (empty progress spans are hidden) */
.library-meta > span:not(:empty) ~ span:not(.new-badge):not(.offline-meta)::before {
    content: "·";
    margin-right: 6px;
    color: var(--faint);
}

.continue-bar {
    display: block;
    height: 4px;
    border-radius: 4px;
    background: var(--surface-3);
    overflow: hidden;
}

.continue-bar > span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .9s var(--ease);
}

.continue-date {
    color: var(--muted);
    font-size: 12px;
}

.new-badge {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.new-badge.is-warning {
    background: var(--danger-soft);
    color: var(--danger);
}

.new-badge.is-quiet {
    padding: 0 7px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--muted);
    font-weight: 550;
}

/* Library list */
.library-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(300px, 100%);
    margin: 0;
    color: var(--faint);
    font-weight: 400;
}

.library-search .fa {
    position: absolute;
    left: 13px;
    font-size: 13px;
    pointer-events: none;
}

.library-search input {
    width: 100%;
    height: 42px;
    padding: 0 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s ease-out, box-shadow .15s ease-out;
}

.library-search input::placeholder {
    color: var(--faint);
}

.library-search input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.library-search kbd {
    position: absolute;
    right: 12px;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 11px;
    box-shadow: none;
}

.library-search input:focus ~ kbd {
    display: none;
}

.library-list {
    margin: 0;
}

.library-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 -10px;
    padding: 0 6px 0 10px;
    border-radius: 10px;
    transition: background-color .15s ease-out;
}

.library-row + .library-row::before {
    content: "";
    position: absolute;
    top: 0;
    right: 10px;
    left: 10px;
    height: 1px;
    background: var(--line);
}

.library-row:hover,
.library-row.menu-open {
    background: var(--surface);
}

.library-row:hover::before,
.library-row:hover + .library-row::before,
.library-row.menu-open::before,
.library-row.menu-open + .library-row::before {
    opacity: 0;
}

.library-link {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
    padding: 14px 0;
}

.library-name {
    font-size: 16.5px;
    font-weight: 650;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.row-menu {
    position: relative;
    flex: none;
}

.row-menu-toggle,
.row-offline-toggle {
    flex: none;
    border-color: transparent;
    background: transparent;
    color: var(--faint);
}

.row-menu-toggle:hover,
.row-offline-toggle:hover,
.row-menu-toggle[aria-expanded="true"] {
    border-color: transparent;
    background: var(--surface-3);
    color: var(--text);
}

.row-offline-toggle.is-active,
.row-offline-toggle.is-busy {
    color: var(--accent);
}

.row-menu-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transform-origin: top right;
    animation: menu-in .18s var(--ease);
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: scale(.96) translateY(-4px);
    }
}

.row-menu-list[hidden] {
    display: none;
}

.row-menu-list button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.row-menu-list button .fa {
    color: var(--muted);
}

.row-menu-list button:hover,
.row-menu-list button:focus-visible {
    background: var(--surface-3);
    outline: none;
}

.row-menu-list .is-danger,
.row-menu-list .is-danger .fa {
    color: var(--danger);
}

.offline-meta {
    color: var(--accent);
    font-weight: 600;
}

.offline-meta::before {
    content: "\f019";
    margin-right: 4px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 11px;
}

.library-empty-search {
    margin: 18px 0;
    color: var(--muted);
}

/* Trash */
.trash {
    margin-top: 56px;
}

.trash summary {
    display: inline-flex;
    width: fit-content;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    list-style: none;
}

.trash summary:hover {
    color: var(--text);
}

.trash summary::-webkit-details-marker {
    display: none;
}

.trash summary::before {
    content: "\f054";
    align-self: center;
    font-family: "Font Awesome 5 Free";
    font-stretch: 100%;
    font-weight: 900;
    font-size: 10px;
    transition: transform .2s var(--ease);
}

.trash[open] summary::before {
    transform: rotate(90deg);
}

.trash .library-name {
    color: var(--muted);
    font-weight: 500;
}

.trash-actions {
    display: flex;
    flex: none;
    gap: 6px;
}

/* Empty library */
.empty-library {
    max-width: 440px;
    margin: 10vh 0 0;
}

.empty-library h2 {
    margin-bottom: 14px;
    font-size: 52px;
}

.empty-library p {
    margin-bottom: 24px;
    color: var(--muted);
}

/* Login */
.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
}

.login-panel {
    width: min(380px, 100%);
}

.login-panel .wordmark {
    font-size: 76px;
    line-height: .85;
}

.login-lede {
    margin: 12px 0 32px;
    color: var(--muted);
}

.login-panel .btn-accent {
    min-height: 48px;
    font-size: 16px;
}

/* Reader */
.reader-page {
    background: #000;
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
}

.reader-shell {
    min-height: 100vh;
    padding-top: 52px;
    background: #000;
}

.reader-topbar {
    position: fixed;
    z-index: 1020;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto;
    gap: 6px;
    align-items: center;
    width: min(720px, calc(100% - 20px));
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(20, 20, 18, .82);
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .7);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    transform: translateX(-50%);
    transition: opacity .2s ease-out, transform .25s var(--ease), visibility .2s;
}

.reader-topbar.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -48px);
}

.reader-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.reader-home:hover {
    background: var(--surface-3);
}

.reader-chapter {
    width: 100%;
    min-height: 36px;
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    background-color: var(--surface-2);
    font-size: 14px;
    font-weight: 650;
    text-align-last: center;
    font-variant-numeric: tabular-nums;
}

.reader-chapter:hover {
    background-color: var(--surface-3);
}

.reader-actions {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
}

.reader-actions .icon-btn {
    width: 36px;
    height: 36px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
}

.reader-actions .icon-btn:hover {
    background: var(--surface-3);
    color: var(--text);
}

.reader-actions .icon-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.reader-actions .icon-btn.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.reader-progress {
    position: fixed;
    z-index: 1030;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
}

.reader-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent);
}

#imagesMainContainer,
[id^="images_container_"] {
    width: 100%;
}

.placeholder {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 48vh;
    background: #000;
}

.placeholder.page-margin {
    margin-top: clamp(36px, 8vh, 120px);
}

.viewer-image {
    display: block;
    width: auto;
    max-width: min(100%, 1100px);
    height: auto;
    object-fit: contain;
    background: var(--surface);
}

.viewer-image:not([src]),
.viewer-image[src=""] {
    min-height: 50vh;
}

.manga_chapter_separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 120px;
    color: var(--accent);
    font-stretch: 62.5%;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
}

.manga_chapter_separator:before,
.manga_chapter_separator:after {
    content: "";
    width: min(24vw, 200px);
    height: 1px;
    background: var(--line-strong);
}

.manga_chapter_separator span {
    white-space: nowrap;
}

/* Offline panel: under the reader bar, or docked at the bottom in the library */
.offline-panel {
    position: fixed;
    z-index: 1019;
    top: calc(max(8px, env(safe-area-inset-top)) + 58px);
    left: 50%;
    display: grid;
    gap: 14px;
    width: min(420px, calc(100% - 20px));
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    animation: panel-in .25s var(--ease);
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
}

.offline-panel[hidden] {
    display: none;
}

.offline-head h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.offline-head p,
.offline-progress p,
.offline-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.offline-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.offline-choices .btn {
    min-height: 42px;
    padding: 6px 8px;
    border-color: var(--line);
    background: var(--surface-3);
    font-size: 13px;
    white-space: nowrap;
}

.offline-choices .btn:hover {
    border-color: var(--accent);
}

.offline-choices .btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.offline-progress {
    display: grid;
    gap: 8px;
}

.offline-progress[hidden] {
    display: none;
}

.offline-progress-track {
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--surface-3);
}

.offline-progress-bar {
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease-out;
}

.offline-hint {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.offline-remove {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

.offline-remove:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.offline-remove[hidden],
.offline-hint[hidden] {
    display: none;
}

.offline-sheet {
    z-index: 1040;
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    animation-name: sheet-in;
}

@keyframes sheet-in {
    from {
        opacity: 0;
        transform: translate(-50%, 16px);
    }
}

.offline-sheet .offline-head {
    position: relative;
    padding-right: 44px;
}

.offline-sheet .offline-series {
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 650;
    overflow-wrap: anywhere;
}

.offline-close {
    position: absolute;
    top: -8px;
    right: -8px;
}

/* Player */
.player-page {
    background: #000;
}

.player-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 100vh;
    padding: 12px;
    gap: 12px;
}

.player-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: min(1120px, 100%);
    margin: 0 auto;
}

.player-topbar .reader-home {
    min-height: 46px;
    background: var(--surface-2);
}

.player-episode {
    width: 100%;
    font-weight: 650;
}

.player-stage {
    display: grid;
    place-items: center;
    width: min(1120px, 100%);
    min-height: 0;
    margin: 0 auto;
    border-radius: 12px;
    background: #000;
    overflow: hidden;
}

.player-video,
.video-js {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: calc(100vh - 166px);
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-controls {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 8px;
    width: min(760px, 100%);
    margin: 0 auto;
}

.player-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 12px;
    white-space: nowrap;
}

.player-control:disabled {
    opacity: .35;
}

/* Floating loader while images or calls are in flight */
#loaderContainer {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 1060;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(20, 20, 18, .9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

#loaderContainer>img {
    max-width: 40px;
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .app-shell {
        width: calc(100% - 32px);
        padding-top: max(20px, env(safe-area-inset-top));
    }

    .app-topbar {
        margin-bottom: 24px;
    }

    .wordmark {
        font-size: 40px;
    }

    .library-section {
        margin-top: 32px;
    }

    .section-title {
        font-size: 24px;
    }

    /* Continue reading becomes a swipeable shelf bleeding to the screen edge */
    .continue-grid {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 74%;
        margin: 0 -16px;
        padding: 0 16px 4px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }

    .continue-grid::-webkit-scrollbar {
        display: none;
    }

    .continue-card {
        scroll-snap-align: start;
        min-height: 176px;
    }

    .continue-card:hover {
        transform: none;
    }

    .continue-name {
        font-size: 28px;
    }

    .section-head {
        flex-wrap: wrap;
    }

    .library-search {
        width: 100%;
    }

    .library-search kbd {
        display: none;
    }

    .library-name {
        font-size: 16px;
    }

    /* Site name stays on the shelf cards; here it only made rows wrap */
    .library-meta .meta-site {
        display: none;
    }

    .reader-shell {
        min-height: 100dvh;
        padding-top: 46px;
    }

    .reader-topbar {
        top: max(6px, env(safe-area-inset-top));
        grid-template-columns: 36px minmax(0, 1fr) auto;
        width: calc(100% - 12px);
        padding: 4px;
        gap: 4px;
    }

    .reader-topbar.is-hidden {
        transform: translate(-50%, -44px);
    }

    .offline-panel {
        top: calc(max(6px, env(safe-area-inset-top)) + 52px);
        width: calc(100% - 12px);
    }

    .offline-sheet {
        top: auto;
        bottom: max(8px, env(safe-area-inset-bottom));
        width: calc(100% - 16px);
    }

    .reader-home {
        width: 100%;
        padding: 0;
    }

    .reader-home span {
        display: none;
    }

    .reader-chapter {
        padding-right: 26px;
        padding-left: 8px;
        font-size: 13px;
    }

    .reader-actions .icon-btn {
        width: 34px;
    }

    .placeholder {
        min-height: 40vh;
        align-items: flex-start;
    }

    .placeholder.page-margin {
        margin-top: 18px;
    }

    .viewer-image {
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }

    .manga_chapter_separator {
        min-height: 88px;
        font-size: 18px;
    }

    #loaderContainer {
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: 54px;
        height: 54px;
    }

    #loaderContainer>img {
        max-width: 34px;
    }

    .player-shell {
        min-height: 100dvh;
        padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
        gap: 8px;
    }

    .player-topbar {
        grid-template-columns: 46px minmax(0, 1fr);
    }

    .player-topbar .reader-home {
        width: 46px;
    }

    .player-stage {
        align-self: center;
        width: 100%;
    }

    .player-video,
    .video-js {
        max-height: calc(100dvh - 146px);
    }

    .player-controls {
        position: sticky;
        bottom: max(8px, env(safe-area-inset-bottom));
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        padding: 6px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: rgba(20, 20, 18, .88);
        box-shadow: var(--shadow);
        backdrop-filter: blur(16px);
    }

    .player-control {
        min-height: 46px;
        padding: 0;
    }

    .player-control span {
        display: none;
    }

    .player-play span {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
