:root {
  color-scheme: dark;
  --page: #202020;
  --header: #333333;
  --surface: #242424;
  --border: #444444;
  --text: #f5f5f2;
  --muted: #bdbdbd;
  --yellow: #ffcc33;
  --yellow-hover: #ffdb66;
  --content-width: 1200px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

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

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: relative;
  display: flex;
  min-height: 142px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 1.1rem 1.5rem 1rem;
  background: var(--header);
  text-align: center;
}

.site-logo,
.footer-logo {
  color: var(--text);
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1.08;
  white-space: nowrap;
}

.site-logo span {
  color: var(--yellow);
}

.site-tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.header-actions {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.header-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.header-button-quiet:hover,
.header-button-quiet[aria-pressed="true"] {
  border-color: var(--yellow);
  color: var(--yellow);
}

.header-button-primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #242424;
}

.header-button-primary:hover {
  border-color: var(--yellow-hover);
  background: var(--yellow-hover);
}

.wallet-balance {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--yellow);
  border-radius: 6px;
  color: var(--yellow);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.wallet-status {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.favorites-count {
  display: inline-grid;
  min-width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  font-size: 0.7rem;
}

.primary-nav {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.primary-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--yellow);
}

main {
  width: min(100% - 3rem, var(--content-width));
  margin: 0 auto;
}

.content-section {
  scroll-margin-top: 72px;
}

.genre-section {
  padding: 1.25rem 0 0.45rem;
}

.discovery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-heading h2,
.community-banner h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.section-note,
.free-note {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.genre-filters {
  display: flex;
  min-width: 0;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  gap: 0.35rem;
}

.genre-filter {
  min-height: 40px;
  padding: 0.4rem 0.52rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.genre-filter:hover {
  border-color: var(--yellow);
  color: var(--text);
}

.genre-filter.is-active,
.genre-filter[aria-pressed="true"] {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #242424;
  font-weight: 750;
}

.search-form {
  display: flex;
  width: auto;
  min-width: 220px;
  min-height: 44px;
  flex: 1 1 260px;
  gap: 0.4rem;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.search-form input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  background: transparent;
  color: var(--text);
}

.search-form input::placeholder {
  color: #a4a4a4;
}

.search-form input:focus-visible {
  outline-offset: -2px;
}

.search-form button,
.button-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border: 1px solid var(--yellow);
  border-radius: 5px;
  background: var(--yellow);
  color: #242424;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.search-form button:hover,
.button-link:hover {
  transform: translateY(-1px);
  border-color: var(--yellow-hover);
  background: var(--yellow-hover);
}

.results-status {
  min-height: 1.2rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.shelf-empty-state {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.comic-shelf {
  padding: 1.05rem 0 0.65rem;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
}

.comic-shelf .comic-grid {
  grid-template-columns: none;
  grid-auto-columns: calc((100% - 5rem) / 6);
  grid-auto-flow: column;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.comic-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgb(0 0 0 / 16%);
  transition: border-color 160ms ease, transform 160ms ease;
}

.comic-card:hover {
  transform: translateY(-2px);
  border-color: #626262;
}

.comic-shelf .comic-card {
  scroll-snap-align: start;
}

.comic-cover {
  position: relative;
  display: flex;
  aspect-ratio: 2 / 3;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  overflow: hidden;
  padding: 0.8rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 5px;
  background-color: #383838;
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.comic-cover::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 12 12 / 8%) 5%, transparent 42%, rgb(12 12 12 / 82%) 100%);
  content: "";
}

.comic-cover .cover-label {
  align-self: flex-start;
  max-width: 100%;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 3px;
  background: rgb(26 26 26 / 76%);
  color: #f4f4f4;
  font-size: 0.57rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.comic-cover-copy {
  display: grid;
  gap: 0.3rem;
  margin-top: auto;
  padding: 0.6rem;
  border-left: 2px solid var(--yellow);
  background: rgb(24 24 24 / 82%);
}

.comic-cover-title {
  color: #fff;
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}

.comic-cover-creator {
  color: #dedede;
  font-size: 0.7rem;
  font-weight: 600;
}

.comic-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.comic-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comic-card h3 a:hover {
  color: var(--yellow);
}

.comic-genre {
  flex: 0 0 auto;
  color: var(--yellow);
  font-size: 0.7rem;
  font-weight: 700;
}

.comic-card-description {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0.35rem 0 0.65rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.5;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.comic-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
}

.read-link,
.favorite-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.read-link {
  flex: 1;
  border: 1px solid var(--yellow);
  background: var(--yellow);
  color: #242424;
}

.read-link:hover {
  background: var(--yellow-hover);
}

.favorite-toggle {
  width: 38px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.favorite-toggle:hover,
.favorite-toggle[aria-pressed="true"] {
  border-color: var(--yellow);
  background: rgb(255 204 51 / 10%);
  color: var(--yellow);
}

.community-banner {
  margin: 2rem 0 1rem;
  padding: clamp(1.5rem, 5vw, 2.7rem);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--header);
  text-align: center;
}

.community-banner h2 {
  margin-bottom: 0.5rem;
}

.community-banner > p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 auto 1rem;
  color: var(--muted);
}

.community-banner-secondary {
  margin-top: 1rem;
  background: var(--surface);
}

.button-link {
  text-decoration: none;
}

.page-view {
  min-height: 55vh;
  padding: 2rem 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 1.4rem;
  color: var(--yellow);
  font-weight: 700;
}

.back-link:hover {
  color: var(--yellow-hover);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.5fr);
  align-items: start;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  max-width: 900px;
  margin: 0 auto;
}

.detail-cover {
  width: 100%;
  max-width: 330px;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #383838;
  background-position: center;
  background-size: cover;
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
}

.detail-copy h1,
.reader-heading h1 {
  margin: 0.2rem 0 0.45rem;
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.detail-byline {
  color: var(--muted);
}

.detail-description {
  margin: 1.3rem 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.75;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.published-chapters {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
}

.published-chapters h2 {
  margin-top: 0;
}

.published-chapter-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.published-chapter-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.reader-view {
  max-width: 760px;
  margin: 0 auto;
}

.reader-heading {
  margin-bottom: 1.3rem;
}

.reader-page-count {
  margin: 0.35rem 0;
  color: var(--yellow);
  font-size: 1rem;
  font-weight: 800;
}

.reader-chapter-select {
  display: grid;
  width: min(100%, 28rem);
  gap: 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.reader-chapter-select select {
  min-height: 44px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #171717;
  color: var(--text);
  font: inherit;
}

.reader-panels {
  display: grid;
  gap: 0.8rem;
}

.reader-page-number {
  align-self: start;
  justify-self: start;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  background: var(--yellow);
  color: #242424;
  font-size: 0.78rem;
  font-weight: 800;
}

.reader-panel {
  display: grid;
  min-height: clamp(180px, 35vw, 300px);
  grid-template-rows: auto 1fr;
  place-items: center;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #333333;
  text-align: center;
}

.reader-panel p {
  max-width: 28rem;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.4;
}

.reader-image-panel {
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: 0.75rem;
}

.reader-page-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(75vh, 1000px);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.reader-image-fallback {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.reader-page-navigation {
  display: flex !important;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0;
  visibility: visible;
}

.reader-page-button {
  display: inline-flex !important;
  min-width: 120px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border: 1px solid var(--yellow);
  border-radius: 5px;
  background: var(--yellow);
  color: #242424;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  visibility: visible;
}

.reader-page-button:disabled {
  border-color: #666666;
  background: #3a3a3a;
  color: #c2c2c2;
  cursor: not-allowed;
  opacity: 1;
}

.reader-page-button:not(:disabled):hover {
  background: var(--yellow-hover);
}

.reader-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.notice-dialog {
  width: min(92vw, 440px);
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

.notice-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

.account-dialog-content {
  position: relative;
}

.notice-dialog h2 {
  margin: 0.3rem 0 0.7rem;
  font-size: 1.45rem;
  line-height: 1.2;
}

.notice-dialog p:not(.eyebrow) {
  color: var(--muted);
}

.account-form {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.account-form label {
  font-weight: 700;
}

.account-form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #181818;
  color: var(--text);
}

.account-form small {
  color: var(--muted);
  font-size: 0.82rem;
}

.account-form button,
#account-logout-button {
  margin-top: 0.65rem;
}

.account-mode-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

#account-dialog-message[data-state="error"] {
  color: #ff9c9c;
}

#account-dialog-message[data-state="success"] {
  color: #a8e6b2;
}

.dialog-close {
  position: absolute;
  top: -1.1rem;
  right: -1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.6rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.2rem;
  margin-top: 2rem;
  padding: 1.4rem 1.5rem 1.8rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.88rem;
}

.site-footer small {
  font-size: 0.78rem;
}

.footer-logo {
  font-size: 1rem;
  letter-spacing: -0.04em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 999px) {
  .site-header {
    min-height: 0;
    padding-top: 1rem;
  }

  .primary-nav {
    gap: clamp(1.2rem, 5vw, 2.7rem);
  }

  .comic-shelf .comic-grid {
    grid-auto-columns: calc((100% - 2.7rem) / 4);
    gap: 0.9rem;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 1.5rem, var(--content-width));
  }

  .site-header {
    padding: 1rem 0.75rem 0.9rem;
  }

  .site-logo {
    font-size: clamp(2rem, 9vw, 2.9rem);
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .header-button {
    min-height: 37px;
    padding-inline: 0.7rem;
    font-size: 0.8rem;
  }

  .primary-nav {
    justify-content: flex-start;
    gap: 1.3rem;
    overflow-x: auto;
    padding: 0.7rem 0.85rem;
    scrollbar-width: thin;
  }

  .primary-nav a {
    font-size: 0.84rem;
  }

  .genre-section {
    padding-top: 1rem;
  }

  .discovery-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 0.25rem;
  }

  .genre-filters {
    flex-wrap: wrap;
    overflow: visible;
    padding: 0.1rem 0;
  }

  .genre-filter {
    flex: 0 0 auto;
  }

  .search-form {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    flex: 0 0 auto;
  }

  .search-form button {
    padding-inline: 0.8rem;
  }

  .section-note,
  .free-note {
    display: none;
  }

  .comic-shelf .comic-grid {
    grid-auto-columns: calc((100% - 0.7rem) / 2);
    gap: 0.7rem;
  }

  .comic-card {
    padding: 0.4rem;
  }

  .comic-cover {
    padding: 0.55rem;
  }

  .comic-cover-copy {
    gap: 0.25rem;
    padding: 0.45rem;
  }

  .comic-cover-title {
    font-size: clamp(0.9rem, 4vw, 1.2rem);
  }

  .comic-cover-creator {
    font-size: 0.65rem;
  }

  .comic-cover .cover-label {
    padding: 0.2rem 0.3rem;
    font-size: 0.53rem;
  }

  .comic-card-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.05rem;
  }

  .comic-card h3 {
    width: 100%;
    font-size: 0.84rem;
  }

  .comic-genre {
    font-size: 0.68rem;
  }

  .comic-card-description {
    min-height: 0;
    font-size: 0.72rem;
  }

  .read-link,
  .favorite-toggle {
    min-height: 34px;
    font-size: 0.74rem;
  }

  .favorite-toggle {
    width: 34px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
  }

  .detail-cover {
    width: min(72%, 280px);
    margin: 0 auto;
  }

  .page-view {
    padding-top: 1.3rem;
  }

  .community-banner {
    padding: 1.6rem 1rem;
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 1rem;
  }
}

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

.preview-page-links,
.information-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  margin-top: 1.15rem;
}

.preview-page-links .button-link,
.information-actions .button-link {
  min-height: 40px;
}

.text-link,
.footer-preview-links a {
  color: var(--yellow);
  font-size: 0.88rem;
  font-weight: 700;
}

.text-link:hover,
.footer-preview-links a:hover {
  color: var(--yellow-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.information-page {
  max-width: 850px;
  min-height: 40vh;
  margin: 1.5rem auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.information-page h1,
.page-heading h1 {
  margin: 0.2rem 0 0.7rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.information-page > p:not(.eyebrow) {
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.7;
}

.information-page .information-lead {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.content-rules-callout {
  max-width: 70ch;
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e05252;
  border-left: 5px solid #e05252;
  border-radius: 5px;
  background: #382424;
  color: #ffdede;
  font-size: 1.05rem;
  font-weight: 800;
}

.creator-submission-form {
  display: grid;
  gap: 1rem;
  max-width: 680px;
  margin-top: 1.5rem;
}

.creator-draft-status {
  max-width: 70ch;
  margin: 0.8rem 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.submission-field {
  display: grid;
  gap: 0.4rem;
}

.submission-field label,
.submission-acknowledgment label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.submission-field input,
.submission-field textarea,
.submission-field select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
  color: var(--text);
}

.submission-field input[type="file"] {
  min-height: 48px;
  padding: 0.45rem;
}

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

.submission-field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.submission-field-error,
.submission-validation-summary {
  margin: 0;
  color: #ff9b9b;
  font-size: 0.86rem;
  font-weight: 650;
}

.submission-validation-summary {
  padding: 0.75rem 0.9rem;
  border: 1px solid #e05252;
  border-radius: 5px;
  background: #382424;
}

.submission-field [aria-invalid="true"] {
  border-color: #e05252;
}

.submission-selected-files {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.submission-selected-files ul {
  display: grid;
  gap: 0.25rem;
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.submission-image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.submission-image-preview {
  width: min(100%, 180px);
  margin: 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
}

.submission-image-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.submission-image-preview figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.uploaded-chapter-pages {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
}

.chapter-title-field {
  display: grid;
  max-width: 34rem;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 700;
}

.chapter-title-field input {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #171717;
  color: var(--text);
  font: inherit;
}

.chapter-upload-dropzone {
  display: grid;
  min-height: 5rem;
  place-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: 5px;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.chapter-upload-dropzone.is-dragging {
  border-color: var(--yellow);
  background: #303020;
}

.chapter-upload-dropzone input {
  max-width: 100%;
  min-height: 38px;
}

.uploaded-chapter-pages h3,
.uploaded-page-item p {
  margin: 0;
}

.uploaded-page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uploaded-page-item {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #292929;
}

.uploaded-page-thumbnail {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #111;
}

.uploaded-page-item[draggable="true"] {
  cursor: grab;
}

.uploaded-page-item[draggable="true"]:active {
  cursor: grabbing;
}

.uploaded-pages-empty {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 5px;
  color: var(--muted);
}

.uploaded-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.uploaded-page-actions button {
  min-height: 38px;
  padding: 0.35rem 0.55rem;
}

.creator-chapter-preview {
  display: grid;
  gap: 0.8rem;
}

.submission-preview-error {
  margin: 0.4rem 0 0;
  color: #ff9b9b;
  font-size: 0.82rem;
}

.submission-acknowledgment {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
}

.submission-acknowledgment input {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin: 0.15rem 0 0;
  accent-color: var(--yellow);
}

.submission-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.submission-summary {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 0.65rem 1rem;
  max-width: 720px;
  margin: 1.25rem 0;
}

.submission-summary dt {
  color: var(--text);
  font-weight: 750;
}

.submission-summary dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.submission-review-previews {
  display: grid;
  gap: 1rem;
  max-width: 720px;
}

.submission-review-preview-group h2 {
  margin: 0;
  font-size: 1.05rem;
}

.submission-acknowledgment-status {
  color: var(--muted);
  font-weight: 700;
}

.submission-confirmation {
  max-width: 70ch;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
  color: var(--text);
  line-height: 1.65;
}

.submission-review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.integration-status-list {
  display: grid;
  gap: 0.55rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.integration-status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
  color: var(--muted);
  font-size: 0.88rem;
}

.integration-status-list strong {
  flex: 0 0 auto;
  color: var(--yellow);
  font-size: 0.76rem;
}

.creator-comic-list {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 1.4rem;
  padding: 0;
  list-style: none;
}

.creator-comic-list > li {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #202020;
}

.creator-chapter-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.creator-chapter-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #292929;
}

.creator-chapter-editor .submission-review-actions {
  align-items: center;
}

.creator-chapter-editor .submission-acknowledgment {
  width: auto;
  margin: 0;
}

.moderation-artwork-preview {
  display: block;
  width: min(100%, 280px);
  max-height: 360px;
  object-fit: contain;
  object-position: left center;
  background: #111;
}

.page-heading {
  margin-bottom: 0.5rem;
}

.page-view > .favorites-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  justify-content: center;
  margin-top: 1.25rem;
}

.favorites-grid .comic-card {
  width: 100%;
  max-width: 420px;
  justify-self: center;
}

.favorites-grid .comic-card-actions {
  flex-wrap: nowrap;
}

.favorites-grid .read-link {
  min-width: 0;
  flex: 1 1 auto;
  padding-inline: 0.5rem;
  white-space: nowrap;
}

.favorites-grid .favorite-toggle {
  width: 40px;
  flex: 0 0 40px;
}

.favorites-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}

.reader-back-to-discover {
  margin-left: 1rem;
}

.footer-preview-links {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.2rem;
  margin-top: 0.55rem;
}

.footer-preview-links a {
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .favorites-grid .favorite-toggle {
    width: 38px;
    flex-basis: 38px;
  }

  .preview-page-links,
  .information-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-page-links .button-link,
  .information-actions .button-link {
    width: 100%;
  }

  .information-page {
    margin-block: 0.8rem;
    padding: 1rem;
  }

  .submission-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
  }

  .submission-summary dd {
    margin-bottom: 0.65rem;
  }

  .submission-review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-status-list li {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .reader-back-to-discover {
    margin-left: 0;
  }
}
