:root {
  color-scheme: dark;
  --bg: #101214;
  --surface: #181b20;
  --surface-2: #22262d;
  --surface-3: #2d333d;
  --line: #343c47;
  --text: #f2f3f5;
  --muted: #a8b0bb;
  --quiet: #76808d;
  --accent: #ffb33f;
  --accent-2: #65d0b7;
  --danger: #ff6f61;
  --good: #8bd66f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.22);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --radius: 8px;
  --font-ui: "Segoe UI", "PT Root UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-reading: "Segoe UI", "Noto Sans", Arial, sans-serif;
  font-family:
    var(--font-ui);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(101, 208, 183, 0.08), transparent 34rem),
    radial-gradient(circle at 80% 10%, rgba(255, 179, 63, 0.06), transparent 28rem),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-ui);
  font-weight: 700;
}

strong {
  font-weight: 650;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(30, 34, 40, 0.94), rgba(17, 19, 22, 0.9));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffb33f, #65d0b7);
  background-size: 180% 180%;
  color: #101215;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(255, 179, 63, 0.18);
  animation: brand-gradient 7s ease-in-out infinite;
}

.brand:hover .brand-mark {
  animation-duration: 3.5s;
}

@keyframes brand-gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.search {
  position: relative;
  max-width: 620px;
  width: 100%;
}

.suggest-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 60;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggest-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
}

.suggest-item:hover {
  background: var(--surface-2);
}

.suggest-more {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: #d9e7ff;
  font-size: 14px;
  font-weight: 700;
}

.suggest-more span {
  color: var(--muted);
  font-size: 13px;
}

.suggest-more:hover {
  background: rgba(52, 120, 246, 0.12);
}

.search input {
  width: 100%;
  min-height: 42px;
  padding: 0 42px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.search input:focus {
  border-color: rgba(255, 179, 63, 0.62);
  box-shadow:
    var(--inner-light),
    0 0 0 3px rgba(255, 179, 63, 0.12);
}

.search > svg {
  position: absolute;
  top: 11px;
  left: 14px;
  color: var(--quiet);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--quiet);
  background: transparent;
  transform: translateY(-50%);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.search-clear:hover,
.search-clear:focus-visible {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  outline: 0;
  background: var(--surface-2);
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.nav a,
.icon-button,
.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.bookmark-nav {
  position: relative;
  display: inline-flex;
  width: auto;
  min-width: 48px;
  padding: 0 9px;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.bookmark-nav svg {
  flex: 0 0 auto;
}

.bookmark-nav span {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: #3478f6;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-weight: 650;
}

.btn-primary {
  background: linear-gradient(180deg, #ffd07a, var(--accent));
  color: #17120a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 22px rgba(255, 179, 63, 0.18);
}

.btn-secondary {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.profile-chip {
  gap: 9px;
  padding-left: 9px;
}

.header-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #17120a;
  background:
    linear-gradient(135deg, rgba(101, 208, 183, 0.96), rgba(255, 188, 91, 0.96)),
    var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 5px 14px rgba(0, 0, 0, 0.2);
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-chip-name {
  line-height: 1;
}

.btn:hover,
.icon-button:hover,
.amount:hover,
.tab:hover,
.side-menu a:hover,
.side-menu button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn:active,
.icon-button:active,
.amount:active,
.tab:active,
.side-menu a:active,
.side-menu button:active {
  transform: translateY(0);
}

.btn:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.btn-ghost {
  color: var(--muted);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  place-items: center;
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.page {
  padding: 28px 0 54px;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.section-title {
  position: relative;
}

.section-title::after {
  display: block;
  width: 42px;
  height: 3px;
  margin-top: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  content: "";
}

.section-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.18;
}

.section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--font-reading);
  line-height: 1.55;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(146px, 180px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-color: var(--surface-3) transparent;
  scroll-snap-type: x proximity;
}

.cover-card {
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.cover-card::after,
.vote-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.12) 46%, transparent 62%);
  content: "";
  opacity: 0;
  transform: translateX(-35%);
  transition:
    opacity 180ms ease,
    transform 420ms ease;
}

.cover-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 179, 63, 0.38);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
}

.cover-card:hover::after,
.vote-card:hover::after {
  opacity: 1;
  transform: translateX(35%);
}

.cover {
  position: relative;
  display: grid;
  aspect-ratio: 2 / 3;
  place-items: end stretch;
  overflow: hidden;
  background:
    linear-gradient(150deg, var(--c1), transparent 58%),
    linear-gradient(25deg, var(--c2), var(--c3));
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 -80px 70px rgba(0, 0, 0, 0.34);
  transition: transform 260ms ease, filter 260ms ease;
}

.cover-card:hover .cover,
.vote-card:hover .cover {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.04);
}

.cover::before,
.cover::after,
.reader-page::before,
.reader-page::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.cover::before {
  top: 15%;
  right: 14%;
  width: 42%;
  height: 34%;
  border-radius: 45% 45% 8px 8px;
}

.cover::after {
  right: 18%;
  bottom: 18%;
  width: 54%;
  height: 30%;
  transform: skew(-12deg);
  border-radius: 8px;
}

.badge-row {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge,
.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  padding: 0 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    rgba(17, 19, 22, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 10px;
  position: relative;
  z-index: 1;
}

.card-title {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.35;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

.updates {
  display: grid;
  gap: 10px;
}

.vertical-tabs {
  display: grid;
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-sort {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-2);
}

.catalog-page {
  padding-top: 24px;
}

.catalog-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.catalog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.catalog-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-color: var(--surface-3) transparent;
}

.catalog-tab,
.filter-chip,
.filter-reset {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.catalog-tab {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-weight: 650;
}

.catalog-tab:hover,
.catalog-tab.active,
.filter-chip:hover,
.filter-chip.active {
  border-color: rgba(255, 179, 63, 0.42);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent),
    rgba(255, 179, 63, 0.1);
}

.catalog-tab:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.active-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-reset {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  background: var(--surface);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}

.catalog-filter-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 44%),
    var(--surface);
  box-shadow: var(--shadow-soft), var(--inner-light);
}

.catalog-filter-block h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.filter-cloud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.filter-chip span {
  color: var(--quiet);
  font-size: 12px;
}

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

.catalog-grid .cover-card {
  min-width: 0;
}

.bookmarked {
  border-color: rgba(52, 120, 246, 0.5);
  color: #d9e7ff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(52, 120, 246, 0.14);
}

.bookmark-control {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: max-content;
  max-width: 100%;
}

.bookmark-control > .btn {
  min-width: 144px;
}

.bookmark-control.compact {
  width: 40px;
}

.bookmark-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 80;
  display: grid;
  min-width: 138px;
  overflow: hidden;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #1b1d21;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.bookmark-control.compact .bookmark-menu {
  left: auto;
  right: 0;
  transform: none;
}

.bookmark-menu button {
  min-height: 34px;
  padding: 0 24px;
  border: 0;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  background: transparent;
  font-weight: 650;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.bookmark-menu button:hover,
.bookmark-menu button:focus-visible,
.bookmark-menu button.active {
  color: #fff;
  outline: 0;
  background: rgba(52, 120, 246, 0.18);
}

.panel:has(.bookmark-menu),
.volume-group:has(.bookmark-menu),
.bookmark-row:has(.bookmark-menu) {
  overflow: visible;
  z-index: 10;
}

.bookmarks-page {
  min-height: calc(100vh - 74px);
  padding-top: 20px;
  background: #111315;
}

.bookmarks-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.bookmarks-head h1 {
  position: relative;
  margin: 0;
  font-size: 26px;
  line-height: 1.18;
}

.bookmarks-head h1::after {
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 110px;
  height: 7px;
  border-radius: 999px;
  background: #3478f6;
  content: "";
}

.bookmark-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 16px;
}

.bookmark-tabs {
  display: flex;
  max-width: 100%;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  scrollbar-color: var(--surface-3) transparent;
}

.bookmark-tab {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.bookmark-tab span {
  color: var(--muted);
}

.bookmark-tab.active {
  background: #3478f6;
  color: #fff;
}

.bookmark-tab.active span {
  color: rgba(255, 255, 255, 0.86);
}

.bookmark-actions {
  display: flex;
  gap: 8px;
}

.bookmark-sort {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.bookmark-list {
  display: grid;
  gap: 10px;
}

.bookmark-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.bookmark-cover {
  display: block;
  width: 64px;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background-position: center;
  background-size: cover;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.bookmark-info {
  min-width: 0;
}

.bookmark-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-info p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bookmark-empty {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.update-item,
.chapter-row,
.comment-row,
.payment-row {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.chapter-row {
  grid-template-columns: 1fr auto auto auto;
}

.comment-row-flat {
  grid-template-columns: 1fr auto;
}

.update-item::before,
.chapter-row::before,
.payment-row::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--c1, var(--accent)), var(--c2, var(--accent-2)));
  content: "";
  opacity: 0.75;
}

.update-item:hover,
.chapter-row:hover,
.comment-row:hover,
.payment-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    var(--inner-light),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 8px 16px rgba(0, 0, 0, 0.2);
}

.thumb::after {
  position: absolute;
  inset: 18% 18% auto auto;
  width: 36%;
  height: 36%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  content: "";
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 38%),
    var(--surface);
  box-shadow:
    var(--inner-light),
    var(--shadow-soft);
}

.panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  content: "";
}

.panel-pad {
  padding: 16px;
}

.panel h3,
.vote-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.28;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.tab {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.tab.active {
  color: #121417;
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffd07a, var(--accent));
  font-weight: 650;
}

.hero-title {
  display: grid;
  min-height: 420px;
  grid-template-columns: 260px 1fr;
  gap: 26px;
  align-items: end;
  padding: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(17, 19, 22, 0.95), rgba(17, 19, 22, 0.62)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(135deg, #26313a, #4b3d35 45%, #1d443f);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.title-cover {
  width: min(100%, 260px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.44),
    0 0 0 8px rgba(255, 255, 255, 0.035);
}

.title-info h1,
.contest-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.04;
}

.title-info p,
.contest-hero p {
  max-width: 720px;
  color: var(--muted);
  font-family: var(--font-reading);
  font-size: 17px;
  line-height: 1.6;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
}

.reader-actions {
  margin: 0;
}

.stat-pill {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.055);
  box-shadow: var(--inner-light);
}

.tag-cloud {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 13px;
}

.comic-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 22px;
  margin-top: 22px;
}

.chapter-row {
  grid-template-columns: 1fr auto auto auto;
}

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

.volume-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.volume-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.volume-summary::-webkit-details-marker {
  display: none;
}

.volume-summary::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  content: "";
  transition: transform 160ms ease;
}

.volume-summary {
  grid-template-columns: auto 1fr auto auto;
}

.volume-group[open] .volume-summary::before {
  transform: rotate(45deg);
}

.volume-chapters {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px 26px;
}

.description-panel {
  max-width: 760px;
}

.description-panel p {
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--font-reading);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-line;
}

.price {
  color: var(--accent);
  font-weight: 700;
}

.price-stack {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.old-price {
  color: var(--muted);
  font-size: 12px;
  text-decoration: line-through;
}

.discount-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #101418;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.reader {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #08090b;
  background-size: 24px 24px;
}

.reader-toolbar {
  position: sticky;
  top: 65px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(12px, 3vw, 28px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 11, 0.92);
  backdrop-filter: blur(14px);
}

.reader-stack {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 22px 10px 46px;
}

.reader-page {
  position: relative;
  min-height: min(1180px, 128vw);
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 36%),
    linear-gradient(25deg, var(--c1), var(--c2) 55%, var(--c3));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 -120px 120px rgba(0, 0, 0, 0.18),
    0 18px 44px rgba(0, 0, 0, 0.42);
}

.reader-page::before {
  top: 8%;
  left: 8%;
  width: 44%;
  height: 38%;
  border-radius: 8px;
}

.reader-page::after {
  right: 8%;
  bottom: 10%;
  width: 54%;
  height: 32%;
  border-radius: 52% 52% 10px 10px;
}

.reader-image {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  min-height: inherit;
  object-fit: cover;
}

.reader-page:has(.reader-image) {
  min-height: 0;
  background: #111316;
}

.reader-page:has(.reader-image)::before,
.reader-page:has(.reader-image)::after {
  display: none;
}

.reader-lock {
  margin-top: 42px;
  text-align: left;
}

.speech {
  position: absolute;
  z-index: 2;
  max-width: 240px;
  padding: 12px 14px;
  border-radius: 18px 18px 18px 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #15171a;
  font-family: var(--font-reading);
  font-weight: 650;
  line-height: 1.32;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.speech.right {
  right: 8%;
  top: 12%;
  border-radius: 18px 18px 4px 18px;
}

.contest-hero {
  padding: 52px clamp(16px, 5vw, 58px);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(17, 19, 22, 0.93), rgba(17, 19, 22, 0.52)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(135deg, #26313a, #604936 52%, #214c44);
  box-shadow:
    var(--inner-light),
    0 20px 50px rgba(0, 0, 0, 0.26);
}

.contest-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 22px;
  margin-top: 22px;
}

.contest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.vote-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.vote-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 179, 63, 0.3);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
}

.vote-cover {
  aspect-ratio: 16 / 10;
}

.cabinet-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
}

.side-menu {
  position: sticky;
  top: 88px;
  display: grid;
  align-self: start;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(16, 18, 21, 0.72);
  box-shadow: var(--inner-light);
}

.side-menu-label {
  display: block;
  margin: 8px 8px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.side-menu-divider {
  display: block;
  height: 1px;
  margin: 8px 8px 2px;
  background: var(--line);
}

.side-menu a,
.side-menu button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.side-menu a.active,
.side-menu button.active {
  color: var(--text);
  border-color: rgba(255, 179, 63, 0.55);
  background:
    linear-gradient(90deg, rgba(255, 179, 63, 0.16), rgba(101, 208, 183, 0.05)),
    var(--surface);
}

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

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 179, 63, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.profile-grid {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: start;
}

.avatar-editor {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.avatar-editor input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.avatar-preview {
  display: grid;
  width: 112px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 179, 63, 0.2), rgba(101, 208, 183, 0.12)),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview span {
  color: var(--text);
  font-size: 38px;
  font-weight: 700;
}

.agreement-list {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.agreement-line {
  display: grid;
  width: min(100%, 620px);
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.agreement-list label,
.field span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.btn-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.agreement-dialog {
  width: min(720px, 100%);
}

.agreement-content {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 620px);
  margin-top: 16px;
  overflow: auto;
  color: var(--muted);
  font-family: var(--font-reading);
  line-height: 1.65;
}

.agreement-content h2,
.agreement-content h3 {
  margin: 8px 0 0;
  color: var(--text);
}

.security-block {
  display: grid;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.security-block:first-of-type {
  margin-top: 8px;
}

.security-block h3 {
  margin: 0;
}

.two-factor-setup {
  margin-top: 4px;
}

.author-create-form {
  display: grid;
  gap: 14px;
  margin: 16px 0;
  padding: 16px 0 306px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.author-create-form .stats {
  margin: 2px 0 0;
}

.author-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}

.author-create-main {
  display: grid;
  gap: 14px;
}

.author-draft-list,
.author-draft-chapters {
  display: grid;
  gap: 12px;
}

.author-draft-volume,
.author-draft-chapter {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.author-draft-chapter {
  background: rgba(255, 255, 255, 0.018);
}

.author-draft-head {
  min-height: 0;
  margin-bottom: 0;
  align-items: center;
}

.author-draft-head h3,
.author-draft-head h4 {
  margin: 0;
}

.author-price-calc {
  padding: 9px 10px;
  border: 1px solid rgba(101, 208, 183, 0.26);
  border-radius: var(--radius);
  color: #bfece2;
  background: rgba(101, 208, 183, 0.08);
  font-size: 13px;
  font-weight: 650;
}

.author-price-calc.is-over {
  border-color: rgba(255, 111, 97, 0.44);
  color: #ffd4cf;
  background: rgba(255, 111, 97, 0.11);
}

.file-button {
  position: relative;
  width: fit-content;
  overflow: hidden;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.author-preview-panel {
  --author-preview-offset: 82px;
  position: fixed;
  top: var(--author-preview-offset);
  right: max(16px, calc((100vw - 1180px) / 2));
  z-index: 60;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(340px, calc(100vw - 32px));
  height: calc(100vh - var(--author-preview-offset) - 16px);
  height: calc(100dvh - var(--author-preview-offset) - 16px);
  max-height: calc(100vh - var(--author-preview-offset) - 16px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(16, 18, 21, 0.985);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.author-price-panel {
  position: fixed;
  right: calc(max(16px, (100vw - 1180px) / 2) + 358px);
  bottom: 16px;
  left: calc(max(16px, (100vw - 1180px) / 2) + 282px);
  z-index: 55;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  max-height: min(36vh, 280px);
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(255, 179, 63, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 179, 63, 0.075), transparent),
    rgba(16, 18, 21, 0.96);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.author-price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.author-price-summary > div,
.author-price-total,
.author-price-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.author-price-summary > div {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 8px 9px;
}

.author-price-summary span,
.author-price-total span,
.author-price-total small,
.author-price-row small {
  color: var(--muted);
  font-size: 12px;
}

.author-price-summary strong,
.author-price-total strong,
.author-price-row strong {
  color: var(--text);
}

.author-price-total {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.author-price-total strong {
  color: var(--accent);
  font-size: 22px;
  line-height: 1.1;
}

.author-price-panel-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.author-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 9px;
}

.author-price-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.author-price-row > span:last-child {
  text-align: right;
}

.author-preview-panel h3 {
  margin: 0;
}

.author-preview-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.author-preview-tabs button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface);
}

.author-preview-tabs button.active,
.author-preview-tabs button:hover {
  color: var(--text);
  border-color: rgba(255, 179, 63, 0.48);
  background: rgba(255, 179, 63, 0.1);
}

.author-preview-stack {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.author-preview-page {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.author-preview-page img {
  display: block;
  width: 100%;
  height: auto;
  background: #08090b;
}

.author-preview-page figcaption {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 13px;
}

.author-preview-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.author-page-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.author-page-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 4px 5px 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.024);
}

.author-page-list span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-page-list .icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}

.author-comic-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.author-comic-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface);
  box-shadow: var(--inner-light);
}

.author-comic-row summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  cursor: pointer;
}

.author-comic-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.author-comic-detail {
  display: grid;
  gap: 14px;
  padding: 0 12px 12px;
}

.volume-admin-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.volume-admin-block h3 {
  margin: 0 0 6px;
}

.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  outline: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(101, 208, 183, 0.58);
  box-shadow:
    var(--inner-light),
    0 0 0 3px rgba(101, 208, 183, 0.1);
}

.field textarea {
  min-height: 94px;
  padding-top: 11px;
  resize: vertical;
}

.locked-value {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.field-wide {
  grid-column: 1 / -1;
}

.payment-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
}

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

.amount {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.amount.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 179, 63, 0.22), rgba(255, 179, 63, 0.09)),
    var(--surface);
  box-shadow:
    var(--inner-light),
    0 12px 24px rgba(255, 179, 63, 0.11);
}

.footer {
  margin-top: 48px;
  padding: 28px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--quiet);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 28px;
  align-items: start;
}

.footer strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.footer p {
  max-width: 420px;
  margin: 8px 0 0;
}

.footer-links {
  display: grid;
  gap: 8px;
  min-width: 160px;
}

.footer-links span {
  color: var(--text);
  font-weight: 700;
}

.footer-links a {
  color: var(--muted);
  transition: color 160ms ease, transform 160ms ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
  outline: 0;
  transform: translateX(2px);
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 11, 0.74);
  backdrop-filter: blur(14px);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 9, 11, 0.76);
  backdrop-filter: blur(14px);
}

.auth-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 42%),
    var(--surface);
  box-shadow:
    var(--inner-light),
    0 24px 64px rgba(0, 0, 0, 0.48);
}

.auth-dialog h2 {
  margin: 0 34px 8px 0;
  font-size: 24px;
  line-height: 1.15;
}

.auth-dialog p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-2);
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.social-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.auth-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  color: var(--quiet);
  font-size: 13px;
}

.auth-separator::before,
.auth-separator::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-message {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  line-height: 1.4;
}

.auth-error {
  border: 1px solid rgba(255, 111, 97, 0.42);
  color: #ffd4cf;
  background: rgba(255, 111, 97, 0.12);
}

.auth-notice {
  border: 1px solid rgba(101, 208, 183, 0.42);
  color: #c9fff3;
  background: rgba(101, 208, 183, 0.1);
}

.age-gate-dialog {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 42%),
    var(--surface);
  box-shadow:
    var(--inner-light),
    0 24px 64px rgba(0, 0, 0, 0.48);
}

.age-gate-dialog h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.age-gate-dialog p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.age-gate-message {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  line-height: 1.4;
}

.age-gate-denied {
  border: 1px solid rgba(255, 111, 97, 0.42);
  color: #ffd4cf;
  background: rgba(255, 111, 97, 0.12);
}

/* Shared polish for controls that were added across different pages. */
h1,
h2,
h3 {
  line-height: 1.16;
}

p {
  line-height: 1.58;
}

.btn,
.icon-button,
.tab,
.amount,
.social-button,
.auth-close,
.side-menu a,
.side-menu button,
.catalog-tab,
.filter-chip,
.filter-reset,
.bookmark-tab,
.tag,
.volume-summary,
.bookmark-row,
.suggest-item,
.suggest-more {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.btn,
.tab,
.amount,
.social-button,
.catalog-tab,
.bookmark-tab {
  min-height: 40px;
}

.filter-chip,
.filter-reset {
  min-height: 32px;
}

.tag {
  min-height: 28px;
}

.tag,
.filter-chip,
.filter-reset {
  font-weight: 600;
}

.nav a:focus-visible,
.btn:focus-visible,
.icon-button:focus-visible,
.tab:focus-visible,
.amount:focus-visible,
.social-button:focus-visible,
.auth-close:focus-visible,
.side-menu a:focus-visible,
.side-menu button:focus-visible,
.catalog-tab:focus-visible,
.filter-chip:focus-visible,
.filter-reset:focus-visible,
.bookmark-tab:focus-visible,
.tag:focus-visible,
.volume-summary:focus-visible,
.bookmark-row:focus-visible,
.suggest-item:focus-visible,
.suggest-more:focus-visible,
.search-sort:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 0;
  border-color: rgba(101, 208, 183, 0.62);
  box-shadow:
    var(--inner-light),
    0 0 0 3px rgba(101, 208, 183, 0.12);
}

.tag:hover,
.filter-reset:hover,
.bookmark-tab:hover,
.social-button:hover,
.auth-close:hover,
.volume-summary:hover,
.suggest-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    var(--surface-2);
  box-shadow: var(--inner-light);
}

.bookmark-row:hover,
.volume-group:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    var(--inner-light),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.bookmark-row:hover {
  transform: translateY(-2px);
}

.bookmark-tab:not(.active) {
  color: var(--muted);
}

.bookmark-tab:not(.active):hover {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--surface-2);
}

.catalog-head,
.bookmarks-head,
.section-head {
  min-height: 40px;
}

.bookmarks-head h1,
.section-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
}

.bookmarks-page .container,
.catalog-page .container {
  display: flow-root;
}

.bookmark-sort .search-sort,
.catalog-actions .search-sort {
  min-width: 220px;
}

.chapter-row .icon-button,
.reader-toolbar .icon-button,
.bookmark-row .icon-button {
  width: 40px;
  min-width: 40px;
}

.volume-group {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.search-sort,
.field input,
.field select,
.field textarea {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search {
    grid-column: 1 / -1;
    order: 3;
    max-width: none;
  }

  .content-grid,
  .catalog-layout,
  .comic-layout,
  .contest-layout,
  .cabinet-layout,
  .payment-layout {
    grid-template-columns: 1fr;
  }

  .catalog-filter-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-menu {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .side-menu-label {
    align-self: center;
    margin: 0 4px;
    white-space: nowrap;
  }

  .side-menu-divider {
    width: 1px;
    min-width: 1px;
    height: 32px;
    margin: 0 4px;
  }

  .side-menu a,
  .side-menu button {
    white-space: nowrap;
  }

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

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

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .author-create-layout {
    grid-template-columns: 1fr;
  }

  .author-create-form {
    padding-bottom: 16px;
  }

  .author-price-panel {
    position: static;
    max-height: none;
  }

  .author-price-panel-list {
    overflow: visible;
  }

  .author-preview-panel {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
  }

  .author-preview-stack {
    overflow: visible;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > div {
    grid-column: 1 / -1;
  }

  .title-info h1,
  .contest-hero h1 {
    font-size: 42px;
  }
}

@media (max-width: 720px) {
  .topbar {
    gap: 10px;
    padding: 10px 12px;
  }

  .nav a:not(.mobile-keep) {
    display: none;
  }

  .page {
    padding-top: 18px;
  }

  .container {
    width: min(100% - 20px, 1180px);
  }

  .hero-title {
    min-height: 0;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    padding: 16px;
    align-items: center;
  }

  .title-info h1,
  .contest-hero h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  .section-title {
    font-size: 22px;
  }

  .catalog-head {
    align-items: stretch;
    flex-direction: column;
  }

  .bookmark-controls,
  .bookmarks-head {
    align-items: stretch;
    flex-direction: column;
  }

  .bookmark-sort {
    justify-content: flex-start;
  }

  .bookmark-row {
    grid-template-columns: 54px 1fr;
  }

  .bookmark-row > .icon-button {
    grid-column: 2;
    justify-self: start;
  }

  .catalog-actions {
    justify-content: flex-start;
  }

  .catalog-filter-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .card-title {
    font-size: 14px;
  }

  .title-info p {
    display: none;
  }

  .stats {
    margin-bottom: 12px;
  }

  .rail {
    grid-auto-columns: minmax(132px, 42vw);
  }

  .update-item,
  .payment-row {
    grid-template-columns: 48px 1fr;
  }

  .update-item .btn,
  .payment-row .btn,
  .update-item > span:last-child {
    grid-column: 2;
    justify-self: start;
  }

  .chapter-row {
    grid-template-columns: 1fr;
  }

  .volume-summary {
    grid-template-columns: auto 1fr;
  }

  .volume-summary > .price,
  .volume-summary > .btn {
    grid-column: 2;
    justify-self: start;
  }

  .volume-chapters {
    padding-left: 16px;
  }

  .contest-grid,
  .form-grid,
  .amount-grid {
    grid-template-columns: 1fr;
  }

  .reader-toolbar {
    top: 111px;
    align-items: stretch;
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
