/*
 * DM Ember presentation layer.
 * The selectors intentionally sit above the reference stylesheet so the
 * publishing, reader, account and SEO core can be upgraded independently.
 */
:root {
  --dw-bg: #1c2a31;
  --dw-bg-deep: #181d21;
  --dw-header: #1d1f23;
  --dw-panel: #2a3740;
  --dw-panel-2: #34424d;
  --dw-pill: #3d4a55;
  --dw-line: rgba(255,255,255,.10);
  --dw-text: #f5f7f8;
  --dw-muted: #94a5b0;
  --dw-soft: #c9d1d5;
  --dw-accent: #dd6165;
  --dw-accent-dark: #bc484d;
  --dw-purple: #b946e7;
  --dw-green: #19b76b;
  --header: var(--dw-header);
  --header-dark: #15171a;
  --bg: var(--dw-bg);
  --text: var(--dw-text);
  --muted: var(--dw-muted);
  --line: var(--dw-line);
  --blue: var(--dw-accent);
  --black: #121417;
  --container: 1410px;
}

html { color-scheme: dark; }
body {
  color: var(--dw-text);
  background: var(--dw-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
}
::selection { color: #fff; background: var(--dw-accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.container { width: min(calc(100% - 40px), var(--container)); }

/* Header */
.site-header {
  position: sticky;
  z-index: 200;
  top: 0;
  height: 78px;
  background: rgba(28,30,34,.98);
  border-bottom: 1px solid rgba(255,255,255,.045);
  box-shadow: 0 5px 18px rgba(0,0,0,.12);
}
.site-header__inner { height: 78px; gap: 10px; }
.nav-toggle {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: block;
  padding: 0;
  margin: 0 2px 0 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.nav-toggle > img { width: 100%; height: 100%; display: block; object-fit: contain; }
.nav-toggle:hover { background: rgba(255,255,255,.07); }
.site-brand { min-width: 172px; max-width: 225px; gap: 10px; margin: 0 4px 0 0; color: #fff; font-size: 22px; letter-spacing: -.02em; }
.site-brand__image { width: auto; max-width: 210px; max-height: 51px; object-fit: contain; }
.site-brand__copy { min-width: 0; display: grid; gap: 3px; line-height: 1; }
.site-brand__mark, .footer-brand__mark { width: 42px; height: 42px; display: grid; align-content: center; gap: 4px; flex: 0 0 auto; padding: 8px; background: var(--dw-accent); border-radius: 10px; transform: skew(-4deg); }
.site-brand__mark i, .footer-brand__mark i { height: 4px; display: block; background: #fff; border-radius: 4px; }
.site-brand__name { overflow: hidden; font-size: 17px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.site-brand__url { overflow: hidden; color: var(--dw-muted); font-size: 10px; font-weight: 650; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.site-nav { flex: 0 0 auto; align-self: center; }
.site-nav__list { height: auto; gap: 7px; }
.site-nav__list li { height: auto; }
.site-nav a {
  height: 46px;
  padding: 0 15px;
  color: #f5f6f7;
  background: var(--dw-panel-2);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
}
.site-nav a:hover, .site-nav .current-menu-item > a { color: #fff; background: var(--dw-accent); }
.site-nav .current-menu-item > a::after { display: none; }
.site-nav .inkwave-popular-tag > a::before { color: #ffb7b9; }
.header-search { min-width: 180px; height: 46px; display: flex; flex: 1 1 430px; margin-left: auto; overflow: hidden; background: #f7f7f8; border-radius: 11px; }
.header-search input[type="search"] { min-width: 0; width: 100%; padding: 0 18px; color: #3f4a52; background: transparent; border: 0; outline: 0; font-size: 15px; font-weight: 600; }
.header-search input::placeholder { color: #94a4af; opacity: 1; }
.header-search button { width: 61px; flex: 0 0 61px; display: grid; place-items: center; padding: 0; color: #fff; background: var(--dw-accent); border: 0; cursor: pointer; }
.header-search button:hover { background: var(--dw-accent-dark); }
.header-search svg { width: 23px; height: 23px; stroke-width: 2.5; }
.site-actions { min-height: 46px; gap: 6px; padding-left: 0; margin-left: 3px; border: 0; }
.bookshelf-link, .account-link { width: 46px; height: 46px; display: grid; place-items: center; padding: 0; color: #fff; background: transparent; border-radius: 10px; }
.bookshelf-link:hover, .account-link:hover { color: #fff; background: var(--dw-panel-2); }
.bookshelf-link svg, .account-link svg { width: 25px; height: 25px; }
.bookshelf-link span, .account-link span { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.language-switcher > button { height: 46px; padding: 0 9px; background: var(--dw-panel-2); border-radius: 10px; }
.language-switcher__menu { top: 52px; color: var(--dw-text); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 8px; box-shadow: 0 14px 35px rgba(0,0,0,.4); }
.language-switcher__menu a { color: var(--dw-soft); border-radius: 5px; }
.language-switcher__menu a:hover, .language-switcher__menu a.is-current { color: #fff; background: var(--dw-accent); }

/* Home */
.catalog-home { min-height: calc(100vh - 78px); padding: 14px 0 0; }
.catalog-alert { min-height: 61px; display: flex; align-items: center; gap: 16px; padding: 12px 25px; margin-bottom: 25px; color: #d2d9dd; background: var(--dw-panel-2); border: 1px solid rgba(255,255,255,.04); border-radius: 14px; }
.catalog-alert > span { width: 14px; height: 14px; flex: 0 0 auto; background: var(--dw-green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(25,183,107,.1); }
.catalog-alert p { margin: 0; font-size: 15px; line-height: 1.45; }
.catalog-section--primary { margin: 0; }
.catalog-title-row { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 9px; }
.catalog-title-row h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.catalog-title-row h1 span { color: var(--dw-muted); font-weight: 600; }
.catalog-title-row > a { color: var(--dw-muted); font-size: 13px; font-weight: 700; }
.catalog-title-row > a:hover { color: #fff; }
.catalog-toolbar { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.catalog-toolbar__filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill, .filter-menu > summary {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  color: #f6f7f8;
  background: var(--dw-pill);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 23px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}
.filter-pill:hover, .filter-menu > summary:hover, .filter-menu[open] > summary { background: #4a5965; }
.filter-pill--all { background: #27343d; border-color: rgba(255,255,255,.1); }
.filter-pill svg, .filter-menu--sort summary svg { width: 17px; height: 17px; }
.filter-menu { position: relative; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary span { color: var(--dw-muted); font-size: 11px; }
.filter-menu > div {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  background: #28363f;
  border: 1px solid var(--dw-line);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(0,0,0,.42);
}
.filter-menu > div a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 9px 11px; color: var(--dw-soft); border-radius: 6px; font-size: 13px; }
.filter-menu > div a:hover { color: #fff; background: var(--dw-panel-2); }
.filter-menu > div small { color: var(--dw-muted); }
.filter-menu > div .filter-menu__all { margin-top: 6px; color: #fff; background: var(--dw-accent); }
.filter-menu--sort { margin-left: auto; }
.filter-menu--sort > summary { border-radius: 12px; }
.filter-menu--sort > summary strong { color: var(--dw-muted); text-transform: uppercase; }
.filter-menu--sort > div { right: 0; left: auto; }
.comic-grid { grid-template-columns: repeat(4, minmax(0,1fr)); column-gap: 18px; row-gap: 28px; }
.comic-card { position: relative; }
.comic-card__cover { position: relative; overflow: hidden; background: #101619; border-radius: 11px; box-shadow: 0 8px 18px rgba(0,0,0,.15); }
.comic-card__cover::after { position: absolute; right: 0; bottom: 0; left: 0; height: 45%; background: linear-gradient(transparent,rgba(0,0,0,.65)); content: ""; pointer-events: none; }
.comic-card__cover img { height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .28s ease, opacity .2s ease; }
.comic-card__cover:hover img { opacity: .9; transform: scale(1.025); }
.comic-card__quality { position: absolute; z-index: 2; top: 10px; right: 10px; color: #fff; font-size: 11px; font-weight: 900; font-style: italic; text-shadow: 0 1px 3px #000; }
.comic-card__chapter, .comic-card__rating { position: absolute; z-index: 2; bottom: 10px; padding: 4px 7px; color: #fff; background: rgba(20,20,20,.78); border-radius: 8px; font-size: 11px; font-weight: 750; }
.comic-card__chapter { left: 10px; }
.comic-card__rating { right: 10px; color: #ffd06a; }
.comic-card h3 { min-height: 0; margin: 8px 0 2px; color: #f7f8f9; font-size: 14px; font-weight: 750; line-height: 1.35; }
.comic-card h3 a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comic-card h3 a:hover { color: var(--dw-accent); }
.comic-card__author { display: block; margin-bottom: 5px; overflow: hidden; color: #b2bec5; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.comic-card__author:hover { color: #fff; }
.comic-card__meta { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 11px; margin: 0; color: var(--dw-muted); font-size: 11px; }
.comic-card__meta > span { min-width: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.comic-card__meta time { overflow: hidden; text-overflow: ellipsis; }
.comic-card__meta svg { width: 13px; height: 13px; flex: 0 0 auto; }
.home-about { grid-template-columns: 190px minmax(0,1fr); gap: 36px; padding: 38px 0 45px; margin-top: 45px; border-color: var(--dw-line); }
.home-about__heading span { color: var(--dw-accent); }
.home-about__heading h2 { color: #fff; font-weight: 750; }
.home-about__body p { color: var(--dw-muted); }
.home-about__body a { color: var(--dw-accent); }

/* Shared controls, archives and directories */
.button { color: var(--dw-text); background: var(--dw-panel-2); border-color: var(--dw-line); border-radius: 9px; }
.button:hover { color: #fff; background: #455560; border-color: #52636f; }
.button--primary { color: #fff; background: var(--dw-accent); border-color: var(--dw-accent); }
.button--primary:hover { background: var(--dw-accent-dark); border-color: var(--dw-accent-dark); }
.button--outline, .button--ghost { color: var(--dw-soft); background: transparent; border-color: rgba(255,255,255,.25); }
.archive-page, .directory-page, .tag-directory-page, .author-page, .comic-detail, .dashboard-page { min-height: calc(100vh - 78px); }
.archive-hero, .directory-hero, .dashboard-hero { padding: 38px 0 25px; background: linear-gradient(180deg,rgba(255,255,255,.025),transparent); border-color: var(--dw-line); }
.archive-hero h1, .directory-hero h1, .dashboard-hero h1 { color: #fff; font-size: clamp(27px,3vw,40px); font-weight: 800; letter-spacing: -.03em; }
.archive-hero p:last-child, .directory-hero p, .dashboard-hero p { color: var(--dw-muted); }
.directory-hero span { color: var(--dw-accent); }
.filter-panel { overflow: hidden; margin: 18px 0 28px; background: var(--dw-panel); border-color: var(--dw-line); border-radius: 13px; }
.filter-panel__fields { padding: 17px 21px 11px; }
.filter-panel fieldset { grid-template-columns: 70px 1fr; padding: 8px 0; }
.filter-panel legend { width: 70px; color: var(--dw-muted); }
.filter-options { gap: 5px; }
.filter-options a { padding: 6px 11px; color: var(--dw-soft); border-radius: 16px; }
.filter-options a:hover { color: #fff; background: var(--dw-panel-2); }
.filter-options a.is-active { color: #fff; background: var(--dw-accent); }
.filter-panel__footer { background: rgba(0,0,0,.13); border-color: var(--dw-line); }
.filter-panel__footer label, .filter-panel__footer > div > a { color: var(--dw-muted); }
.filter-panel__footer select, .profile-form input { color: var(--dw-text); background: var(--dw-bg-deep); border-color: var(--dw-line); border-radius: 7px; }
.archive-results-head, .tag-archive-actions, .author-works-heading { border-color: var(--dw-line); }
.archive-results-head p, .tag-archive-actions { color: var(--dw-muted); }
.view-switch button { color: var(--dw-muted); background: var(--dw-panel); border-color: var(--dw-line); }
.view-switch button.is-active { color: #fff; background: var(--dw-accent); }
.archive-grid.is-list .comic-card { border-color: var(--dw-line); }
.archive-grid.is-list .comic-card__cover { max-width: 180px; }
.pagination { padding: 46px 0 40px; }
.pagination ul { flex-wrap: wrap; gap: 9px; }
.pagination a, .pagination span { width: auto; min-width: 45px; height: 45px; padding: 0 14px; color: var(--dw-soft); background: var(--dw-panel-2); border: 0; border-radius: 10px; font-weight: 750; }
.pagination a:hover { color: #fff; background: #45545f; }
.pagination .current { color: #fff; background: var(--dw-accent); }
.catalog-pagination li:first-child a, .catalog-pagination li:last-child a { min-width: 150px; }
.empty-state { color: var(--dw-text); background: rgba(255,255,255,.018); border-color: var(--dw-line); border-radius: 13px; }
.empty-state p { color: var(--dw-muted); }
.tag-directory ul { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.tag-directory a { color: var(--dw-soft); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 10px; }
.tag-directory a:hover { color: #fff; background: var(--dw-panel-2); border-color: rgba(255,255,255,.2); }
.tag-directory small { color: var(--dw-muted); }
.ranked-comic__number { background: rgba(221,97,101,.92); border: 0; border-radius: 7px; }
.ranked-comic:nth-child(-n+3) .ranked-comic__number { color: #17191b; background: #ffd067; border: 0; }
.ranked-comic > strong, .latest-comic > time { color: var(--dw-muted); }

/* Author and comic detail */
.breadcrumbs { color: var(--dw-muted); }
.breadcrumbs a:hover { color: var(--dw-accent); }
.author-profile, .comic-hero, .detail-section, .detail-sidebar > div { color: var(--dw-text); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 13px; }
.author-profile__avatar, .creator-card__avatar { background: var(--dw-accent); }
.author-profile__copy > p:last-child, .author-profile__count span { color: var(--dw-muted); }
.author-profile__count { border-color: var(--dw-line); }
.author-works-heading span { color: var(--dw-accent); }
.comic-hero { grid-template-columns: 280px minmax(0,1fr); gap: 39px; padding: 24px; }
.comic-hero__cover img { border-radius: 10px; box-shadow: 0 15px 30px rgba(0,0,0,.25); }
.comic-hero h1 { font-size: clamp(30px,4vw,48px); font-weight: 850; letter-spacing: -.04em; }
.comic-hero__tax, .comic-hero__alias, .comic-hero__credits span, .comic-update-note { color: var(--dw-muted); }
.tag-list span, .tag-list a { color: var(--dw-soft); background: var(--dw-panel-2); border-radius: 15px; }
.tag-list a:hover { color: #fff; background: var(--dw-accent); }
.tag-list--topics .tag-list__label { color: var(--dw-muted); background: transparent; }
.tag-list--topics a { color: #d4dbe0; background: rgba(255,255,255,.07); }
.comic-stats { max-width: 720px; border-color: var(--dw-line); }
.comic-stats div { border-color: var(--dw-line); }
.comic-stats span { color: var(--dw-muted); }
.comic-actions .bookshelf-button.is-added { background: var(--dw-accent); }
.share-menu { color: var(--dw-text); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 11px; box-shadow: 0 18px 38px rgba(0,0,0,.45); }
.share-menu__close, .share-network { color: var(--dw-muted); }
.detail-layout { grid-template-columns: minmax(0,1fr) 285px; gap: 24px; }
.detail-section { padding: 24px; }
.detail-section__heading, .chapter-list, .chapter-list a, .info-card dl > div { border-color: var(--dw-line); }
.detail-section__heading > span, .detail-section__heading > div > span, .chapter-list a > span { color: var(--dw-accent); }
.detail-section__heading small, .prose, .chapter-list time, .info-card dt { color: var(--dw-muted); }
.chapter-order { color: var(--dw-soft); background: var(--dw-panel-2); border-color: var(--dw-line); border-radius: 7px; }
.chapter-list a:hover { color: #fff; background: rgba(255,255,255,.045); }
.creator-card h2 a:hover { color: var(--dw-accent); }
.recommendations { background: rgba(0,0,0,.11); border-color: var(--dw-line); }

/* User pages and generic content */
.dashboard-nav, .dashboard-content > section, .login-card, .account-card, .text-card, .prose-page { color: var(--dw-text); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 12px; }
.dashboard-nav a { color: var(--dw-soft); border-color: var(--dw-line); }
.dashboard-nav a:hover, .dashboard-nav a.is-active { color: #fff; background: var(--dw-accent); }
.muted-note, .account-card p, .login-card p, .profile-form small { color: var(--dw-muted); }
.history-list a { border-color: var(--dw-line); }
.profile-form input { padding: 10px 12px; }
.form-notice.is-success { color: #bff4d4; background: rgba(25,183,107,.16); }
.form-notice.is-error { color: #ffc5c5; background: rgba(221,97,101,.17); }
.text-card { padding: 22px; }
.not-found > span { color: var(--dw-accent); }
.inkwave-toast { background: var(--dw-accent); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,.35); }

/* Reader: retain a real day/night distinction while using the new controls. */
.inkwave-reader-page { color-scheme: light; --reader-bg: #dfe3e5; --reader-paper: #fff; background: var(--reader-bg); }
.inkwave-reader-page.is-night { color-scheme: dark; --reader-bg: #11181c; --reader-paper: #1c272d; }
.reader-toolbar { height: 58px; background: var(--dw-header); border-color: var(--dw-line); }
.reader-toolbar__back { height: 58px; border-color: var(--dw-line); }
.reader-toolbar__title a { color: #ff9da0; }
.reader-tool { border-color: var(--dw-line); }
.brightness-control input, .reader-settings input { accent-color: var(--dw-accent); }
.reader-settings { top: 68px; color: var(--dw-text); background: var(--dw-panel); border-color: var(--dw-line); border-radius: 11px; box-shadow: 0 18px 38px rgba(0,0,0,.4); }
.reader-settings button { color: var(--dw-soft); background: var(--dw-bg-deep); border-color: var(--dw-line); }
.reader-settings button.is-active { color: #fff; background: var(--dw-accent); }
.reader-settings label, .reader-setting-value output { color: var(--dw-muted); }
.reader { padding-top: 58px; }
.reader-progress { top: 57px; }
.reader-progress span { background: var(--dw-accent); }
.reader-page-nav { background: var(--dw-panel); border-color: var(--dw-line); border-radius: 9px; overflow: hidden; }
.reader-chapter-nav { border-color: var(--dw-line); border-radius: 10px; overflow: hidden; }
.reader-chapter-nav__catalog { background: var(--dw-accent) !important; }
.reader-end > span { color: var(--dw-accent); }

/* Footer */
.site-footer { padding: 42px 0 24px; color: var(--dw-muted); background: var(--dw-bg-deep); border-top: 1px solid rgba(255,255,255,.04); }
.footer-brand { width: max-content; display: grid; grid-template-columns: 58px auto; grid-template-rows: auto auto; align-items: center; gap: 0 12px; margin: 0 auto 25px; color: #fff; }
.footer-brand__avatar { width: 58px; height: 58px; grid-row: 1 / 3; object-fit: contain; }
.footer-brand__mark { width: 50px; height: 50px; grid-row: 1 / 3; border-radius: 11px; }
.footer-brand strong { align-self: end; font-size: 27px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.footer-brand small { align-self: start; color: var(--dw-accent); font-size: 10px; font-weight: 750; letter-spacing: .04em; }
.site-footer__notice { max-width: 980px; padding: 0 0 25px; margin: 0 auto; color: var(--dw-muted); border-color: var(--dw-line); text-align: center; }
.site-footer__notice a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer__bottom { align-items: center; padding-top: 21px; }
.site-footer__menu a { color: var(--dw-soft); }
.site-footer__menu a:hover { color: var(--dw-accent); }

@media (max-width: 1280px) {
  .site-brand { min-width: 145px; max-width: 170px; }
  .site-nav a { padding-inline: 12px; }
  .site-nav .inkwave-popular-tag { display: none; }
  .header-search { flex-basis: 310px; }
}

@media (max-width: 1020px) {
  .site-header, .site-header__inner { height: 68px; }
  .site-brand { max-width: none; margin-right: auto; }
  .site-nav { position: fixed; z-index: 210; top: 68px; right: 0; bottom: 0; left: 0; display: none; padding: 15px 20px 30px; overflow-y: auto; background: rgba(24,29,33,.98); }
  .site-nav.is-open { display: block; }
  .site-nav__list { display: grid; gap: 8px; padding: 0; }
  .site-nav__list li { display: block !important; }
  .site-nav a { height: 49px; padding: 0 17px; border: 0; font-size: 15px; }
  .header-search { order: 3; min-width: 240px; max-width: 430px; flex: 1 1 320px; }
  .comic-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .filter-menu--sort { align-self: flex-end; margin: 0; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .site-header, .site-header__inner { height: 62px; }
  .site-header__inner { gap: 7px; }
  .nav-toggle { width: 42px; height: 42px; flex-basis: 42px; border-radius: 9px; }
  .site-brand { min-width: 0; font-size: 18px; }
  .site-brand__name { font-size: 15px; }
  .site-brand__url { font-size: 9px; }
  .site-brand__mark { width: 38px; height: 38px; }
  .site-nav { top: 62px; }
  .header-search { position: absolute; top: 72px; right: 12px; left: 12px; max-width: none; box-shadow: 0 10px 28px rgba(0,0,0,.35); }
  .site-actions { margin-left: auto; }
  .language-switcher { display: none; }
  .bookshelf-link, .account-link { width: 39px; height: 39px; }
  .bookshelf-link svg, .account-link svg { width: 21px; height: 21px; }
  .catalog-home { padding-top: 68px; }
  .catalog-alert { align-items: flex-start; padding: 14px 16px; border-radius: 10px; }
  .catalog-alert > span { margin-top: 4px; }
  .catalog-toolbar__filters { flex-wrap: nowrap; padding-bottom: 5px; overflow-x: auto; scrollbar-width: none; }
  .catalog-toolbar__filters::-webkit-scrollbar { display: none; }
  .filter-pill, .filter-menu > summary { min-height: 41px; flex: 0 0 auto; padding: 0 14px; }
  .filter-menu > div { position: fixed; top: 130px; right: 12px; left: 12px; max-height: calc(100vh - 150px); }
  .filter-menu--sort { align-self: flex-start; }
  .comic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 11px; row-gap: 22px; }
  .comic-card__cover img { aspect-ratio: 4 / 3; }
  .comic-card__meta { grid-template-columns: 1fr auto; }
  .comic-card__meta > span:last-child { display: none; }
  .catalog-pagination li:first-child, .catalog-pagination li:last-child { width: 100%; }
  .catalog-pagination li:first-child a, .catalog-pagination li:last-child a { width: 100%; min-width: 0; }
  .tag-directory ul { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .comic-hero { grid-template-columns: 1fr; padding: 18px; }
  .comic-hero__cover { width: min(75%,280px); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { grid-template-columns: 1fr; }
  .chapter-list { grid-template-columns: 1fr; }
  .chapter-list a:nth-child(odd) { border-right: 0; }
  .chapter-list a:nth-child(even) { padding-left: 0; }
  .site-footer__bottom { align-items: center; flex-direction: column; text-align: center; }
  .site-footer__nav, .site-footer__menu { margin-left: 0; justify-content: center; }
}

@media (max-width: 460px) {
  .site-brand__copy { max-width: 130px; }
  .bookshelf-link { display: none; }
  .catalog-title-row h1 { font-size: 20px; }
  .comic-card__rating { display: none; }
  .comic-card h3 { font-size: 13px; }
  .comic-card__author { font-size: 10px; }
  .tag-directory ul { grid-template-columns: 1fr; }
  .home-about { grid-template-columns: 1fr; gap: 12px; }
}

/* =========================================================
   DM Ember — third anime theme
   ========================================================= */
:root {
  --ae-bg: #1e2b36;
  --ae-bg-deep: #151f28;
  --ae-panel: #2b3d4e;
  --ae-panel-soft: #34495d;
  --ae-line: rgba(178, 215, 238, .18);
  --ae-line-strong: rgba(178, 215, 238, .32);
  --ae-text: #f4f7fa;
  --ae-muted: #aab8c5;
  --ae-accent: #73c7ee;
  --ae-accent-strong: #3da8db;
  --dw-bg: var(--ae-bg);
  --dw-bg-deep: var(--ae-bg-deep);
  --dw-header: #17232d;
  --dw-panel: var(--ae-panel);
  --dw-panel-2: var(--ae-panel-soft);
  --dw-pill: #3b5063;
  --dw-line: var(--ae-line);
  --dw-text: var(--ae-text);
  --dw-muted: var(--ae-muted);
  --dw-soft: #d6e0e7;
  --dw-accent: var(--ae-accent-strong);
  --dw-accent-dark: #2385b4;
  --container: 1540px;
}

body {
  color: var(--ae-text);
  background:
    radial-gradient(circle at 12% 5%, rgba(99,159,197,.11), transparent 27rem),
    radial-gradient(circle at 86% 22%, rgba(63,118,153,.08), transparent 31rem),
    linear-gradient(135deg, rgba(255,255,255,.012) 25%, transparent 25%) 0 0/46px 46px,
    var(--ae-bg);
  font-family: ui-rounded, "Nunito Sans", "Avenir Next", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.container { width: min(calc(100% - 48px), var(--container)); }

/* Cinematic masthead */
.site-header.ember-header {
  position: relative;
  top: auto;
  height: auto;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.ember-masthead {
  height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 112%, rgba(115,199,238,.23), transparent 21rem),
    linear-gradient(90deg, rgba(10,18,25,.24), transparent 34%, transparent 66%, rgba(10,18,25,.24)),
    #1a2732;
  border-bottom: 1px solid rgba(255,255,255,.025);
}
.ember-masthead__inner { position: relative; height: 100%; display: flex; align-items: center; }
.ember-brand {
  position: relative;
  z-index: 3;
  max-width: 500px;
  display: grid;
  gap: 12px;
  color: var(--ae-text);
}
.ember-brand strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(35px, 4.3vw, 65px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .95;
}
.ember-brand strong span { color: #fff; }
.ember-brand strong em { color: var(--ae-accent); font-style: normal; }
.ember-brand small { color: #d0dae2; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.ember-brand__image { width: auto; max-width: 430px; max-height: 90px; object-fit: contain; }
.ember-character {
  position: absolute;
  z-index: 2;
  bottom: -1px;
  left: 50%;
  width: 240px;
  height: 240px;
  object-fit: contain;
  transform: translateX(-50%);
  mix-blend-mode: screen;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,.25));
}
.ember-masthead__actions { z-index: 3; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ember-signin, .ember-masthead .language-switcher > button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  color: #dce5eb;
  background: rgba(58,78,95,.78);
  border: 1px solid var(--ae-line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}
.ember-signin:hover { color: #fff; background: rgba(74,102,124,.9); }
.ember-signin svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.ember-masthead .language-switcher__menu { top: 48px; }

.ember-nav-shell {
  position: relative;
  z-index: 20;
  min-height: 60px;
  display: flex;
  align-items: stretch;
  margin-top: -1px;
  padding: 0 8px;
  background: rgba(43,61,78,.97);
  border: 1px solid var(--ae-line-strong);
  border-radius: 9px;
  box-shadow: 0 14px 34px rgba(5,13,20,.23);
}
.ember-home-link, .ember-shelf {
  width: 60px;
  display: grid;
  flex: 0 0 60px;
  place-items: center;
  color: var(--ae-accent);
  border-right: 1px solid var(--ae-line);
}
.ember-shelf { border-right: 0; border-left: 1px solid var(--ae-line); }
.ember-home-link:hover, .ember-shelf:hover { color: #fff; background: rgba(255,255,255,.055); }
.ember-home-link svg, .ember-shelf svg { width: 22px; height: 22px; fill: currentColor; }
.ember-nav-shell .site-nav { flex: 0 1 auto; }
.ember-nav-shell .site-nav__list { gap: 0; }
.ember-nav-shell .site-nav a {
  height: 58px;
  padding: 0 19px;
  color: #e6edf2;
  background: transparent;
  border-right: 1px solid var(--ae-line);
  border-radius: 0;
  font-size: 14px;
  font-weight: 800;
}
.ember-nav-shell .site-nav a:hover,
.ember-nav-shell .site-nav .current-menu-item > a { color: #fff; background: rgba(115,199,238,.12); box-shadow: inset 0 -3px var(--ae-accent); }
.ember-nav-shell .header-search {
  max-width: 360px;
  height: 42px;
  align-self: center;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  margin: 0 0 0 auto;
  color: #b9c8d2;
  background: rgba(255,255,255,.085);
  border: 1px solid var(--ae-line);
  border-radius: 7px;
}
.ember-nav-shell .header-search > svg { width: 19px; height: 19px; align-self: center; justify-self: center; fill: none; stroke: currentColor; stroke-width: 2; }
.ember-nav-shell .header-search input[type="search"] { padding: 0 12px 0 0; color: #fff; font-size: 14px; }
.ember-nav-shell .header-search input::placeholder { color: #afbdc8; }
.ember-nav-shell .header-search button { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.ember-nav-shell .nav-toggle { display: none; }

/* Home, catalogue cards and pagination */
.ember-home { min-height: 60vh; padding: 30px 0 4px; }
.ember-section { padding-bottom: 55px; }
.ember-section + .ember-section { padding-top: 44px; border-top: 1px solid var(--ae-line); }
.ember-section__head, .ember-title-panel {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 11px 26px 10px 34px;
  margin-bottom: 25px;
  overflow: hidden;
  background: linear-gradient(100deg, rgba(49,70,89,.98), rgba(41,58,74,.94));
  border: 1px solid var(--ae-line-strong);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(5,13,20,.12);
}
.ember-section__head::before, .ember-title-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 9px;
  background: linear-gradient(#8ed6f7, #398ebb);
  content: "";
}
.ember-section__head::after, .ember-title-panel::after {
  position: absolute;
  right: -18px;
  bottom: -38px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.13) 0 6px, transparent 7px), radial-gradient(circle at 70% 55%, rgba(255,255,255,.08) 0 12px, transparent 13px);
  transform: rotate(-14deg);
  content: "";
}
.ember-section__head h1, .ember-section__head h2, .ember-title-panel h1 { margin: 0; color: #fff; font-size: clamp(23px,2.2vw,32px); font-weight: 900; letter-spacing: -.025em; line-height: 1.08; }
.ember-section__head p, .ember-title-panel p { margin: 5px 0 0; color: #b7c5cf; font-size: 13px; font-weight: 650; }
.ember-section__head > a { z-index: 2; color: #dbe7ed; font-size: 13px; font-weight: 800; }
.ember-section__head > a:hover { color: var(--ae-accent); }
.ember-grid { display: grid; gap: 30px 24px; }
.ember-grid--catalog, .ember-grid--trending, .ember-grid--ranking { grid-template-columns: repeat(6, minmax(0,1fr)); }
.ember-card { min-width: 0; }
.ember-card .ember-card__cover {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #111a21;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  box-shadow: 0 14px 26px rgba(3,10,16,.21);
}
.ember-card .ember-card__cover::after { height: 27%; background: linear-gradient(transparent, rgba(7,12,17,.62)); }
.ember-card .ember-card__cover img { width: 100%; height: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.ember-card:hover .ember-card__cover img { transform: scale(1.028); }
.ember-card h3 { margin: 10px 0 0; font-size: 14px; font-weight: 800; }
.ember-card h3 a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ember-card h3 a:hover { color: var(--ae-accent); }
.ember-card__likes, .ember-card__chapters {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(26,34,43,.78);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
  backdrop-filter: blur(4px);
}
.ember-card__chapters { top: auto; right: 10px; bottom: 10px; left: auto; color: #dfe9ef; }
.ember-pagination { padding: 46px 0 4px; }
.ember-pagination ul { width: max-content; max-width: 100%; padding: 0; margin: auto; overflow: hidden; background: rgba(19,29,38,.72); border: 1px solid rgba(255,255,255,.05); border-radius: 30px; }
.ember-pagination li { margin: 0; }
.ember-pagination a, .ember-pagination span { min-width: 58px; height: 54px; padding: 0 19px; background: transparent; border-radius: 0; }
.ember-pagination .current { background: #466783; }
.ember-pagination a:hover { background: rgba(115,199,238,.13); }

/* Top page */
.ember-top { min-height: 65vh; padding: 34px 0 20px; }
.ember-section__head--top { margin-bottom: 24px; }
.ember-range-tabs { width: max-content; max-width: 100%; display: flex; margin: 0 auto 30px; overflow: hidden; background: #19242e; border: 1px solid rgba(255,255,255,.05); border-radius: 30px; }
.ember-range-tabs a { min-width: 104px; display: grid; place-items: center; padding: 15px 22px; color: #e4ebef; font-weight: 850; }
.ember-range-tabs a:hover { color: #fff; background: rgba(255,255,255,.05); }
.ember-range-tabs a.is-current { color: #fff; background: #466783; }
.ember-ranked { position: relative; min-width: 0; }
.ember-ranked > span { position: absolute; z-index: 5; top: 8px; right: 8px; min-width: 32px; padding: 6px; color: #13212c; background: var(--ae-accent); border-radius: 7px; font-size: 12px; font-weight: 950; text-align: center; }

/* Detail */
.ember-detail { min-height: 70vh; padding: 20px 0 0; }
.ember-detail .breadcrumbs { padding: 2px 0 18px; }
.ember-title-panel { min-height: 80px; align-items: center; padding-left: 32px; margin-bottom: 24px; }
.ember-title-panel > div { min-width: 0; }
.ember-title-panel h1 { overflow-wrap: anywhere; }
.ember-title-panel > span { z-index: 2; color: rgba(255,255,255,.14); font-size: 54px; }
.ember-detail-card {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(0,1fr);
  gap: 28px;
  margin-bottom: 34px;
}
.ember-detail-cover { align-self: start; }
.ember-detail-cover > img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--ae-line-strong); border-radius: 10px; box-shadow: 0 18px 35px rgba(4,11,18,.3); }
.ember-like-box { padding: 16px; margin-top: 16px; color: #d5dfe6; background: rgba(18,27,35,.82); border: 1px solid rgba(255,255,255,.05); border-radius: 9px; text-align: center; }
.ember-like-box > strong { display: block; color: #fff; font-size: 30px; line-height: 1; }
.ember-like-box > small { display: block; margin-top: 4px; color: var(--ae-muted); }
.ember-like-box > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.ember-like-box button { min-height: 44px; color: #fff; background: #466783; border: 0; border-radius: 7px; font: inherit; font-weight: 800; cursor: pointer; }
.ember-like-box button:hover, .ember-like-box .bookshelf-button.is-added { background: var(--ae-accent-strong); }
.ember-like-box .share-control { position: relative; }
.ember-like-box .share-button { width: 100%; }
.ember-like-box .share-menu { top: auto; right: 0; bottom: calc(100% + 9px); left: auto; width: min(320px, calc(100vw - 40px)); text-align: left; }
.ember-detail-info { min-width: 0; padding: 38px 48px 34px; background: linear-gradient(130deg, rgba(48,68,87,.97), rgba(38,55,70,.97)); border: 1px solid var(--ae-line-strong); border-radius: 10px; box-shadow: 0 15px 34px rgba(5,13,20,.17); }
.ember-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 50px; margin: 0 0 30px; }
.ember-facts > div { min-width: 0; display: grid; grid-template-columns: minmax(90px,.7fr) minmax(0,1fr); gap: 14px; align-items: center; min-height: 55px; border-bottom: 1px solid var(--ae-line); }
.ember-facts dt { color: #b5c2cb; font-size: 14px; font-weight: 850; }
.ember-facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #fff; font-size: 14px; font-weight: 800; text-align: right; }
.ember-facts dd a { color: var(--ae-accent); }
.ember-synopsis { padding: 28px 0 25px; border-top: 1px solid var(--ae-line); border-bottom: 1px solid var(--ae-line); }
.ember-synopsis h2, .ember-genres h2 { margin: 0 0 15px; color: #b9c8d2; font-size: 15px; font-weight: 900; }
.ember-synopsis .prose { color: #f0f4f7; font-size: 16px; line-height: 1.8; }
.ember-genres { padding: 26px 0 6px; }
.ember-genres > div { display: flex; flex-wrap: wrap; gap: 9px; }
.ember-genres a { padding: 7px 11px; color: #e2eaf0; background: rgba(18,28,36,.52); border: 1px solid rgba(255,255,255,.04); border-radius: 7px; font-size: 12px; font-weight: 800; }
.ember-genres a:hover { color: #fff; background: #466783; }
.ember-read-button { width: max-content; min-width: 190px; margin-top: 25px; }
.ember-chapters { padding: 26px; margin: 0 0 35px; background: rgba(43,61,78,.91); border: 1px solid var(--ae-line); border-radius: 10px; }
.ember-chapters .detail-section__heading { margin: 0; }
.ember-detail .recommendations { background: rgba(11,18,24,.18); }

/* Share footer */
.ember-footer.site-footer { padding: 32px 0 24px; background: rgba(21,31,40,.96); }
.ember-share { display: grid; place-items: center; gap: 13px; padding: 25px 18px 23px; margin-bottom: 22px; background: linear-gradient(100deg, rgba(49,70,89,.96), rgba(41,58,74,.94)); border: 1px solid var(--ae-line-strong); border-radius: 9px; }
.ember-share p { color: #b9c7d0; font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.ember-share > div { display: flex; align-items: center; gap: 12px; }
.ember-share a, .ember-share button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: #eef5f8; background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; }
.ember-share a:hover, .ember-share button:hover { color: var(--ae-accent); background: rgba(115,199,238,.08); border-color: var(--ae-line); }
.ember-share span { font-size: 24px; line-height: 1; }
.ember-share svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ember-footer .site-footer__notice { max-width: 1100px; }
.ember-footer .site-footer__bottom { align-items: center; }
.ember-footer .site-footer__menu a:hover { color: var(--ae-accent); }

/* Keep the dedicated reader free of a second, oversized masthead. */
.inkwave-reader-page .ember-header { display: none; }

@media (max-width: 1280px) {
  .ember-grid--catalog, .ember-grid--trending, .ember-grid--ranking { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .ember-nav-shell .site-nav .inkwave-popular-tag { display: none; }
  .ember-nav-shell .site-nav a { padding-inline: 15px; }
  .ember-detail-card { grid-template-columns: 320px minmax(0,1fr); }
  .ember-detail-info { padding-inline: 34px; }
}

@media (max-width: 1020px) {
  .ember-masthead { height: 180px; }
  .ember-character { width: 205px; height: 205px; }
  .ember-brand { max-width: 380px; }
  .ember-brand strong { font-size: 44px; }
  .ember-nav-shell .nav-toggle { width: 58px; display: grid; flex: 0 0 58px; align-content: center; gap: 5px; padding: 0 18px; border-radius: 0; }
  .ember-nav-shell .nav-toggle > span { height: 2px; display: block; background: currentColor; border-radius: 2px; }
  .ember-nav-shell .site-nav { position: fixed; z-index: 220; top: 0; right: 0; bottom: 0; left: 0; display: none; padding: 84px 22px 30px; overflow-y: auto; background: rgba(19,30,39,.99); }
  .ember-nav-shell .site-nav.is-open { display: block; }
  .ember-nav-shell .site-nav__list { display: grid; }
  .ember-nav-shell .site-nav a { height: 52px; border: 0; border-bottom: 1px solid var(--ae-line); font-size: 16px; }
  .ember-nav-shell .header-search { max-width: none; flex: 1 1 auto; }
  .ember-grid--catalog, .ember-grid--trending, .ember-grid--ranking { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .ember-detail-card { grid-template-columns: 270px minmax(0,1fr); }
  .ember-detail-info { padding: 28px; }
  .ember-facts { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .ember-masthead { height: 142px; }
  .ember-masthead__inner { align-items: center; }
  .ember-brand { max-width: calc(100% - 100px); gap: 8px; }
  .ember-brand strong { font-size: clamp(29px,9vw,42px); }
  .ember-brand small { max-width: 270px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .ember-character { right: -22px; bottom: -7px; left: auto; width: 150px; height: 150px; transform: none; opacity: .72; }
  .ember-masthead__actions { position: absolute; z-index: 5; top: 12px; right: 0; }
  .ember-masthead .language-switcher { display: none; }
  .ember-signin { width: 38px; min-height: 38px; justify-content: center; padding: 0; border-radius: 50%; }
  .ember-signin span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
  .ember-nav-shell { min-height: 54px; padding: 0; border-right: 0; border-left: 0; border-radius: 0; }
  .ember-home-link, .ember-shelf { width: 50px; flex-basis: 50px; }
  .ember-nav-shell .nav-toggle { width: 50px; flex-basis: 50px; padding: 0 15px; }
  .ember-nav-shell .header-search { position: static; height: 38px; margin: 0 7px; box-shadow: none; }
  .ember-home { padding-top: 23px; }
  .ember-section { padding-bottom: 38px; }
  .ember-section + .ember-section { padding-top: 33px; }
  .ember-section__head, .ember-title-panel { min-height: 67px; padding: 11px 18px 10px 24px; margin-bottom: 18px; }
  .ember-section__head h1, .ember-section__head h2, .ember-title-panel h1 { font-size: 21px; }
  .ember-section__head p { font-size: 11px; }
  .ember-section__head > a { font-size: 11px; }
  .ember-grid { gap: 22px 12px; }
  .ember-grid--catalog, .ember-grid--trending, .ember-grid--ranking { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ember-card h3 { font-size: 12px; }
  .ember-card__likes, .ember-card__chapters { top: 7px; left: 7px; padding: 4px 6px; font-size: 9px; }
  .ember-card__chapters { top: auto; right: 7px; bottom: 7px; left: auto; }
  .ember-range-tabs a { min-width: 76px; padding: 12px 14px; font-size: 12px; }
  .ember-detail { padding-top: 12px; }
  .ember-detail-card { grid-template-columns: 1fr; }
  .ember-detail-cover { width: min(78%,330px); margin: auto; }
  .ember-detail-info { padding: 24px 18px; }
  .ember-facts > div { grid-template-columns: 90px minmax(0,1fr); }
  .ember-synopsis .prose { font-size: 14px; }
  .ember-chapters { padding: 18px; }
  .ember-share { padding-inline: 12px; }
  .ember-footer .site-footer__bottom { align-items: center; flex-direction: column; text-align: center; }
  .ember-footer .site-footer__nav, .ember-footer .site-footer__menu { margin-left: 0; justify-content: center; }
}

@media (max-width: 480px) {
  .ember-home-link, .ember-shelf { display: none; }
  .ember-grid--catalog, .ember-grid--trending, .ember-grid--ranking { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ember-section__head > a { display: none; }
  .ember-range-tabs { width: 100%; }
  .ember-range-tabs a { min-width: 0; flex: 1; padding-inline: 8px; }
  .ember-title-panel > span { display: none; }
  .ember-detail-cover { width: min(88%,310px); }
  .ember-like-box > div { grid-template-columns: 1fr; }
  .ember-facts > div { grid-template-columns: 82px minmax(0,1fr); }
}

/* DM Ember: compact sidebar catalogue inspired by the supplied references. */
:root {
  --ember-bg: #0f1113;
  --ember-bar: #101214;
  --ember-panel: #202326;
  --ember-panel-2: #292d30;
  --ember-line: rgba(255,255,255,.075);
  --ember-text: #f5f5f3;
  --ember-muted: #a5a7a8;
  --ember-accent: #ff5626;
  --ember-accent-2: #ff7a45;
  --ae-bg: var(--ember-bg);
  --ae-bg-deep: #090b0c;
  --ae-panel: var(--ember-panel);
  --ae-panel-soft: var(--ember-panel-2);
  --ae-line: var(--ember-line);
  --ae-line-strong: rgba(255,255,255,.13);
  --ae-text: var(--ember-text);
  --ae-muted: var(--ember-muted);
  --ae-accent: var(--ember-accent-2);
  --ae-accent-strong: var(--ember-accent);
  --dw-bg: var(--ember-bg);
  --dw-bg-deep: #090b0c;
  --dw-panel: var(--ember-panel);
  --dw-panel-2: var(--ember-panel-2);
  --dw-accent: var(--ember-accent);
  --dw-accent-dark: #dd3f16;
  --container: 1760px;
}
html { background: var(--ember-bg); }
body {
  --ember-sidebar-width: 294px;
  color: var(--ember-text);
  background: var(--ember-bg);
  overflow-x: hidden;
}
body.ember-sidebar-collapsed { --ember-sidebar-width: 88px; }
body:not(.inkwave-reader-page) > main,
body:not(.inkwave-reader-page) > .site-footer {
  width: calc(100% - var(--ember-sidebar-width));
  margin-left: var(--ember-sidebar-width);
  transition: width .22s ease, margin-left .22s ease;
}
body:not(.inkwave-reader-page) > main { min-height: calc(100vh - 74px); padding-top: 140px; }
.container { width: min(calc(100% - 48px), var(--container)); }

/* Fixed top bar. */
.ember-header { position: static; height: 0; color: var(--ember-text); background: transparent; }
.ember-topbar {
  position: fixed;
  z-index: 500;
  top: 0;
  right: 0;
  left: 0;
  height: 74px;
  display: grid;
  grid-template-columns: auto minmax(220px, 760px) auto;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  background: rgba(15,17,19,.98);
  border-bottom: 1px solid var(--ember-line);
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.ember-sidebar-toggle {
  width: 38px;
  height: 42px;
  display: grid;
  align-content: center;
  gap: 5px;
  position: absolute;
  left: 20px;
  padding: 6px;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ember-sidebar-toggle span { width: 27px; height: 3px; display: block; background: currentColor; border-radius: 5px; transition: transform .2s; }
.ember-brand {
  min-width: 0;
  max-width: 245px;
  display: flex;
  align-items: center;
  margin-left: 49px;
  overflow: hidden;
}
.ember-brand strong { display: flex; overflow: hidden; font-size: 28px; font-weight: 950; letter-spacing: -.055em; line-height: 1; white-space: nowrap; }
.ember-brand strong span { overflow: hidden; text-overflow: ellipsis; }
.ember-brand strong em { color: var(--ember-accent); font-style: normal; }
.ember-brand__image { width: auto; max-width: 220px; max-height: 46px; object-fit: contain; }
.ember-search {
  height: 46px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 52px;
  justify-self: center;
  width: min(100%,760px);
  overflow: hidden;
  color: var(--ember-text);
  background: #202326;
  border: 1px solid rgba(255,255,255,.03);
  border-radius: 13px;
}
.ember-search input { min-width: 0; padding: 0 17px; color: #f5f5f3; background: transparent; border: 0; outline: 0; }
.ember-search input::placeholder { color: #b8b8b8; opacity: 1; }
.ember-search button { display: grid; place-items: center; padding: 0; color: #d7d7d7; background: transparent; border: 0; cursor: pointer; }
.ember-search button:hover { color: var(--ember-accent); }
.ember-search svg { width: 23px; height: 23px; }
.ember-topbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.ember-signin { min-height: 44px; display: grid; place-items: center; padding: 0 18px; color: #fff; background: var(--ember-accent); border-radius: 12px; box-shadow: 0 0 22px rgba(255,86,38,.25); font-weight: 800; white-space: nowrap; }
.ember-signin:hover { background: var(--ember-accent-2); }
.ember-topbar .language-switcher > button { padding: 0 12px; background: #202326; }
.ember-topbar .language-switcher > button span { color: var(--ember-accent); }
.ember-topbar .language-switcher__menu { top: 53px; background: #1d2022; border-color: var(--ember-line); }

/* Collapsible sidebar: only labels collapse; destinations remain available as icons. */
.ember-sidebar {
  position: fixed;
  z-index: 440;
  top: 74px;
  bottom: 0;
  left: 0;
  width: var(--ember-sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 13px 16px;
  overflow: hidden;
  background: #101214;
  border-right: 1px solid var(--ember-line);
  transition: width .22s ease, transform .22s ease;
}
.ember-sidebar ul { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.ember-sidebar a { height: 55px; display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; padding: 0 13px; color: #e9e9e8; border-radius: 12px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.ember-sidebar a:hover { color: #fff; background: #1b1e20; }
.ember-sidebar svg { width: 27px; height: 27px; justify-self: center; stroke-width: 2; }
.ember-sidebar span { overflow: hidden; opacity: 1; transition: opacity .14s; }
.ember-sidebar-collapsed .ember-sidebar a { grid-template-columns: 38px 0; gap: 0; padding-inline: 12px; }
.ember-sidebar-collapsed .ember-sidebar span { width: 0; opacity: 0; }
.ember-feedback { margin-top: auto; }
.home .ember-sidebar__home,
.post-type-archive-ink_comic .ember-sidebar__series,
.tax-ink_genre .ember-sidebar__series,
.tax-ink_status .ember-sidebar__series,
.tax-ink_audience .ember-sidebar__series,
.page-template-page-tags-php .ember-sidebar__categories,
.page-template-page-top-php .ember-sidebar__trending,
.page-template-page-ranking-php .ember-sidebar__trending,
.page-template-page-latest-php .ember-sidebar__latest {
  color: #fff;
  background: #24282b;
}
.ember-sidebar a[aria-current="page"] { color:#fff; background:#24282b; }

/* Horizontal live tag rail. */
.ember-tag-strip {
  position: fixed;
  z-index: 430;
  top: 74px;
  right: 0;
  left: var(--ember-sidebar-width);
  height: 55px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 52px;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 24px;
  background: rgba(15,17,19,.97);
  border-bottom: 1px solid var(--ember-line);
  transition: left .22s ease;
}
.ember-tag-strip > div { display: flex; gap: 8px; overflow: hidden; }
.ember-tag-strip > div a { flex: 0 0 auto; padding: 7px 13px; color: #ededeb; background: #292c2e; border-radius: 18px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ember-tag-strip > div a:hover { color: #fff; background: #383c3f; }
.ember-tag-strip__more { height: 38px; display: grid; place-items: center; color: #fff; background: #1d2022; border-radius: 50%; font-size: 29px; line-height: 1; }

/* Home. */
.ember-home { padding-bottom: 50px; }
.ember-home-intro { max-width: 1500px; margin: 0 0 35px; color: #d3d3d1; font-size: 15px; line-height: 1.35; }
.ember-home-intro a { color:var(--ember-accent); white-space:nowrap; }
.ember-section { padding: 0 0 50px; }
.ember-section + .ember-section { padding-top: 0; border: 0; }
.ember-section__head {
  min-height: 50px;
  padding: 0;
  margin-bottom: 18px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.ember-section__head::before, .ember-section__head::after { display: none; }
.ember-section__head h1, .ember-section__head h2 { color: #fff; font-size: clamp(24px,2vw,31px); font-weight: 900; }
.ember-section__head > a { display: flex; align-items: center; gap: 10px; color: #e8e8e6; font-size: 16px; }
.ember-section__head > a span { width: 43px; height: 43px; display: grid; place-items: center; background: #242729; border-radius: 50%; font-size: 30px; line-height: 1; }
.ember-section__head > a:hover { color: var(--ember-accent); }
.ember-trending-rail {
  display: grid;
  grid-auto-columns: minmax(190px, 1fr);
  grid-auto-flow: column;
  gap: 20px;
  padding-bottom: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.ember-trending-rail::-webkit-scrollbar { display: none; }
.ember-trending-rail .ember-card { min-width: 190px; }
.ember-series-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 27px 22px; }
.ember-card { min-width: 0; text-align: center; }
.ember-card .ember-card__cover { position: relative; aspect-ratio: 3 / 4; border: 0; border-radius: 13px; box-shadow: none; }
.ember-card .ember-card__cover::after { display: none; }
.ember-card__chapters {
  top: 10px;
  right: auto;
  bottom: auto;
  left: 10px;
  padding: 5px 9px;
  color: #fff;
  background: rgba(20,20,20,.86);
  border-radius: 8px;
}
.ember-card__type, .ember-card__cover time {
  position: absolute;
  z-index: 3;
  bottom: 10px;
  padding: 3px 8px;
  color: #fff;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
}
.ember-card__type { left: 10px; background: #3697ee; text-transform: uppercase; }
.ember-card__cover time { right: 10px; background: #4cb968; }
.ember-card h3 { margin: 12px 0 6px; color: #f4f4f2; font-size: 15px; font-weight: 800; text-align: center; }
.ember-card p { width: max-content; max-width: 100%; padding: 3px 8px; margin: 0 auto; overflow: hidden; color: #c4c4c2; background: #25282a; border-radius: 5px; font-size: 10px; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.ember-pagination a, .ember-pagination span { min-width: 48px; height: 48px; color: #f5f5f3; }
.ember-pagination .current { background: var(--ember-accent); }

/* Series archive and filters. */
.ember-catalogue, .ember-categories, .ember-taxonomy { padding-bottom: 55px; }
.ember-page-title { margin: 0 0 28px; color: #f5f5f3; font-size: clamp(30px,3vw,42px); line-height: 1.1; }
.ember-filter-bar {
  display: grid;
  grid-template-columns: repeat(4,minmax(170px,1fr)) minmax(150px,.75fr) auto;
  gap: 18px 24px;
  align-items: end;
  padding: 25px;
  margin-bottom: 28px;
  background: #222527;
  border: 1px solid var(--ember-line);
  border-radius: 18px;
}
.ember-filter-bar label { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 12px; color: #ddd; font-weight: 700; white-space: nowrap; }
.ember-filter-bar select, .ember-filter-bar input {
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  color: #ededeb;
  background: #24272a;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  outline: 0;
}
.ember-filter-bar button { height: 44px; padding: 0 20px; color: #fff; background: var(--ember-accent); border: 0; border-radius: 11px; cursor: pointer; font-weight: 800; }

/* Categories: first matching work supplies the image, term name stays readable above it. */
.ember-category-search { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 16px; padding: 25px; margin-bottom: 28px; background: #222527; border: 1px solid var(--ember-line); border-radius: 18px; }
.ember-category-search label { font-weight: 800; }
.ember-category-search > div { height: 48px; display: grid; grid-template-columns: minmax(0,1fr) 48px; background: #202224; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; }
.ember-category-search input { min-width: 0; padding: 0 16px; color: #fff; background: transparent; border: 0; outline: 0; }
.ember-category-search svg { width: 21px; height: 21px; align-self: center; justify-self: center; color: #aaa; }
.ember-category-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px 28px; }
.ember-category-card { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; background: #1e2123; border: 1px solid var(--ember-line); border-radius: 35px; isolation: isolate; }
.ember-category-card::after { position: absolute; z-index: -1; inset: 0; background: linear-gradient(100deg,rgba(0,0,0,.22),rgba(0,0,0,.48)); content: ""; }
.ember-category-card img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.ember-category-card:hover img { transform: scale(1.045); }
.ember-category-card span { max-width: 90%; color: #fff; font-size: clamp(24px,2.1vw,40px); font-weight: 950; line-height: 1.02; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.7); overflow-wrap: anywhere; }
.ember-category-card small { position: absolute; right: 16px; bottom: 12px; color: rgba(255,255,255,.78); font-size: 10px; }
.ember-category-card[hidden] { display: none; }
.ember-taxonomy__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--ember-line); }
.ember-taxonomy__head h1 { margin: 0; font-size: clamp(28px,3vw,42px); }
.ember-taxonomy__head a { color: var(--ember-accent-2); }
.ember-taxonomy__head span { color: var(--ember-muted); }

/* Reframe inherited detail and directory surfaces for the app shell. */
.ember-top, .ember-detail, .directory-page, .author-page, .dashboard-page, .prose-page, .generic-archive .section, .not-found { padding-top: 140px !important; }
.ember-top .ember-section__head { margin-bottom: 24px; }
.ember-grid--ranking, .comic-grid, .latest-grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 27px 22px; }
.ember-grid--ranking .ember-ranked > span { background: var(--ember-accent); color: #fff; }
.ember-title-panel { background: #222527; border-color: var(--ember-line); }
.ember-title-panel::before { background: var(--ember-accent); }
.ember-detail-info, .ember-chapters, .detail-section, .profile-card, .settings-card, .login-card, .text-card, .author-profile { background: #202326; border-color: var(--ember-line); }
.ember-like-box { background: #17191b; }
.ember-facts > div, .ember-synopsis, .chapter-list, .chapter-list a { border-color: var(--ember-line); }
.ember-facts dd a, .breadcrumbs a:hover, .chapter-list a > span, .section-heading > a:hover { color: var(--ember-accent-2); }
.ember-detail .recommendations { background: transparent; }
.ember-footer.site-footer { width: calc(100% - var(--ember-sidebar-width)); padding: 34px 0 25px; margin-left: var(--ember-sidebar-width); background: #0b0d0e; transition: width .22s ease, margin-left .22s ease; }
.ember-share { background: #17191b; border-color: var(--ember-line); }
.ember-share a:hover, .ember-share button:hover, .ember-footer .site-footer__menu a:hover { color: var(--ember-accent); }
.inkwave-reader-page { --ember-sidebar-width: 0px; }
.inkwave-reader-page .ember-header { display: none; }
.inkwave-reader-page > main { width: 100%; margin-left: 0; padding-top: 48px; }

/* Responsive shell. */
@media (max-width: 1500px) {
  .ember-series-grid, .ember-grid--ranking, .comic-grid, .latest-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .ember-filter-bar { grid-template-columns: repeat(3,minmax(180px,1fr)); }
}
@media (max-width: 1180px) {
  body { --ember-sidebar-width: 240px; }
  body.ember-sidebar-collapsed { --ember-sidebar-width: 82px; }
  .ember-topbar { grid-template-columns: auto minmax(220px,1fr) auto; }
  .ember-brand { max-width: 190px; }
  .ember-series-grid, .ember-grid--ranking, .comic-grid, .latest-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .ember-category-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ember-detail-card { grid-template-columns: 300px minmax(0,1fr); }
}
@media (max-width: 900px) {
  body, body.ember-sidebar-collapsed { --ember-sidebar-width: 0px; }
  body:not(.inkwave-reader-page) > main,
  body:not(.inkwave-reader-page) > .site-footer,
  .ember-footer.site-footer { width: 100%; margin-left: 0; }
  .ember-topbar { height: 64px; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding-inline: 14px; }
  .ember-sidebar-toggle { left: 12px; }
  .ember-brand { max-width: calc(100% - 55px); margin-left: 47px; }
  .ember-brand strong { font-size: 23px; }
  .ember-topbar__actions .language-switcher { display: none; }
  .ember-signin { min-height: 40px; padding-inline: 12px; font-size: 12px; }
  .ember-search { position: fixed; z-index: 445; top: 72px; right: 14px; left: 14px; width: auto; height: 44px; }
  .ember-sidebar { top: 64px; width: min(294px,84vw); padding-top: 18px; transform: translateX(-105%); box-shadow: 18px 0 50px rgba(0,0,0,.45); }
  .ember-sidebar-open .ember-sidebar { transform: none; }
  .ember-sidebar a, .ember-sidebar-collapsed .ember-sidebar a { grid-template-columns: 38px minmax(0,1fr); gap: 9px; padding-inline: 13px; }
  .ember-sidebar span, .ember-sidebar-collapsed .ember-sidebar span { width: auto; opacity: 1; }
  .ember-tag-strip { top: 124px; left: 0; height: 52px; padding-inline: 14px; }
  body:not(.inkwave-reader-page) > main { padding-top: 195px; }
  .ember-top, .ember-detail, .directory-page, .author-page, .dashboard-page, .prose-page, .generic-archive .section, .not-found { padding-top: 195px !important; }
  .ember-series-grid, .ember-grid--ranking, .comic-grid, .latest-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 14px; }
  .ember-filter-bar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ember-filter-bar label { grid-template-columns: 1fr; gap: 7px; }
  .ember-category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .ember-category-card { border-radius: 24px; }
}
@media (max-width: 620px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .ember-home-intro { margin-bottom: 25px; font-size: 13px; }
  .ember-section__head h1, .ember-section__head h2 { font-size: 22px; }
  .ember-section__head > a { font-size: 0; }
  .ember-section__head > a span { font-size: 28px; }
  .ember-trending-rail { grid-auto-columns: minmax(165px,58vw); gap: 13px; }
  .ember-series-grid, .ember-grid--ranking, .comic-grid, .latest-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 11px; }
  .ember-card h3 { font-size: 13px; }
  .ember-filter-bar { grid-template-columns: 1fr; gap: 13px; padding: 17px; border-radius: 14px; }
  .ember-category-search { grid-template-columns: 1fr; gap: 9px; padding: 17px; }
  .ember-category-grid { grid-template-columns: 1fr; }
  .ember-category-card { aspect-ratio: 16 / 8.5; }
  .ember-category-card span { font-size: 28px; }
  .ember-taxonomy__head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ember-detail-card { grid-template-columns: 1fr; }
  .ember-detail-cover { width: min(86%,330px); margin: auto; }
  .ember-facts { grid-template-columns: 1fr; }
  .ember-footer.site-footer { padding-top: 24px; }
}
