:root {
  --accent: #eb3349;
  --accent-dark: #c72439;
  --ink: #222;
  --muted: #777;
  --line: #e6e6e6;
  --paper: #fff;
  --panel: #f7f7f7;
  --header: #171717;
  --header-soft: #242424;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.container { width: min(1170px, calc(100% - 32px)); margin-inline: auto; }
.screen-reader-text, .skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  z-index: 1000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 9px 12px;
  color: #fff;
  background: var(--accent);
}

.site-header { background: var(--accent); color: #fff; }
.header-main {
  min-height: 96px;
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(260px, 430px);
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  padding-block: 10px;
}
.site-logo { display: inline-flex; align-items: center; width: min(250px, 100%); }
.site-logo img { width: 250px; height: auto; max-height: 76px; object-fit: contain; object-position: left center; }
.site-search { display: grid; grid-template-columns: 1fr 46px; height: 42px; }
.site-search input {
  min-width: 0;
  border: 1px solid #444;
  border-right: 0;
  border-radius: 3px 0 0 3px;
  color: #eee;
  background: #2e2e2e;
  padding: 0 13px;
  outline: 0;
}
.site-search input:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.site-search button {
  border: 0;
  border-radius: 0 3px 3px 0;
  color: #fff;
  background: var(--accent);
  font-size: 25px;
  cursor: pointer;
}
.site-search button:hover { background: var(--accent-dark); }
.menu-toggle { display: none; }

.primary-nav { border-top: 1px solid rgba(255, 255, 255, .18); background: #d52c42; }
.primary-nav ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.primary-nav a {
  display: block;
  min-height: 50px;
  padding: 15px 20px 13px;
  color: #cfcdbe;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.primary-nav a:hover, .primary-nav a:focus-visible { color: #fff; background: #b91f33; }
.primary-nav .live-menu-item { position: relative; }
.primary-nav .live-menu-item a { padding-left: 36px; }
.live-status-dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42d878;
  box-shadow: 0 0 0 2px rgba(66, 216, 120, .2);
  transform: translateY(-50%);
  pointer-events: none;
}
.genre-nav { border-bottom: 1px solid #ddd; color: #555; background: #fff; }
.genre-scroll { display: flex; align-items: center; gap: 22px; min-height: 44px; overflow-x: auto; scrollbar-width: thin; }
.genre-scroll a { flex: none; font-size: 13px; font-weight: 700; }

.site-main { min-height: 56vh; }
.catalog-section { padding-block: 38px 48px; }
.section-heading {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 24px;
  border-bottom: 2px solid var(--accent);
}
.section-heading h1, .section-heading h2 {
  margin: 0;
  padding: 8px 14px 7px;
  color: #333;
  font-size: 17px;
  line-height: 1.35;
  text-transform: uppercase;
}
.heading-mark {
  display: grid;
  place-items: center;
  width: 39px;
  min-height: 39px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
}

.manga-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 30px 20px;
  align-items: start;
}
.manga-card { min-width: 0; }
.cover-link { display: block; background: #ededed; overflow: hidden; }
.manga-cover {
  width: 100%;
  aspect-ratio: 175 / 238;
  object-fit: cover;
  background: #ededed;
}
.cover-fallback {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 18px 12px 16px;
  color: #fff;
  background: #343434;
  text-align: center;
}
.cover-fallback strong { align-self: end; color: var(--accent); font-size: 42px; line-height: 1; }
.cover-fallback span { align-self: end; display: -webkit-box; overflow: hidden; font-size: 12px; font-weight: 700; line-height: 1.35; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.card-body { padding-top: 10px; }
.card-body h2 { min-height: 42px; margin: 0 0 5px; font-size: 14px; line-height: 1.45; }
.card-body h2 a { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rating { display: flex; align-items: center; gap: 7px; color: #ffc107; font-size: 13px; line-height: 1; }
.rating > span > span { color: #cfcfcf; }
.rating small { color: #777; font-size: 11px; }
.chapter-preview { margin: 8px 0 0; padding: 0; list-style: none; }
.chapter-preview li { margin-top: 5px; }
.chapter-preview span {
  display: block;
  overflow: hidden;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.manga-card[hidden] { display: none; }
.empty-search { padding: 30px 0; color: var(--muted); text-align: center; }

.browse-band { padding-block: 34px 42px; border-top: 1px solid var(--line); background: var(--panel); }
.genre-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: #ddd; border: 1px solid #ddd; }
.genre-grid a { min-width: 0; padding: 10px 12px; background: #fff; font-size: 13px; }
.genre-grid a::before { content: "›"; margin-right: 7px; color: var(--accent); font-weight: 700; }

.breadcrumbs { margin-bottom: 22px; color: #777; font-size: 12px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 7px; color: #aaa; }
.archive-header { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 28px; }
.archive-header h1 { margin: 0 0 5px; font-size: 28px; line-height: 1.25; }
.archive-header p { margin: 0; color: var(--muted); }
.catalog-filter { width: min(320px, 100%); color: #555; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.catalog-filter span { display: block; margin-bottom: 5px; }
.catalog-filter input { width: 100%; height: 40px; border: 1px solid #ccc; border-radius: 3px; padding: 0 11px; color: #222; background: #fff; }
.catalog-filter input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.empty-state { padding: 50px 24px; border: 1px solid var(--line); text-align: center; }
.empty-state h2 { margin-top: 0; }
.empty-state a { display: inline-block; margin-top: 10px; padding: 9px 14px; color: #fff; background: var(--accent); }

.series-hero { padding-block: 28px 38px; color: #eee; background: #282828; }
.series-hero .breadcrumbs { color: #aaa; }
.series-hero .breadcrumbs a:hover { color: #fff; }
.series-hero h1 { margin: 0 0 24px; color: #fff; font-size: 32px; line-height: 1.25; }
.series-summary { display: grid; grid-template-columns: 193px minmax(0, 1fr); gap: 30px; }
.series-cover { width: 193px; }
.profile-cover { width: 193px; aspect-ratio: 193 / 278; }
.series-details { min-width: 0; }
.profile-rating { margin-bottom: 18px; }
.profile-rating .rating { font-size: 17px; }
.series-details dl { margin: 0; }
.series-details dl > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid #414141; }
.series-details dt { color: #aaa; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.series-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.series-details dd a { color: #fff; text-decoration: underline; text-decoration-color: #777; text-underline-offset: 3px; }
.series-details dd a:hover { color: var(--accent); }
.series-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.series-actions a { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 3px; padding: 9px 14px; font-size: 13px; font-weight: 700; }
.series-actions .primary-action { color: #fff; background: var(--accent); }
.series-actions .primary-action:hover, .series-actions .primary-action:focus-visible { color: #fff; background: var(--accent-dark); }
.series-actions .secondary-action { color: #fff; background: transparent; }
.series-actions .secondary-action:hover, .series-actions .secondary-action:focus-visible { color: #fff; background: var(--accent); }
.series-content { padding-block: 38px 54px; }
.series-content > section + section { margin-top: 36px; }
.series-description { max-width: 900px; }
.series-description p { margin: 0; color: #555; font-size: 16px; }
.chapter-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.chapter-control-label, .chapter-jump label { display: block; margin-bottom: 5px; color: #666; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.chapter-sort-options { display: flex; }
.chapter-sort-options button { min-height: 38px; border: 1px solid #ccc; padding: 7px 13px; color: #555; background: #fff; cursor: pointer; }
.chapter-sort-options button:first-child { border-radius: 3px 0 0 3px; }
.chapter-sort-options button:last-child { margin-left: -1px; border-radius: 0 3px 3px 0; }
.chapter-sort-options button[aria-pressed="true"] { z-index: 1; border-color: var(--accent); color: #fff; background: var(--accent); }
.chapter-jump { width: min(310px, 100%); }
.chapter-jump > div { display: grid; grid-template-columns: minmax(0, 1fr) 46px; }
.chapter-jump input { min-width: 0; height: 38px; border: 1px solid #ccc; border-radius: 3px 0 0 3px; padding: 0 10px; color: #222; background: #fff; }
.chapter-jump input:focus { z-index: 1; border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
.chapter-jump button { border: 0; border-radius: 0 3px 3px 0; color: #fff; background: var(--accent); font-weight: 700; cursor: pointer; }
.chapter-jump button:hover, .chapter-jump button:focus-visible { background: var(--accent-dark); }
.chapter-jump-status { min-height: 0; margin: 0; color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.chapter-jump-status:not(:empty) { margin: -3px 0 11px; }
.chapter-list { margin: 0; padding: 0; border: 1px solid var(--line); list-style: none; }
.chapter-list li { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chapter-list li:last-child { border-bottom: 0; }
.chapter-list a { font-weight: 700; }
.chapter-list a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: #ddd; text-underline-offset: 3px; }
.chapter-list a:hover { text-decoration-color: currentColor; }
.chapter-list small { flex: none; color: #999; }
.series-comments { grid-column: 1 / -1; padding-top: 8px; }
.comment-count { margin: -8px 0 16px; color: #777; font-size: 13px; font-weight: 700; }
.archived-comments { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.archived-comments > li { margin-left: min(calc((var(--comment-depth, 1) - 1) * 46px), 92px); }
.archived-comments .comment-depth-1 { --comment-depth: 1; }
.archived-comments .comment-depth-2 { --comment-depth: 2; }
.archived-comments .comment-depth-3 { --comment-depth: 3; }
.archived-comment { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; padding: 16px; border: 1px solid var(--line); background: #fff; }
.comment-initial { display: grid; width: 42px; height: 42px; border-radius: 50%; place-items: center; color: #fff; background: #777; font-size: 16px; font-weight: 800; }
.comment-copy { min-width: 0; }
.comment-copy header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 7px; }
.comment-copy h3 { min-width: 0; margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.comment-copy header p { flex: none; margin: 0; color: #888; font-size: 12px; }
.comment-copy > p { margin: 0; color: #444; overflow-wrap: anywhere; }
.chapter-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.chapter-heading-row h1 { min-width: 0; overflow-wrap: anywhere; }
.reader-theme-toggle { display: grid; flex: none; width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 3px; padding: 0; place-items: center; color: #fff; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.reader-theme-toggle:hover, .reader-theme-toggle:focus-visible, .reader-theme-toggle[aria-pressed="true"] { border-color: var(--accent); color: #fff; background: var(--accent); }
.reader-details { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 18px; margin: 8px 60px 0 0; color: #bbb; font-size: 13px; }
.reader-details > * + *::before { content: "•"; margin-right: 18px; color: #777; }
.reader-details a { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: #777; text-underline-offset: 3px; }
.reader-details a:hover { color: var(--accent); }
.chapter-content.reader-content { width: 100%; padding-block: 20px 42px; background: #f2f2f2; }
.reader-navigation { display: grid; grid-template-columns: minmax(112px, 1fr) minmax(190px, 320px) minmax(112px, 1fr); align-items: center; gap: 18px; }
.reader-navigation-top { margin-bottom: 20px; }
.reader-navigation-bottom { margin-top: 20px; }
.reader-page-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; min-width: 112px; min-height: 42px; border: 1px solid var(--accent); border-radius: 3px; padding: 9px 14px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 700; }
.reader-page-link:hover, .reader-page-link:focus-visible { color: #fff; background: var(--accent-dark); }
.reader-page-link.is-disabled { border-color: #ccc; color: #999; background: #e1e1e1; }
.reader-next { justify-self: end; }
.reader-chapter-picker { min-width: 0; }
.reader-chapter-picker select { width: 100%; height: 42px; border: 1px solid #bbb; border-radius: 3px; padding: 0 38px 0 12px; color: #333; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.reader-chapter-picker select:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.reader-pages { width: 100%; margin: 0; background: #e7e7e7; }
.reader-pages img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.chapter-page.reader-dark { --ink: #eee; --muted: #aaa; --line: #444; --paper: #121212; color-scheme: dark; background: #121212; }
.reader-dark .chapter-hero { background: #171717; }
.reader-dark .reader-content { background: #171717; }
.reader-dark .reader-pages { background: #090909; }
.reader-dark .reader-chapter-picker select { border-color: #555; color: #eee; background: #242424; }
.reader-dark .reader-page-link.is-disabled { border-color: #444; color: #777; background: #292929; }

.chapter-hero { padding-block: 28px 30px; color: #eee; background: #282828; }
.chapter-hero .breadcrumbs { color: #aaa; }
.chapter-hero .breadcrumbs a:hover { color: #fff; }
.chapter-hero h1 { margin: 0; color: #fff; font-size: 32px; line-height: 1.25; }
.has-reader .chapter-hero { padding-block: 20px 22px; }
.has-reader .chapter-hero .breadcrumbs { margin-bottom: 14px; }
.has-reader .chapter-hero h1 { font-size: 24px; }
.chapter-content { padding-block: 38px 54px; }
.chapter-summary { display: grid; grid-template-columns: 193px minmax(0, 1fr); gap: 30px; align-items: start; }
.chapter-cover { display: block; width: 193px; overflow: hidden; background: #ededed; }
.chapter-summary .section-heading { margin-bottom: 18px; }
.chapter-summary p { max-width: 760px; color: #555; font-size: 16px; }
.chapter-summary p a, .official-release a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.chapter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chapter-actions a { display: inline-flex; align-items: center; min-height: 42px; padding: 10px 14px; border: 1px solid var(--accent); font-weight: 700; }
.chapter-actions .primary-action { color: #fff; background: var(--accent); }
.chapter-actions .primary-action:hover { color: #fff; background: var(--accent-dark); }
.chapter-actions .secondary-action { color: var(--accent-dark); background: #fff; }
.official-release { max-width: 790px; margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
.official-release p { color: #555; }

.content-page { padding-block: 34px 60px; }
.content-page .section-heading { margin-top: 0; }
.prose { max-width: 760px; font-size: 16px; }
.prose a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.error-content { padding-block: 80px; text-align: center; }
.error-code { margin: 0; color: var(--accent); font-size: 80px; font-weight: 800; line-height: 1; }
.error-content h1 { margin: 10px 0; font-size: 30px; }
.error-content > p:not(.error-code) { color: var(--muted); }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.error-actions a { padding: 10px 14px; color: #fff; background: var(--accent); }

.site-footer { color: #bbb; background: #1b1b1b; }
.footer-grid { display: grid; grid-template-columns: minmax(280px, 2fr) 1fr 1fr; gap: 48px; padding-block: 38px; }
.footer-brand img { width: 180px; max-height: 70px; object-fit: contain; object-position: left center; }
.footer-brand p { max-width: 480px; margin: 14px 0 0; color: #999; }
.site-footer h2 { margin: 0 0 12px; color: #fff; font-size: 14px; text-transform: uppercase; }
.site-footer nav a { display: block; width: fit-content; margin: 7px 0; font-size: 13px; }
.copyright { padding-block: 14px; border-top: 1px solid #333; color: #777; font-size: 12px; }

@media (max-width: 980px) {
  .manga-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .genre-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .container { width: min(100% - 22px, 620px); }
  .header-main { min-height: 78px; grid-template-columns: minmax(150px, 1fr) auto; gap: 12px; }
  .site-logo { width: 180px; }
  .site-logo img { width: 180px; max-height: 62px; }
  .site-search { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 40px; margin-bottom: 8px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 3px; padding: 8px 10px; color: #fff; background: #c72439; cursor: pointer; }
  .menu-toggle span:first-child { font-size: 20px; line-height: 1; }
  .primary-nav ul { display: none; flex-direction: column; padding-block: 5px; }
  .primary-nav ul.is-open { display: flex; }
  .primary-nav a { min-height: 42px; padding: 11px 12px; }
  .primary-nav .live-menu-item a { width: 100%; padding-left: 29px; }
  .live-status-dot { left: 12px; }
  .genre-scroll { gap: 17px; }
  .catalog-section { padding-block: 28px 38px; }
  .manga-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 13px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-header { align-items: stretch; flex-direction: column; gap: 18px; }
  .catalog-filter { width: 100%; }
  .series-hero h1 { font-size: 26px; }
  .series-summary { grid-template-columns: 145px minmax(0, 1fr); gap: 20px; }
  .series-cover, .profile-cover { width: 145px; }
  .series-details dl > div { grid-template-columns: 1fr; gap: 2px; }
  .chapter-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .chapter-jump { width: 100%; }
  .chapter-hero h1 { font-size: 26px; }
  .chapter-summary { grid-template-columns: 1fr; gap: 20px; }
  .chapter-cover { width: 160px; }
  .reader-details { margin-right: 0; }
  .reader-navigation { grid-template-areas: "picker picker" "previous next"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .reader-chapter-picker { grid-area: picker; }
  .reader-previous, .reader-navigation > .is-disabled:first-child { grid-area: previous; }
  .reader-next { grid-area: next; }
  .reader-page-link { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .card-body h2 { min-height: 40px; font-size: 13px; }
  .series-summary { grid-template-columns: 112px minmax(0, 1fr); gap: 15px; }
  .series-cover, .profile-cover { width: 112px; }
  .series-hero h1 { font-size: 22px; }
  .chapter-hero h1 { font-size: 22px; }
  .has-reader .chapter-hero h1 { font-size: 20px; }
  .chapter-heading-row { gap: 12px; }
  .reader-theme-toggle { width: 36px; height: 36px; }
  .reader-details { align-items: flex-start; flex-direction: column; gap: 2px; }
  .reader-details > * + *::before { content: none; }
  .series-actions { align-items: stretch; flex-direction: column; }
  .series-actions a { width: 100%; }
  .chapter-list li { align-items: flex-start; flex-direction: column; gap: 2px; }
  .archived-comments > li { margin-left: min(calc((var(--comment-depth, 1) - 1) * 20px), 40px); }
  .archived-comment { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .comment-initial { width: 34px; height: 34px; font-size: 14px; }
  .comment-copy header { align-items: flex-start; flex-direction: column; gap: 2px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
}
