:root {
    --bg: #080d12;
    --bg-deep: #060a0e;
    --surface: #0e151c;
    --surface-2: #131d26;
    --surface-3: #18242f;
    --line: #22313d;
    --line-soft: rgba(137, 171, 186, .14);
    --text: #edf7f7;
    --text-soft: #8fa4ad;
    --muted: #667b84;
    --primary: #19d3c5;
    --primary-strong: #0eb3ab;
    --primary-deep: #096c6b;
    --primary-soft: rgba(25, 211, 197, .12);
    --success: #45d391;
    --danger: #ef6262;
    --warning: #f1ba5f;
    --radius: 9px;
    --radius-lg: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, .34);
    color: var(--text);
    background: var(--bg);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* clip evita el desbordamiento horizontal sin crear un contenedor que rompa position: sticky. */
html, body { min-height: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 3px solid rgba(25, 211, 197, .45); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-soft); }
.scan-container { width: min(1260px, calc(100% - 40px)); margin-inline: auto; }
.eyebrow { margin-bottom: 7px; color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.brand { display: inline-flex; min-height: 40px; align-items: center; gap: 9px; font-size: .96rem; font-weight: 700; white-space: nowrap; }
.brand em { color: var(--primary); font-style: normal; font-weight: 800; }
.brand-mark { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: transparent; color: inherit; font-size: 0; box-shadow: 0 0 22px rgba(25, 211, 197, .22); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 66px;
    padding: 0 max(20px, calc((100vw - 1260px) / 2));
    border-bottom: 1px solid var(--line-soft);
    gap: 16px;
    background: rgba(7, 12, 17, .94);
    box-shadow: 0 7px 24px rgba(0,0,0,.16);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.site-header nav { display: flex; align-items: center; justify-content: center; gap: 24px; color: #b3c1c7; font-size: .78rem; font-weight: 650; }
.site-header nav a { position: relative; padding: 24px 8px; }
.site-header nav a::after { position: absolute; right: 50%; bottom: 0; left: 50%; height: 2px; background: var(--primary); content: ""; transition: right .2s, left .2s; }
.site-header nav a:hover { color: white; }
.site-header nav a:hover::after { right: 0; left: 0; }
.mobile-menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3.5px;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.mobile-menu-toggle:hover,
.mobile-menu-toggle[aria-expanded="true"] {
    border-color: rgba(25, 211, 197, 0.45);
    background: var(--surface-2);
    color: var(--primary);
}
.mobile-menu-toggle:active {
    transform: scale(0.95);
}
.mobile-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 0;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s ease, opacity .2s ease;
}
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
.header-search { display: flex; min-width: 0; height: 40px; margin-left: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.header-search input { min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; background: transparent; color: var(--text); flex: 1; font-size: .76rem; }
.header-search input::placeholder { color: #60727a; }
.header-search button { width: 42px; min-width: 42px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 1.2rem; }
.header-search:focus-within { border-color: var(--primary-strong); box-shadow: 0 0 0 3px var(--primary-soft); }

.header-user-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.header-notifications { position: relative; display: flex; align-items: center; }
.notifications-bell { position: relative; display: grid; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: #92a4ac; cursor: pointer; place-items: center; transition: background .2s, border-color .2s, color .2s; }
.notifications-bell:hover, .notifications-bell[aria-expanded="true"] { border-color: rgba(25, 211, 197, 0.4); background: var(--surface-2); color: var(--primary); }
.notifications-bell.has-unread { color: var(--primary); box-shadow: 0 0 12px rgba(25, 211, 197, 0.25); }
.unread-badge { position: absolute; top: -3px; right: -3px; display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; align-items: center; justify-content: center; background: #ff4757; color: #ffffff; font-size: .62rem; font-weight: 900; line-height: 1; box-shadow: 0 0 8px rgba(255, 71, 87, 0.6); }
.unread-badge.is-hidden { display: none; }

.notifications-dropdown { position: absolute; top: calc(100% + 10px); right: 0; width: min(340px, 90vw); border: 1px solid rgba(164, 231, 226, 0.18); border-radius: 12px; background: linear-gradient(145deg, rgba(14, 24, 30, 0.98), rgba(9, 16, 21, 0.99)); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(20px); z-index: 100; overflow: hidden; animation: dropdownFade .18s ease-out; }
@keyframes dropdownFade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.notifications-dropdown-header { display: flex; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.02); }
.notifications-dropdown-header strong { color: var(--text); font-size: .82rem; }
.mark-all-read-btn { padding: 0; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: .68rem; font-weight: 750; }
.mark-all-read-btn:hover { text-decoration: underline; }
.notifications-list { max-height: 360px; overflow-y: auto; }
.notification-item { display: grid; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; transition: background .18s; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: rgba(25, 211, 197, 0.06); }
.notification-item.is-unread { background: rgba(25, 211, 197, 0.09); border-left: 3px solid var(--primary); }
.notification-icon { display: grid; width: 32px; height: 32px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); place-items: center; font-size: .9rem; }
.notification-content { min-width: 0; }
.notification-title { color: var(--text); font-size: .76rem; font-weight: 750; line-height: 1.25; }
.notification-message { margin-top: 3px; color: #9cb1b6; font-size: .7rem; }
.notification-time { display: block; margin-top: 5px; color: var(--muted); font-size: .6rem; }
.notifications-empty { padding: 28px 20px; text-align: center; }
.notifications-empty p { margin: 0 0 4px; color: var(--text); font-size: .8rem; font-weight: 750; }
.notifications-empty small { color: var(--text-soft); font-size: .68rem; }

.account-link { display: inline-flex; min-height: 42px; max-width: 180px; padding: 4px 8px 4px 5px; border: 1px solid var(--line); border-radius: 999px; align-items: center; gap: 7px; color: #dce8e9; font-size: .68rem; font-weight: 750; }
.account-link:hover { border-color: rgba(25,211,197,.45); color: var(--primary); }
.account-link-avatar { display: grid; width: 31px; height: 31px; border-radius: 50%; place-items: center; background: linear-gradient(145deg, var(--primary), #087d79); color: #031211; font-size: .72rem; font-weight: 900; }
.account-link-name { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link-guest { padding-right: 11px; }
.header-auth-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 7px 16px; border-radius: 8px; font-size: .84rem; font-weight: 750; white-space: nowrap; transition: background .18s, border-color .18s, transform .16s; }
.header-auth-btn:hover { transform: translateY(-1px); }
.badge-nsfw { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; background: #ff4757; color: #ffffff; font-size: .78rem; font-weight: 850; letter-spacing: .02em; margin-left: 6px; vertical-align: middle; }
.nav-admin { padding: 8px 12px; border: 1px solid rgba(25,211,197,.3); border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 750; }
.role-badge { display: inline-flex; margin-left: 5px; padding: 2px 6px; border: 1px solid rgba(241,186,95,.38); border-radius: 999px; align-items: center; background: rgba(241,186,95,.12); color: #f1ba5f; font-size: .52rem; font-weight: 850; letter-spacing: .04em; line-height: 1.25; text-transform: uppercase; vertical-align: middle; }
.role-badge-large { padding: 4px 8px; font-size: .58rem; vertical-align: .25em; }
.moderator-nav-mobile { display: none; }
.moderator-nav-desktop { min-height: 38px; padding: 7px 12px; font-size: .7rem; white-space: nowrap; }
.account-moderator-button { margin-left: auto; white-space: nowrap; }

.scan-hero { position: relative; padding: 30px 0 34px; overflow: hidden; border-bottom: 1px solid var(--line-soft); background: radial-gradient(circle at 50% 0%, rgba(25,211,197,.08), transparent 42%), var(--bg-deep); }
.hero-slides-wrapper { position: relative; width: min(1260px, calc(100% - 40px)); min-height: 0; margin-inline: auto; overflow: hidden; border-radius: 14px; touch-action: pan-y; cursor: grab; }
.hero-slides-wrapper:active { cursor: grabbing; }
.hero-slides { display: grid; width: calc(var(--hero-count, 3) * 50%); min-height: 0; grid-template-columns: repeat(var(--hero-count, 3), minmax(0, 1fr)); gap: 18px; transition: transform .5s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.hero-slides.is-dragging { transition: none !important; }
.hero-slide { position: relative; min-width: 0; aspect-ratio: 1.68 / 1; overflow: hidden; border: 1px solid rgba(164,231,226,.14); border-radius: 13px; background: var(--surface-2); box-shadow: 0 18px 36px rgba(0,0,0,.26); }
.scan-hero-backdrop { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: center; }
.scan-hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,10,14,.96) 0%, rgba(4,10,14,.72) 38%, rgba(4,10,14,.16) 100%), linear-gradient(0deg, rgba(4,10,14,.8), transparent 56%); }
.scan-hero-content { position: relative; display: flex; min-height: 100%; padding: 28px 30px; align-items: flex-end; }
.scan-hero-copy { max-width: 88%; }
.hero-slide-cover { display: none; }
.hero-badge { display: inline-flex; margin-bottom: 9px; padding: 4px 8px; border: 1px solid rgba(25,211,197,.36); border-radius: 999px; background: rgba(25,211,197,.16); color: var(--primary); font-size: .58rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.scan-hero-copy .eyebrow { display: inline-flex; margin: 0 0 9px 6px; padding: 4px 8px; border-radius: 999px; background: rgba(25,211,197,.12); font-size: .58rem; }
.scan-hero-copy h1 { max-width: 680px; margin-bottom: 10px; overflow-wrap: anywhere; font-size: clamp(1.5rem, 2.8vw, 2.55rem); font-weight: 850; letter-spacing: -.045em; line-height: 1; text-wrap: balance; }
.scan-hero-copy > p:not(.eyebrow) { max-width: 560px; margin-bottom: 13px; color: #c0d0d2; font-size: .72rem; line-height: 1.45; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.hero-actions .button { min-height: 31px; padding: 6px 11px; font-size: .63rem; }
.hero-stats { display: flex; margin-top: 12px; gap: 18px; color: #9aafb2; font-size: .57rem; text-transform: uppercase; }
.hero-stats span { display: flex; align-items: baseline; gap: 5px; }
.hero-stats strong { color: #ecfafa; font-size: .66rem; }
.hero-carousel-arrow { position: absolute; top: 50%; z-index: 10; transform: translateY(-50%); display: grid; width: 46px; height: 46px; padding: 0; border: 1px solid rgba(164,231,226,.22); border-radius: 50%; background: rgba(6,15,20,.78); color: #d9eeee; cursor: pointer; place-items: center; backdrop-filter: blur(12px); font-size: 1.6rem; transition: background .2s, border-color .2s, transform .2s, color .2s; }
.hero-arrow-prev { left: max(20px, calc((100vw - 1260px) / 2)); }
.hero-arrow-next { right: max(20px, calc((100vw - 1260px) / 2)); }
.hero-carousel-arrow:hover { border-color: var(--primary); background: rgba(25,211,197,.2); color: var(--primary); transform: translateY(-50%) scale(1.08); }
.hero-carousel-dots { position: absolute; bottom: 12px; left: 50%; z-index: 10; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid rgba(164,231,226,.15); border-radius: 999px; background: rgba(6,15,20,.75); backdrop-filter: blur(10px); }
.hero-carousel-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.25); cursor: pointer; transition: width .3s ease, background .3s ease, border-radius .3s ease; }
.hero-carousel-dots button:hover { background: rgba(25,211,197,.6); }
.hero-carousel-dots button[aria-selected="true"] { width: 26px; border-radius: 999px; background: var(--primary); box-shadow: 0 0 12px rgba(25,211,197,.5); }

.search-hero { padding: 74px 0 54px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 18% 30%, rgba(25,211,197,.09), transparent 35%), var(--surface); }
.search-hero h1 { margin-bottom: 25px; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.045em; }
.search-form { display: flex; max-width: 600px; height: 47px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.search-form input { min-width: 0; padding: 0 15px; border: 0; outline: 0; background: transparent; color: var(--text); flex: 1; }
.search-form button { padding: 0 24px; border: 0; border-radius: 0 7px 7px 0; background: var(--primary); color: #031313; cursor: pointer; font-weight: 800; }

.button { display: inline-flex; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 6px; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: .77rem; font-weight: 760; transition: transform .16s, background .16s, border-color .16s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, var(--primary), #0faeaa); color: #021313; box-shadow: 0 8px 24px rgba(25,211,197,.16); }
.button-primary:hover { background: #35e1d5; }
.button-secondary { border-color: var(--line); background: var(--surface-2); color: #d8e4e5; }
.button-secondary:hover { border-color: #3d5360; background: var(--surface-3); }
.button-glass { border-color: rgba(255,255,255,.17); background: rgba(15,23,30,.66); color: white; backdrop-filter: blur(8px); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--text-soft); }
.button-danger { background: rgba(239,98,98,.12); color: #ff8a8a; border-color: rgba(239,98,98,.22); }
.button-wide { width: 100%; }

.scan-section { padding-block: 55px; }
.section-heading { display: flex; margin-bottom: 26px; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.25rem); letter-spacing: -.035em; }
.section-heading > a { display: inline-flex; min-height: 40px; align-items: center; color: var(--primary); font-size: .75rem; font-weight: 750; }
.compact-heading { margin-bottom: 21px; }
.compact-heading h2 { font-size: 1.35rem; letter-spacing: -.025em; }

.update-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.update-card { display: flex; flex-direction: column; min-width: 0; padding: 7px; border: 1px solid var(--line-soft); border-radius: 10px; background: linear-gradient(145deg, var(--surface-2), #0e161d); transition: transform .2s, border-color .2s; }
.update-card:hover { border-color: rgba(25,211,197,.35); transform: translateY(-3px); }
.update-cover { display: block; overflow: hidden; aspect-ratio: 2/2.5; border-radius: 7px; background: var(--surface-3); flex-shrink: 0; }
.update-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.update-card:hover .update-cover img { transform: scale(1.035); }
.update-card-body { display: flex; flex-direction: column; flex: 1; padding: 8px 2px 2px; }
.update-card h3 { min-height: 34px; margin-bottom: 8px; overflow: hidden; font-size: .82rem; line-height: 1.28; font-weight: 700; }
.update-card h3 a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.update-card h3 a:hover { color: var(--primary); }
.update-chapters { display: flex; flex-direction: column; gap: 5px; margin-top: auto; }
.chapter-chip { display: flex; min-height: 28px; padding: 4px 8px; border-radius: 5px; align-items: center; justify-content: space-between; gap: 6px; background: var(--primary-soft); color: #b9edeb; font-size: .66rem; font-weight: 700; text-decoration: none; transition: background .18s, color .18s; }
.chapter-chip:hover { background: rgba(25, 211, 197, 0.22); color: #ffffff; }
.chapter-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-chip time { color: #6f9598; font-weight: 500; font-size: .6rem; flex-shrink: 0; }

.home-columns { display: grid; padding-top: 28px; padding-bottom: 75px; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 42px; }
.catalog-main { min-width: 0; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px 17px; }
.book-card { min-width: 0; }
.cover-wrap { position: relative; display: block; overflow: hidden; aspect-ratio: 2/2.82; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-2); box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.cover-wrap::after { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,9,12,.28), transparent 35%); content: ""; opacity: 0; transition: opacity .25s; }
.cover-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.book-card:hover .cover-wrap img { transform: scale(1.035); }
.book-card:hover .cover-wrap::after { opacity: 1; }
.cover-placeholder { display: flex; width: 100%; height: 100%; padding: 17px; align-items: center; justify-content: space-between; flex-direction: column; background: linear-gradient(145deg, #12373a, #0c171e 72%); color: white; }
.cover-placeholder b { margin: auto; color: var(--primary); font-size: 4.5rem; font-weight: 800; }
.cover-placeholder small { align-self: flex-start; color: var(--text-soft); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }
.status-pill { position: absolute; z-index: 2; top: 9px; right: 9px; padding: 5px 7px; border: 1px solid rgba(25,211,197,.22); border-radius: 5px; background: rgba(5,13,17,.82); color: var(--primary); font-size: .56rem; font-weight: 800; text-transform: uppercase; backdrop-filter: blur(6px); }
.book-card-body { padding: 12px 2px 0; }
.book-card-body h3 { margin-bottom: 5px; overflow: hidden; font-size: .86rem; line-height: 1.28; text-overflow: ellipsis; white-space: nowrap; }
.book-card-body h3 a { display: flex; min-height: 36px; align-items: center; }
.book-card-body h3 a:hover { color: var(--primary); }
.book-card-body p { margin: 0; color: var(--text-soft); font-size: .68rem; }
.recent-panel { position: sticky; top: 92px; padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface); }
.recent-panel .section-heading { padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.chapter-feed > a { display: grid; padding: 13px 0; border-bottom: 1px solid var(--line-soft); grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.chapter-feed > a:last-child { border-bottom: 0; }
.chapter-feed > a:hover strong { color: var(--primary); }
.feed-number { color: var(--primary-deep); font-size: .67rem; font-weight: 800; }
.chapter-feed strong { display: block; overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.chapter-feed small { display: block; margin-top: 3px; color: var(--text-soft); font-size: .64rem; }
.chapter-feed time { color: var(--muted); font-size: .61rem; }
.pagination { display: flex; margin-top: 34px; justify-content: center; gap: 7px; }
.pagination a { display: grid; width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 6px; place-items: center; color: var(--text-soft); font-size: .73rem; }
.pagination a.active, .pagination a:hover { border-color: var(--primary); background: var(--primary); color: #031313; }

.most-viewed-section { padding-top: 12px; }
.most-viewed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.most-viewed-card { display: grid; min-width: 0; padding: 9px; border: 1px solid var(--line-soft); border-radius: 9px; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; background: var(--surface); }
.most-viewed-cover { overflow: hidden; aspect-ratio: 2/2.8; border-radius: 6px; background: var(--surface-3); }
.most-viewed-cover img { width: 100%; height: 100%; object-fit: cover; }
.most-viewed-body { min-width: 0; padding-top: 1px; }
.most-viewed-body .rank { margin-bottom: 4px; color: var(--primary); font-size: .63rem; font-weight: 850; }
.most-viewed-body h3 { margin-bottom: 6px; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.25; }
.most-viewed-body h3 a:hover, .directory-card h3 a:hover { color: var(--primary); }
.most-viewed-body .muted, .directory-card-body .muted { margin-bottom: 8px; font-size: .64rem; }
.trending-section { padding-top: 32px; padding-bottom: 40px; }
.trending-panel { min-width: 0; padding: 28px 30px 24px; border: 1px solid rgba(164,231,226,.14); border-radius: 14px; background: linear-gradient(135deg, rgba(14,26,32,.95), rgba(9,16,21,.98)); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.trending-panel-heading { display: flex; margin-bottom: 22px; align-items: center; justify-content: space-between; gap: 18px; }
.trending-title { display: flex; min-width: 0; align-items: center; gap: 12px; }
.trending-title h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -.035em; }
.trending-icon { display: grid; width: 40px; height: 40px; border-radius: 9px; background: rgba(25,211,197,.15); color: var(--primary); font-size: 1.2rem; place-items: center; }
.trending-all { display: inline-flex; min-height: 38px; padding: 0 16px; border-radius: 8px; align-items: center; background: var(--primary); color: #031313; font-size: .78rem; font-weight: 850; white-space: nowrap; }
.trending-all:hover { background: #45e5da; }

.discord-banner-section { margin-top: 15px; margin-bottom: 25px; }
.discord-banner-card { position: relative; overflow: hidden; padding: 26px 36px; border: 1px solid rgba(88, 101, 242, 0.35); border-radius: 14px; background: linear-gradient(135deg, rgba(17, 20, 36, 0.95), rgba(10, 12, 23, 0.98)); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); }
.discord-banner-glow { position: absolute; top: -50%; left: 50%; width: 500px; height: 300px; transform: translateX(-50%); background: radial-gradient(circle, rgba(88, 101, 242, 0.25) 0%, transparent 70%); pointer-events: none; }
.discord-banner-content { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.discord-icon-badge { display: grid; width: 58px; height: 58px; min-width: 58px; border-radius: 14px; background: #5865F2; color: #ffffff; place-items: center; box-shadow: 0 0 24px rgba(88, 101, 242, 0.55); }
.discord-copy { flex: 1; min-width: 240px; }
.discord-copy h2 { margin: 0 0 6px; font-size: clamp(1.15rem, 2vw, 1.45rem); color: #ffffff; letter-spacing: -.02em; }
.discord-copy p { margin: 0; color: #a4b0c2; font-size: .82rem; line-height: 1.5; max-width: 640px; }
.discord-button { display: inline-flex; min-height: 44px; padding: 0 22px; border-radius: 999px; align-items: center; gap: 8px; background: #5865F2; color: #ffffff; font-weight: 850; font-size: .83rem; box-shadow: 0 0 20px rgba(88, 101, 242, 0.45); transition: background .2s, transform .2s, box-shadow .2s; }
.discord-button:hover { background: #4752C4; color: #ffffff; transform: translateY(-2px); box-shadow: 0 0 28px rgba(88, 101, 242, 0.7); }

.trending-scroll-wrapper { position: relative; width: 100%; }
.trending-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.07);
}
.trending-grid:active { cursor: grabbing; }

/* Custom Glowing Teal Scrollbar for Trending Grid */
.trending-grid::-webkit-scrollbar {
    height: 7px;
}
.trending-grid::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    margin-inline: 2px;
}
.trending-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(90deg, #0eb3ab, var(--primary));
    box-shadow: 0 0 10px rgba(25, 211, 197, 0.45);
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}
.trending-grid::-webkit-scrollbar-thumb:hover {
    background: #3ee8dc;
    box-shadow: 0 0 16px rgba(25, 211, 197, 0.8);
}

.trending-card { position: relative; display: flex; flex: 0 0 162px; width: 162px; min-height: 100%; border: 0; flex-direction: column; background: transparent; scroll-snap-align: start; }
.trending-card:hover { transform: translateY(-2px); }
.trending-cover { display: block; overflow: hidden; aspect-ratio: 3/4; border: 1px solid rgba(164,231,226,.13); border-radius: 8px; background: var(--surface-3); }
.trending-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.trending-card:hover .trending-cover img { transform: scale(1.035); }
.trending-body { display: flex; min-width: 0; padding: 11px 1px 0; flex: 1; flex-direction: column; }
.trending-body h3 { margin: 0 0 5px; overflow: hidden; font-size: .9rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.trending-body h3 a:hover { color: var(--primary); }
.trending-chapter { display: block; margin-bottom: 7px; overflow: hidden; color: #a8b1b4; font-size: .78rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.trending-rating { display: flex; margin-top: auto; align-items: center; gap: 6px; color: #ffd22e; font-size: .82rem; font-weight: 850; letter-spacing: .03em; }
.trending-rating b { color: #9ca6a9; font-size: .72rem; letter-spacing: 0; }
.popular-panel { padding-inline: 20px; }
.popular-heading { align-items: flex-start; }
.popular-tabs { display: inline-flex; padding: 3px; border-radius: 6px; background: rgba(4,10,14,.62); gap: 2px; }
.popular-tabs span { padding: 6px 7px; border-radius: 4px; color: var(--text-soft); font-size: .59rem; white-space: nowrap; }
.popular-tabs span.active { background: var(--primary); color: #031313; font-weight: 800; }
.popular-list { display: grid; margin: 0; padding: 0; list-style: none; gap: 13px; }
.popular-item { display: grid; min-width: 0; grid-template-columns: 22px 47px minmax(0,1fr); align-items: center; gap: 9px; }
.popular-rank { display: grid; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .68rem; font-weight: 850; place-items: center; }
.popular-item:first-child .popular-rank { background: var(--primary); color: #031313; }
.popular-thumb { display: block; overflow: hidden; aspect-ratio: 2/2.75; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--surface-3); }
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-copy { min-width: 0; }
.popular-copy h3 { margin: 0 0 4px; overflow: hidden; font-size: .75rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.popular-copy h3 a:hover { color: var(--primary); }
.popular-copy p { margin: 0 0 5px; overflow: hidden; color: var(--text-soft); font-size: .59rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.popular-rating { color: #f7d354; font-size: .64rem; letter-spacing: .03em; white-space: nowrap; }
.popular-rating b { margin-left: 5px; color: var(--text-soft); font-size: .61rem; letter-spacing: 0; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.genre-chips span, .genre-chips a { padding: 4px 6px; border: 1px solid rgba(25,211,197,.18); border-radius: 4px; background: var(--primary-soft); color: #8bd8d2; font-size: .56rem; font-weight: 700; }
.genre-chips a:hover { border-color: rgba(25,211,197,.55); color: white; }

.directory-hero { padding: 64px 0 48px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 17% 25%, rgba(25,211,197,.12), transparent 35%), var(--surface); }
.directory-hero h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.05em; }
.directory-hero p:not(.eyebrow) { margin-bottom: 24px; color: var(--text-soft); }
.directory-search { display: flex; width: min(680px, 100%); min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.directory-search input { min-width: 0; padding: 0 14px; border: 0; background: transparent; flex: 1; }
.directory-search .button { margin: 4px; min-height: 38px; }
.directory-section { padding-top: 38px; }
.directory-section-simple { padding-top: 45px; }
.directory-section-simple h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.045em; }
.directory-result-heading { display: flex; margin: 0 0 18px; align-items: baseline; gap: 10px; }
.directory-result-heading .eyebrow { margin: 0; }
.directory-result-heading strong { font-size: 1.05rem; }
.catalog-filters { display: grid; margin-bottom: 42px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 9px; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 11px; background: var(--surface); }
.catalog-filters label { display: flex; color: var(--text-soft); flex-direction: column; gap: 6px; font-size: .65rem; font-weight: 700; }
.catalog-filters select { min-height: 42px; }
.catalog-filters .button { min-height: 42px; }
.directory-heading { margin-bottom: 22px; }
.directory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
.directory-card { min-width: 0; padding: 7px; border: 1px solid var(--line-soft); border-radius: 9px; background: linear-gradient(145deg, var(--surface-2), #0e161d); }
.directory-cover { display: block; overflow: hidden; aspect-ratio: 2/2.75; border-radius: 6px; background: var(--surface-3); }
.directory-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.directory-card:hover .directory-cover img { transform: scale(1.035); }
.directory-card-body { padding: 10px 4px 4px; }
.directory-card-title { display: flex; min-height: 38px; align-items: flex-start; justify-content: space-between; gap: 7px; }
.directory-card h3 { margin: 0; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.25; }
.directory-card-title .badge { flex: 0 0 auto; font-size: .48rem; }
.empty-state { padding: 55px 25px; border: 1px dashed #314550; border-radius: 10px; background: var(--surface); text-align: center; }
.empty-state > span { color: var(--primary); font-size: .7rem; text-transform: uppercase; }
.empty-state h3 { margin: 10px 0; font-size: 1.45rem; }
.empty-state p { margin: 0; color: var(--text-soft); }
.site-footer { display: flex; min-height: 130px; padding: 32px max(20px, calc((100vw - 1260px) / 2)); border-top: 1px solid var(--line); align-items: center; justify-content: space-between; background: #060a0e; color: var(--text-soft); font-size: .73rem; }
.site-footer p { margin: 13px 0 0; }

.account-hero { padding: 45px 0; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 15% 20%, rgba(25,211,197,.13), transparent 34%), var(--surface); }
.account-hero-inner { display: flex; min-width: 0; align-items: center; gap: 16px; }
.account-avatar { display: grid; width: 62px; height: 62px; flex: 0 0 auto; border: 1px solid rgba(25,211,197,.35); border-radius: 50%; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.35rem; font-weight: 850; }
.account-hero h1 { margin: 0 0 5px; overflow-wrap: anywhere; font-size: clamp(1.75rem, 4vw, 2.8rem); letter-spacing: -.045em; }
.account-hero p:not(.eyebrow) { margin: 0; color: var(--text-soft); font-size: .8rem; }
.account-logout { margin-left: auto; }
.account-grid { display: grid; padding-top: 42px; padding-bottom: 75px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 30px; }
.account-section { margin-bottom: 40px; }
.account-favorites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.account-favorite-card { display: grid; min-width: 0; padding: 8px; border: 1px solid var(--line-soft); border-radius: 8px; grid-template-columns: 64px minmax(0, 1fr); gap: 11px; background: var(--surface); }
.account-favorite-cover { overflow: hidden; aspect-ratio: 2/2.75; border-radius: 5px; background: var(--surface-3); }
.account-favorite-cover img { width: 100%; height: 100%; object-fit: cover; }
.account-favorite-card h3 { margin: 3px 0 5px; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.25; }
.account-favorite-card h3 a:hover { color: var(--primary); }
.account-favorite-card .muted { margin-bottom: 8px; font-size: .64rem; }
.account-favorite-card .genre-chips { gap: 4px; }
.account-favorite-card .genre-chips a { padding: 4px 5px; font-size: .52rem; }
.account-history { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); }
.account-history a { display: grid; min-height: 58px; padding: 9px 13px; border-bottom: 1px solid var(--line-soft); grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.account-history a:last-child { border-bottom: 0; }
.account-history a:hover strong { color: var(--primary); }
.history-icon { display: grid; width: 25px; height: 25px; border-radius: 6px; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .7rem; }
.account-history strong, .account-history small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-history strong { font-size: .72rem; }
.account-history small { margin-top: 3px; color: var(--text-soft); font-size: .63rem; }
.account-history time { color: var(--muted); font-size: .6rem; }
.expand-button { width: 100%; margin-top: 14px; min-height: 40px; border-color: var(--line-soft); background: var(--surface-2); color: var(--text-soft); font-size: .74rem; font-weight: 750; }
.expand-button:hover { border-color: rgba(25,211,197,.35); background: var(--surface-3); color: var(--primary); }
.account-comments { display: flex; flex-direction: column; gap: 10px; }
.account-comment-card { padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); }
.account-comment-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.comment-target a { color: var(--text); font-size: .78rem; }
.comment-target a:hover { color: var(--primary); }
.comment-target small { color: var(--text-soft); font-size: .7rem; }
.account-comment-header time { color: var(--muted); font-size: .6rem; }
.account-comment-body { margin: 0 0 8px; color: #b7c7cb; font-size: .75rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.comment-delete-link { padding: 0; border: 0; background: none; color: #ef8888; cursor: pointer; font-size: .62rem; font-weight: 700; }
.comment-delete-link:hover { color: #ffb1b1; text-decoration: underline; }
.account-profile-card { position: sticky; top: 90px; }
.account-profile-card .button { width: 100%; }
.account-grid-simple { display: block; max-width: 960px; }
.account-settings { max-width: 520px; margin-top: 12px; padding: 15px 18px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); }
.account-settings summary { min-height: 38px; color: var(--primary); cursor: pointer; font-size: .72rem; font-weight: 750; }
.account-settings[open] summary { margin-bottom: 15px; }
.compact-empty { padding: 26px 18px; }
.favorite-form { display: inline-flex; }
.page-flash { margin-top: 18px; margin-bottom: 0; }
.community-section { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 35px; }
.community-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.community-grid .panel-card { margin-bottom: 0; }
.community-rating { align-self: start; }
.rating-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rating-summary strong { font-size: 2.4rem; letter-spacing: -.06em; line-height: 1; color: #ffffff; }
.rating-stars-wrapper { position: relative; display: inline-block; font-size: 1.15rem; letter-spacing: .12em; line-height: 1; user-select: none; }
.rating-stars-wrapper .stars-bg { color: rgba(255, 255, 255, 0.16); }
.rating-stars-wrapper .stars-fill { position: absolute; top: 0; left: 0; white-space: nowrap; overflow: hidden; color: #f59e0b; text-shadow: 0 0 10px rgba(245, 158, 11, 0.4); transition: width .3s ease; }
.rating-summary small { width: 100%; margin-top: -4px; color: var(--text-soft); font-size: .67rem; }

.rating-form { display: flex; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); align-items: center; flex-direction: column; gap: 10px; width: 100%; }
.rating-form-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.rating-form-label { color: var(--text-soft); font-size: .68rem; font-weight: 750; }
.rating-clear-btn { background: none; border: 0; padding: 0; color: #ef8888; font-size: .64rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.rating-clear-btn:hover { color: #ff5252; }

.rating-options { display: flex; width: 100%; gap: 6px; }
.rating-star-btn, .rating-star-label { flex: 1; display: inline-flex; min-height: 38px; padding: 0 4px; border: 1px solid var(--line); border-radius: 7px; align-items: center; justify-content: center; color: #c4d4d6; cursor: pointer; font-size: .72rem; font-weight: 750; background: var(--surface-2); transition: all .18s ease; user-select: none; outline: 0; }
.rating-star-btn:hover, .rating-star-label:hover { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.08); color: #fbbf24; transform: translateY(-1px); }
.rating-star-btn.is-selected,
.rating-star-label.is-selected,
.rating-star-label:has(input:checked) { border-color: #f59e0b !important; background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; box-shadow: 0 0 14px rgba(245, 158, 11, 0.25); }
.community-login-note { color: var(--text-soft); font-size: .7rem; }
.community-login-note a { color: var(--primary); font-weight: 750; }
.sr-only, input[name="hp_website_check"] { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; display: none !important; }
.comment-form { display: grid; margin-bottom: 19px; gap: 8px; }
.comment-form label { display: flex; color: #c5d4d6; flex-direction: column; gap: 4px; font-size: .68rem; font-weight: 700; }
.comment-form label small { color: var(--muted); font-weight: 450; }
.comment-form textarea { min-height: 83px; resize: vertical; }
.comment-form .button { justify-self: start; }
.comment-list { border-top: 1px solid var(--line-soft); }
.comment-item { display: grid; position: relative; padding: 16px 0 15px; border-bottom: 1px solid var(--line-soft); grid-template-columns: 32px minmax(0,1fr); align-items: start; gap: 10px; }
.comment-item:last-child { border-bottom: 0; }
.comment-avatar { display: grid; width: 32px; height: 32px; border: 1px solid rgba(25,211,197,.3); border-radius: 50%; place-items: center; background: linear-gradient(145deg, var(--primary-soft), #11252c); color: var(--primary); font-size: .72rem; font-weight: 850; }
.comment-content { min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; }
.comment-meta strong { font-size: .71rem; }
.comment-meta time { color: var(--muted); font-size: .59rem; }
.comment-item p { max-width: 72ch; margin: 7px 0 0; color: #c2d0d2; font-size: .73rem; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-delete { margin-top: 7px; padding: 0; border: 0; background: none; color: #ef8888; cursor: pointer; font-size: .6rem; }
.comment-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.comment-vote-btn { display: inline-flex; min-height: 28px; padding: 3px 9px; border: 1px solid var(--line-soft); border-radius: 6px; align-items: center; gap: 5px; background: rgba(255,255,255,.02); color: #8e9ea4; cursor: pointer; font-size: .68rem; font-weight: 700; transition: all .18s ease; }
.comment-vote-btn svg { flex-shrink: 0; transition: transform .18s ease, stroke .18s ease; }
.comment-vote-btn:hover { border-color: rgba(25,211,197,.35); background: var(--surface-2); color: var(--text); }
.comment-vote-btn:hover svg { transform: scale(1.15); }
.comment-vote-btn:hover .rotate-180 { transform: rotate(180deg) scale(1.15); }
.comment-vote-btn.is-active-like { border-color: rgba(25,211,197,.6); background: var(--primary-soft); color: var(--primary); }
.comment-vote-btn.is-active-like svg { fill: var(--primary); stroke: var(--primary); }
.comment-vote-btn.is-active-dislike { border-color: rgba(239,98,98,.5); background: rgba(239,98,98,.12); color: #ff8888; }
.comment-vote-btn.is-active-dislike svg { fill: #ff8888; stroke: #ff8888; }
.comment-vote-btn .vote-counter { padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,0.05); font-weight: 800; font-size: .65rem; }
.comment-vote-btn.is-active-like .vote-counter { background: rgba(25,211,197,0.2); color: #ffffff; }
.comment-vote-btn.is-active-dislike .vote-counter { background: rgba(239,98,98,0.2); color: #ffffff; }
.comment-action-link { padding: 0; border: 0; background: none; color: #8ea1aa; cursor: pointer; font-size: .65rem; font-weight: 700; }
.comment-action-link:hover { color: var(--primary); }
.comment-delete-form { display: inline-flex; }

.comment-reply-form { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-2); }
.comment-reply-form textarea { width: 100%; min-height: 60px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: .74rem; outline: 0; resize: vertical; }
.comment-reply-form textarea:focus { border-color: var(--primary-strong); }
.reply-form-actions { display: flex; gap: 6px; margin-top: 7px; }
.button-sm { min-height: 32px; padding: 4px 10px; font-size: .68rem; }

.comment-replies { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-left: 12px; border-left: 2px solid rgba(25,211,197,.2); }
.comment-item.is-reply { grid-template-columns: 26px minmax(0,1fr); padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.05); gap: 8px; }
.comment-item.is-reply:last-child { border-bottom: 0; }
.comment-item.is-reply .comment-avatar { width: 26px; height: 26px; font-size: .64rem; }
.comment-reply-target { display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 4px; background: var(--primary-soft); color: var(--primary); font-size: .7rem; font-weight: 750; text-decoration: none; transition: background .18s, color .18s; }
.comment-reply-target:hover { background: var(--primary); color: #0b1518; text-decoration: none; }
.comment-reply-badge { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; margin-bottom: 5px; padding: 5px 10px; border-left: 3px solid var(--primary); border-radius: 0 7px 7px 0; background: linear-gradient(90deg, rgba(25,211,197,.08), rgba(25,211,197,.02)); text-decoration: none; transition: background .18s, border-color .18s; }
.comment-reply-badge:hover { background: linear-gradient(90deg, rgba(25,211,197,.15), rgba(25,211,197,.05)); border-left-color: var(--primary-strong); text-decoration: none; }
.reply-badge-header { display: flex; align-items: center; gap: 5px; }
.reply-badge-icon { color: var(--primary); font-size: .82rem; font-weight: 900; line-height: 1; }
.reply-badge-user { color: var(--primary); font-size: .67rem; font-weight: 750; letter-spacing: .01em; }
.reply-badge-snippet { margin: 0; color: #9bb0b6; font-size: .68rem; font-style: italic; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-badge-spoiler { color: #e6a836; font-style: normal; }
@keyframes commentFlash {
    0% { background: rgba(25,211,197,.35); box-shadow: 0 0 18px rgba(25,211,197,.5); }
    100% { background: transparent; box-shadow: none; }
}
.comment-form-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.spoiler-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; white-space: nowrap; }
.spoiler-switch input { display: none; }
.switch-slider { position: relative; width: 38px; height: 21px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.08); transition: all .25s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0; }
.switch-slider::before { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #9bb0b6; transition: transform .25s cubic-bezier(0.4,0,0.2,1), background .25s ease, box-shadow .25s ease; }
.spoiler-switch:hover .switch-slider { border-color: rgba(230,168,54,.5); }
.spoiler-switch input:checked + .switch-slider { border-color: #e6a836; background: rgba(230,168,54,.25); box-shadow: 0 0 14px rgba(230,168,54,.35); }
.spoiler-switch input:checked + .switch-slider::before { transform: translateX(17px); background: #e6a836; box-shadow: 0 0 8px #e6a836; }
.switch-label { color: var(--text-soft); font-size: .76rem; font-weight: 700; transition: color .2s ease; }
.spoiler-switch input:checked ~ .switch-label { color: #e6a836; }

.comment-spoiler-box { margin-top: 6px; margin-bottom: 6px; border: 1px dashed rgba(230,168,54,.4); border-radius: 7px; background: rgba(230,168,54,.04); overflow: hidden; }
.comment-spoiler-btn { width: 100%; min-height: 42px; padding: 8px 12px; border: 0; background: transparent; color: #e6a836; font-size: .72rem; font-weight: 750; text-align: left; cursor: pointer; transition: background .18s; }
.comment-spoiler-btn:hover { background: rgba(230,168,54,.1); }
.comment-spoiler-content { padding: 8px 12px 10px; border-top: 1px solid rgba(230,168,54,.2); }
.comment-spoiler-content.is-hidden { display: none; }

.inline-spoiler { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #22292f; color: transparent; cursor: pointer; user-select: none; transition: color .18s, background .18s; }
.inline-spoiler::before { content: 'SPOILER'; color: #e6a836; font-size: .62rem; font-weight: 800; letter-spacing: .05em; }
.inline-spoiler.is-revealed { background: rgba(230,168,54,.12); color: var(--text); border: 1px solid rgba(230,168,54,.3); }
.inline-spoiler.is-revealed::before { display: none; }

.comment-item.is-highlighted { animation: commentFlash 1.8s ease-out forwards; border-radius: 8px; padding-inline: 8px; }
.no-comments { padding: 17px 0 0; font-size: .69rem; }

.series-hero { position: relative; isolation: isolate; display: grid; width: min(1120px, calc(100% - 40px)); min-height: 520px; margin: 24px auto 36px; padding: 48px 40px; grid-template-columns: 260px minmax(0, 1fr); align-items: center; gap: 48px; border-radius: 16px; border: 1px solid rgba(255,255,255,.07); background: rgba(11,18,24,.7); backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
.series-hero-backdrop { position: absolute; inset: -3%; z-index: 0; background-size: cover; background-position: center; filter: blur(2px) brightness(.58) saturate(1.25); transform: scale(1.04); opacity: .98; }
.series-hero-overlay { position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(5,11,15,.68) 0%, rgba(8,16,21,.38) 48%, rgba(5,11,15,.68) 100%); pointer-events: none; }
.series-hero-glow { position: absolute; z-index: 1; top: 70px; left: -150px; width: 480px; height: 360px; border-radius: 50%; background: rgba(25,211,197,.08); filter: blur(80px); pointer-events: none; }
.series-hero > .series-cover, .series-hero > .series-copy { position: relative; z-index: 2; }
.series-cover { overflow: hidden; aspect-ratio: 2/2.82; border: 1px solid #29404c; border-radius: 10px; background: var(--surface-2); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.series-cover.3d-card { transform: perspective(1000px) rotateY(-3deg) rotateX(2deg); transition: transform .4s ease, box-shadow .4s ease; box-shadow: 0 24px 50px rgba(0,0,0,.6), 0 0 35px rgba(25,211,197,.2); }
.series-cover.3d-card:hover { transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.02); box-shadow: 0 30px 60px rgba(0,0,0,.7), 0 0 50px rgba(25,211,197,.35); }
.series-cover img { width: 100%; height: 100%; object-fit: cover; }
.series-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.series-breadcrumb { display: flex; margin-bottom: 20px; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: .68rem; text-align: center; }
.series-breadcrumb a { display: inline-flex; min-width: 44px; min-height: 36px; align-items: center; justify-content: center; color: var(--primary); }
.series-title-line { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.series-copy h1 { margin-bottom: 7px; overflow-wrap: anywhere; font-size: clamp(2.2rem, 4.5vw, 3.8rem); letter-spacing: -.055em; line-height: 1.05; text-align: center; }
.original-title { margin-top: 8px; margin-bottom: 18px; color: var(--text-soft); font-size: .85rem; font-style: italic; opacity: .88; text-align: center; }

.series-stats-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 20px; width: 100%; }
.stat-glass-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 10px 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.03); backdrop-filter: blur(10px); min-width: 115px; flex: 1; max-width: 160px; }
.stat-glass-card small { color: var(--text-soft); font-size: .62rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; text-align: center; width: 100%; }
.stat-glass-card strong { color: var(--text); font-size: .86rem; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; width: 100%; }
.stat-sub { color: var(--text-soft); font-size: .72rem; font-weight: 400; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #8ea1aa; flex-shrink: 0; }
.status-dot.is-active { background: #10b981; box-shadow: 0 0 10px #10b981; }

.series-genres { justify-content: center; }
.synopsis-wrapper { margin-bottom: 24px; text-align: center; }
.series-synopsis { max-width: 720px; margin: 0 auto; color: #a8babf; font-size: .83rem; line-height: 1.72; text-align: center; }
.series-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.chapter-list-section { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 25px 0 85px; }
.chapter-box { width: min(1120px, calc(100% - 40px)); margin: 18px auto 32px; }
.chapter-box-body { padding: 0; }
.chapter-progress-track { height: 4px; margin-bottom: 11px; overflow: hidden; border-radius: 3px; background: #15262b; }
.chapter-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-deep), var(--primary)); box-shadow: 0 0 12px rgba(25,211,197,.38); }
.chapter-list-scroll { max-height: 430px; overflow-y: auto; border-radius: 8px; scrollbar-color: var(--primary-deep) var(--surface-3); scrollbar-width: thin; }
.chapter-panel-heading {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.chapter-heading-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
.chapter-total {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(25, 211, 197, 0.08);
    border: 1px solid rgba(25, 211, 197, 0.25);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 750;
    white-space: nowrap;
    letter-spacing: .01em;
}
.chapter-total b {
    color: #ffffff;
    font-weight: 900;
}
.chapter-box-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chapter-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.chapter-search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-soft);
    font-size: 1rem;
    pointer-events: none;
    line-height: 1;
    opacity: .75;
}
.chapter-order-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    color: #dce8e9;
    font-size: .72rem;
    font-weight: 750;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s, transform .12s;
    white-space: nowrap;
}
.chapter-order-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}
.chapter-order-btn:active {
    transform: scale(0.96);
}
.chapter-order-icon {
    font-size: .9rem;
    color: var(--primary);
    line-height: 1;
}
.button-continue { background: linear-gradient(135deg, #19d3c5, #0ea599); color: #071013; font-weight: 850; box-shadow: 0 0 20px rgba(25,211,197,.35); }
.chapter-list { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); }
.chapter-list > a { display: flex; min-height: 54px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); align-items: center; gap: 12px; font-size: .76rem; text-decoration: none; color: inherit; transition: background .18s; }
.chapter-list > a:last-child { border-bottom: 0; }
.chapter-list > a:hover { background: rgba(25, 211, 197, 0.04); }
.chapter-list > a.is-read { opacity: .78; }
.chapter-list > a.is-last-read { background: rgba(25,211,197,.08); opacity: 1; border-left: 3px solid var(--primary); }
.chapter-number { flex-shrink: 0; min-width: 65px; color: var(--primary); font-size: .7rem; font-weight: 800; }
.chapter-list > a strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 600; color: var(--text); }
.read-badge { flex-shrink: 0; display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,.06); color: var(--text-soft); font-size: .62rem; font-weight: 700; white-space: nowrap; }
.read-badge.is-last-read-badge { background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(25,211,197,.3); font-weight: 800; }
.chapter-list time { flex-shrink: 0; color: var(--muted); font-size: .64rem; white-space: nowrap; }
.chapter-list > a > .chapter-number { flex: 0 1 auto; min-width: 0; }
.chapter-list > a > time { margin-left: auto; }
.chapter-list > a > b:last-child { margin-left: auto; }
.chapter-list > a b { flex-shrink: 0; color: var(--text-soft); font-size: .82rem; margin-left: 4px; }
.site-footer { display: flex; flex-wrap: wrap; width: min(1260px, calc(100% - 40px)); margin: 50px auto 0; padding: 32px 0 45px; border-top: 1px solid var(--line-soft); align-items: center; justify-content: space-between; gap: 20px; color: var(--text-soft); font-size: .78rem; }
.site-footer p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.footer-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-soft); font-weight: 600; transition: color .18s; }
.footer-nav a:hover { color: var(--primary); text-decoration: underline; }

.legal-document-section { padding: 40px 0 80px; }
.legal-card { max-width: 860px; margin: 0 auto; padding: 35px 40px; }
.legal-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.legal-header h1 { margin-bottom: 6px; font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.03em; }
.legal-date { color: var(--muted); font-size: .74rem; margin: 0; }
.legal-content h2 { margin: 26px 0 12px; color: var(--text); font-size: 1.15rem; }
.legal-content p { color: #b0c2c8; font-size: .88rem; line-height: 1.7; margin-bottom: 16px; }
.legal-content ul { margin: 0 0 18px 20px; padding: 0; color: #b0c2c8; font-size: .86rem; line-height: 1.7; }
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.legal-table { width: 100%; margin: 20px 0 26px; border-collapse: collapse; font-size: .82rem; }
.legal-table th, .legal-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.legal-table th { background: rgba(255,255,255,.03); color: var(--primary); font-weight: 800; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.legal-table td code { padding: 2px 6px; border-radius: 4px; background: rgba(25,211,197,.12); color: var(--primary); font-family: monospace; font-size: .78rem; }

.reader-mode .site-header, .reader-mode .site-footer { display: none; }
.reader-mode { background: #070b0f; }
.reader-mode main { min-height: 100vh; }
.reader-header { position: sticky; z-index: 40; top: 0; display: grid; min-height: 62px; padding: 0 20px; border-bottom: 1px solid var(--line); grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 24px; background: rgba(7,12,17,.97); backdrop-filter: blur(14px); }
.reader-brand { display: flex; min-width: 44px; min-height: 42px; align-items: center; gap: 8px; font-size: .76rem; }
.reader-brand .brand-mark { width: 27px; height: 27px; }
.reader-breadcrumb { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--muted); font-size: .68rem; }
.reader-breadcrumb a { display: inline-flex; min-height: 36px; align-items: center; color: var(--primary); }
.reader-breadcrumb strong { overflow: hidden; color: #c8d5d7; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.reader-close { display: grid; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 6px; place-items: center; color: var(--text-soft); font-size: .72rem; }
.reader-progress { position: fixed; z-index: 60; top: 0; right: 0; left: 0; height: 3px; }
.reader-progress span { display: block; width: 0; height: 100%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.reader-toolbar { position: sticky; z-index: 35; top: 62px; display: grid; width: min(1160px, calc(100% - 30px)); min-height: 52px; margin: 12px auto 0; padding: 7px; border: 1px solid var(--line); border-radius: 8px; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; background: rgba(15,22,29,.96); box-shadow: 0 10px 30px rgba(0,0,0,.25); backdrop-filter: blur(12px); }
.reader-toolbar a, .reader-toolbar button, .reader-toolbar .reader-disabled, .reader-page-count { display: inline-flex; min-height: 42px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 5px; align-items: center; justify-content: center; background: #101920; color: #c6d4d7; font-size: .67rem; font-weight: 650; }
.reader-toolbar a:hover, .reader-toolbar button:hover { border-color: rgba(25,211,197,.3); color: var(--primary); }
.reader-toolbar-center { display: flex; align-items: center; justify-content: center; gap: 7px; }
.reader-page-count { color: var(--text-soft); font-weight: 500; }
.reader-tools { display: flex; justify-self: end; gap: 6px; }
.reader-tools button { min-width: 44px; cursor: pointer; }
.reader-settings-panel { position: sticky; z-index: 28; top: 76px; display: grid; width: min(760px, calc(100% - 30px)); margin: 10px auto 0; padding: 15px; border: 1px solid rgba(25,211,197,.35); border-radius: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 12px; background: rgba(10,20,27,.97); box-shadow: 0 16px 38px rgba(0,0,0,.45); color: #e8f2f3; }
.reader-settings-panel[hidden] { display: none; }
.reader-settings-panel label, .reader-setting-group { display: grid; gap: 6px; color: #a9bbbe; font-size: .66rem; font-weight: 750; }
.reader-settings-panel select, .reader-settings-panel input, .reader-settings-panel button { min-height: 36px; }
.reader-settings-panel select { padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #111d25; color: #eef8f8; }
.reader-settings-panel input[type="range"] { min-height: 22px; accent-color: var(--primary); }
.reader-setting-stepper { display: grid; grid-template-columns: 38px 38px 38px; align-items: center; gap: 4px; }
.reader-setting-stepper button, .reader-settings-reset { border: 1px solid var(--line); border-radius: 6px; background: #111d25; color: #dce9ea; cursor: pointer; }
.reader-setting-stepper output { text-align: center; color: var(--primary); font-size: .75rem; }
.reader-settings-reset { padding: 0 12px; }
@media (max-width: 760px) {
    .reader-settings-panel { position: relative; top: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reader-settings-reset { grid-column: 1 / -1; }
}
.reader-disabled { opacity: .35; }
.reader-title { width: min(900px, calc(100% - 40px)); margin: 42px auto 24px; text-align: center; }
.reader-title p { margin-bottom: 7px; color: var(--primary); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.reader-title h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.55rem, 3.4vw, 2.6rem); letter-spacing: -.04em; }
.reader-pages { position: relative; width: min(900px, calc(100% - 30px)); margin: 0 auto 45px; border: 2px solid rgba(25,211,197,.5); border-radius: 12px; overflow: hidden; background: rgba(13,21,28,.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 45px rgba(25,211,197,.3); transition: width .2s, border-color .3s ease, box-shadow .3s ease; }
.reader-pages img { display: block; width: 100%; height: auto; margin: 0; padding: 0; border: 0; box-shadow: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.reader-pages { user-select: none; }
.reader-mask-pages { background: #fdfdfd; }
.reader-mask-pages .chapter-mask-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    background: transparent;
    filter: brightness(0);
}
.reader-mask-pages .chapter-mask-image + .chapter-mask-image {
    margin-top: var(--chapter-mask-overlap, -24.444444%);
}
.reader-canvas-pages { background: #fdfdfd; }
.reader-canvas-pages canvas { display: block; width: 100%; height: auto; margin: 0; padding: 0; border: 0; user-select: none; pointer-events: none; filter: brightness(0); }
.reader-theme-dark .reader-canvas-pages, body[data-reader-theme="dark"] .reader-canvas-pages { background: #101010; }
.reader-theme-dark .reader-canvas-pages canvas, body[data-reader-theme="dark"] .reader-canvas-pages canvas { filter: none; }
.reader-theme-sepia .reader-canvas-pages, body[data-reader-theme="sepia"] .reader-canvas-pages { background: #eee2c5; }
.reader-theme-sepia .reader-canvas-pages canvas, body[data-reader-theme="sepia"] .reader-canvas-pages canvas { filter: brightness(0) saturate(100%) invert(20%) sepia(22%) saturate(783%) hue-rotate(351deg) brightness(92%) contrast(87%); }
.reader-theme-dark .reader-mask-pages, body[data-reader-theme="dark"] .reader-mask-pages { background: #101010; }
.reader-theme-dark .reader-mask-pages .chapter-mask-image, body[data-reader-theme="dark"] .reader-mask-pages .chapter-mask-image { background: transparent; filter: none; }
.reader-theme-sepia .reader-mask-pages, body[data-reader-theme="sepia"] .reader-mask-pages { background: #eee2c5; }
.reader-theme-sepia .reader-mask-pages .chapter-mask-image, body[data-reader-theme="sepia"] .reader-mask-pages .chapter-mask-image { background: transparent; filter: brightness(0) saturate(100%) invert(20%) sepia(22%) saturate(783%) hue-rotate(351deg) brightness(92%) contrast(87%); }
.reader-render-pending { margin: 0; padding: 45px 24px; color: var(--text-soft); text-align: center; }
@media print {
    .reader-mode .reader-pages { visibility: hidden; }
}
.reader-mode.reader-wide .reader-pages { width: min(1180px, calc(100% - 20px)); }
.reader-theme-dark .reader-pages { border: 2px solid rgba(25,211,197,.55); box-shadow: 0 20px 60px rgba(0,0,0,.8), 0 0 50px rgba(25,211,197,.35); background: rgba(13,21,28,.95); }
.reader-theme-dark .reader-pages img { filter: invert(1) hue-rotate(180deg); background: #05080b; }
body:not(.reader-theme-dark):not(.reader-theme-sepia):not(.reader-theme-sage) .reader-pages, body[data-reader-theme="light"] .reader-pages { border: 2px solid rgba(25,211,197,.55); background: #fdfdfd; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 16px 45px rgba(0,0,0,.35), 0 0 35px rgba(25,211,197,.3); }

/* Sepia theme */
body.reader-theme-sepia .reader-pages, body[data-reader-theme="sepia"] .reader-pages { border: 2px solid rgba(210,165,95,.6); background: #f5eedb; box-shadow: 0 16px 45px rgba(0,0,0,.3), 0 0 35px rgba(210,165,95,.25); }
body.reader-theme-sepia .reader-pages img, body[data-reader-theme="sepia"] .reader-pages img { filter: sepia(0.35) contrast(0.95); }

/* Text chapters styling */
.reader-text-content { max-width: 820px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 32px); font-family: Georgia, 'Times New Roman', Cambria, serif; font-size: 1.15rem; line-height: 1.88; }
.reader-text-content p { margin: 0 0 1.45em; text-align: justify; text-justify: inter-word; word-break: break-word; }
body:not(.reader-theme-dark):not(.reader-theme-sepia) .reader-text-content, body[data-reader-theme="light"] .reader-text-content { color: #1a2228; }
body.reader-theme-dark .reader-text-content, body[data-reader-theme="dark"] .reader-text-content { color: #e5f1f3; }
body.reader-theme-sepia .reader-text-content, body[data-reader-theme="sepia"] .reader-text-content { color: #3b2e22; }

/* Chapter select dropdown in toolbar */
.reader-chapter-select { display: inline-flex; max-width: 220px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line-soft); border-radius: 5px; background: #101920; color: #c6d4d7; font-size: .67rem; font-weight: 650; cursor: pointer; }
.reader-chapter-select:hover, .reader-chapter-select:focus { border-color: rgba(25,211,197,.4); color: var(--primary); outline: none; }
.reader-chapter-select option { background: #101920; color: #edf7f7; padding: 6px 10px; }

.reader-chapter-picker-trigger { display: none; min-width: 0; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-soft); border-radius: 7px; align-items: center; justify-content: space-between; gap: 10px; background: #101920; color: #d8e5e6; font-size: .7rem; font-weight: 700; cursor: pointer; }
.reader-chapter-picker-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-chapter-picker-trigger b { color: var(--primary); font-size: 1rem; }
.reader-chapter-picker[hidden] { display: none; }
.reader-chapter-picker { position: fixed; z-index: 1100; inset: 0; display: grid; align-items: end; }
.reader-chapter-picker-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,7,10,.78); backdrop-filter: blur(4px); }
/* A stable-height chapter drawer keeps search and navigation within thumb reach. */
.reader-chapter-picker-sheet { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(540px, 100%); height: min(80dvh, 720px); margin: 0 auto; padding: 27px 20px max(20px, env(safe-area-inset-bottom)); border: 1px solid #254047; border-bottom: 0; border-radius: 26px 26px 0 0; overflow: hidden; background: linear-gradient(155deg, #14252c, #0c171e 42%); box-shadow: 0 -20px 80px #0008; }
.reader-chapter-picker-sheet::before { content: ''; position: absolute; top: 9px; left: calc(50% - 18px); width: 36px; height: 4px; border-radius: 9px; background: #47616a; }
.reader-chapter-picker-sheet > header { display: flex; flex: none; margin-bottom: 20px; align-items: flex-start; justify-content: space-between; gap: 16px; }
.reader-chapter-picker-sheet > header > div { min-width: 0; }
.reader-chapter-picker-sheet > header small { display: block; color: #6bccc4; font-size: 10px; letter-spacing: .14em; font-weight: 750; }
.reader-chapter-picker-sheet > header h2 { margin: 7px 0; color: #f2f8f8; font-size: 25px; letter-spacing: -.035em; }
.reader-chapter-picker-sheet > header p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: #93acb4; font-size: 12px; line-height: 1.5; }
.reader-chapter-picker-sheet > header button { display: grid; flex: none; width: 38px; height: 38px; border: 1px solid #30454d; border-radius: 12px; place-items: center; background: #ffffff05; color: #bdd0d5; font-size: 24px; cursor: pointer; }
.reader-chapter-picker-search { display: flex; flex: none; min-height: 50px; margin-bottom: 12px; padding: 0 14px; border: 1px solid #30454d; border-radius: 13px; align-items: center; gap: 10px; background: #08131a; color: #76959f; transition: border-color .15s, box-shadow .15s; }
.reader-chapter-picker-search:focus-within { border-color: #39c9ba; box-shadow: 0 0 0 3px #39c9ba15; }
.reader-chapter-picker-search svg { flex: none; }
.reader-chapter-picker-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #eef7f7; font-size: 16px; }
.reader-chapter-picker-search input::placeholder { color: #718b95; font-size: 13px; }
.reader-chapter-picker-meta { display: flex; flex: none; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; color: #819da6; font-size: 11px; }
.reader-chapter-picker-meta button { min-height: 36px; border: 0; padding: 0 3px; background: transparent; color: #68d4c8; font: inherit; font-weight: 700; cursor: pointer; }
.reader-chapter-picker-list { display: flex; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: #31565d transparent; }
.reader-chapter-picker-list a { position: relative; display: grid; flex: none; min-height: 68px; padding: 12px 15px; border: 1px solid #ffffff05; border-radius: 12px; grid-template-columns: minmax(0,1fr) auto; align-content: center; gap: 5px 12px; background: #ffffff02; color: #cfdbdd; text-decoration: none; }
.reader-chapter-picker-list a[hidden] { display: none; }
.reader-chapter-picker-list a:hover { background: #ffffff07; border-color: #36505a; }
.reader-chapter-picker-list a.is-current { border-color: #2b8f85; background: linear-gradient(100deg, #133d3b, #112b30); }
.reader-chapter-picker-list a > span { grid-column: 1; color: #82a6b0; font-size: 11px; font-weight: 750; }
.reader-chapter-picker-list a > strong { grid-column: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; font-weight: 550; color: #d4e2e6; }
.reader-chapter-picker-list a.is-current > span { color: #76e3d2; }
.reader-chapter-picker-list a > em { grid-column: 2; grid-row: 1 / 3; align-self: center; padding: 5px 7px; border-radius: 6px; background: #4ed6bd18; color: #91eddd; font-size: 9px; font-style: normal; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.reader-chapter-picker-empty { margin: 20px 0; color: #93acb4; font-size: 13px; text-align: center; }
.reader-chapter-picker :focus-visible { outline: 2px solid #76e3d2; outline-offset: 3px; }
body.reader-picker-open { overflow: hidden; }

/* Chapter filter input in series page */
.chapter-search-filter { min-height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .75rem; width: 180px; transition: all .2s ease; }
.chapter-search-filter:focus { width: 220px; border-color: var(--primary); outline: none; box-shadow: 0 0 12px rgba(25,211,197,.2); }

.reader-comments { width: min(900px, calc(100% - 30px)); padding: 12px 0 75px; }
.reader-comments-card { padding: 20px; }
.reader-theme-dark .reader-title h1, .reader-theme-dark .reader-title p { color: #eaf7f6; }
.reader-tools button[aria-pressed="true"] { border-color: rgba(25,211,197,.6); background: rgba(25,211,197,.14); color: var(--primary); }
.reader-transcript { width: min(860px, calc(100% - 40px)); margin: 0 auto 50px; }
.reader-transcript summary { display: flex; width: max-content; min-height: 44px; margin: auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 6px; align-items: center; color: var(--text-soft); cursor: pointer; font-size: .7rem; }
.reader-transcript > div { margin-top: 18px; padding: clamp(25px, 5vw, 55px); border: 1px solid var(--line); border-radius: 999px; background: #f6f5f1; color: #1b2024; font-family: Georgia, serif; font-size: 1.04rem; line-height: 1.9; }

.chapter-opinion-section { width: min(900px, calc(100% - 20px)); margin: 35px auto 25px; }
.chapter-opinion-card { padding: 24px 28px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; }
.opinion-header { text-align: center; margin-bottom: 20px; }
.opinion-eyebrow { display: inline-block; color: var(--primary); font-size: .63rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.opinion-header h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.opinion-header p { margin: 0; color: var(--text-soft); font-size: .75rem; }

.opinion-controls { display: flex; justify-content: center; gap: 14px; margin-bottom: 22px; }
.chapter-vote-btn { display: inline-flex; min-height: 44px; padding: 0 20px; border: 1px solid var(--line-soft); border-radius: 999px; align-items: center; gap: 9px; background: rgba(255,255,255,.03); color: var(--text-soft); font-size: .78rem; font-weight: 700; cursor: pointer; text-decoration: none; transition: all .2s ease; user-select: none; }
.chapter-vote-btn:hover { border-color: rgba(25,211,197,.4); color: var(--text); background: rgba(25,211,197,.08); }
.chapter-vote-btn strong { padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.06); font-size: .7rem; font-weight: 800; color: var(--muted); }

.chapter-vote-btn.is-active-like { border-color: var(--primary); background: rgba(25,211,197,.15); color: var(--primary); box-shadow: 0 0 16px rgba(25,211,197,.25); }
.chapter-vote-btn.is-active-like strong { background: rgba(25,211,197,.25); color: #fff; }

.chapter-vote-btn.is-active-dislike { border-color: #ef6262; background: rgba(239,98,98,.15); color: #ff9494; box-shadow: 0 0 16px rgba(239,98,98,.25); }
.chapter-vote-btn.is-active-dislike strong { background: rgba(239,98,98,.25); color: #fff; }

.vote-svg { flex-shrink: 0; transition: transform .2s ease; }
.rotate-180 { transform: rotate(180deg); }
.chapter-vote-btn:hover .vote-svg { transform: scale(1.1); }
.chapter-vote-btn:hover .rotate-180 { transform: rotate(180deg) scale(1.1); }

.opinion-bar-wrapper { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.opinion-bar-info { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; color: var(--text-soft); }
.opinion-bar-info strong { color: var(--primary); font-weight: 800; }
.opinion-bar-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.opinion-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0ea599, var(--primary)); box-shadow: 0 0 10px rgba(25,211,197,.4); transition: width .4s ease; }
.reader-nav { display: grid; width: min(900px, calc(100% - 30px)); margin: 0 auto 50px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.reader-nav > a:not(.reader-index) { display: flex; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line-soft); border-radius: 6px; justify-content: center; flex-direction: column; transition: all .2s ease; text-decoration: none; }
.reader-nav > a:not(.reader-index):hover { border-color: rgba(25,211,197,.4); background: rgba(25,211,197,.06); }
.reader-nav a.next { align-items: flex-end; text-align: right; }
.reader-nav span { color: var(--primary); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.reader-nav strong { margin-top: 4px; color: #c4d1d3; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.reader-nav > .reader-index { display: inline-flex; min-height: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; align-items: center; color: var(--text-soft); font-size: .7rem; font-weight: 650; text-decoration: none; transition: all .2s ease; }
.reader-nav > .reader-index:hover { border-color: rgba(25,211,197,.4); color: var(--primary); }
.reader-nav .reader-disabled { display: flex; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line-soft); border-radius: 6px; justify-content: center; flex-direction: column; opacity: .4; }

.error-page { display: grid; min-height: 75vh; padding: 80px 20px; place-content: center; text-align: center; }
.error-page h1 { margin-bottom: 12px; font-size: clamp(2.5rem, 6vw, 5rem); }
.error-page p:not(.eyebrow) { max-width: 580px; color: var(--text-soft); line-height: 1.7; }

.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 232px minmax(0,1fr); background: #0a1015; color: var(--text); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); flex-direction: column; background: #080d12; }
.brand-admin { padding: 0 5px 20px; border-bottom: 1px solid var(--line-soft); }
.brand-admin > span:last-child { display: flex; flex-direction: column; }
.brand-admin small { margin-top: 2px; color: var(--muted); font-size: .58rem; font-weight: 500; }
.admin-profile { display: flex; margin: 18px 4px 3px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 8px; align-items: center; gap: 10px; background: var(--surface); }
.admin-profile > span { display: grid; width: 32px; height: 32px; border-radius: 50%; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .74rem; font-weight: 850; }
.admin-profile div { display: flex; min-width: 0; flex-direction: column; }
.admin-profile strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; }
.admin-profile small { margin-top: 2px; color: var(--muted); font-size: .58rem; }
.admin-nav { display: flex; margin-top: 22px; flex-direction: column; gap: 4px; }
.admin-nav a { display: flex; min-height: 44px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; align-items: center; gap: 10px; color: #8ea1aa; font-size: .72rem; font-weight: 650; }
.admin-nav a > span { width: 17px; color: #657b84; text-align: center; font-size: .9rem; }
.admin-nav a:hover { background: var(--surface); color: #dce8e9; }
.admin-nav a.active { border-color: rgba(25,211,197,.17); background: linear-gradient(90deg, rgba(25,211,197,.16), rgba(25,211,197,.035)); color: var(--primary); }
.admin-nav a.active > span { color: var(--primary); }
.sidebar-logout { margin-top: auto; }
.sidebar-logout button { width: 100%; justify-content: flex-start; }
.admin-main { min-width: 0; padding: 30px clamp(20px, 3.5vw, 48px) 70px; background: radial-gradient(circle at 95% 0, rgba(25,211,197,.035), transparent 30%), #0b1117; }
.admin-topbar { display: flex; min-height: 55px; margin-bottom: 23px; align-items: center; justify-content: space-between; gap: 20px; }
.admin-topbar h1 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.admin-user { display: inline-flex; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; align-items: center; gap: 7px; color: var(--text-soft); font-size: .65rem; }
.admin-user i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid; border-radius: 7px; font-size: .75rem; }
.alert-success { border-color: rgba(69,211,145,.24); background: rgba(69,211,145,.1); color: #80e4af; }
.alert-error { border-color: rgba(239,98,98,.25); background: rgba(239,98,98,.1); color: #ff9494; }
.metric-grid { display: grid; margin-bottom: 18px; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.dashboard-metrics { grid-template-columns: repeat(5, minmax(0,1fr)); }
.dashboard-columns { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.stats-metrics { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 24px; }
.stats-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-bottom: 24px; }
.stats-report-card { padding: 20px 24px; }
.stats-report-wide { grid-column: 1 / -1; }
.stats-ranking-list { display: flex; max-height: 560px; margin-top: 10px; padding-right: 4px; overflow-y: auto; flex-direction: column; gap: 10px; }
.stats-profitable-grid { display: grid; max-height: 620px; margin-top: 10px; padding-right: 4px; overflow-y: auto; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.metric-grid article { position: relative; overflow: hidden; min-height: 105px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 9px; background: linear-gradient(145deg, var(--surface-2), #101820); }
.metric-grid article::after { position: absolute; top: 0; right: 0; width: 55px; height: 55px; border-radius: 0 0 0 100%; background: var(--primary-soft); content: ""; }
.metric-grid span, .metric-grid small { display: block; color: var(--text-soft); font-size: .65rem; }
.metric-grid strong { display: block; margin: 8px 0 4px; font-size: 1.65rem; letter-spacing: -.045em; }
.metric-grid .metric-warning { border-color: rgba(239,98,98,.25); }
.metric-grid .metric-warning::after { background: rgba(239,98,98,.12); }
.admin-grid { display: grid; margin-bottom: 18px; grid-template-columns: minmax(0,1.55fr) minmax(260px,.85fr); gap: 18px; }
.panel-card { margin-bottom: 18px; padding: 20px; border: 1px solid var(--line-soft); border-radius: 9px; background: linear-gradient(145deg, #111a22, #0e161d); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.moderator-shell .brand-mark { background: transparent; }
.moderator-shell .admin-profile > span { border-color: rgba(241,186,95,.35); background: rgba(241,186,95,.12); color: #f1ba5f; }
.moderator-shell .admin-nav a.active { border-color: rgba(241,186,95,.25); background: rgba(241,186,95,.11); color: #f1ba5f; }
.moderator-filters { display: grid; margin: 18px 0; grid-template-columns: minmax(220px, 1fr) 170px 170px auto; gap: 9px; }
.moderator-filters input, .moderator-filters select { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); }
.moderator-comments { display: flex; flex-direction: column; gap: 12px; }
.moderator-comment-card { padding: 17px; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(7,12,17,.48); }
.moderator-comment-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.moderator-comment-meta > div:first-child small { display: block; margin-top: 4px; color: var(--text-soft); font-size: .66rem; }
.moderator-comment-meta > div:last-child { display: flex; align-items: center; gap: 9px; }
.moderator-comment-meta time { color: var(--muted); font-size: .6rem; }
.moderator-comment-body { margin: 13px 0; color: #c6d4d6; font-size: .78rem; line-height: 1.6; word-break: break-word; }
.moderator-comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.moderator-comment-actions form { margin: 0; }
.moderator-delete { color: var(--danger); }
.moderator-reply { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.moderator-reply summary { color: #f1ba5f; cursor: pointer; font-size: .7rem; font-weight: 750; }
.moderator-reply form { display: flex; margin-top: 10px; align-items: end; gap: 8px; }
.moderator-reply textarea { min-height: 72px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; resize: vertical; background: var(--surface); color: var(--text); flex: 1; }
@media (max-width: 620px) {
    .moderator-filters { grid-template-columns: 1fr !important; }
    .moderator-comment-meta, .moderator-reply form { align-items: stretch; flex-direction: column; }
    .moderator-comment-meta > div:last-child { justify-content: space-between; }
    .account-hero-inner { flex-wrap: wrap; }
    .account-moderator-button { width: 100%; margin-left: 0; order: 3; justify-content: center; }
}
.panel-heading { display: flex; margin-bottom: 18px; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; font-size: 1.05rem; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-heading > a { display: inline-flex; min-height: 40px; align-items: center; color: var(--primary); font-size: .68rem; font-weight: 750; }
.workflow-list { margin: 0; padding: 0; list-style: none; }
.workflow-list li { display: grid; min-height: 57px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.workflow-list li:last-child { border-bottom: 0; }
.workflow-list li > span { display: grid; width: 26px; height: 26px; border: 1px solid rgba(25,211,197,.2); border-radius: 6px; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .65rem; font-weight: 800; }
.workflow-list strong { font-size: .74rem; }
.workflow-list small { display: block; margin-top: 3px; color: var(--muted); font-size: .62rem; }
.workflow-list a, .link-button { display: inline-flex; min-height: 36px; padding: 0 8px; border: 0; align-items: center; background: none; color: var(--primary); cursor: pointer; font-size: .68rem; font-weight: 750; }
.link-button.danger { color: var(--danger); }
.storage-card { background: linear-gradient(145deg, #113337, #0d1b22); }
.storage-card h2 { font-size: 1.8rem; }
.storage-card p { color: #8daeb1; font-size: .7rem; line-height: 1.6; }
.storage-track { height: 7px; margin: 25px 0 15px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.storage-track span { display: block; min-width: 2%; height: 100%; border-radius: inherit; background: var(--primary); box-shadow: 0 0 12px rgba(25,211,197,.55); }
.toolbar { display: flex; min-height: 48px; margin-bottom: 17px; align-items: center; justify-content: space-between; gap: 18px; }
.toolbar p { margin: 0; color: #cbd7d9; font-size: .76rem; }
.toolbar small { display: block; margin-top: 5px; font-size: .64rem; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .71rem; }
.admin-series-table { min-width: 760px; }
.admin-users-table { min-width: 860px; }
.user-metrics article { min-height: 96px; }
.user-filters { display: grid; margin-bottom: 20px; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, .7fr) minmax(180px, .8fr) auto; align-items: end; gap: 10px; }
.user-filters input, .user-filters select { min-height: 42px; }
.user-email-cell { display: block; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-detail-meta { display: flex; margin-top: 20px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 7px; flex-wrap: wrap; gap: 18px 30px; background: rgba(255,255,255,.018); color: var(--muted); font-size: .68rem; }
.user-detail-meta strong { color: var(--text-soft); font-weight: 700; }
.user-security-card { background: linear-gradient(145deg, #12252a, #0e171d); }
.user-danger-card { border-color: rgba(239,98,98,.28); background: linear-gradient(145deg, #29191d, #151215); }
.delete-user-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.delete-user-form label { display: flex; min-width: min(310px, 100%); color: #c8b1b3; flex: 1; flex-direction: column; gap: 7px; font-size: .68rem; font-weight: 700; }
.delete-user-form label strong { color: #ff9494; }
.button-danger { border-color: rgba(239,98,98,.45); background: #a93d49; color: #fff; }
.button-danger:hover { border-color: #ff7e88; background: #c54d5a; }
.button[data-bulk-submit]:disabled { border-color: var(--line-soft); background: #29343a; color: #7c898e; cursor: not-allowed; opacity: .72; }
.bulk-check-cell { width: 42px; text-align: center; }
.bulk-check-cell input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
tr.is-selected td { background: rgba(25,211,197,.055); }
th { padding: 10px 11px; border-bottom: 1px solid var(--line); color: #647982; font-size: .58rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 11px; border-bottom: 1px solid var(--line-soft); color: #c5d1d3; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.012); }
td small, .table-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: .59rem; }
td code { color: #9db2b8; }
.table-actions { width: 1%; text-align: right; white-space: nowrap; }
.table-actions .table-icon-link { display: inline-grid; margin-left: 7px; vertical-align: middle; }
.table-actions a:not(.table-icon-link) { color: var(--primary); font-weight: 700; }
.table-icon-link { display: grid; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 5px; place-items: center; background: var(--surface-3); color: #afbec1; font-size: .76rem; }
.table-icon-link:hover { border-color: var(--primary); color: var(--primary); }
.admin-cover-thumb { display: grid; overflow: hidden; width: 36px; height: 50px; border: 1px solid var(--line); border-radius: 4px; place-items: center; background: var(--surface-3); color: var(--primary); font-weight: 800; }
.admin-cover-thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty-cell { padding: 44px; color: var(--muted); text-align: center; }
.badge { display: inline-flex; padding: 4px 7px; border-radius: 4px; background: #202d35; color: #9fb0b6; font-size: .56rem; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.badge-success, .badge-published, .badge-publishing, .badge-completed { background: rgba(69,211,145,.12); color: #63dca0; }
.badge-error { background: rgba(239,98,98,.12); color: #f78080; }
.badge-rejected, .badge-paused { background: rgba(241,186,95,.13); color: #e8bb70; }
.badge-rendering, .badge-received { background: rgba(91,148,232,.13); color: #85adeb; }
.badge-draft, .badge-hidden { background: rgba(145,159,166,.12); color: #91a0a6; }
.status-dot { display: inline-flex; align-items: center; color: var(--text-soft); }
.status-dot::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #64747b; content: ""; }
.status-dot.good::before { background: var(--success); box-shadow: 0 0 7px rgba(69,211,145,.5); }
.id-code { padding: 4px 6px; border-radius: 4px; background: var(--surface-3); color: var(--primary); font-size: .7rem; font-weight: 800; }
.back-link { display: inline-flex; min-height: 40px; align-items: center; color: var(--text-soft); font-size: .7rem; font-weight: 650; }
.back-link:hover { color: var(--primary); }
.id-banner { display: flex; margin-bottom: 18px; padding: 13px 17px; border: 1px solid rgba(25,211,197,.2); border-radius: 8px; align-items: center; gap: 13px; background: var(--primary-soft); }
.id-banner span { color: #7aaba9; font-size: .61rem; font-weight: 750; text-transform: uppercase; }
.id-banner strong { color: var(--primary); font-size: 1.25rem; }
.id-banner button { min-height: 40px; margin-left: auto; padding-inline: 10px; border: 0; background: none; color: var(--primary); cursor: pointer; font-size: .68rem; font-weight: 750; }
.form-section { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid label, .stack-form label { display: flex; color: #aebdc1; flex-direction: column; gap: 7px; font-size: .68rem; font-weight: 700; }
.form-grid label small, .stack-form label small, .file-field small { color: var(--muted); font-weight: 450; }
.current-media-preview { display: flex; width: min(100%, 420px); margin-top: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; align-items: center; gap: 10px; background: rgba(255,255,255,.025); }
.current-media-preview img { display: block; width: 48px; height: 64px; border-radius: 5px; object-fit: cover; background: var(--surface-3); }
.current-banner-preview img { width: 150px; height: 76px; }
.current-media-preview small { color: var(--text-soft) !important; font-size: .65rem; }
.nsfw-label { color: #ff7d86; }
.recovery-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.recovery-code-grid code { overflow-wrap: anywhere; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: #0a1117; color: var(--primary); font-size: .72rem; text-align: center; }
.span-2 { grid-column: span 2; }
input, textarea, select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: #0a1117; color: #dbe6e7; font-size: .73rem; }
input::placeholder, textarea::placeholder { color: #50636b; }
input:focus, textarea:focus, select:focus { border-color: var(--primary-strong); box-shadow: 0 0 0 3px var(--primary-soft); }
select { color-scheme: dark; }
textarea { resize: vertical; line-height: 1.6; }
.chapter-editor { min-height: 430px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .76rem; }
.check-field { display: flex !important; padding: 12px; border: 1px solid var(--line); border-radius: 7px; align-items: flex-start; flex-direction: row !important; gap: 10px !important; background: #0a1117; }
.check-field input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); }
.check-field small { display: block; margin-top: 3px; }
.seo-auto-toggle { margin-bottom: 14px; border-color: rgba(25,211,197,.28); background: linear-gradient(145deg, rgba(25,211,197,.08), #0a1117); }
.seo-preview { margin-bottom: 18px; padding: 14px 16px; border: 1px solid rgba(25,211,197,.18); border-radius: 8px; background: #0a1117; }
.seo-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #dbe6e7; font-size: .72rem; }
.seo-preview-title { margin: 13px 0 3px; color: #8adfd9; font-size: .95rem; font-weight: 750; }
.seo-preview-url { margin: 0 0 7px; overflow-wrap: anywhere; color: #68bd90; font-size: .65rem; }
.seo-preview-description { margin: 0; color: #aebdc1; font-size: .7rem; line-height: 1.55; }
.seo-preview > small { display: block; margin-top: 10px; color: var(--muted); font-size: .62rem; }
.genre-field { margin: 0; padding: 0; border: 0; }
.genre-field legend { margin-bottom: 7px; color: #aebdc1; font-size: .68rem; font-weight: 700; }
.genre-options { display: flex; flex-wrap: wrap; gap: 7px; }
.genre-option { display: inline-flex !important; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; align-items: center; flex-direction: row !important; gap: 7px !important; background: #0a1117; color: var(--text-soft) !important; cursor: pointer; }
.genre-option:has(input:checked) { border-color: rgba(25,211,197,.45); background: var(--primary-soft); color: var(--primary) !important; }
.genre-option input { width: 15px; height: 15px; accent-color: var(--primary); }
.series-genres { margin: -8px 0 24px; }
.form-actions { display: flex; margin: 0 0 20px; justify-content: flex-end; }
.stack-form { display: flex; flex-direction: column; gap: 15px; }
.permission-list { display: flex; margin: 0; padding: 0; border: 0; flex-direction: column; gap: 7px; }
.permission-list legend { margin-bottom: 8px; color: #aebdc1; font-size: .68rem; font-weight: 700; }
.permission-list label { display: flex; padding: 11px; border: 1px solid var(--line); border-radius: 7px; align-items: flex-start; flex-direction: row; gap: 9px; background: #0a1117; }
.permission-list input { width: 15px; margin-top: 2px; accent-color: var(--primary); }
.permission-list small { display: block; margin-top: 3px; }
.note-card { background: linear-gradient(145deg, #102d31, #0d171d); }
.note-card h2 { font-size: 1.4rem; }
.note-card p, .note-card li { color: #91a7ac; font-size: .7rem; line-height: 1.65; }
.note-card ul { padding-left: 17px; }
.token-reveal { display: grid; margin-bottom: 18px; padding: 19px; border: 1px solid rgba(25,211,197,.3); border-radius: 9px; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; background: var(--primary-soft); }
.token-reveal h2 { margin: 0; font-size: 1rem; }
.token-reveal code { overflow: hidden; padding: 10px; border-radius: 5px; background: #081115; color: #98e7e2; text-overflow: ellipsis; white-space: nowrap; }
.danger-actions { display: flex; margin-top: -6px; padding-top: 18px; border-top: 1px solid rgba(239,98,98,.16); justify-content: flex-end; gap: 9px; }

.auth-shell { display: grid; min-height: 100vh; padding: 25px; background: radial-gradient(circle at 50% 10%, rgba(25,211,197,.1), transparent 34%), #070c11; place-items: center; }
.login-card { width: min(410px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #121c24, #0d151b); box-shadow: 0 28px 80px rgba(0,0,0,.45); }
.login-copy { margin: 34px 0 23px; }
.login-copy h1 { margin-bottom: 8px; font-size: 2rem; letter-spacing: -.045em; }
.login-copy p:last-child { color: var(--text-soft); font-size: .74rem; }
.login-card .back-link { display: flex; min-height: 42px; margin-top: 20px; align-items: center; justify-content: center; text-align: center; }
.public-login-card { width: min(460px, 100%); }
.auth-switch { margin: 18px 0 0; color: var(--text-soft); font-size: .72rem; text-align: center; }
.auth-switch a { color: var(--primary); font-weight: 750; }

/* AdSense & Floating Ad System Styles */
.ad-slot {
    box-sizing: border-box;
    width: 100%;
}
.ad-slot-banner {
    width: min(100% - 24px, 1200px);
    margin: 20px auto;
    text-align: center;
    overflow: hidden;
}
.ad-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}
ins.adsbygoogle {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    text-align: center;
}
.ad-slot ins.adsbygoogle {
    width: 100%;
}
.adsense-example-card {
    width: 100%;
    min-height: 92px;
    padding: 14px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(16, 26, 36, 0.95), rgba(11, 18, 25, 0.98));
    border: 1px dashed rgba(25, 211, 197, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    box-sizing: border-box;
    transition: border-color .2s ease;
}
.adsense-example-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}
.adsense-info-icon {
    font-size: .75rem;
    color: var(--text-soft);
    opacity: .85;
    cursor: help;
}
.adsense-example-body {
    width: 100%;
}
.adsense-example-title {
    display: block;
    font-size: .94rem;
    color: #ffffff;
    font-weight: 750;
    margin-bottom: 2px;
    line-height: 1.3;
}
.adsense-example-url {
    display: inline-block;
    font-size: .74rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}
.adsense-example-desc {
    margin: 0;
    font-size: .78rem;
    color: var(--text-soft);
    line-height: 1.4;
}

@media (max-width: 580px) {
    .adsense-example-card {
        padding: 12px 14px;
        min-height: 80px;
        border-radius: 10px;
    }
    .adsense-example-title {
        font-size: .84rem;
    }
    .adsense-example-desc {
        font-size: .72rem;
    }
}
.ad-content a {
    display: inline-block;
    max-width: 100%;
    text-decoration: none;
    transition: opacity .2s ease, transform .2s ease;
}
.ad-content a:hover {
    opacity: .96;
    transform: translateY(-1px);
}
.ad-content img,
.ad-slot img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    border: 1px solid rgba(164, 231, 226, 0.14);
    transition: box-shadow .2s ease, border-color .2s ease;
}
.ad-content a:hover img {
    border-color: rgba(25, 211, 197, 0.35);
    box-shadow: 0 10px 28px rgba(25, 211, 197, 0.15);
}
.chapter-box .ad-slot-banner {
    width: 100%;
    margin: 14px 0 20px;
}
.reader-container .ad-slot-banner {
    width: 100%;
    margin: 20px 0;
}
.ad-demo-banner { padding: 18px 24px; border: 1px dashed rgba(14, 165, 153, 0.4); border-radius: 10px; background: rgba(14, 165, 153, 0.05); color: var(--text); }
.ad-badge { display: inline-block; font-size: .62rem; font-weight: 850; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; background: var(--primary); color: #031313; margin-bottom: 6px; }
.ad-demo-banner strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.ad-demo-banner p { margin: 0; font-size: .78rem; color: var(--text-soft); }

.ad-slot-floating { position: fixed; z-index: 99999; max-width: 320px; box-shadow: 0 16px 40px rgba(0,0,0,0.8); border-radius: 12px; overflow: hidden; transition: transform .3s ease; pointer-events: auto; }
.ad-slot-floating .ad-close-btn { position: absolute; top: 8px; right: 8px; z-index: 999999; width: 28px; height: 28px; border-radius: 50%; background: #000000; color: #ffffff; border: 2px solid #ffffff; font-size: .9rem; font-weight: bold; cursor: pointer; display: grid; place-items: center; line-height: 1; pointer-events: auto; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.ad-slot-floating .ad-close-btn:hover { background: #ff4757; color: #ffffff; border-color: #ff4757; transform: scale(1.1); }

.ad-slot-floating_bottom_left { bottom: 20px; left: 20px; }
.ad-slot-floating_bottom_right { bottom: 20px; right: 20px; }
.ad-slot-floating_top_right { top: 80px; right: 20px; }
.ad-slot-floating_modal_overlay { top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 420px; width: min(90%, 420px); border: 1px solid var(--primary); }

.ad-demo-box { padding: 20px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; }
.ad-demo-box strong { display: block; font-size: .95rem; color: #ffffff; margin-bottom: 4px; }
.ad-demo-box p { margin: 0; font-size: .75rem; color: var(--text-soft); }

/* Popular / Series Más Vistas Redesign */
.popular-section { margin-top: 40px; margin-bottom: 40px; }
.popular-card-container { background: #0c1017; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 24px; box-shadow: 0 16px 40px rgba(0,0,0,0.6); }
.popular-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 14px; }
.popular-header h2 { font-size: 1.4rem; font-weight: 900; color: #ffffff; margin: 0; display: flex; align-items: center; gap: 10px; }
.popular-tabs { display: inline-flex; background: rgba(255, 255, 255, 0.06); padding: 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); gap: 4px; }
.popular-tab-btn { background: transparent; border: none; color: var(--text-soft); font-size: .82rem; font-weight: 750; padding: 6px 18px; border-radius: 8px; cursor: pointer; transition: all .2s ease; }
.popular-tab-btn:hover { color: #ffffff; }
.popular-tab-btn.is-active { background: #8c52ff; color: #ffffff; box-shadow: 0 4px 16px rgba(140,82,255,0.45); }

.popular-list { display: flex; flex-direction: column; gap: 12px; }
.popular-list-tab { display: none; }
.popular-list-tab.is-active { display: flex; flex-direction: column; gap: 12px; }

.popular-item { display: flex; align-items: center; gap: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid transparent; transition: all .2s ease; text-decoration: none; }
.popular-item:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(140, 82, 255, 0.35); transform: translateX(4px); }

.popular-cover-wrap { position: relative; width: 66px; height: 90px; flex-shrink: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,0.6); }
.popular-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.popular-rank-badge { position: absolute; top: 4px; left: 4px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; background: #8c52ff; color: #ffffff; font-size: .75rem; font-weight: 900; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.6); border: 2px solid #0c1017; }

.popular-item:nth-child(1) .popular-rank-badge { background: linear-gradient(135deg, #8c52ff, #ff0075); }
.popular-item:nth-child(2) .popular-rank-badge { background: linear-gradient(135deg, #7000ff, #00d4ff); }
.popular-item:nth-child(3) .popular-rank-badge { background: linear-gradient(135deg, #ff0055, #ff9900); }

.popular-item-info { flex: 1; min-width: 0; }
.popular-item-title { font-size: .96rem; font-weight: 800; color: #ffffff; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.popular-item-genres { font-size: .76rem; color: var(--text-soft); margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popular-item-genres span { color: #dcdde1; font-weight: 600; }
.popular-item-rating { font-size: .78rem; color: #f1ba5f; display: flex; align-items: center; gap: 6px; font-weight: 800; }
.popular-item-rating .stars { letter-spacing: -1px; }

.reader-ranking-section { padding-top: 8px; }
.reader-ranking-panel { padding: 24px; border: 1px solid rgba(164,231,226,.14); border-radius: 14px; background: linear-gradient(145deg, rgba(14,26,32,.96), rgba(9,16,21,.98)); box-shadow: 0 18px 42px rgba(0,0,0,.28); }
.reader-ranking-heading { display: flex; margin-bottom: 18px; align-items: flex-end; justify-content: space-between; gap: 18px; }
.reader-ranking-heading h2 { margin: 0 0 5px; font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -.035em; }
.reader-ranking-heading p:not(.eyebrow) { margin: 0; color: var(--text-soft); font-size: .72rem; }
.reader-ranking-rule { display: inline-flex; min-height: 34px; padding: 0 11px; border: 1px solid rgba(25,211,197,.24); border-radius: 999px; align-items: center; background: var(--primary-soft); color: var(--primary); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.reader-ranking-list { display: grid; margin: 0; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; list-style: none; }
.reader-ranking-item { display: grid; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 9px; grid-template-columns: 28px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; background: rgba(255,255,255,.025); }
.reader-ranking-position { color: var(--primary); font-size: .76rem; font-weight: 850; text-align: center; }
.reader-ranking-avatar { display: grid; width: 34px; height: 34px; border-radius: 50%; place-items: center; background: linear-gradient(145deg, var(--primary), #087d79); color: #031211; font-size: .72rem; font-weight: 900; }
.reader-ranking-copy { min-width: 0; }
.reader-ranking-copy strong { display: block; overflow: hidden; color: var(--text); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.reader-ranking-copy small { display: block; margin-top: 3px; color: var(--text-soft); font-size: .62rem; }
.reader-ranking-score { display: inline-flex; align-items: baseline; gap: 4px; color: var(--primary); white-space: nowrap; }
.reader-ranking-score b { font-size: 1rem; }
.reader-ranking-score small { color: var(--text-soft); font-size: .58rem; }
.reader-ranking-empty { padding: 24px 10px 10px; color: var(--text-soft); font-size: .74rem; text-align: center; }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Optimized & Conflict-Free)
   ========================================================================== */

/* 1. Large Tablets & Small Laptops (<= 1080px) */
@media (max-width: 1080px) {
    .site-header { gap: 16px; }
    .site-header nav { gap: 16px; }
    .update-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .home-columns { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
    .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .directory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .most-viewed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trending-grid { gap: 14px; }
}

/* 2. Tablets & Mobile Nav Transition (<= 900px) */
@media (max-width: 900px) {
    .site-header {
        height: 58px;
        padding-inline: 14px;
        gap: 10px;
    }
    .site-header .brand {
        flex-shrink: 0;
    }
    .mobile-menu-toggle {
        display: flex;
        order: 10;
        flex: 0 0 auto;
    }
    .site-main-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 14px;
        left: 14px;
        display: none !important;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 12px;
        flex-direction: column;
        align-items: stretch !important;
        gap: 4px !important;
        background: rgba(12, 21, 28, .98);
        box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
        backdrop-filter: blur(18px);
        z-index: 1000;
    }
    .site-main-nav.is-open {
        display: flex !important;
    }
    .site-main-nav a {
        display: flex !important;
        min-height: 44px;
        padding: 0 14px;
        border-radius: 8px;
        align-items: center;
        color: var(--text);
        font-size: .8rem;
        font-weight: 650;
    }
    .site-main-nav a:hover {
        background: var(--primary-soft);
        color: var(--primary);
    }
    .site-main-nav a::after {
        display: none;
    }
    .moderator-nav-mobile { display: flex !important; color: #f1ba5f !important; }
    .moderator-nav-desktop { display: none !important; }
    .moderator-filters { grid-template-columns: 1fr 1fr; }

    .header-search {
        flex: 1 1 180px;
        max-width: 260px;
        height: 38px;
        margin-left: auto;
    }
    .header-user-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .notifications-bell {
        width: 38px;
        height: 38px;
    }
    .header-auth-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: .78rem;
        border-radius: 6px;
    }

    /* Hero Banner: 1 slide per view on tablet/mobile */
    .hero-slides {
        width: calc(var(--hero-count, 3) * 100%);
        gap: 14px;
    }
    .hero-slide {
        height: clamp(310px, 46vw, 390px);
        aspect-ratio: auto;
        border-radius: 12px;
    }
    .scan-hero-content {
        padding: 24px 22px;
        align-items: flex-end;
    }
    .scan-hero-copy {
        max-width: 92%;
    }
    .scan-hero-copy h1 {
        font-size: clamp(1.4rem, 4.5vw, 2.3rem);
    }

    /* Home & Series Layouts */
    .home-columns {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .recent-panel {
        position: static;
    }
    .update-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }
    .book-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .directory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .series-hero {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 32px;
    }

    /* Admin Shell Responsive */
    .admin-shell {
        display: block;
    }
    .admin-sidebar {
        position: sticky;
        z-index: 50;
        top: 0;
        height: auto;
        padding: 10px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
        background: #080d12;
    }
    .brand-admin {
        padding: 0 12px 0 0;
        border-right: 1px solid var(--line-soft);
        border-bottom: 0;
    }
    .brand-admin small, .admin-profile {
        display: none;
    }
    .admin-nav {
        margin: 0;
        flex-direction: row;
        gap: 4px;
    }
    .admin-nav a {
        white-space: nowrap;
        min-height: 38px;
        padding: 0 10px;
        font-size: .7rem;
    }
    .sidebar-logout {
        margin: 0 0 0 auto;
    }
    .sidebar-logout button {
        width: max-content;
    }

    .account-grid {
        grid-template-columns: 1fr;
    }
    .account-profile-card {
        position: static;
    }
    .community-grid {
        grid-template-columns: 1fr;
    }
    .user-filters {
        grid-template-columns: 1fr 1fr;
    }
    .user-filters input {
        grid-column: 1 / -1;
    }

    .admin-series-table {
        min-width: 0;
        table-layout: fixed;
    }
    .admin-series-table th,
    .admin-series-table td {
        padding-inline: 7px;
    }
    .admin-series-table th:nth-child(2),
    .admin-series-table td:nth-child(2),
    .admin-series-table th:nth-child(6),
    .admin-series-table td:nth-child(6),
    .admin-series-table th:nth-child(8),
    .admin-series-table td:nth-child(8) {
        display: none;
    }
    .admin-series-table th:nth-child(3),
    .admin-series-table td:nth-child(3) {
        width: 48px;
    }
    .admin-series-table th:nth-child(5),
    .admin-series-table td:nth-child(5) {
        width: 98px;
    }
    .admin-series-table th:nth-child(7),
    .admin-series-table td:nth-child(7) {
        width: 62px;
        text-align: center;
    }
    .admin-series-table th:last-child,
    .admin-series-table td:last-child {
        width: 84px;
    }
    .admin-series-table th:nth-child(1),
    .admin-series-table td:nth-child(1) {
        width: 38px;
    }
    .admin-series-table td:nth-child(4) {
        min-width: 0;
    }
    .admin-series-table td:nth-child(4) strong,
    .admin-series-table td:nth-child(4) .table-subtitle {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .admin-series-table td:nth-child(5) .badge {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    .admin-series-table .table-actions {
        gap: 5px;
    }
    .admin-series-table .table-icon-link {
        width: 34px;
        height: 34px;
    }
    .admin-users-table {
        min-width: 720px;
    }
}

/* 3. Small Tablets & Phablets (<= 720px) */
@media (max-width: 720px) {
    .scan-container {
        width: min(100% - 24px, 1260px);
    }
    .scan-hero {
        padding: 16px 0 22px;
    }
    .hero-slides-wrapper {
        width: 100%;
        border-radius: 11px;
    }
    .hero-slide {
        height: clamp(300px, 54vw, 380px);
    }
    .scan-hero-content {
        padding: 20px 18px;
    }
    .scan-hero-copy {
        max-width: 95%;
    }
    .scan-hero-copy h1 {
        font-size: clamp(1.3rem, 6vw, 2.1rem);
    }
    .scan-hero-copy > p:not(.eyebrow) {
        max-width: 440px;
        font-size: .68rem;
    }
    .hero-arrow-prev {
        left: 8px;
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    .hero-arrow-next {
        right: 8px;
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    .hero-carousel-dots {
        bottom: 12px;
    }

    .update-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 10px;
    }
    .book-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .most-viewed-grid {
        grid-template-columns: 1fr;
    }

    .trending-panel {
        padding: 24px 20px;
    }
    .trending-grid {
        padding-bottom: 8px;
    }

    /* Catalog Filters Form */
    .catalog-filters {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .catalog-filters .button {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 42px;
    }

    /* Series Page Hero & Chapter List */
    .series-hero {
        width: 100%;
        padding: 28px 18px;
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
        justify-items: center;
    }
    .series-cover {
        width: min(180px, 52vw);
        margin: 0 auto;
    }
    .series-copy {
        width: 100%;
    }
    .series-copy h1 {
        font-size: clamp(1.6rem, 6.5vw, 2.5rem);
    }
    .series-title-line {
        align-items: center;
        justify-content: center;
    }
    .series-stats-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
    }
    .series-stats-bar .stat-glass-card {
        min-width: 0;
        max-width: none;
        width: auto;
        padding: 10px 8px;
    }
    .series-genres {
        justify-content: center;
    }
    .series-actions {
        width: 100%;
        flex-direction: column;
    }
    .series-actions .button,
    .series-actions .favorite-form,
    .series-actions .favorite-form .button {
        width: 100%;
    }

    .chapter-box {
        width: 100%;
    }
    .chapter-panel-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 16px;
    }
    .chapter-heading-top {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }
    .chapter-heading-top h2 {
        font-size: 1.15rem;
        margin: 0;
        line-height: 1.25;
    }
    .chapter-heading-top .eyebrow {
        margin: 0 0 4px;
        font-size: .68rem;
    }
    .chapter-total {
        padding: 5px 12px;
        font-size: .74rem;
        border-radius: 999px;
    }
    .chapter-box-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .chapter-search-wrap {
        flex: 1 1 auto;
        min-width: 0;
    }
    .chapter-search-filter {
        width: 100% !important;
        min-height: 42px;
        font-size: .82rem;
        border-radius: 8px;
    }
    .chapter-order-btn {
        flex-shrink: 0;
        min-height: 42px;
        padding: 0 14px;
        font-size: .78rem;
        border-radius: 8px;
    }
    .chapter-list time {
        display: none;
    }

    /* Reader Toolbar & Nav */
    .reader-header {
        min-height: 58px;
        padding-inline: 12px;
        gap: 10px;
    }
    .reader-brand strong {
        display: none;
    }
    .reader-breadcrumb strong {
        max-width: 140px;
    }
    .reader-toolbar {
        position: static;
        width: 100%;
        margin-top: 10px;
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .reader-toolbar-center {
        grid-row: 2;
        grid-column: 1 / -1;
        display: flex;
        width: 100%;
    }
    .reader-toolbar-center a,
    .reader-toolbar-center .reader-disabled {
        flex: 1;
        text-align: center;
    }
    .reader-toolbar-center .reader-chapter-select-desktop {
        display: none;
    }
    .reader-toolbar-center .reader-chapter-picker-trigger {
        display: inline-flex;
        flex: 2;
        min-width: 0;
        max-width: none;
    }
    .reader-mode .reader-pages {
        width: calc(100% - 44px);
    }
    .reader-mode.reader-wide .reader-pages {
        width: calc(100% - 12px);
    }
    .reader-tools {
        grid-column: 2;
        grid-row: 1;
    }
    .reader-nav {
        grid-template-columns: 1fr 1fr;
    }
    .reader-nav > .reader-index {
        display: none;
    }

    /* Admin Grids */
    .metric-grid, .dashboard-metrics, .stats-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-grid, .dashboard-columns, .stats-report-grid {
        grid-template-columns: 1fr;
    }
    .stats-report-wide {
        grid-column: auto;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: auto;
    }
    .token-reveal {
        grid-template-columns: 1fr;
    }

    /* Ranking & Discord */
    .reader-ranking-panel {
        padding: 18px;
    }
    .reader-ranking-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .reader-ranking-rule {
        align-self: flex-start;
    }
    .discord-banner-card {
        padding: 22px 20px;
    }
    .discord-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .discord-button {
        width: 100%;
        justify-content: center;
    }
}

/* 4. Mobile Devices (<= 580px) */
@media (max-width: 580px) {
    .site-header {
        height: 56px;
        padding-inline: 12px;
        gap: 8px;
    }
    .site-header .brand {
        flex-shrink: 0;
    }
    .site-header .brand-mark {
        width: 30px;
        height: 30px;
        font-size: .84rem;
    }
    .site-header .brand > span:last-child {
        font-size: .88rem;
    }
    .header-search {
        display: none !important;
    }
    .header-user-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .account-link {
        width: 38px;
        height: 38px;
        min-height: 38px;
        max-width: 38px;
        padding: 0;
        border: 1.5px solid rgba(25, 211, 197, 0.45);
        border-radius: 50%;
        background: var(--surface);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 0 12px rgba(25, 211, 197, 0.18);
        overflow: hidden;
        flex-shrink: 0;
        text-decoration: none;
        transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
    }
    .account-link:active {
        transform: scale(0.93);
    }
    .account-link:hover {
        border-color: var(--primary);
        box-shadow: 0 0 16px rgba(25, 211, 197, 0.4);
    }
    .account-link-avatar {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: linear-gradient(145deg, var(--primary), #087d79);
        color: #031211;
        font-size: .84rem;
        font-weight: 900;
        line-height: 1;
    }
    .account-link-name {
        display: none !important;
    }
    .notifications-bell {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        flex-shrink: 0;
    }
    .mobile-menu-toggle {
        display: flex;
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        flex-shrink: 0;
    }
    .mobile-menu-toggle span {
        width: 16px;
    }
    .notifications-dropdown {
        right: -6px;
        width: min(310px, 92vw);
    }
    .header-auth-register {
        display: none !important;
    }
    .header-auth-btn {
        min-height: 36px;
        padding: 6px 12px;
        font-size: .76rem;
    }

    .chapter-box.panel-card {
        padding: 16px 14px;
        border-radius: 12px;
    }
    .chapter-heading-top h2 {
        font-size: 1.08rem;
    }
    .chapter-total {
        padding: 4px 10px;
        font-size: .7rem;
    }
    .chapter-list > a {
        padding: 11px 12px;
        min-height: 50px;
        gap: 8px;
    }
    .chapter-number {
        min-width: 52px;
        font-size: .72rem;
    }
    .chapter-list > a strong {
        font-size: .78rem;
    }
    .chapter-list > a b {
        opacity: .4;
        font-size: .76rem;
    }

    /* Ads on Mobile */
    .ad-slot-banner {
        width: 100%;
        margin: 12px 0 16px;
    }
    .ad-slot-floating {
        max-width: calc(100vw - 28px);
        left: 14px !important;
        right: 14px !important;
        bottom: 14px !important;
        margin: 0 auto;
    }
    .ad-slot-floating .ad-content img {
        max-height: 200px;
        object-fit: cover;
    }
    .ad-demo-banner {
        padding: 14px 16px;
    }

    /* Popular Redesign on Mobile */
    .popular-card-container {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .popular-header {
        margin-bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .popular-tabs {
        width: 100%;
        display: flex;
    }
    .popular-tab-btn {
        flex: 1;
        padding: 6px 4px;
        font-size: .74rem;
        text-align: center;
    }
    .popular-item {
        gap: 10px;
        padding: 8px 6px;
    }
    .popular-cover-wrap {
        width: 56px;
        height: 76px;
    }
    .popular-item-title {
        font-size: .86rem;
    }
    .popular-item-genres {
        font-size: .7rem;
    }

    .reader-ranking-list {
        grid-template-columns: 1fr;
    }
}

/* 5. Small Mobile (<= 500px) */
@media (max-width: 500px) {
    .scan-section {
        padding-block: 36px;
    }
    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .update-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 8px;
    }
    .update-card {
        padding: 5px;
    }
    .update-cover {
        aspect-ratio: 2/2.5;
        max-height: 145px;
    }
    .update-card-body {
        padding: 5px 2px 2px;
    }
    .update-card h3 {
        min-height: 28px;
        margin-bottom: 4px;
        font-size: .68rem;
        line-height: 1.22;
    }
    .update-card h3 a {
        min-height: 28px;
    }
    .update-card .chapter-chip {
        min-height: 28px;
        padding: 3px 5px;
        font-size: .54rem;
    }

    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 10px;
    }
    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 8px;
    }
    .catalog-filters {
        grid-template-columns: 1fr;
    }
    .user-filters {
        grid-template-columns: 1fr;
    }
    .user-filters input {
        grid-column: auto;
    }
    .admin-users-table {
        min-width: 620px;
    }

    .series-hero {
        padding: 22px 14px;
    }
    .series-cover {
        width: 150px;
    }
    .series-breadcrumb {
        display: none;
    }
    .hero-carousel-arrow {
        display: none;
    }

    .trending-panel {
        padding: 20px 14px 18px;
    }
    .trending-title h2 {
        font-size: 1.25rem;
    }
    .trending-grid {
        grid-template-columns: repeat(5, minmax(135px, 1fr));
        gap: 10px;
    }

    .reader-toolbar-center .reader-page-count {
        display: none;
    }
    .reader-toolbar a,
    .reader-toolbar button,
    .reader-toolbar .reader-disabled {
        min-height: 40px;
        padding-inline: 8px;
        font-size: .65rem;
    }
    .reader-tools button[data-reader-theme] {
        max-width: 98px;
        padding-inline: 4px;
        font-size: .56rem;
    }
    .reader-tools {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .opinion-controls {
        gap: 8px;
    }
    .chapter-vote-btn {
        flex: 1 1 120px;
        min-height: 40px;
        padding: 0 12px;
        font-size: .74rem;
    }
    .opinion-header h3 {
        font-size: 1.05rem;
    }

    .comment-form-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .spoiler-switch {
        align-self: flex-start;
    }
    .comment-form .button,
    .rating-form .button {
        width: 100%;
    }
    .rating-options {
        justify-content: space-between;
    }
    .rating-options label {
        flex: 1;
        justify-content: center;
    }

    .auth-shell {
        padding: 14px;
    }
    .login-card {
        padding: 22px 18px;
    }
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }
    .footer-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .account-favorites {
        grid-template-columns: 1fr;
    }
    .account-logout {
        width: 100%;
        margin-left: 0;
    }
    .account-logout .button {
        width: 100%;
    }
}

/* 6. Ultra-Compact Mobile (<= 380px) */
@media (max-width: 380px) {
    .scan-container {
        width: calc(100% - 16px);
    }
    .site-header {
        padding-inline: 8px;
    }
    .site-header .brand > span:last-child {
        font-size: .8rem;
    }
    .update-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 6px;
    }
    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 8px;
    }
    .popular-tab-btn {
        padding: 5px 2px;
        font-size: .7rem;
    }
}

/* ==========================================================================
   Series Favorites Styling & Indicators
   ========================================================================== */
.button-favorite {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .22s cubic-bezier(.16, 1, .3, 1);
}
.button-favorite .favorite-icon {
    flex-shrink: 0;
    transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), fill .22s ease, stroke .22s ease;
}
.button-favorite:hover .favorite-icon {
    transform: scale(1.18);
}
.button-favorite.is-active {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.75) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.28);
}
.button-favorite.is-active:hover {
    background: rgba(245, 158, 11, 0.28) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Guest Authentication Prompts & Notice Badges
   ========================================================================== */
.opinion-guest-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: -8px 0 20px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(25, 211, 197, 0.07);
    border: 1px solid rgba(25, 211, 197, 0.22);
    color: #a4b0c2;
    font-size: .74rem;
    text-align: center;
}
.opinion-guest-notice svg {
    flex-shrink: 0;
    color: var(--primary);
}
.opinion-guest-notice a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.opinion-guest-notice a:hover {
    color: #45e5da;
}

.guest-cta-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(14, 26, 34, 0.75), rgba(9, 17, 23, 0.85));
    border: 1px solid rgba(164, 231, 226, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.guest-cta-card.compact {
    padding: 12px 16px;
    margin-top: 10px;
    margin-bottom: 0;
}
.guest-cta-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: rgba(25, 211, 197, 0.12);
    font-size: 1.15rem;
}
.guest-cta-card.compact .guest-cta-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: .95rem;
}
.guest-cta-body {
    flex: 1;
    min-width: 0;
}
.guest-cta-body strong {
    display: block;
    margin-bottom: 3px;
    color: #ffffff;
    font-size: .82rem;
    font-weight: 750;
}
.guest-cta-body p {
    margin: 0;
    color: #a4b0c2;
    font-size: .75rem;
    line-height: 1.45;
}
.guest-cta-body a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.guest-cta-body a:hover {
    color: #45e5da;
}

/* Auth Toast Popup */
.auth-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(440px, calc(100vw - 32px));
}
.auth-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(10, 18, 24, 0.94);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(25, 211, 197, 0.35);
    color: #ffffff;
    font-size: .8rem;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 0 0 20px rgba(25, 211, 197, 0.15);
    animation: toastSlideUp .3s cubic-bezier(.16, 1, .3, 1);
}
.auth-toast.toast-exit {
    animation: toastSlideDown .25s ease-in forwards;
}
.auth-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.auth-toast-content svg {
    color: var(--primary);
    flex-shrink: 0;
}
.auth-toast-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--primary);
    color: #031313 !important;
    font-weight: 850;
    font-size: .74rem;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .15s, background .15s;
}
.auth-toast-btn:hover {
    background: #45e5da;
    transform: translateY(-1px);
}
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastSlideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(20px) scale(.96); }
}

/* Background ZIP import progress */
.zip-import-status {
    max-width: 920px;
}
.zip-upload-progress {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(25, 211, 197, .22);
    border-radius: 10px;
    background: rgba(25, 211, 197, .05);
}
.zip-upload-progress strong { color: var(--primary); font-size: .82rem; }
.zip-upload-progress small { color: var(--text-soft); line-height: 1.45; }
.zip-progress-shell {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid rgba(25, 211, 197, .22);
    border-radius: 12px;
    background: rgba(25, 211, 197, .05);
}
.zip-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
}
.zip-progress-track span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea599, var(--primary));
    transition: width .35s ease;
}
.zip-progress-track.is-indeterminate span {
    width: 38% !important;
    min-width: 38%;
    animation: zipProgress 1.2s ease-in-out infinite;
}
.zip-progress-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    color: var(--text-soft);
    font-size: .78rem;
}
.zip-progress-row strong {
    color: var(--primary);
    font-size: 1rem;
}
.zip-import-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.zip-import-metrics > div {
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .025);
}
.zip-import-metrics span,
.zip-import-metrics strong {
    display: block;
}
.zip-import-metrics span {
    color: var(--text-soft);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.zip-import-metrics strong {
    margin-top: 5px;
    color: var(--text);
    font-size: 1rem;
}
.zip-import-message {
    margin: 18px 0 0;
    color: var(--text-soft);
    line-height: 1.55;
}
.zip-duplicate-review {
    max-width: 920px;
    border-color: rgba(245, 158, 11, .34);
}
.zip-duplicate-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.zip-duplicate-selection {
    margin: -6px 0 18px;
    color: var(--text-soft);
    font-size: .82rem;
}
.zip-duplicate-intro {
    margin: 0 0 18px;
    color: var(--text-soft);
    line-height: 1.55;
}
.zip-duplicate-list {
    display: grid;
    gap: 16px;
}
.zip-duplicate-group {
    overflow: hidden;
    border: 1px solid rgba(245, 158, 11, .34);
    border-radius: 14px;
    background: rgba(245, 158, 11, .045);
}
.zip-duplicate-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(245, 158, 11, .2);
    background: rgba(245, 158, 11, .08);
}
.zip-duplicate-group-heading > div {
    display: grid;
    gap: 3px;
}
.zip-duplicate-group-heading strong {
    color: var(--text);
    font-size: .92rem;
}
.zip-duplicate-group-heading > span {
    color: var(--text-soft);
    font-size: .78rem;
}
.zip-duplicate-group-items {
    display: grid;
}
.zip-duplicate-item {
    display: grid;
    grid-template-columns: minmax(180px, .9fr) minmax(240px, 1.35fr);
    gap: 14px 18px;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid rgba(245, 158, 11, .16);
    border-radius: 0;
    background: transparent;
}
.zip-duplicate-item:last-child {
    border-bottom: 0;
}
.zip-duplicate-source,
.zip-duplicate-name {
    display: grid;
    gap: 6px;
}
.zip-duplicate-source strong {
    overflow-wrap: anywhere;
    color: var(--text);
}
.zip-duplicate-source span,
.zip-duplicate-source small,
.zip-duplicate-name span {
    color: var(--text-soft);
    font-size: .78rem;
    line-height: 1.4;
}
.zip-duplicate-name input {
    width: 100%;
}
.zip-duplicate-options {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.zip-duplicate-delete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: .82rem;
}
.zip-duplicate-delete input {
    width: auto;
}
.zip-duplicate-actions {
    margin: 18px 0 0;
}
@keyframes zipProgress {
    0% { transform: translateX(-130%); }
    50%, 100% { transform: translateX(285%); }
}
@media (max-width: 720px) {
    .zip-import-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .zip-duplicate-item { grid-template-columns: 1fr; }
    .zip-duplicate-options { grid-column: 1; justify-content: flex-start; }
    .zip-duplicate-heading-actions { justify-content: flex-start; }
    .zip-duplicate-group-heading { align-items: flex-start; flex-direction: column; }
}

/* Reader controls: keep the open panel in normal flow, below the toolbar. */
.reader-settings-panel { position: relative; top: auto; z-index: 20; box-sizing: border-box; width: min(900px, calc(100% - 30px)); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 20px; }
.reader-settings-panel > * { min-width: 0; }
.reader-settings-panel label, .reader-settings-panel .reader-setting-group { margin: 0; font-size: .8rem; line-height: 1.5; }
.reader-settings-panel select { width: 100%; min-width: 0; height: 44px; font-size: .9rem; }
.reader-settings-panel input[type="range"] { width: 100%; min-width: 0; height: 32px; padding: 0; margin: 0; box-shadow: none; border: 0; background: transparent; }
.reader-setting-stepper { grid-template-columns: 44px minmax(24px, 1fr) 44px; }
.reader-setting-stepper button { height: 44px; font-size: .9rem; }
.reader-setting-stepper output { font-size: .9rem; }
.reader-settings-panel .reader-settings-reset { grid-column: 1 / -1; justify-self: end; min-height: 40px; }
.reader-tools { flex-wrap: wrap; }
.reader-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; }
.reader-toolbar-center { min-width: 0; }
.reader-toolbar-center select { min-width: 0; }
body.reader-theme-sage .reader-canvas-pages { background: #e2eadf; border-color: #90a88a; box-shadow: 0 12px 36px rgba(0,0,0,.2); }
body.reader-theme-sage .reader-canvas-pages canvas { filter: brightness(0) saturate(100%) invert(18%) sepia(12%) saturate(1092%) hue-rotate(61deg) brightness(95%) contrast(89%); }
.reader-settings-panel :focus-visible, .reader-tools button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1000px) {
 .reader-toolbar { grid-template-columns: auto minmax(0, 1fr); }
 .reader-tools { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
}
@media (max-width: 600px) {
 .reader-settings-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 16px 12px; }
 .reader-tools button { flex: 1 1 auto; }
 .reader-settings-panel .reader-settings-reset { justify-self: stretch; }
}

@media (max-width: 600px) {
 .reader-toolbar > .reader-index { grid-row: 1; grid-column: 1; justify-self: start; }
 .reader-toolbar-center { grid-row: 2; grid-column: 1 / -1; }
 .reader-tools { grid-row: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
 .reader-tools button[data-reader-theme] { max-width: none; font-size: .65rem; }
}
