:root {
  color-scheme: light;
  --surface: #f6f7f9;
  --surface-raised: #ffffff;
  --surface-muted: #e9edf2;
  --text: #1d2633;
  --text-muted: #667085;
  --border: #d7dde5;
  --accent: #5268e0;
  --accent-strong: #3e50bd;
  --shadow: 0 .5rem 1.6rem rgb(30 41 59 / 12%);
  --reader-surface: #111318;
  --reader-bar: #1d2028;
  --reader-text: #f5f7fb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #11151b;
    --surface-raised: #1a2029;
    --surface-muted: #252d38;
    --text: #edf1f7;
    --text-muted: #a4afbd;
    --border: #303a47;
    --accent: #8fa1ff;
    --accent-strong: #aab7ff;
    --shadow: 0 .5rem 1.6rem rgb(0 0 0 / 35%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #11151b; --surface-raised: #1a2029; --surface-muted: #252d38;
  --text: #edf1f7; --text-muted: #a4afbd; --border: #303a47;
  --accent: #8fa1ff; --accent-strong: #aab7ff; --shadow: 0 .5rem 1.6rem rgb(0 0 0 / 35%);
}

:root[data-theme="light"] { color-scheme: light; }

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: var(--surface);
  color: var(--text);
  transition: background-color .2s ease, color .2s ease;
}
body > header, body > .container, body > footer { position: relative; z-index: 1; }
.library-folder-backdrop { position: fixed; z-index: 0; inset: 3rem 0 0; overflow: hidden; pointer-events: none; }
.library-folder-backdrop::before { position: absolute; inset: -3rem; background: var(--folder-cover) center / cover no-repeat; filter: blur(12px) saturate(.95); opacity: .42; content: ""; transform: scale(1.04); }
.library-folder-backdrop::after { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--surface) 0%, transparent 17%, transparent 82%, var(--surface) 100%); opacity: .3; content: ""; }
:root[data-theme="dark"] .library-folder-backdrop::before { opacity: .47; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .library-folder-backdrop::before { opacity: .47; } }

a { color: var(--accent); }
.navbar, .footer { background: var(--surface-raised); border-color: var(--border) !important; }
.downloads-page { max-width: 58rem; margin: 3rem auto; }
.downloads-intro { max-width: 48rem; color: var(--text-muted); font-size: 1.08rem; }
.download-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.download-card { padding: 1.5rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--surface-raised); box-shadow: var(--shadow); }
.download-card h2 { font-size: 1.3rem; }
.download-card p { min-height: 3rem; color: var(--text-muted); }
.download-button { display: inline-block; padding: .7rem 1rem; border-radius: .55rem; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.download-button:hover { color: #fff; filter: brightness(1.08); }
.download-warning { padding: 1rem; border: 1px solid #d6a43b66; border-radius: .7rem; background: #d6a43b18; color: var(--text); }
.edition-options { display: grid; gap: 1rem; margin-top: 2rem; }.edition-card { overflow: hidden; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface-raised); box-shadow: var(--shadow); }.edition-card summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.3rem; cursor: pointer; list-style: none; }.edition-card summary::-webkit-details-marker { display: none; }.edition-card summary strong,.edition-card summary small { display: block; }.edition-card summary strong { font-size: 1.25rem; }.edition-card summary small { margin-top: .2rem; color: var(--text-muted); }.edition-icon { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: .7rem; background: var(--accent); color: #fff; font-size: 1.3rem; font-weight: 850; }.edition-expand { color: var(--accent); font-weight: 700; }.edition-card[open] .edition-expand { font-size: 0; }.edition-card[open] .edition-expand::after { font-size: .95rem; content: "Ocultar"; }.edition-content { padding: 0 1.3rem 1.3rem; border-top: 1px solid var(--border); }.edition-content>p:first-child { margin-top: 1.2rem; }.edition-content li { margin-bottom: .3rem; }.download-options.compact { margin: 1.25rem 0; }@media(max-width:540px){.edition-card summary{grid-template-columns:auto 1fr}.edition-expand{grid-column:2}}
.navbar-brand, .navbar .nav-link, .footer { color: var(--text); }
.navbar .nav-link:hover, .navbar .nav-link:focus { color: var(--accent); }
.compact-navbar { min-height: 3rem; padding-block: .28rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .4rem; padding-block: 0; }
.brand-lockup img { width: 2.35rem; height: 2.35rem; object-fit: contain; }
.brand-lockup span { font-weight: 700; letter-spacing: -.02em; }
.admin-nav { display: flex; align-items: center; gap: .3rem; margin-left: .8rem; }
.admin-nav a { padding: .38rem .7rem; border: 1px solid var(--border); border-radius: .45rem; background: var(--surface-muted); color: var(--text); font-size: .85rem; font-weight: 650; text-decoration: none; }
.admin-nav a:hover, .admin-nav a:focus { border-color: var(--accent); color: var(--accent); }
.top-help-link { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; padding: .35rem .6rem; color: var(--text); font-weight: 650; text-decoration: none; }
.top-help-link span { display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-muted); color: var(--accent); }
.top-help-link:hover { color: var(--accent); }
.navbar-user-tools { display: flex; align-items: center; margin-left: auto; }
.account-nav .nav-link, .account-nav .btn.nav-link { color: var(--text) !important; }
.account-nav .nav-link:hover, .account-nav .btn.nav-link:hover { color: var(--accent) !important; }
.account-nav li:first-child .nav-link { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) { .admin-nav { flex-wrap: wrap; margin: .6rem 0; } .navbar-user-tools { flex-wrap: wrap; justify-content: space-between; width: 100%; margin: 0; } .account-nav { flex-direction: row; } }
.footer-brand { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.footer-brand img { width: auto; height: 3.4rem; object-fit: contain; }
@media (max-width: 480px) { .footer-brand img { height: 2.65rem; } }
.navbar-toggler { border-color: var(--border); }
.navbar-toggler-icon { filter: var(--nav-icon-filter, none); }
:root[data-theme="dark"] .navbar-toggler-icon { --nav-icon-filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .navbar-toggler-icon { --nav-icon-filter: invert(1); } }
.text-secondary, .text-muted { color: var(--text-muted) !important; }
.theme-picker { display: flex; align-items: center; gap: .2rem; margin-right: .75rem; padding: .2rem; border: 1px solid var(--border); border-radius: 2rem; background: var(--surface-muted); }
.theme-picker button { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); }
.theme-picker button:hover { color: var(--text); }
.theme-picker button.active { background: var(--surface-raised); color: var(--accent); box-shadow: 0 .1rem .4rem rgb(0 0 0 / 12%); }
input, select, textarea { border: 1px solid var(--border); border-radius: .45rem; background: var(--surface-raised); color: var(--text); }

.eyebrow { margin: 0; color: #6c757d; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.library-heading { display: flex; align-items: end; justify-content: space-between; margin: 1.25rem 0; }
.content-filter { display: inline-flex; gap: .25rem; margin: 0; padding: .25rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--surface-muted); }
.content-filter button { padding: .45rem .85rem; border: 0; border-radius: .45rem; background: transparent; color: var(--text-muted); font-weight: 650; }
.content-filter button:hover { color: var(--text); }
.content-filter button.active { background: var(--surface-raised); color: var(--accent); box-shadow: 0 .12rem .35rem rgb(0 0 0 / 12%); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.5rem; }
.library-tools { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(9rem, auto) minmax(10rem, auto) auto auto; gap: .6rem; margin: .65rem 0 1.25rem; }
.library-tools label { margin: 0; }
.book-grouping { display: inline-flex; gap: .25rem; margin: 0 0 1.25rem; padding: .25rem; border: 1px solid var(--border); border-radius: .65rem; background: var(--surface-muted); }
.book-grouping a { padding: .45rem .8rem; border-radius: .45rem; color: var(--text-muted); text-decoration: none; font-weight: 700; }
.book-grouping a.active { background: var(--surface-raised); color: var(--accent); box-shadow: 0 .12rem .35rem rgb(0 0 0 / 12%); }
.reading-status-filter { margin: 0; }
.library-filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
@media (max-width: 700px) { .library-tools { grid-template-columns: 1fr; } .library-filter-row { align-items: stretch; } .book-grouping, .content-filter { overflow-x: auto; } }
.library-card[hidden] { display: none; }
.content-filter-empty { margin-top: 1rem; }
.library-card { position: relative; min-width: 0; }
.cover-link { position: relative; display: flex; aspect-ratio: 2 / 3; overflow: hidden; border-radius: .75rem; background: var(--surface-muted); box-shadow: var(--shadow); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.cover-link:hover { transform: translateY(-.25rem); }
.cover-link img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { margin: auto; color: #fff; font-size: 1.2rem; font-weight: 700; }
.card-copy { padding: .75rem .15rem; }
.card-copy h2 { margin: .25rem 0 .5rem; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.card-copy h2 a { color: var(--text); text-decoration: none; }
.format-badge { color: var(--text-muted); font-size: .7rem; font-weight: 700; }
.folder-progress-copy > .progress { height: .35rem; margin-top: .55rem; }
.folder-progress-copy > small { display: block; margin-top: .3rem; color: var(--text-muted); font-size: .72rem; }
.empty-library { padding: 5rem 1rem; border: 1px dashed var(--border); border-radius: 1rem; background: var(--surface-raised); text-align: center; }
.library-breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .85rem; color: var(--text-muted); font-size: .9rem; }
.library-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.library-breadcrumbs a:hover { color: var(--accent); }
.library-breadcrumbs span:last-child { display: none; }
.folder-card .cover-link { position: relative; border: 1px solid var(--border); background: linear-gradient(145deg, var(--surface-muted), var(--surface-raised)); }
.folder-card .cover-link::after { position: absolute; inset: auto 0 0; height: 24%; background: linear-gradient(transparent, rgb(0 0 0 / 42%)); content: ""; pointer-events: none; }
.cover-stack { position: relative; aspect-ratio: 2 / 3; }
.cover-stack::before, .cover-stack::after { position: absolute; border: 1px solid rgb(255 255 255 / 38%); border-radius: .75rem; content: ""; pointer-events: none; }
.cover-stack::before { inset: 0 0 .65rem .65rem; background: linear-gradient(145deg, #7257d8, #4330a5); transform: rotate(1.8deg); }
.cover-stack::after { inset: .32rem .32rem .32rem .32rem; background: linear-gradient(145deg, #f59e42, #d95f3b); transform: rotate(.8deg); }
.cover-stack .cover-link { position: absolute; z-index: 1; inset: .65rem .65rem 0 0; aspect-ratio: auto; }
.cover-stack .cover-link:hover { transform: translateY(-.2rem) rotate(-.4deg); }
.folder-symbol { color: var(--accent); font-size: 3rem; }
.document-type { position: absolute; right: .55rem; bottom: .55rem; z-index: 2; display: grid; min-width: 2.7rem; height: 2.7rem; place-items: center; padding: 0 .4rem; border: 2px solid rgb(255 255 255 / 85%); border-radius: .45rem; box-shadow: 0 .2rem .7rem rgb(0 0 0 / 48%); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .03em; }
.document-type-pdf { background: #c62828; }
.document-type-word { background: #185abd; font-family: Arial, sans-serif; font-size: 1.35rem; }
.read-badge { position: absolute; left: .55rem; bottom: .55rem; z-index: 3; padding: .28rem .5rem; border-radius: 2rem; background: #16834a; box-shadow: 0 .2rem .6rem rgb(0 0 0 / 35%); color: #fff; font-size: .72rem; font-weight: 800; }
.card-context { position: absolute; top: .45rem; right: .45rem; z-index: 10; }
.card-context-toggle { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; padding: 0; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; background: rgb(15 18 24 / 78%); color: #fff; font-size: 1.5rem; line-height: 1; backdrop-filter: blur(5px); }
.card-context .dropdown-menu { min-width: 15rem; }
.context-inline-form { display: grid; gap: .4rem; padding: .5rem 1rem; }
.context-inline-form label { display: grid; gap: .25rem; color: var(--text-muted); font-size: .75rem; }
.context-inline-form input { min-width: 0; width: 100%; padding: .35rem .45rem; }
.context-inline-form button { padding: .35rem .55rem; border: 0; border-radius: .35rem; background: var(--accent); color: #fff; }
.context-cover-form label { cursor: pointer; }
.reader-shell { --reader-controls-height: 0rem; position: fixed; inset: 0; z-index: 1100; display: flex; width: 100%; height: 100%; min-height: 0; flex-direction: column; overflow: hidden; background: var(--reader-surface); color: var(--reader-text); transition: padding-bottom .2s ease; }
.reader-shell.controls-visible { --reader-controls-height: 4rem; padding-bottom: 4rem; }
.reader-toolbar { z-index: 2; display: grid; min-height: 3.5rem; flex: 0 0 auto; grid-template-columns: 1fr minmax(0, 2fr) 1fr; align-items: center; gap: 1rem; padding: .5rem 1rem; background: var(--reader-bar); }
.reader-toolbar strong { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.reader-toolbar > :last-child { text-align: right; }
.reader-toolbar-actions { display: flex; align-items: center; justify-content: end; gap: .65rem; }
.reader-toolbar-actions > a, .reader-toolbar-button { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid #ffffff35; border-radius: 50%; background: transparent; color: var(--reader-text); font-weight: 800; text-decoration: none; }
.reader-page-position { margin-left: .5rem; color: #aeb8c5; font-size: .8em; font-weight: 500; }
.reader-back { color: var(--reader-text); text-decoration: none; }
.comic-reader { min-height: 0; flex: 1; display: grid; align-items: center; overflow: hidden; touch-action: pan-y pinch-zoom; }
.comic-reader { --reader-zoom: 1; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); justify-content: center; overflow: auto; }
.comic-reader.right-to-left { direction: rtl; }
.comic-reader img { display: block; width: auto; height: auto; max-width: calc(100% * var(--reader-zoom)); max-height: calc((100vh - 3.5rem - var(--reader-controls-height)) * var(--reader-zoom)); margin: auto; object-fit: contain; cursor: pointer; }
.comic-reader.spread img { max-width: calc(50vw * var(--reader-zoom)); }
.comic-reader.fit-height img { width: auto; height: calc((100vh - 3.5rem - var(--reader-controls-height)) * var(--reader-zoom)); max-width: none; max-height: none; }
.comic-reader.fit-width img { width: calc(100% * var(--reader-zoom)); height: auto; max-width: none; max-height: none; }
.comic-reader.fit-width.spread img { width: calc(50vw * var(--reader-zoom)); }
.page-scrubber { display: flex; align-items: center; gap: .75rem; padding: .35rem 1rem; background: var(--reader-bar); color: var(--reader-text); }
.page-scrubber input { flex: 1; accent-color: #78a9ff; }
.page-scrubber output { min-width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.reader-shell:not(.controls-visible) .page-scrubber { display: none; }
.page-controls { position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; display: flex; min-height: 4rem; align-items: center; justify-content: center; gap: .35rem; padding: .5rem; overflow-x: auto; background: var(--reader-bar); opacity: 0; pointer-events: none; transform: translateY(100%); transition: opacity .18s ease, transform .18s ease; }
.reader-shell.controls-visible .page-controls { opacity: 1; pointer-events: auto; transform: translateY(0); }
.page-controls button { min-width: 2.6rem; min-height: 2.6rem; border: 1px solid #ffffff26; border-radius: .5rem; background: #ffffff0d; color: var(--reader-text); font-size: 1.35rem; }
.page-controls button:hover:not(:disabled) { background: #ffffff1c; }
.page-controls button:disabled { opacity: .3; }
.page-controls .reader-fit-button { min-width: 5.25rem; padding-inline: .55rem; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.page-controls label { display: flex; align-items: center; gap: .4rem; margin: 0 .35rem; }
.page-controls input { width: 4rem; padding: .45rem; border-color: #ffffff26; background: #090b0f; color: var(--reader-text); text-align: center; }
.next-comic-card { position: fixed; right: 1.25rem; bottom: calc(1.25rem + var(--reader-controls-height)); z-index: 1200; display: grid; grid-template-columns: 7rem minmax(12rem, 18rem); gap: 1rem; width: min(28rem, calc(100vw - 2rem)); padding: 1rem; border: 1px solid #ffffff2b; border-radius: .9rem; background: #171b22f2; box-shadow: 0 .8rem 2.5rem rgb(0 0 0 / 55%); color: #f5f7fa; backdrop-filter: blur(12px); transition: bottom .2s ease; }
.next-comic-card[hidden] { display: none; }
.next-comic-card > div { display: flex; min-width: 0; flex-direction: column; align-items: start; justify-content: center; gap: .55rem; }
.next-comic-card small { color: #aeb8c5; }
.next-comic-card strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.next-comic-cover { display: flex; aspect-ratio: 2 / 3; overflow: hidden; border-radius: .55rem; background: #292f39; color: #fff; text-decoration: none; }
.next-comic-cover img { width: 100%; height: 100%; object-fit: cover; }
.next-comic-cover span { margin: auto; font-weight: 700; }
.next-comic-close { position: absolute; top: .35rem; right: .45rem; border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; }
.next-comic-finished { grid-column: 1 / -1; padding: .6rem; }
.control-divider { width: 1px; height: 1.8rem; margin: 0 .25rem; background: #ffffff26; }
.epub-reader { position: relative; min-height: 0; flex: 1; display: flex; background: #e9e7e1; }
.epub-viewer { min-width: 0; flex: 1; height: 100%; overflow: hidden; background: #f7f2e8; }
.epub-viewer iframe { border: 0 !important; background: transparent; }
.epub-status { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; background: var(--surface-raised); color: var(--text); text-align: center; }
.epub-status[hidden] { display: none; }
.epub-status small { color: var(--text-muted); }
.epub-status.error { color: #b42318; }
.epub-controls #epub-position { min-width: 12rem; color: var(--reader-text); text-align: center; font-variant-numeric: tabular-nums; }
#epub-toc { width: min(22rem, 85vw); padding: 1rem; overflow: auto; background: var(--reader-bar); color: var(--reader-text); }
#epub-toc strong { display: block; margin-bottom: .75rem; }
#epub-toc button { display: block; width: 100%; padding: .6rem; border: 0; border-radius: .35rem; background: transparent; color: inherit; text-align: left; }
#epub-toc button:hover, #epub-toc button.active { background: #ffffff18; }
.document-reader { flex: 1; width: 100%; border: 0; background: white; }
.epub-message { margin: auto; max-width: 35rem; padding: 2rem; text-align: center; }
.dropdown-menu, .admin-card { border-color: var(--border); background: var(--surface-raised); color: var(--text); }
.dropdown-item { color: var(--text); }
.dropdown-item:hover { background: var(--surface-muted); color: var(--text); }
.admin-heading { display: flex; align-items: end; justify-content: space-between; margin: 2rem 0; }
.admin-table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.admin-table small, .admin-table strong { display: block; }
.user-row { display: grid; grid-template-columns: minmax(10rem, 1fr) auto auto minmax(8rem, auto) auto; align-items: center; gap: .75rem; }
.search-bar, .root-form { display: flex; align-items: end; gap: .75rem; margin-bottom: 1.5rem; }
.search-bar input { max-width: 32rem; }
.root-form label { flex: 1; }
.root-list, .publication-admin-list { display: grid; gap: .75rem; }
.admin-card { padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; box-shadow: 0 .15rem .6rem rgb(0 0 0 / 5%); }
.root-list .admin-card { display: flex; align-items: center; justify-content: space-between; }
.scan-root-card > div:first-child { display: grid; min-width: 0; flex: 1; gap: .35rem; }
.scan-root-card .progress { max-width: 36rem; }
.scan-state { width: max-content; padding: .15rem .45rem; border-radius: 2rem; background: var(--surface-muted); color: var(--text-muted); font-size: .72rem; font-weight: 750; }
.scan-state-scanning { background: #dbe8ff; color: #174ea6; }.scan-state-paused { background: #fff0c2; color: #7a4f00; }.scan-state-failed { background: #fee4e2; color: #b42318; }
.root-actions { display: flex; gap: .5rem; }
.scan-pending { color: var(--accent); font-weight: 600; }
.root-list code, .root-list small { display: block; margin-top: .3rem; }
.admin-card summary { display: grid; grid-template-columns: 5rem minmax(12rem, 2fr) minmax(10rem, 1fr) auto; align-items: center; gap: 1rem; cursor: pointer; }
.availability { padding: .25rem .5rem; border-radius: 1rem; background: var(--surface-muted); color: var(--text-muted); font-size: .75rem; }
.availability.available { background: #23863624; color: #3fb950; }
.metadata-form { display: grid; gap: 1rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.metadata-form > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; }
.metadata-form label:not(.form-check) { display: grid; gap: .3rem; color: var(--text-muted); font-size: .85rem; }
.metadata-form .btn { justify-self: start; }
.cover-editor { display: grid; grid-template-columns: 7rem minmax(0, 1fr); align-items: center; gap: 1rem; }
.cover-editor > img, .cover-placeholder { width: 7rem; aspect-ratio: 2 / 3; border: 1px solid var(--border); border-radius: .5rem; background: var(--surface-muted); object-fit: cover; }
.cover-placeholder { display: grid; place-items: center; padding: .5rem; color: var(--text-muted); text-align: center; }
.cover-editor label { display: grid; gap: .45rem; color: var(--text-muted); }
.cover-editor small { font-weight: 400; }
.folder-cover-layout { display: grid; grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.folder-cover-list { display: grid; gap: .65rem; }
.folder-cover-list .admin-card { display: grid; grid-template-columns: 4rem minmax(0, 1fr); align-items: center; gap: .8rem; padding: .65rem; color: inherit; text-decoration: none; }
.folder-cover-list .admin-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.folder-cover-list img { width: 4rem; aspect-ratio: 2 / 3; border-radius: .35rem; object-fit: cover; }
.folder-cover-list span { display: grid; min-width: 0; gap: .15rem; }
.folder-cover-list strong, .folder-cover-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-cover-list em { color: var(--accent); font-size: .75rem; font-style: normal; font-weight: 700; }
.folder-cover-picker { min-width: 0; }
.folder-cover-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.folder-cover-picker-heading h2 { margin: 0; }
.cover-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .8rem; }
.cover-choice { min-width: 0; }
.cover-choice button { display: grid; width: 100%; height: 100%; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: .65rem; background: var(--surface-raised); color: var(--text); text-align: left; }
.cover-choice.selected button { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.cover-choice img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.cover-choice span { display: grid; gap: .2rem; padding: .55rem; }
.cover-choice strong, .cover-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-cover-empty { min-height: 12rem; display: grid; place-items: center; color: var(--text-muted); }
.shortcut-page { max-width: 62rem; margin-inline: auto; }
.shortcut-intro { color: var(--text-muted); }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.shortcut-card { padding: 1rem; border: 1px solid var(--border); border-radius: .8rem; background: color-mix(in srgb, var(--surface-raised) 90%, transparent); }
.shortcut-card h2 { margin-bottom: .8rem; font-size: 1.1rem; }
.shortcut-list { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .55rem .9rem; margin: 0; }
.shortcut-list dt, .shortcut-list dd { margin: 0; }
.shortcut-list dd { color: var(--text-muted); }
.shortcut-list kbd { display: inline-block; min-width: 2rem; margin: .08rem; padding: .2rem .42rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: .3rem; background: var(--surface-muted); color: var(--text); text-align: center; }
.ajax-status { position: fixed; right: 1rem; bottom: 1rem; z-index: 1300; max-width: min(24rem, calc(100vw - 2rem)); padding: .7rem 1rem; border-radius: .55rem; background: #166534; box-shadow: var(--shadow); color: #fff; }
.ajax-status.error { background: #b42318; }
@media (max-width: 850px) { .folder-cover-layout { grid-template-columns: 1fr; } .folder-cover-list { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); } }
@media (max-width: 700px) { .root-form { align-items: stretch; flex-direction: column; } .admin-card summary { grid-template-columns: 1fr; gap: .25rem; } }
@media (max-width: 900px) { .user-row { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .reader-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; } .page-controls { gap: .2rem; overflow-x: auto; justify-content: start; } .page-controls button { min-width: 2.35rem; } .page-controls input { width: 3.5rem; } .theme-picker { margin: .5rem 0; width: max-content; } #epub-toc { position: absolute; inset: 0 auto 0 0; z-index: 2; display: none; } #epub-toc.open { display: block; } }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
