:root {
  --bg: #050505;
  --bg-soft: #0d0d0d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f6f6f6;
  --muted: #a3a3a3;
  --muted-strong: #cfcfcf;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --radius-sm: 16px;
  --page-width-compact: 760px;
  --page-width-wide: 1040px;
  --reader-sticky-offset: 84px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(180deg, #111 0%, #050505 32%, #020202 100%);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.topbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 7, 7, 0.84);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.topbar-search {
  flex: 1 1 320px;
  min-width: min(100%, 260px);
  display: flex;
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  stroke: #f2f2f2;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1,
.hero-panel h2,
.detail-heading h2,
.reader-info h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.brand h1 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.eyebrow,
.section-tag,
.stat-label {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.toolbar {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.mobile-reader-actions {
  display: none;
  gap: 8px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.topbar.is-menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.topbar.is-menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.is-menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.source-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 50%);
  box-shadow: var(--shadow);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
}

.source-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.source-pill,
.ghost-button,
.detail-actions button,
.chapter-row,
.card-hitbox {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.source-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted-strong);
  border-radius: 18px;
  padding: 11px 13px;
  font-size: 0.9rem;
  min-height: 48px;
  text-align: left;
  width: 100%;
}

.source-pill.is-active,
.ghost-button.is-active,
.source-pill:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.ghost-button.is-active {
  background: rgba(255, 255, 255, 0.12);
}

.search-form {
  position: relative;
  display: block;
  width: min(100%, 420px);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-form input,
.chapter-tools input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-form input:focus,
.chapter-tools input:focus {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.detail-actions button:not(.ghost-button) {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #f3f3f3;
  color: #111;
}

.ghost-button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.ghost-button:hover,
.detail-actions button:hover,
.chapter-row:hover,
.card-hitbox:hover {
  transform: translateY(-2px);
}

.workspace {
  display: block;
}

.catalog-bento {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(250px, 0.82fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}

.catalog-bento > .source-panel,
.catalog-bento > .hero-panel {
  margin-top: 0;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-panel,
.detail-layout,
.reader-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  min-height: 230px;
  padding: 22px 24px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03) 52%, rgba(255, 255, 255, 0.015)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.hero-panel::before {
  content: attr(data-title);
  position: absolute;
  right: 20px;
  bottom: -18px;
  max-width: 76%;
  color: rgba(255, 255, 255, 0.075);
  font-family: "Instrument Serif", serif;
  font-size: clamp(4.2rem, 10vw, 8.8rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  text-align: right;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  z-index: -1;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -34% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

.hero-panel-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(620px, 76%);
  position: relative;
  z-index: 1;
}

.hero-panel .eyebrow {
  color: #bdbdbd;
}

.hero-panel h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0;
  max-width: 10ch;
}

.hero-narrative {
  display: grid;
  gap: 6px;
}

.hero-support {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.62;
  max-width: 40ch;
}

.hero-copy,
.detail-copy,
.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-stats,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.meta-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.stat-card strong,
.meta-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.05rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.search-entry-panel,
.search-view-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at top right, rgba(255, 179, 179, 0.08), transparent 38%);
  box-shadow: var(--shadow);
}

.search-entry-panel h3,
.search-view-head h2 {
  margin: 6px 0 0;
  font-size: 1.18rem;
  font-weight: 500;
}

.catalog-tools-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at top right, rgba(255, 179, 179, 0.08), transparent 36%);
  box-shadow: var(--shadow);
}

.results-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.022)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 40%);
  box-shadow: var(--shadow);
}

.results-panel-search {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at top right, rgba(255, 179, 179, 0.08), transparent 36%);
}

.results-panel-head {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.results-panel-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
}

.catalog-tools-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-tools-head h3 {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.catalog-tools-head .ghost-button {
  justify-self: end;
}

.catalog-tools-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.catalog-tags-block {
  flex: 1 1 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.catalog-genre-search {
  position: relative;
}

.catalog-genre-search input,
.catalog-filter-field select {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  outline: none;
}

.catalog-genre-search input {
  padding: 0 14px 0 42px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,241,227,0.62)' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  background-repeat: no-repeat, no-repeat;
  background-position: 14px 50%, 0 0;
  background-size: 16px 16px, auto;
}

.catalog-genre-search input::placeholder {
  color: rgba(246, 246, 246, 0.42);
}

.catalog-genre-search input:focus,
.catalog-filter-field select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.catalog-genre-suggestions {
  position: relative;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  margin-top: -2px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(11, 11, 11, 0.98), rgba(7, 7, 7, 0.98)),
    radial-gradient(circle at top right, rgba(255, 179, 179, 0.08), transparent 45%);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.32);
}

.catalog-genre-suggestions[hidden] {
  display: none;
}

.catalog-genre-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-strong);
  text-align: left;
}

.catalog-genre-option strong {
  font-weight: 500;
}

.catalog-genre-option small {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.catalog-genre-option:hover,
.catalog-genre-option.is-active {
  border-color: rgba(255, 179, 179, 0.32);
  background: rgba(255, 179, 179, 0.11);
  color: var(--text);
}

.catalog-genre-meta {
  min-height: 1.3rem;
}

.catalog-genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.tag-chip.is-active,
.tag-chip:hover {
  border-color: rgba(255, 179, 179, 0.35);
  background: rgba(255, 179, 179, 0.12);
  color: var(--text);
}

.catalog-filter-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.catalog-filter-field {
  display: grid;
  gap: 6px;
}

.catalog-filter-field span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.catalog-filter-field select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 36px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 241, 227, 0.7) 50%),
    linear-gradient(135deg, rgba(255, 241, 227, 0.7) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.tag-chip,
.catalog-filter-field select,
.catalog-genre-search input,
.catalog-genre-option {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.catalog-grid-home {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.catalog-grid-search {
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}

.manga-card {
  min-height: 100%;
  height: 100%;
}

.card-hitbox {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.card-hitbox:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.card-cover-shell {
  position: relative;
  aspect-ratio: 0.72;
  overflow: hidden;
  background: linear-gradient(180deg, #161616, #0d0d0d);
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.card-hitbox:hover .card-cover {
  transform: scale(1.03);
}

.card-type {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.card-copy {
  display: grid;
  grid-template-rows: minmax(2.8em, auto) minmax(1.3em, auto) 1fr;
  gap: 9px;
  padding: 15px 15px 16px;
  min-height: 138px;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-chapter,
.card-footer {
  margin: 0;
  color: var(--muted);
}

.card-chapter {
  min-height: 1.35em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  margin-top: auto;
  align-items: baseline;
}

.card-cover[data-fallback="true"],
.detail-cover[data-fallback="true"] {
  object-fit: cover;
  background: #080808;
}

.feed-state {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.scroll-sentinel {
  height: 1px;
}

.detail-view .detail-back {
  margin-bottom: 16px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 22px;
  padding: 22px;
}

.detail-cover-panel {
  position: sticky;
  top: 110px;
  align-self: start;
}

.detail-cover {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.detail-content {
  display: grid;
  gap: 20px;
}

.detail-heading {
  display: grid;
  gap: 16px;
}

.detail-heading h2 {
  font-size: clamp(2.2rem, 4.7vw, 4rem);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-row span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
}

.detail-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.028);
}

.detail-block h3,
.chapter-header h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.chapter-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.chapter-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chapter-list {
  display: grid;
  gap: 12px;
}

.chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.026);
  color: var(--text);
}

.chapter-row-main {
  display: grid;
  gap: 6px;
  text-align: left;
}

.chapter-row-date,
.chapter-row-action {
  color: var(--muted);
}

.reader-shell {
  padding: 18px;
}

.reader-topbar,
.reader-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.reader-topbar {
  position: sticky;
  top: var(--reader-sticky-offset);
  z-index: 10;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 5, 5, 0.86);
  backdrop-filter: blur(14px);
}

.reader-topbar-left,
.reader-topbar-right,
.reader-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reader-info {
  align-items: end;
  margin-bottom: 14px;
}

.reader-nav-inline {
  justify-content: space-between;
  margin: 0 auto 14px;
  width: min(100%, var(--page-width-wide));
}

.reader-nav-bottom {
  margin: 14px auto 0;
}

.reader-pages {
  display: grid;
  gap: 0;
  margin: 0 auto;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
}

.reader-pages.layout-compact {
  width: min(100%, var(--page-width-compact));
}

.reader-pages.layout-wide {
  width: min(100%, var(--page-width-wide));
}

.reader-page {
  border-radius: 0;
  border: 0;
  overflow: hidden;
  background: #000;
}

.reader-page img {
  width: 100%;
  height: auto;
}

.hidden {
  display: none !important;
}

.scroll-top-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(9, 9, 9, 0.88);
  color: var(--text);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.scroll-top-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scroll-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

@media (max-width: 1080px) {
  .catalog-bento,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-cover-panel {
    position: static;
  }

  .reader-topbar-right {
    display: none;
  }

  .catalog-tools-layout {
    grid-template-columns: 1fr;
  }

  .catalog-filter-grid {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 10px;
  }

  .topbar {
    top: 8px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .topbar-main {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
    flex: 0 0 auto;
  }

  .topbar-search {
    flex: none;
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }

  .search-form {
    width: 100%;
  }

  .toolbar {
    flex: none;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 10px;
  }

  .topbar.is-menu-open .toolbar {
    display: flex;
  }

  body.is-reader-mode .reader-topbar {
    display: none;
  }

  body.is-reader-mode .mobile-reader-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  body.is-reader-mode .mobile-reader-actions .ghost-button {
    width: 100%;
  }

  .hero-panel {
    align-items: flex-end;
    padding: 12px 14px;
  }

  .hero-panel::before {
    right: 12px;
    bottom: -8px;
    max-width: 82%;
    font-size: clamp(3rem, 14vw, 5.2rem);
  }

  .hero-panel::after {
    inset: auto -18% -30% auto;
    width: 190px;
    height: 190px;
  }

  .hero-panel-copy {
    max-width: 100%;
  }

  .hero-support {
    max-width: 100%;
  }

  .catalog-tools-panel {
    padding: 14px;
  }

  .catalog-tools-head,
  .catalog-tools-layout,
  .search-entry-panel,
  .search-view-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .catalog-tools-head .ghost-button,
  .search-entry-panel .ghost-button,
  .search-view-head .ghost-button {
    justify-self: start;
  }

  .catalog-filter-grid {
    grid-template-columns: 1fr;
  }

  .catalog-genre-row {
    gap: 8px;
  }

  .search-form,
  .chapter-tools,
  .reader-topbar,
  .reader-info,
  .chapter-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stats,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .card-hitbox {
    border-radius: 16px;
  }

  .card-type {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 5px 8px;
    font-size: 0.62rem;
    text-align: center;
  }

  .card-copy {
    gap: 6px;
    padding: 10px;
    min-height: 96px;
  }

  .card-title {
    font-size: 0.78rem;
    line-height: 1.25;
    min-height: 2.45em;
  }

  .card-chapter {
    font-size: 0.68rem;
    min-height: 1.2em;
  }

  .card-footer {
    font-size: 0.62rem;
    gap: 6px;
  }

  .scroll-top-button {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
}

body.is-reader-mode .topbar {
  position: static;
  top: auto;
  left: auto;
  width: auto;
  transform: none;
  z-index: auto;
}

body.is-reader-mode .reader-shell {
  padding-top: 18px;
}

body.is-reader-mode .reader-topbar {
  position: static;
  top: auto;
  z-index: auto;
}

body.is-reader-immersive .topbar,
body.is-reader-immersive .reader-topbar,
body.is-reader-immersive .reader-info,
body.is-reader-immersive .reader-nav-inline,
body.is-reader-immersive .mobile-reader-actions {
  display: none !important;
}

body.is-reader-immersive .scroll-top-button {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(14px) !important;
}

@media (min-width: 761px) {
  body.is-reader-mode {
    --reader-sticky-offset: 72px;
  }

  body.is-reader-mode .topbar {
    padding: 6px 10px;
  }

  body.is-reader-mode .topbar-main {
    width: auto;
  }

  body.is-reader-mode .brand h1 {
    font-size: clamp(1.35rem, 2vw, 1.8rem);
  }

  body.is-reader-mode .reader-shell {
    padding-top: 18px;
  }
}

@media (max-width: 760px) {
  body.is-reader-mode .reader-shell {
    padding: 12px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.is-reader-mode .app-shell {
    width: 100%;
    padding: 10px 0 24px;
  }

  body.is-reader-mode .reader-info,
  body.is-reader-mode .reader-nav-inline {
    width: 100%;
    padding-inline: 12px;
  }

  body.is-reader-mode .reader-pages,
  body.is-reader-mode .reader-pages.layout-compact,
  body.is-reader-mode .reader-pages.layout-wide {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
  }

  body.is-reader-mode .reader-page,
  body.is-reader-mode .reader-page img {
    border-radius: 0;
  }

  body.is-reader-immersive .reader-shell {
    padding-top: 0;
  }
}
