:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #edf4ef;
  --surface-warm: #fff4e7;
  --ink: #111815;
  --muted: #65726c;
  --line: #d7dfda;
  --line-strong: #aebcb4;
  --teal: #167c72;
  --teal-dark: #0f5d55;
  --coral: #d95d49;
  --gold: #d79b22;
  --blue: #3a6ea5;
  --danger: #b93636;
  --shadow: 0 18px 48px rgba(17, 24, 21, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

body.web-mode {
  color-scheme: dark;
  --bg: #1b1b1b;
  --surface: #242424;
  --surface-soft: #303030;
  --surface-warm: #2b2023;
  --ink: #f2f2f2;
  --muted: #a8a8a8;
  --line: #343434;
  --line-strong: #4a4a4a;
  --teal: #ed2553;
  --teal-dark: #ff5b7d;
  --coral: #ed2553;
  --gold: #ffc857;
  --blue: #6d9be8;
  --danger: #ff6075;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

body.admin-mode {
  color-scheme: dark;
  --bg: #1b1b1b;
  --surface: #242424;
  --surface-soft: #303030;
  --surface-warm: #2b2023;
  --ink: #f2f2f2;
  --muted: #a8a8a8;
  --line: #343434;
  --line-strong: #4a4a4a;
  --teal: #ed2553;
  --teal-dark: #ff5b7d;
  --coral: #ed2553;
  --gold: #ffc857;
  --blue: #6d9be8;
  --danger: #ff6075;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

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

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

button,
.button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

button:hover,
.button:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}

button.primary,
.button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

button.warning {
  border-color: rgba(217, 93, 73, 0.55);
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 244, 0.94);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 176px;
}

.brand-symbol {
  width: 34px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(237, 37, 83, 0.28));
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-word {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.75px;
  line-height: 1;
}

.brand-word-h {
  color: #ed2553;
  text-shadow: 0 0 18px rgba(237, 37, 83, 0.24);
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.locale-switcher {
  display: inline-flex;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}

.locale-icon {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.locale-switcher select {
  width: auto;
  min-width: 114px;
  min-height: 34px;
  padding: 6px 26px 6px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.locale-switcher-reader select {
  min-width: 102px;
  min-height: 32px;
  height: 32px;
  padding-block: 4px;
}

.reader-tools .locale-switcher {
  color: rgba(245, 247, 242, 0.78);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a,
.nav button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
}

.nav a:hover,
.nav button:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  transform: none;
}

.content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 56px;
}

.section {
  margin: 0 0 34px;
}

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

.section-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.section-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-header-inner {
  grid-template-columns: auto 1fr;
}

.admin-shell .content {
  max-width: 1320px;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface-soft);
}

.metric strong {
  display: block;
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.placement-panel {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-warm);
  padding: 14px 16px;
  color: #53351e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
}

.placement-panel[data-placement-key="gallery:top"] {
  margin-top: 24px;
}

.placement-panel strong {
  color: var(--ink);
}

.placement-panel a {
  color: var(--teal-dark);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.gallery-card:hover {
  box-shadow: 0 12px 32px rgba(17, 24, 21, 0.1);
}

.placement-card {
  border-color: rgba(215, 155, 34, 0.56);
  background: #fffaf0;
}

.placement-cover {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(22, 124, 114, 0.94), rgba(217, 93, 73, 0.9)),
    var(--teal);
}

.placement-cover strong {
  max-width: 12ch;
  font-size: 24px;
  line-height: 1.12;
}

.placement-card-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.web-mode input,
body.web-mode select,
body.web-mode textarea {
  background: #2c2c2c;
  border-color: #3e3e3e;
  color: var(--ink);
}

body.web-mode input::placeholder,
body.web-mode textarea::placeholder {
  color: #858585;
}

body.web-mode button,
body.web-mode .button {
  background: #2c2c2c;
  border-color: #464646;
  color: var(--ink);
}

body.web-mode button:hover,
body.web-mode .button:hover {
  border-color: var(--teal);
  background: #353535;
}

body.web-mode button.primary,
body.web-mode .button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

body.web-mode .site-header {
  background: #1f1f1f;
  border-bottom-color: #111;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.web-mode .header-inner {
  max-width: 1280px;
  padding: 12px 15px;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 14px;
}

body.web-mode .mobile-header-panel {
  display: contents;
}

body.web-mode .brand {
  display: flex;
  min-width: 178px;
  align-items: center;
  gap: 9px;
}

body.web-mode .brand-word {
  color: #fff;
  font-size: 22px;
}

body.web-mode .brand-sub {
  display: none;
}

body.web-mode .site-search {
  gap: 0;
}

body.web-mode .site-search input {
  border-radius: 4px 0 0 4px;
  min-height: 38px;
  background: #333;
  border-color: #111;
  color: #eee;
}

body.web-mode .site-search button {
  border-radius: 0 4px 4px 0;
  min-height: 38px;
  padding-inline: 18px;
}

body.web-mode .nav a,
body.web-mode .nav button {
  min-height: 32px;
  color: #ccc;
  font-size: 14px;
}

body.web-mode .nav a:hover,
body.web-mode .nav button:hover {
  color: #fff;
  background: #2a2a2a;
  border-color: #3c3c3c;
}

body.web-mode .content {
  max-width: 1280px;
  padding: 22px 15px 52px;
}

body.web-mode .section {
  margin-bottom: 32px;
}

body.web-mode .section-title {
  color: #fff;
  font-size: 24px;
  font-weight: 500;
}

body.web-mode .section-title::before {
  content: none;
}

body.web-mode .directory-head,
body.web-mode .section-head {
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

body.web-mode .directory-head .button,
body.web-mode .section-head .button,
body.web-mode .directory-head button,
body.web-mode .section-head .refresh-button {
  min-height: 32px;
  padding: 5px 11px;
  background: #2c2c2c;
  border-color: #444;
  color: #ddd;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.refresh-icon {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  font-size: 1.2em;
  line-height: 1;
}

.refresh-button:hover .refresh-icon {
  transform: rotate(24deg);
}

@media (prefers-reduced-motion: no-preference) {
  .refresh-icon {
    transition: transform 160ms ease;
  }
}

body.web-mode .filters {
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(130px, 1fr));
  gap: 10px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #242424;
  padding: 14px;
}

body.web-mode .filters button,
body.web-mode .filters .button {
  align-self: end;
}

body.web-mode .form-panel,
body.web-mode .table-panel,
body.web-mode .auth-panel,
body.web-mode .detail-cover,
body.web-mode .info-item,
body.web-mode .empty {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

body.web-mode .gallery-card:hover {
  border-color: #555;
  box-shadow:
    0 0 0 1px rgba(237, 37, 83, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

body.web-mode .card-title,
body.web-mode .detail-title {
  color: #fff;
}

body.web-mode .detail-desc {
  color: #b6b6b6;
}

body.web-mode .detail-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  column-gap: 30px;
  row-gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
}

body.web-mode .detail-back-button {
  min-height: 32px;
  padding: 5px 11px;
}

body.web-mode .detail-cover {
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.48);
}

body.web-mode .detail-cover img {
  display: block;
  width: 100%;
}

body.web-mode .detail-panel {
  gap: 15px;
}

body.web-mode .detail-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
}

body.web-mode .detail-original {
  display: block;
  margin: 9px 0 0;
  color: #a7a7a7;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.web-mode .detail-meta-list {
  gap: 9px;
}

body.web-mode .detail-meta-row {
  grid-template-columns: 86px minmax(0, 1fr);
}

body.web-mode .detail-meta-row > span {
  color: #d0d0d0;
  font-size: 15px;
  padding-top: 5px;
}

body.web-mode .detail-filter-link,
body.web-mode .detail-filter-link:visited,
body.web-mode .detail-filter-link:hover {
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-decoration: none;
}

body.web-mode .detail-meta-row .tag-row {
  display: flex;
}

body.web-mode .detail-stats {
  color: #9b9b9b;
  font-size: 14px;
}

body.web-mode .detail-desc {
  max-width: 78ch;
  margin: 0;
  color: #b8b8b8;
  line-height: 1.65;
}

body.web-mode .actions-row {
  gap: 8px;
}

body.web-mode .actions-row .button,
body.web-mode .actions-row button {
  border-radius: 4px;
  min-height: 42px;
  padding: 9px 15px;
  font-weight: 700;
}

body.web-mode .page-preview-section {
  max-width: 1180px;
  margin: 38px auto 0;
}

body.web-mode .page-preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 18px;
}

body.web-mode .page-thumb {
  color: #aaa;
  font-size: 13px;
}

body.web-mode .page-thumb img {
  border-radius: 3px;
  background: #262626;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.36);
  transition: transform 180ms ease, filter 180ms ease;
}

body.web-mode .page-thumb:hover img {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

body.web-mode .grid {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 22px 18px;
}

body.web-mode .recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 18px;
  width: 100%;
  overflow: visible;
}

body.web-mode .adaptive-gallery-grid > [hidden] {
  display: none;
}

body.web-mode .gallery-card {
  background: #2b2b2b;
  border: 1px solid #343434;
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(48px, 1fr);
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

body.web-mode .cover-link {
  border-radius: 0;
  background: #2b2b2b;
  box-shadow: none;
}

body.web-mode .cover-link img {
  transition: transform 180ms ease, filter 180ms ease;
}

body.web-mode .gallery-card:hover .cover-link img {
  transform: scale(1.025);
  filter: brightness(1.08);
}

body.web-mode .card-body {
  display: grid;
  align-items: center;
  min-height: 52px;
  padding: 9px 10px 10px;
  background: #2b2b2b;
}

body.web-mode .card-title {
  min-height: 0;
  color: #ddd;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.28;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.web-mode .meta-line {
  color: #969696;
}

body.web-mode .gallery-card:not(.placement-card) .meta-line,
body.web-mode .gallery-card:not(.placement-card) .tag-row,
body.web-mode .gallery-card:not(.placement-card) .card-actions,
body.web-mode .gallery-card:not(.placement-card) .card-badge {
  display: none;
}

body.web-mode .tag,
body.web-mode .pill {
  background: #2c2c2c;
  border-color: #3c3c3c;
  color: #c9c9c9;
}

body.web-mode .tag:hover,
body.web-mode .pill:hover {
  background: #383838;
  border-color: var(--teal);
  color: #fff;
}

body.web-mode .card-badge {
  background: rgba(237, 37, 83, 0.9);
}

body.web-mode .placement-panel {
  background: #241e20;
  border-color: rgba(237, 37, 83, 0.42);
  color: #cfcfcf;
}

body.web-mode .placement-panel strong {
  color: #fff;
}

body.web-mode .placement-panel a {
  color: var(--teal-dark);
}

body.web-mode .placement-card {
  background: #2b2b2b;
}

body.web-mode .placement-cover {
  aspect-ratio: 3 / 4;
  min-height: 0;
  border-radius: 0;
  background:
    linear-gradient(150deg, rgba(237, 37, 83, 0.95), rgba(55, 55, 55, 0.96)),
    #2b2b2b;
}

body.web-mode .placement-card .meta-line,
body.web-mode .placement-card button {
  display: none;
}

body.web-mode .placement-card-copy {
  color: #b5b5b5;
  display: -webkit-box;
}

body.web-mode .placement-card .button {
  display: inline-flex;
}

body.web-mode .site-footer {
  border-top-color: #111;
  background: #1b1b1b;
  color: #888;
}

body.web-mode .footer-inner {
  max-width: 1280px;
  padding-inline: 15px;
}

body.admin-mode input,
body.admin-mode select,
body.admin-mode textarea {
  background: #2c2c2c;
  border-color: #3e3e3e;
  color: var(--ink);
}

body.admin-mode input::placeholder,
body.admin-mode textarea::placeholder {
  color: #858585;
}

body.admin-mode button,
body.admin-mode .button {
  background: #2c2c2c;
  border-color: #464646;
  color: var(--ink);
}

body.admin-mode button:hover,
body.admin-mode .button:hover {
  border-color: var(--teal);
  background: #353535;
}

body.admin-mode button.primary,
body.admin-mode .button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

body.admin-mode button.warning,
body.admin-mode .button.warning {
  border-color: rgba(255, 96, 117, 0.48);
  color: var(--danger);
}

body.admin-mode .site-header {
  background: #1f1f1f;
  border-bottom-color: #111;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.admin-mode .admin-header-inner {
  max-width: 1320px;
  padding: 12px 15px;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
}

body.admin-mode .brand {
  display: flex;
  min-width: 178px;
  align-items: center;
  gap: 9px;
}

body.admin-mode .brand-word {
  color: #fff;
  font-size: 22px;
}

body.admin-mode .brand-sub {
  display: none;
}

body.admin-mode .nav a,
body.admin-mode .nav button {
  min-height: 32px;
  color: #ccc;
  font-size: 14px;
}

body.admin-mode .nav a:hover,
body.admin-mode .nav button:hover {
  color: #fff;
  background: #2a2a2a;
  border-color: #3c3c3c;
}

body.admin-mode .content {
  max-width: 1320px;
  padding: 22px 15px 52px;
}

body.admin-mode .section-title {
  color: #fff;
  font-size: 24px;
  font-weight: 500;
}

body.admin-mode .section-note {
  color: var(--muted);
}

body.admin-mode .section-head {
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

body.admin-mode .form-panel,
body.admin-mode .table-panel,
body.admin-mode .auth-panel,
body.admin-mode .info-item,
body.admin-mode .empty,
body.admin-mode .metric {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

body.admin-mode .auth-panel h1,
body.admin-mode .form-panel h2,
body.admin-mode .table-panel h2 {
  color: #fff;
}

body.admin-mode .admin-tabs a {
  background: #2c2c2c;
  border-color: #3c3c3c;
  color: #c9c9c9;
}

body.admin-mode .admin-tabs a:hover {
  background: #383838;
  border-color: var(--teal);
  color: #fff;
}

body.admin-mode .admin-tabs a.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

body.admin-mode .data-table th,
body.admin-mode .data-table td {
  border-bottom-color: var(--line);
}

body.admin-mode .data-table th {
  background: #202020;
  color: var(--muted);
}

body.admin-mode .data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

body.admin-mode .status {
  background: #303030;
  color: var(--teal-dark);
}

body.admin-mode .status.draft,
body.admin-mode .status.hidden {
  background: #352529;
  color: #ff8ca1;
}

body.admin-mode .site-footer {
  border-top-color: #111;
  background: #1b1b1b;
  color: #888;
}

body.admin-mode .footer-inner {
  max-width: 1320px;
  padding-inline: 15px;
}

.cover-link {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface-soft);
  overflow: hidden;
}

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

.card-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  border-radius: 999px;
  background: rgba(17, 24, 21, 0.82);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
}

.card-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.card-title {
  margin: 0;
  line-height: 1.35;
  font-size: 16px;
  min-height: 42px;
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 12px;
}

.tag:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pagination-pages,
.pagination-jump,
.pagination-jump label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-step {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.pagination-page {
  min-width: 38px;
  padding-inline: 10px;
}

.pagination-page.active,
.pagination-page[aria-current="page"] {
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.pagination-ellipsis {
  color: var(--muted);
  min-width: 18px;
  text-align: center;
}

.pagination .disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.pagination-jump {
  color: var(--muted);
  margin-left: 8px;
}

.pagination-jump-input {
  width: 72px;
  min-height: 38px;
  padding: 6px 8px;
  text-align: center;
}

.empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  grid-template-areas:
    "back kicker"
    "cover panel";
  column-gap: 28px;
  row-gap: 10px;
  align-items: start;
}

.detail-back-button {
  grid-area: back;
  justify-self: start;
}

.detail-kicker {
  grid-area: kicker;
  align-self: center;
  margin: 0;
}

.detail-cover {
  grid-area: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-panel {
  grid-area: panel;
  display: grid;
  gap: 18px;
}

.detail-original,
.detail-stats {
  margin: 8px 0 0;
  color: var(--muted);
}

.detail-title {
  margin: 0;
  font-size: 38px;
  line-height: 1.1;
}

.detail-desc {
  line-height: 1.8;
  color: #39413d;
  max-width: 76ch;
}

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

.analytics-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.analytics-filter {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) repeat(2, minmax(150px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.ad-management-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ad-editor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(500px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.ad-editor-grid .form-panel {
  min-width: 0;
}

.ad-target-fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ad-target-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-chip-grid label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-soft);
}

.checkbox-chip-grid input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.data-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.mini-chip {
  display: inline-flex;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 3px 6px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.ad-allocation-panel .data-table input[type="number"] {
  width: 92px;
  min-width: 76px;
}

.ad-allocation-panel .data-table input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.ad-allocation-panel .form-actions {
  margin-top: 14px;
}

.analytics-breakdown {
  min-width: 0;
  overflow-x: auto;
}

.analytics-breakdown h3,
.analytics-dashboard .table-panel > h3 {
  margin: 0 0 14px;
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-item strong {
  display: block;
  margin-top: 4px;
}

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

.detail-meta-list {
  display: grid;
  gap: 8px;
}

.detail-meta-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.detail-meta-row > span {
  color: var(--muted);
  font-weight: 700;
  padding-top: 4px;
}

.page-preview-section {
  margin-top: 36px;
}

.page-preview-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px;
}

.page-preview-grid.has-preview-overflow::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 96px;
  background: linear-gradient(180deg, rgba(27, 27, 27, 0) 0%, var(--bg) 92%);
  pointer-events: none;
}

.page-thumb[hidden],
.page-preview-actions[hidden] {
  display: none;
}

.page-preview-actions {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.page-preview-button {
  min-height: 54px;
  border: 0;
  border-radius: 5px;
  padding: 13px 22px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.page-preview-more-button {
  background: #f42453;
}

.page-preview-more-button:hover {
  background: #ff3561;
}

.page-preview-all-button {
  background: #383838;
}

.page-preview-all-button:hover {
  background: #474747;
}

.preview-eye {
  position: relative;
  width: 19px;
  height: 13px;
  margin-right: 9px;
  border: 2px solid currentColor;
  border-radius: 50% / 60%;
  flex: 0 0 auto;
}

.preview-eye::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.page-thumb {
  display: grid;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.page-thumb.is-preview-teaser {
  height: 90px;
  overflow: hidden;
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.4) 58%, transparent 100%);
}

.page-thumb.is-preview-teaser span {
  display: none;
}

.page-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-soft);
}

.reader-shell {
  background: #111815;
  color: #f5f7f2;
  min-height: 100vh;
  overflow-x: clip;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 21, 0.92);
  backdrop-filter: blur(14px);
}

.reader-toolbar a,
.reader-toolbar button,
.reader-toolbar select {
  color: #f5f7f2;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.reader-title {
  min-width: 0;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.progress-track {
  position: fixed;
  left: 0;
  right: 0;
  top: 58px;
  z-index: 31;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--teal);
}

.reader-pages {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 14px 70px;
  display: grid;
  gap: 16px;
}

.reader-pages.compact {
  max-width: 760px;
}

.reader-page {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #202925;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

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

.reader-inline-placement {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #f5f7f2;
  padding: 16px;
  display: grid;
  gap: 6px;
}

a.reader-inline-placement {
  text-decoration: none;
  cursor: pointer;
}

.reader-inline-placement span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.reader-inline-placement strong {
  font-size: 17px;
}

.reader-inline-placement p {
  margin: 0;
  color: rgba(245, 247, 242, 0.74);
}

.reader-inline-placement .reader-inline-placement-cta {
  color: var(--gold);
  font-weight: 700;
}

.page-number {
  padding: 8px 10px;
  color: rgba(245, 247, 242, 0.72);
  font-size: 12px;
}

.reader-toolbar {
  grid-template-columns: minmax(0, 1fr);
  padding: 8px 14px;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.reader-heading {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.reader-tools {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 6px;
}

.reader-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
}

.reader-first-page-button {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.reader-back-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 14px;
}

.reader-back-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.reader-back-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.reader-mode-icon {
  position: relative;
  display: block;
  width: 17px;
  height: 16px;
}

.reader-mode-icon::before,
.reader-mode-icon::after {
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
}

.reader-mode-toggle[data-reader-mode="wide"] .reader-mode-icon::before {
  left: 1px;
  top: 2px;
  width: 7px;
  height: 12px;
}

.reader-mode-toggle[data-reader-mode="wide"] .reader-mode-icon::after {
  right: 1px;
  top: 2px;
  width: 7px;
  height: 12px;
}

.reader-mode-toggle[data-reader-mode="compact"] .reader-mode-icon::before {
  left: 2px;
  top: 1px;
  width: 13px;
  height: 6px;
}

.reader-mode-toggle[data-reader-mode="compact"] .reader-mode-icon::after {
  left: 2px;
  bottom: 1px;
  width: 13px;
  height: 6px;
}

.reader-favorite {
  font-size: 20px;
  color: rgba(245, 247, 242, 0.86);
}

.reader-favorite.is-favorited {
  color: var(--teal);
}

.reader-title {
  margin: 0;
  text-align: left;
  font-size: 16px;
}

.progress-track {
  top: 0;
}

.reader-stage {
  position: relative;
  min-height: calc(100vh - 36px);
}

.reader-pages {
  padding: 10px 14px 44px;
}

.reader-pages.compact {
  max-width: 760px;
  gap: var(--reader-page-gap, 4px);
}

.reader-pages.wide {
  width: min(1420px, calc(100vw - 112px));
  max-width: none;
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  padding: 18px 0 28px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.reader-page {
  border-radius: 3px;
  box-shadow: none;
}

.reader-pages.compact .reader-page + .reader-page {
  margin-top: 0;
}

.reader-pages.wide .reader-page,
.reader-pages.wide .reader-inline-placement {
  display: none;
}

.reader-pages.wide .reader-page.is-spread-visible {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 104px);
  background: #151b18;
}

.reader-pages.wide .reader-inline-placement.is-spread-visible {
  display: grid;
  grid-column: 1 / -1;
  place-content: center;
  justify-self: stretch;
  min-height: calc(100vh - 104px);
}

.reader-pages.wide .reader-page img {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 112px);
  object-fit: contain;
}

.reader-page img {
  display: block;
}

.reader-page-nav {
  position: fixed;
  top: 50%;
  z-index: 28;
  width: 42px;
  min-width: 42px;
  height: 68px;
  min-height: 68px;
  padding: 0;
  border-radius: 8px;
  color: #f5f7f2;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  font-size: 34px;
  transform: translateY(-50%);
}

.reader-page-nav:hover {
  transform: translateY(-50%);
}

.reader-page-prev {
  left: 16px;
}

.reader-page-next {
  right: 16px;
}

.reader-page-nav.is-hidden {
  display: none;
}

.reader-mode-toggle.is-hidden {
  display: none;
}

.reader-page-nav:disabled {
  opacity: 0.32;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}

.account-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) repeat(2, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.account-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.account-identity-copy {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.account-email-verification {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.account-email-verification .section-note,
.verification-sent {
  margin: 0;
  text-align: center;
}

.verification-sent {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.verification-resend-prompt {
  width: 100%;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.account-email-verification button {
  width: 100%;
}

.verification-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.verification-badge.verified,
.verification-success {
  color: #166534;
  background: #dcfce7;
}

.verification-badge.pending {
  color: #92400e;
  background: #fef3c7;
}

.pending-email-note {
  color: var(--muted);
  font-size: 12px;
}

.verification-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
}

.account-card h2,
.account-card p {
  margin: 0;
  text-align: center;
}

.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  justify-self: center;
  margin-inline: auto;
  flex: 0 0 auto;
}

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

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 48px;
}

.password-visibility-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
  transition:
    background 150ms ease,
    color 150ms ease;
  display: grid;
  place-items: center;
}

body.web-mode .password-visibility-toggle,
body.web-mode .password-visibility-toggle:hover,
body.web-mode .password-visibility-toggle:focus-visible {
  transform: translateY(-50%);
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
}

.password-eye-icon {
  position: relative;
  width: 19px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 60% 60% 55% 55%;
}

.password-eye-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-visibility-toggle.is-visible .password-eye-icon::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 4px;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px var(--surface);
  transform: rotate(-38deg);
  z-index: 1;
}

.admin-gallery-stack {
  display: grid;
  gap: 18px;
}

.form-panel,
.table-panel,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

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

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

.settings-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.settings-group legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.hero-copy-locale {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
}

.hero-copy-locale legend {
  color: var(--teal);
  font-size: 13px;
}

.history-title-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.history-title-link:hover {
  color: var(--teal);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.checkbox-line input {
  width: auto;
  min-height: 0;
}

.email-settings-panel .info-grid {
  margin-bottom: 18px;
}

.email-settings-panel .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.admin-tabs a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--surface);
}

.admin-tabs a.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f9faf7;
}

.data-table td:last-child {
  text-align: right;
}

.admin-gallery-panel {
  overflow-x: auto;
}

.admin-collapsible-panel .section-head {
  gap: 12px;
  margin-bottom: 12px;
}

.admin-collapsible-panel.is-collapsed .section-head {
  margin-bottom: 0;
}

.admin-collapsible-panel .section-head button {
  flex: 0 0 auto;
}

.admin-collapsible-panel.is-collapsed .admin-collapsible-body {
  display: none;
}

.admin-gallery-filters {
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(120px, 1fr)) minmax(110px, 0.8fr) minmax(90px, 0.6fr);
  align-items: end;
}

.admin-user-stack {
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.admin-user-stack > *,
.admin-user-panel,
.admin-user-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.admin-user-filters {
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr)) minmax(90px, 0.7fr) auto auto;
  align-items: end;
}

.admin-user-edit-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.admin-user-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-user-table {
  width: 1120px;
  min-width: 1120px;
}

.admin-user-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.admin-user-actions {
  min-width: 190px;
}

.admin-user-block-dialog {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(25, 14, 10, 0.32);
}

.admin-user-block-dialog::backdrop {
  background: rgba(20, 12, 10, 0.62);
  backdrop-filter: blur(2px);
}

.admin-user-block-dialog form {
  margin: 0;
}

.block-duration-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.45fr);
  gap: 12px;
}

.admin-gallery-table {
  min-width: 960px;
}

.admin-bulk-form {
  min-width: 0;
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.bulk-toolbar .bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  white-space: nowrap;
}

.bulk-toolbar input,
.bulk-item-checkbox {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--teal);
}

.bulk-action-field {
  min-width: min(220px, 100%);
}

.bulk-action-field select {
  min-width: 200px;
}

.bulk-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.bulk-select-column {
  width: 42px;
  text-align: center !important;
}

.table-subtext {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.compact-tags {
  gap: 4px;
  margin-top: 6px;
}

.compact-tags .tag {
  padding: 3px 6px;
  font-size: 11px;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.table-actions .button,
.table-actions button {
  min-height: 30px;
  padding: 5px 9px;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  display: inline-flex;
}

.status.draft,
.status.hidden {
  background: #f6ece7;
  color: #8c4633;
}

.status.paused,
.status.ended,
.status.archived {
  background: rgba(128, 128, 128, 0.16);
  color: var(--muted);
}

.status.running {
  background: rgba(215, 155, 34, 0.18);
  color: var(--gold);
}

.status.completed,
.status.active,
.status.success {
  background: rgba(22, 124, 114, 0.16);
  color: var(--teal-dark);
}

.status.failed,
.status.error {
  background: rgba(185, 54, 54, 0.16);
  color: var(--danger);
}

.status.temporary {
  background: rgba(215, 155, 34, 0.18);
  color: #8a5a00;
}

.status.permanent {
  background: rgba(185, 54, 54, 0.16);
  color: var(--danger);
}

.compact-head {
  margin-bottom: 8px;
}

.error-note {
  color: var(--danger);
}

.auth-wrap {
  max-width: 440px;
  margin: 42px auto;
}

.auth-panel h1,
.form-panel h2,
.table-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.stack {
  display: grid;
  gap: 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 34px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  min-width: 220px;
  max-width: min(440px, calc(100vw - 32px));
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #111815;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
  }

  .detail-layout,
  .form-layout,
  .account-layout,
  .ad-editor-grid {
    grid-template-columns: 1fr;
  }

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

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

  body.web-mode .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-layout,
  body.web-mode .detail-layout {
    grid-template-areas:
      "back"
      "cover"
      "kicker"
      "panel";
    row-gap: 12px;
  }

  .detail-title {
    font-size: 30px;
  }

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

  .reader-toolbar {
    grid-template-columns: 1fr;
  }

  .reader-title {
    text-align: left;
  }

  .reader-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .pagination-step {
    order: 1;
  }

  .pagination-pages {
    flex: 1 1 100%;
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
    order: 2;
  }

  .pagination-jump {
    flex: 1 1 100%;
    justify-content: center;
    margin-left: 0;
    order: 3;
  }

  .content {
    padding: 18px 12px 44px;
  }

  body.web-mode .header-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.web-mode .brand {
    min-width: 0;
  }

  body.web-mode .site-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.web-mode .nav {
    justify-content: flex-start;
  }

  .site-search,
  .filters,
  .info-grid,
  .analytics-grid,
  .analytics-filter,
  .metric-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  body.web-mode .detail-meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  body.web-mode .page-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .page-preview-actions {
    gap: 10px;
  }

  .page-preview-button {
    min-height: 48px;
    padding: 11px 15px;
    font-size: 16px;
  }

  .card-body {
    padding: 10px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  body.web-mode .placement-cover {
    min-height: 180px;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  body.web-mode .header-inner {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  body.web-mode .brand,
  body.web-mode .site-search,
  body.web-mode .nav {
    min-width: 0;
    width: 100%;
  }

  body.web-mode .site-search {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }
}

.site-search,
.filters,
.admin-gallery-filters,
.tag-search-filters,
.favorite-search-filters {
  width: 100%;
  min-width: 0;
}

.site-search input,
.site-search button,
.filters label,
.filters input,
.filters select,
.filters textarea,
.filters button,
.filters .button {
  min-width: 0;
}

.filters,
body.web-mode .filters,
.admin-gallery-filters {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  align-items: end;
}

.favorite-search-filters,
.tag-search-filters {
  grid-template-columns: minmax(min(280px, 100%), 1fr) auto auto;
}

.filters button,
.filters .button {
  white-space: nowrap;
}

.search-tag-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.search-tag-picker legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.search-tag-picker-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-tag-count {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.search-tag-selected,
.search-tag-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.search-tag-selected:empty {
  display: none;
}

.search-tag-chip,
.search-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border-radius: 999px;
}

.search-tag-chip {
  padding: 5px 7px 5px 10px;
  color: #f5f7f2;
  background: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.search-tag-chip button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: rgba(255, 255, 255, 0.16);
  line-height: 1;
}

.search-tag-option {
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  white-space: normal;
}

.search-tag-option small {
  color: var(--muted);
  font-size: 11px;
}

.search-tag-option.is-selected {
  color: var(--teal);
  border-color: currentColor;
}

.search-tag-empty {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .search-tag-picker-head {
    grid-template-columns: 1fr;
  }

  .search-tag-count {
    padding-bottom: 0;
  }
}

@media (max-width: 1024px) {
  .reader-toolbar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
    padding: 7px 10px;
    backdrop-filter: none;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    transition:
      transform 180ms ease,
      opacity 180ms ease;
    will-change: transform, opacity;
  }

  .reader-toolbar.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, -110%, 0);
  }

  .reader-heading {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .reader-tools {
    order: 0;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .reader-tools .locale-switcher {
    flex: 1 1 0;
    max-width: 126px;
    overflow: hidden;
  }

  .reader-tools .locale-switcher select {
    width: 100%;
    min-width: 0;
  }

  .reader-title {
    order: 1;
    font-size: 14px;
  }

  .reader-icon-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .reader-first-page-button {
    min-width: 0;
    height: 30px;
    min-height: 30px;
    padding-inline: 6px;
  }

  .reader-mode-toggle {
    display: none;
  }

  .reader-stage {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
    min-height: calc(100vh - 32px);
  }

  .reader-pages {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 7px 0 32px;
  }

  .reader-pages.compact {
    width: 100%;
    max-width: 100%;
    gap: var(--reader-page-gap, 4px);
  }

  .reader-pages.compact .reader-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .reader-pages.compact .reader-page img {
    width: 100%;
    max-width: none;
  }

  .reader-pages.wide {
    width: calc(100vw - 54px);
    min-height: calc(100vh - 46px);
    gap: 3px;
  }

  .reader-pages.wide .reader-page.is-spread-visible {
    min-height: calc(100vh - 94px);
  }

  .reader-pages.wide .reader-page img {
    max-height: calc(100vh - 104px);
  }

  .reader-page-nav {
    width: 26px;
    min-width: 26px;
    height: 52px;
    min-height: 52px;
    font-size: 25px;
  }

  .reader-page-prev {
    left: 6px;
  }

  .reader-page-next {
    right: 6px;
  }
}

@media (max-width: 560px) {
  .site-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .filters,
  body.web-mode .filters,
  .admin-gallery-filters,
  .admin-user-filters,
  .favorite-search-filters,
  .tag-search-filters {
    grid-template-columns: 1fr;
  }

  .admin-user-edit-grid,
  .block-duration-fields {
    grid-template-columns: 1fr;
  }

  .admin-user-block-dialog {
    padding: 18px;
  }

  .filters button,
  .filters .button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .site-search,
  body.web-mode .site-search {
    grid-template-columns: 1fr !important;
  }

  .site-search button,
  body.web-mode .site-search button {
    width: 100%;
    border-radius: 4px;
  }

  body.web-mode .site-search input {
    border-radius: 4px;
  }
}

/* Sites experience pass: discovery, accessible navigation, compact mobile chrome. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(255, 91, 125, 0.92);
  outline-offset: 3px;
}

.site-search:focus-within {
  border-radius: 7px;
  outline: 3px solid rgba(255, 91, 125, 0.92);
  outline-offset: 3px;
}

.site-search:focus-within :where(input, button):focus-visible {
  outline: none;
}

.content:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  min-height: 42px;
  padding: 9px 14px;
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

body.web-mode .nav a.active,
body.web-mode .nav a[aria-current="page"],
body.admin-mode .nav a.active,
body.admin-mode .nav a[aria-current="page"] {
  border-color: rgba(237, 37, 83, 0.48);
  background: rgba(237, 37, 83, 0.12);
  color: #fff;
}

.home-hero {
  position: relative;
  isolation: isolate;
  min-height: 290px;
  margin: 4px 0 16px;
  border: 1px solid #353535;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 32px;
  padding: clamp(28px, 5vw, 60px);
  background:
    radial-gradient(circle at 84% 24%, rgba(237, 37, 83, 0.2), transparent 30%),
    linear-gradient(125deg, #2b2023 0%, #202020 48%, #171717 100%);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #2b2023 0%, rgba(32, 32, 32, 0.97) 34%, rgba(23, 23, 23, 0.68) 60%, rgba(15, 15, 15, 0.28) 100%),
    linear-gradient(0deg, rgba(9, 9, 9, 0.82) 0%, rgba(9, 9, 9, 0.05) 58%, rgba(9, 9, 9, 0.34) 100%);
}

.home-hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -2;
  width: 54%;
  overflow: hidden;
  background: #171717;
}

.home-hero-art.has-feather {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 var(--hero-feather), #000 calc(100% - var(--hero-feather)), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 var(--hero-feather), #000 calc(100% - var(--hero-feather)), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 var(--hero-feather), #000 calc(100% - var(--hero-feather)), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 var(--hero-feather), #000 calc(100% - var(--hero-feather)), transparent 100%);
  mask-composite: intersect;
}

.home-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  filter: saturate(0.82) contrast(1.08) brightness(0.72);
  transform: scale(1.035);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.eyebrow {
  display: inline-block;
  color: #ff7895;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 12ch;
  margin: 10px 0 14px;
  color: #fff;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.home-hero p {
  max-width: 56ch;
  margin: 0;
  color: #c1c1c1;
  font-size: 16px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-actions .button {
  min-height: 44px;
  padding-inline: 18px;
  font-weight: 700;
}

.tag-shortcuts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 30px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.tag-shortcuts > span {
  flex: 0 0 auto;
  margin-right: 4px;
  color: #888;
  font-size: 12px;
  font-weight: 700;
}

.tag-shortcuts a {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid #383838;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  background: #242424;
  color: #d5d5d5;
  font-size: 13px;
}

.tag-shortcuts a:hover {
  border-color: var(--teal);
  color: #fff;
}

.tag-shortcuts small {
  color: #777;
}

.tag-shortcuts .tag-shortcuts-all {
  border-color: transparent;
  background: transparent;
  color: #ff7895;
}

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

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

.continue-card {
  min-width: 0;
  border: 1px solid #353535;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  background: #242424;
}

.continue-cover {
  min-height: 158px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #303030;
  color: #888;
  font-size: 12px;
}

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

.continue-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px;
}

.continue-copy h3 {
  margin: 7px 0 12px;
  color: #eee;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: #9a9a9a;
  font-size: 12px;
}

.reading-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #3b3b3b;
}

.reading-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.continue-link {
  width: fit-content;
  margin-top: 11px;
  color: #ff7895;
  font-size: 13px;
  font-weight: 700;
}

.card-cover-wrap {
  position: relative;
}

.card-cover-wrap .cover-link {
  display: block;
}

body.web-mode .gallery-card:not(.placement-card) .meta-line {
  display: flex;
}

body.web-mode .gallery-card .card-body {
  align-content: start;
  align-items: start;
  gap: 8px;
  min-height: 112px;
}

body.web-mode .gallery-card .meta-line {
  gap: 6px;
  color: #8d8d8d;
}

body.web-mode .gallery-card .meta-line span + span::before {
  content: "·";
  margin-right: 6px;
  color: #555;
}

.card-favorite {
  position: absolute;
  right: 9px;
  top: 9px;
  z-index: 2;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0;
  background: rgba(20, 20, 20, 0.78) !important;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  font-size: 22px;
}

.card-favorite:hover {
  background: rgba(45, 45, 45, 0.92) !important;
}

.card-favorite.is-favorited {
  border-color: rgba(237, 37, 83, 0.72);
  color: #ff5b7d;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  max-width: 54ch;
  margin: 7px auto 16px;
  line-height: 1.65;
}

.empty-state .button {
  min-height: 42px;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.ranking-tabs a {
  min-height: 40px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #242424;
  color: #bdbdbd;
  font-weight: 700;
}

.ranking-tabs a:hover,
.ranking-tabs a.active {
  border-color: var(--teal);
  background: rgba(237, 37, 83, 0.12);
  color: #fff;
}

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

.ranking-card {
  position: relative;
  min-width: 0;
  border: 1px solid #343434;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 62px 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 12px;
  background: #242424;
}

.ranking-card.is-top {
  border-color: rgba(237, 37, 83, 0.45);
  background: linear-gradient(90deg, rgba(237, 37, 83, 0.12), #242424 34%);
}

.ranking-number {
  color: #858585;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ranking-card.is-top-1 .ranking-number { color: #ffc857; }
.ranking-card.is-top-2 .ranking-number { color: #d7d7d7; }
.ranking-card.is-top-3 .ranking-number { color: #d98a5d; }

.ranking-cover {
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #303030;
  color: #888;
}

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

.ranking-copy {
  min-width: 0;
}

.ranking-copy h2 {
  margin: 0 0 9px;
  color: #f0f0f0;
  font-size: 18px;
  line-height: 1.35;
}

.ranking-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-bottom: 10px;
  color: #969696;
  font-size: 13px;
}

.ranking-favorite {
  position: static;
}

.popular-tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}

.popular-tag-card {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #353535;
  border-radius: 8px;
  overflow: hidden;
  background: #2b2b2b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.popular-tag-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.popular-tag-card strong {
  position: absolute;
  inset: auto 0 0;
  padding: 22px 10px 10px;
  background: linear-gradient(transparent, rgba(9, 9, 9, 0.94));
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.popular-tag-card:hover img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.popular-tag-admin-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.popular-tag-admin-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.placement-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(220px, 1fr) auto;
}

.placement-cover {
  padding: 0;
}

.placement-media {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 1;
  border-radius: 5px;
  overflow: hidden;
  background: #171717;
}

.placement-media-card {
  aspect-ratio: 3 / 4;
  border-radius: 0;
}

.placement-media-reader {
  aspect-ratio: 16 / 5;
}

.placement-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5) brightness(0.62);
}

.placement-media span {
  position: absolute;
  inset: auto 8px 8px;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

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

  .home-hero-art {
    width: 62%;
  }

  .home-hero::after {
    background:
      linear-gradient(90deg, #2b2023 0%, rgba(32, 32, 32, 0.96) 44%, rgba(20, 20, 20, 0.58) 78%, rgba(12, 12, 12, 0.32) 100%),
      linear-gradient(0deg, rgba(9, 9, 9, 0.82) 0%, rgba(9, 9, 9, 0.08) 60%, rgba(9, 9, 9, 0.36) 100%);
  }

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

  .history-card-grid {
    grid-template-columns: 1fr;
  }

  .placement-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  body.web-mode .header-inner {
    position: relative;
    grid-template-columns: 1fr !important;
    gap: 0;
    padding: 10px 12px;
  }

  body.web-mode .mobile-header-panel {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1;
    display: grid;
    gap: 9px;
    box-sizing: border-box;
    padding: 0 12px 6px;
    border-bottom: 1px solid #111;
    background: #1f1f1f;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
    opacity: var(--header-expanded-ratio, 1);
    transform: translateY(calc(-12px * var(--header-collapse-progress, 0)));
    will-change: transform, opacity;
    visibility: visible;
  }

  body.web-mode .content {
    padding-top: calc(clamp(18px, 2.15vw, 22px) + var(--mobile-header-panel-height, 0px));
  }

  body.web-mode .site-header.is-mobile-compact .mobile-header-panel {
    pointer-events: none;
    visibility: hidden;
  }

  body.web-mode .nav,
  body.admin-mode .nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: visible;
    padding: 1px 0 5px;
  }

  body.web-mode .nav::-webkit-scrollbar,
  body.admin-mode .nav::-webkit-scrollbar {
    display: none;
  }

  body.web-mode .nav a,
  body.web-mode .nav button,
  body.admin-mode .nav a,
  body.admin-mode .nav button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 12px;
  }

  body.web-mode .locale-switcher,
  body.admin-mode .locale-switcher {
    flex: 1 1 150px;
    max-width: 210px;
  }

  body.admin-mode .admin-header-inner {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px 12px 8px;
  }

  .home-hero {
    min-height: 0;
    margin-top: 0;
    gap: 26px;
    padding: 28px 22px 24px;
  }

  .home-hero-art {
    width: 68%;
  }

  .home-hero-art img {
    object-position: center 18%;
  }

  .home-hero h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .home-hero p {
    font-size: 14px;
  }

  .tag-shortcuts {
    margin-bottom: 24px;
  }

  .ranking-card {
    grid-template-columns: 42px 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .ranking-favorite {
    position: absolute;
    right: 10px;
    top: 10px;
  }

  .ranking-copy {
    padding-right: 42px;
  }

  .popular-tag-admin-list {
    grid-template-columns: 1fr;
  }

  body.web-mode .gallery-card .card-body {
    min-height: 126px;
  }

  body.web-mode .gallery-card .meta-line {
    display: grid;
    gap: 2px;
  }

  body.web-mode .gallery-card .meta-line span + span::before {
    content: none;
  }

  .card-favorite {
    right: 7px;
    top: 7px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 1024px) {
  .search-tag-picker:not(.is-expanded) .search-tag-option:nth-child(n + 11) {
    display: none;
  }

  .search-tag-picker.is-expanded .search-tags-expand {
    display: none;
  }
}

.search-tags-expand {
  justify-self: start;
}

.consent-banner {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  left: 18px;
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 16px;
  box-shadow: var(--shadow);
}

.consent-banner p {
  margin: 5px 0 0;
  color: var(--muted);
}

.image-load-failed {
  min-height: 96px;
  background: repeating-linear-gradient(135deg, var(--surface-soft), var(--surface-soft) 10px, var(--surface) 10px, var(--surface) 20px);
  color: transparent;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
}

@media (max-width: 560px) {
  .consent-banner {
    align-items: stretch;
    flex-direction: column;
    right: 10px;
    bottom: 10px;
    left: 10px;
  }
}

@media (max-width: 460px) {
  body.web-mode .content,
  body.admin-mode .content {
    padding-inline: 12px;
  }

  .home-hero {
    margin-inline: -2px;
    border-radius: 8px;
  }

  .home-hero h1 {
    max-width: 10ch;
  }

  .section-head {
    align-items: flex-start;
  }

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

  .continue-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .continue-cover {
    min-height: 144px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
