:root { color-scheme: dark; font: 1rem/1.65 system-ui, sans-serif; color: #ecebf5; background: #13182a; }
body { box-sizing: content-box; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 69rem; margin: 0 auto; padding: 0 1rem; }
body > main { flex: 1 0 auto; min-width: 0; }
header { border-bottom: 1px solid #363e57; padding: 1rem 0; }
nav { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; }
nav:empty { display: none; }
a { color: #f0c883; }
button, input, textarea { font: inherit; padding: .35rem .55rem; max-width: 100%; }
textarea { display: block; width: min(100%, 52rem); box-sizing: border-box; }
img { max-width: 100%; height: auto; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .9rem; list-style: none; padding: 0; }
.story-grid li { padding: .85rem; background: #1e253b; border: 1px solid #363e57; border-radius: .55rem; overflow-wrap: anywhere; }
.story-grid strong, .story-grid small { display: block; }
.cover { display: block; object-fit: cover; aspect-ratio: 2 / 3; }
.chapter-text, .comic-pages { max-width: 52rem; margin: 1rem auto; }
.chapter-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.comic-pages { padding: 0; list-style: none; background: #fff; color: #141414; }
.comic-pages img { display: block; width: 100%; }
.forum-intro, .forum-empty { color: #b8bdd1; }
.forum-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; margin: 1.25rem 0; }
.forum-panel { background: #1e253b; border: 1px solid #363e57; padding: 1.1rem; border-radius: .65rem; min-width: 0; }
.forum-panel h2 { margin: 0 0 .75rem; font-size: 1.12rem; }
.forum-topics { list-style: none; padding: 0; margin: 0; overflow-wrap: anywhere; }
.forum-topics li + li { border-top: 1px solid #363e57; margin-top: .65rem; padding-top: .65rem; }
.forum-action { display: inline-block; padding: .55rem .85rem; border-radius: .4rem; background: #f0c883; color: #18141b; font-weight: 650; text-decoration: none; }
.forum-back { display: inline-block; margin-bottom: 1rem; }
.forum-thread { display: grid; gap: 1rem; max-width: 52rem; overflow-wrap: anywhere; }
.forum-author { margin: 0; color: #f0c883; }
.forum-role { display: inline-block; margin-inline-start: .25rem; padding: .04rem .4rem; border: 1px solid var(--line); border-radius: .35rem; color: var(--muted); font-size: .78rem; }
.story-genres { min-width: 0; border: 1px solid var(--line); border-radius: .45rem; margin: 1rem 0; }
.story-genres p { margin: 0 0 .4rem; color: var(--muted); }
.story-genres > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 8rem),1fr)); gap: .3rem .6rem; max-height: 13rem; overflow: auto; }
main form .story-genres label { display: flex; align-items: baseline; }
main form .story-genres input[type="checkbox"] { width: auto; }
.forum-post > p:last-of-type { margin-bottom: 0; }
.forum-replies { list-style: none; padding: 0; margin: 0; }
.forum-replies li + li { border-top: 1px solid #363e57; padding-top: .65rem; }
.forum-reply-label { display: grid; gap: .35rem; margin-bottom: .8rem; }
.forum-reply-label textarea { border: 1px solid #49516a; border-radius: .4rem; background: #13182a; }
button.forum-action { border: 0; cursor: pointer; }
@media (max-width: 640px) { .forum-layout { grid-template-columns: 1fr; } }
.account-panel { box-sizing: border-box; max-width: 30rem; margin: 1rem auto; padding: clamp(1rem, 4vw, 1.65rem); border: 1px solid #363e57; border-radius: .65rem; background: #1e253b; }
.account-panel h2 { margin-top: 0; font-family: system-ui, "Segoe UI", Arial, sans-serif; }
.account-panel label { display: grid; gap: .25rem; }
.account-panel input { box-sizing: border-box; width: 100%; border: 1px solid #49516a; border-radius: .4rem; background: #13182a; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.account-actions button { border: 0; cursor: pointer; }
.account-switch { padding: .5rem .8rem; border: 1px solid #49516a; border-radius: .4rem; text-decoration: none; }
.site-masthead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; }
.site-masthead a { text-decoration: none; }
.site-masthead a:hover { text-decoration: underline; }
.site-brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.35rem system-ui, "Segoe UI", Arial, sans-serif; }
.catalog-hero { display: grid; align-items: center; min-height: 16rem; padding: clamp(1rem,4vw,2.5rem); border-radius: .7rem; border: 1px solid #363e57; background: linear-gradient(90deg,#11162a 12%,#11162ac9 53%,#11162a30),url('/images/tinh-ha.webp') center 54% / cover; }
.catalog-hero h2 { margin: 0; font: 700 clamp(1.7rem,4vw,2.75rem) system-ui, "Segoe UI", Arial, sans-serif; }
.catalog-hero p { margin: .4rem 0 1rem; }
.catalog-panel { margin-top: 1rem; border: 1px solid #363e57; border-radius: .65rem; padding: clamp(.9rem,3vw,1.45rem); background: #1e253b; }
.catalog-panel h2 { margin: 0 0 .75rem; }
.catalog-search { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem; }
.catalog-search label { display: grid; gap: .35rem; flex: 1 1 14rem; max-width: 28rem; }
.catalog-search input { box-sizing: border-box; width: 100%; border: 1px solid #49516a; border-radius: .4rem; background: #13182a; }

:root {
  --surface: #191f33;
  --line: #363e57;
  --muted: #bfc5d8;
  --accent: #f0c883;
}
body { background: radial-gradient(ellipse at top, #20263e, #13182a 34rem); }
.site-masthead { padding-block: 1.15rem; }
.site-masthead nav { gap: .25rem; }
.site-masthead nav a { padding: .35rem .65rem; border-radius: .4rem; color: #ecebf5; }
.site-masthead nav a:hover, .site-masthead nav a[aria-current="page"] { background: var(--surface); color: var(--accent); }
main > h1 { font: 700 clamp(1.9rem, 5vw, 3rem)/1.15 system-ui, "Segoe UI", Arial, sans-serif; overflow-wrap: anywhere; margin-block: 1.65rem 1.05rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main > [role="status"] { padding: .65rem 1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
main form label { display: grid; gap: .35rem; font-weight: 600; }
main input:not([type="hidden"]), main textarea, main select {
  box-sizing: border-box;
  width: 100%;
  background: #101526;
  color: inherit;
  border: 1px solid #49516a;
  border-radius: .45rem;
  padding: .55rem .65rem;
  font: inherit;
}
main button { background: var(--accent); color: #18141b; border: 1px solid transparent; border-radius: .45rem; font-weight: 650; cursor: pointer; padding: .55rem .85rem; }
main button:hover, .forum-action:hover { background: #f9dca5; }
.content-panel { background: var(--surface); border: 1px solid var(--line); border-radius: .65rem; min-width: 0; padding: clamp(1rem, 3vw, 1.5rem); margin-block: 1rem; overflow-wrap: anywhere; }
.content-panel h2:first-child { margin-top: 0; }
.content-panel textarea { max-width: none; }
.manage-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); align-items: start; gap: 1rem; }
.manage-layout .content-panel { margin-top: 0; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list li + li { border-top: 1px solid var(--line); }
.entry-list li { padding-block: .65rem; }
.entry-list form { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.story-summary { display: flex; align-items: flex-start; gap: clamp(.75rem,3vw,1.5rem); }
.story-summary .cover { flex: 0 0 auto; width: clamp(5rem, 18vw, 9rem); border-radius: .4rem; }
.story-summary p { margin: 0 0 .75rem; }
.story-summary p:last-child { margin-bottom: 0; white-space: pre-line; }
.story-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
.story-grid .cover { width: 100%; border-radius: .32rem; margin-bottom: .5rem; }
.chapter-heading, .chapter-nav { max-width: 52rem; margin-inline: auto; }
.chapter-nav { justify-content: center; }
.chapter-text { box-sizing: border-box; padding: clamp(1rem, 4vw, 2.75rem); background: var(--surface); border-radius: .65rem; font: 1.16rem/1.85 system-ui, "Segoe UI", Arial, sans-serif; }
.chapter-text p:first-child { margin-top: 0; }
.chapter-text p:last-child { margin-bottom: 0; }
.catalog-tabs { gap: .45rem; margin-bottom: 1rem; }
.catalog-tabs [aria-current="page"] { background: var(--accent); color: #18141b; }
.catalog-search label:has(select) { flex-basis: 10rem; }
.profile-avatar { width: 6rem; height: 6rem; object-fit: cover; border-radius: 50%; }
.gallery-landscape { max-width: 50rem; margin: 0; }
.gallery-landscape img { display: block; border-radius: .4rem; }
.catalog-ad { margin-block: 1.25rem; text-align: center; }
.catalog-ad p { margin: 0; color: var(--muted); font-size: .8rem; }
.catalog-ad img { object-fit: contain; }
.user-list form { display: grid; justify-content: stretch; }
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: .9rem 0 1.25rem; font-size: .9rem; }
.site-footer, .home-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.site-footer nav { margin-top: .55rem; }
.site-footer p { margin: .35rem 0 0; color: var(--muted); }
.home-layout { margin-top: 1rem; }
.home-layout > .catalog-panel, .home-sidebar .content-panel { margin-top: 0; }
.home-sidebar .content-panel { padding: 1rem; }
.home-sidebar h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.sidebar-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .6rem; }
.sidebar-row { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); align-items: center; gap: .55rem; }
.sidebar-rank { grid-template-columns: 1.3rem 2.75rem minmax(0, 1fr); }
.sidebar-rank small { display: block; color: var(--muted); }
.sidebar-position { font-weight: 700; color: var(--muted); text-align: center; }
.sidebar-cover { display: grid; place-items: center; border: 1px solid var(--line); aspect-ratio: 2 / 3; }
.sidebar-top-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .2rem; margin-bottom: .6rem; }
.sidebar-top-tabs a { text-align: center; border-bottom: 2px solid var(--line); padding: .35rem .12rem; text-decoration: none; font-size: .85rem; }
.sidebar-top-tabs a[aria-current="page"] { border-color: #b97b32; background: var(--surface); font-weight: 700; }
.catalog-banner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.catalog-banner > div { align-self: center; padding: clamp(1rem, 3vw, 1.8rem); }
.catalog-banner p { margin: 0 0 .75rem; font-weight: 650; font-size: clamp(1rem, 2.2vw, 1.3rem); }
.catalog-banner img { display: block; width: 100%; height: clamp(8rem, 15vw, 10rem); object-fit: cover; object-position: right center; }
@media (max-width: 520px) { .catalog-banner { grid-template-columns: minmax(0, 1fr); } }
.catalog-hero { min-height: 9rem; }
.home-featured { margin-block: 1.4rem; }
.home-featured h2 { margin: 0 0 .65rem; font-size: 1.3rem; }
.featured-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; list-style: none; padding: 0; margin: 0; }
.featured-list a { display: grid; position: relative; border-radius: .6rem; overflow: hidden; color: #fff; text-decoration: none; }
.featured-list .cover { width: 100%; aspect-ratio: 4 / 5; }
.featured-list span { position: absolute; inset: auto 0 0; padding: .65rem; color: #fff; background: #13182aee; overflow-wrap: anywhere; }
.featured-list small { display: block; }
.home-layout .story-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); }
main:has(> .auth-panel) > h1 { max-width: 30rem; margin-inline: auto; }
.auth-panel .auth-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem; margin-bottom: .85rem; }
.auth-panel .auth-primary, .auth-panel .auth-google { box-sizing: border-box; width: 100%; text-align: center; }
.auth-panel .auth-google { display: block; margin-top: .65rem; font-weight: 650; }
.auth-panel .auth-policy { color: var(--muted); font-size: .85rem; margin: 1rem 0 0; }
.reader-breadcrumb { gap: .45rem .8rem; font-size: .9rem; }
main:has(.story-summary) :is(.reader-breadcrumb, .story-facts, .home-sidebar, .chapter-list-row) a { text-decoration: none; }
main:has(.story-summary) :is(.reader-breadcrumb, .story-facts, .home-sidebar, .chapter-list-row) a:is(:hover, :focus-visible) { text-decoration: underline; }
.reader-breadcrumb a + a::before { content: "›"; margin-inline-end: .65rem; color: var(--muted); }
.story-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem .8rem; margin: 0 0 1rem; }
.story-facts dt, .chapter-list-row small { color: var(--muted); }
.story-facts dd { margin: 0; }
.story-read-actions, .chapter-nav { gap: .5rem; align-items: center; }
.story-description p { margin-bottom: 0; white-space: pre-line; }
.chapter-list-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; }
.chapter-heading h2 { margin: .55rem 0 1rem; overflow-wrap: anywhere; }
.chapter-heading .chapter-nav { justify-content: flex-start; }
main .chapter-nav select { width: auto; max-width: 100%; }
.comic-pages { max-width: 69rem; margin-block: 0; }
.comic-toolbar { max-width: 69rem; background: var(--surface); border: 1px solid var(--line); padding: .45rem; gap: .35rem; }
.comic-toolbar-sticky { position: sticky; top: 0; z-index: 2; }
.comic-toolbar .account-switch, .comic-toolbar button { padding: .3rem .55rem; }
.comic-toolbar .chapter-unavailable { opacity: .55; }
.rating-stars { border: 0; padding: 0; margin: 0; min-width: 0; }
.rating-stars legend { padding: 0; font-weight: 650; margin-bottom: .35rem; }
main .rating-stars button { background: transparent; color: #a88952; font-size: 1.75rem; line-height: 1; min-width: 2.65rem; min-height: 2.65rem; padding: .3rem; }
main .rating-stars button.rating-filled { color: #ebae48; }
main .rating-stars button:hover, main .rating-stars button:focus-visible { background: var(--surface); color: #d68b13; }
.rating-stars small { display: block; color: var(--muted); margin-top: .35rem; }
.chapter-comments { max-width: 52rem; box-sizing: border-box; margin-inline: auto; scroll-margin-top: 6rem; }
.chapter-comments li p { white-space: pre-wrap; }
.catalog-card-cover { border-radius: .4rem; overflow: hidden; margin-bottom: .55rem; }
.catalog-card-cover .cover { margin: 0; border-radius: 0; }
.catalog-cover-fallback { display: grid; place-items: center; aspect-ratio: 2 / 3; background: var(--surface); color: var(--accent); }
.catalog-card-metrics { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .15rem .45rem; padding: .22rem .4rem; background: #202039; color: #fff; font-size: .72rem; }
.catalog-card-chapters { list-style: none; padding: 0; margin: .35rem 0 0; }
.story-grid .catalog-card-chapters li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .45rem; padding: .28rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: .82rem; }
.catalog-card-chapters small { color: var(--muted); }
.catalog-results { min-width: 0; }
.catalog-results > h2 { margin: 0 0 .65rem; }
.catalog-results .catalog-filter-panel { margin-top: 0; padding: .95rem; }
.catalog-results > .story-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.story-grid .catalog-story-card { padding: 0; border: 0; background: transparent; }
.catalog-card-cover { border: 1px solid var(--line); }
.catalog-card-cover > a { display: block; position: relative; isolation: isolate; text-decoration: none; }
.catalog-card-cover > a::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #0c1021e8); pointer-events: none; }
.catalog-card-cover :is(.cover, .catalog-cover-fallback) { aspect-ratio: 3 / 4; }
.catalog-card-title { position: absolute; inset: auto .65rem .55rem; z-index: 1; color: #fff; line-height: 1.3; text-shadow: 0 1px 4px #000; }
.catalog-card-cover > a:hover .catalog-card-title { text-decoration: underline; }
main:has(> .landing-hero) > h1 {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.landing-hero { margin-top: 1rem; }
.landing-hero nav { gap: .5rem; }
.featured-list.featured-single { grid-template-columns: minmax(0, 1fr); }
.featured-single a { grid-template-columns: 5rem minmax(0, 1fr); align-items: center; background: var(--surface); border: 1px solid var(--line); padding: .55rem; gap: .85rem; }
.featured-single a .cover, .featured-single a .catalog-cover-fallback { aspect-ratio: 1; border-radius: .3rem; }
.featured-single a span, [data-theme="light"] .featured-single a span {
  position: static; min-width: 0; padding: 0 .5rem 0 0; border: 0; color: inherit; background: transparent;
}
.featured-single small { color: var(--muted); margin-top: .25rem; }
.landing-masthead { border-bottom: 0; padding-bottom: 0; gap: .75rem; }
.masthead-search { display: flex; flex: 1 1 15rem; max-width: 30rem; min-width: 0; align-items: stretch; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
.masthead-search input { flex: 1; width: 0; min-width: 0; border: 0; border-radius: .55rem 0 0 .55rem; background: transparent; color: inherit; padding: .5rem .65rem; }
.masthead-search button { border: 0; border-inline-start: 1px solid var(--line); border-radius: 0 .55rem .55rem 0; background: transparent; color: inherit; font-weight: 650; cursor: pointer; }
.masthead-account { display: flex; gap: .4rem; margin-inline-start: auto; }
.masthead-account a { padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .45rem; }
.masthead-account a.masthead-signin { background: #f0c883; border-color: #f0c883; color: #20172b; font-weight: 650; }
.site-masthead.landing-masthead nav {
  flex-basis: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: stretch; gap: .25rem;
  padding: .35rem .45rem; border: 1px solid #6c537e; border-radius: .55rem;
  background: linear-gradient(105deg, #342958, #53376b);
}
.site-masthead.landing-masthead nav a { color: #fff8f0; text-align: center; }
.site-masthead.landing-masthead nav a:hover { background: #ffffff20; color: #fff8f0; }
.site-masthead.landing-masthead nav a[aria-current="page"] { background: #f0c883; color: #20172b; font-weight: 650; }
.theme-toggle { width: 2.55rem; height: 2.55rem; padding: 0; font-size: 1.25rem; line-height: 1; }
main .comic-toolbar select { flex: 1 1 9rem; min-width: 0; max-width: 22rem; padding: .3rem .45rem; }
@media (max-width: 760px) { .featured-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); } }
@media (max-width: 760px) { .site-footer, .home-layout { grid-template-columns: minmax(0, 1fr); } }
.review-check label { display: flex; align-items: baseline; }
.review-check input[type="checkbox"] { width: auto; }
.account-dashboard { max-width: 55rem; margin-inline: auto; }
main:has(> .account-dashboard) > h1 { max-width: 55rem; margin-inline: auto; }
.account-overview { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.account-identity { min-width: 0; }
.account-identity h2, .account-identity p { margin: 0; }
.account-identity p { color: var(--muted); margin-top: .2rem; font-size: .9rem; }
.account-signout button { background: transparent; color: inherit; border-color: var(--line); }
.account-signout button:hover { color: #18141b; }
.account-shortcuts { flex: 1 0 100%; border-top: 1px solid var(--line); padding-top: .85rem; gap: .5rem; }
.account-shortcuts a { border: 1px solid var(--line); padding: .35rem .65rem; border-radius: .4rem; text-decoration: none; }
.account-shortcuts a:hover { text-decoration: underline; }
.account-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1rem; align-items: start; }
.account-settings .content-panel { margin: 0; }
.account-settings h2 { margin-bottom: .75rem; }
.account-settings details { border-top: 1px solid var(--line); padding: .65rem 0; }
.account-settings details:last-child { padding-bottom: 0; }
.account-settings summary { cursor: pointer; font-weight: 600; }
.account-settings input[type="file"] { min-width: 0; }
.follow-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.follow-layout > .content-panel { margin: 0; }
.follow-layout ol { padding-inline-start: 1.5rem; }
.follow-list li { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr) auto; align-items: start; gap: .75rem; }
.follow-list small { display: block; color: var(--muted); }
.follow-cover { display: grid; place-items: center; aspect-ratio: 2 / 3; border: 1px solid var(--line); color: var(--accent); }
.follow-chapters { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .35rem; }
@media (max-width: 760px) { .follow-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 460px) {
  .follow-list li { grid-template-columns: 3.75rem minmax(0, 1fr); }
  .follow-list form { grid-column: 2; }
}
.theme-toggle { border: 1px solid var(--line); border-radius: .4rem; background: var(--surface); color: inherit; cursor: pointer; }
:root[data-theme="light"] {
  color-scheme: light;
  color: #25243a;
  background: #f5f4f8;
  --surface: #fff;
  --line: #bcb3ce;
  --muted: #484256;
  --accent: #f0c883;
}
[data-theme="light"] body { background: #f5f4f8; }
[data-theme="light"] a,
[data-theme="light"] .site-masthead nav a,
[data-theme="light"] .forum-author { color: #50316f; }
[data-theme="light"] .site-masthead.landing-masthead nav a { color: #fff8f0; }
[data-theme="light"] .site-masthead.landing-masthead nav a[aria-current="page"] { color: #20172b; }
[data-theme="light"] :is(.site-masthead, .catalog-panel, .account-panel, .forum-panel, .story-grid li, .account-switch, .entry-list li, .forum-topics li, .forum-replies li) { border-color: var(--line); }
[data-theme="light"] :is(.catalog-panel, .account-panel, .forum-panel, .story-grid li) { background: var(--surface); }
[data-theme="light"] :is(.forum-empty, .forum-intro) { color: var(--muted); }
[data-theme="light"] main :is(input:not([type="hidden"]), textarea, select) { background: #fff; border-color: #a49bb5; }
[data-theme="light"] .catalog-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #25243a;
  border-color: var(--line);
  background: #fff;
}
[data-theme="light"] .catalog-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 43%;
  background: linear-gradient(90deg, #fff, transparent 55%), url('/images/tinh-ha.webp') right center / cover;
}
@media (max-width: 640px) {
  [data-theme="light"] .catalog-hero::before { inset-inline-start: 62%; background-image: linear-gradient(90deg, #fff, transparent 85%), url('/images/tinh-ha.webp'); }
}
[data-theme="light"] .catalog-hero .account-switch { color: #50316f; background: var(--surface); }
[data-theme="light"] .featured-list a { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
[data-theme="light"] .featured-list span { position: static; background: var(--surface); color: #25243a; border-top: 1px solid var(--line); }
[data-theme="light"] .featured-list small { color: var(--muted); }
[data-theme="light"] :is(.forum-action, .catalog-tabs [aria-current="page"]) { color: #18141b; }
@media (max-width: 640px) {
  .manage-layout { grid-template-columns: minmax(0, 1fr); }
  .site-masthead nav a { padding-inline: .45rem; }
}
.text-toolbar { flex-wrap: nowrap; gap: .25rem; }
.text-toolbar a, .text-toolbar button, .text-toolbar .chapter-unavailable { flex-shrink: 0; white-space: nowrap; }
.text-toolbar select { width: 100%; }
.text-toolbar [data-chapter-prev], .text-toolbar [data-chapter-next], .text-toolbar form button {
  background: #b6353c; color: #fff; border-color: #b6353c;
}
.text-toolbar [data-chapter-prev], .text-toolbar [data-chapter-next], .text-toolbar .chapter-unavailable {
  font-size: 1.15rem; line-height: 1.2;
}
.featured-carousel { position: relative; }
.featured-carousel .featured-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 2.8rem) / 5); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.featured-carousel .featured-list > li { min-width: 0; scroll-snap-align: start; }
.featured-carousel button { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; padding: 0; width: 2.5rem; height: 2.5rem; background: #16192de8; color: #fff; border: 1px solid #ffffff80; border-radius: .5rem; font: 1.75rem/1 system-ui; }
.featured-carousel button:disabled { opacity: .5; cursor: default; }
.featured-carousel [data-featured-prev] { left: .35rem; }
.featured-carousel [data-featured-next] { right: .35rem; }

.mobile-navigation, .mobile-quick-links { display: none; }
.site-masthead:not(.landing-masthead) > .theme-toggle { order: 1; }
.featured-list .catalog-cover-fallback { aspect-ratio: 4 / 5; }
.featured-single .catalog-cover-fallback { aspect-ratio: 1; }

@media (max-width: 760px) {
  .site-masthead { position: relative; flex-wrap: nowrap; justify-content: flex-start; gap: .45rem; padding-block: .55rem; }
  .site-masthead .site-brand { min-width: 0; margin-inline-end: auto; font-size: clamp(1rem, 5vw, 1.25rem); }
  .site-masthead > .theme-toggle { flex: 0 0 2.75rem; height: 2.75rem; }
  .site-masthead > .masthead-search, .site-masthead > .masthead-account,
  .site-masthead > .desktop-navigation, .site-masthead.landing-masthead > .desktop-navigation { display: none; }
  .mobile-navigation { display: block; order: 2; margin: 0; }
  .mobile-navigation summary { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; box-sizing: border-box; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); color: var(--accent); font-size: 1.35rem; cursor: pointer; list-style: none; }
  .mobile-navigation summary::-webkit-details-marker { display: none; }
  .mobile-navigation:not([open]) summary span:last-child, .mobile-navigation[open] summary span:first-child { display: none; }
  .mobile-navigation-panel { position: absolute; inset: 100% 0 auto; z-index: 4; padding: .75rem; max-height: 75vh; overflow: auto; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); box-shadow: 0 .65rem 1.5rem #0b0d1840; }
  .mobile-navigation-panel .masthead-search { margin-bottom: .5rem; }
  .mobile-navigation-panel .masthead-search input { font-size: 1rem; }
  .site-masthead .mobile-navigation-panel nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .4rem; border: 0; padding: 0; background: transparent; }
  .site-masthead .mobile-navigation-panel nav a { display: flex; align-items: center; text-align: start; min-height: 2.75rem; }
  .site-masthead.landing-masthead .mobile-navigation-panel nav a { color: inherit; }
  .site-masthead.landing-masthead .mobile-navigation-panel nav a[aria-current="page"],
  .site-masthead .mobile-navigation-panel nav a[aria-current="page"] { background: #f0c883; color: #20172b; }
  .mobile-navigation-panel .masthead-account { margin-top: .55rem; }
  .landing-hero { margin-top: .65rem; padding: .85rem; }
  .landing-hero h2 { font-size: clamp(1.35rem, 5.8vw, 1.75rem); }
  .landing-hero p { font-size: .92rem; line-height: 1.5; max-width: 35ch; margin-bottom: .65rem; }
  .landing-hero nav a { padding: .4rem .6rem; font-size: .88rem; }
  .landing-hero nav :is([href="/truyen-chu/"], [href="/truyen-tranh/"]) { display: none; }
  .home-featured { margin-block: 1rem; }
  .mobile-quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; padding: .2rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
  .mobile-quick-links a { display: grid; place-items: center; min-height: 2.75rem; padding: .15rem; text-align: center; font-size: .82rem; line-height: 1.2; text-decoration: none; }
  .featured-carousel .featured-list { grid-auto-columns: calc((100% - .7rem) / 2); }
  .featured-carousel .featured-single { grid-auto-columns: 100%; }
  .featured-carousel button { position: static; transform: none; margin-top: .35rem; }
  .featured-list :is(.cover, .catalog-cover-fallback) { aspect-ratio: 4 / 5; }
  .featured-list:not(.featured-single) a { background: var(--surface); color: inherit; border: 1px solid var(--line); }
  .featured-list:not(.featured-single) a span, [data-theme="light"] .featured-list:not(.featured-single) a span { position: static; padding: .5rem; background: var(--surface); color: inherit; border-top: 1px solid var(--line); }
  .featured-list small { color: var(--muted); }
  .featured-single :is(.cover, .catalog-cover-fallback) { aspect-ratio: 1; }
  .featured-list strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.25; }
  .featured-list small { line-height: 1.35; margin-top: .2rem; }
  .catalog-results > .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}
