/* Theme matched to disclaimish.com: dark navy page, dark-gray navbar/footer, a
   centered light-gray content panel, pink accent, Afacad type. */
:root {
  --bg: #2d303f; /* page background (dark navy) */
  --chrome: #4d545c; /* navbar / footer / drawer (dark gray) */
  --panel: #bababa; /* centered content panel (light gray) */
  --card: #ffffff; /* cards / forms / tables */
  --stage: #23252f; /* comic reader stage */
  --fg: #ececf3; /* text on dark surfaces */
  --fg-dark: #110b07; /* text on the light panel */
  --muted: #c5c5c5; /* muted text on dark */
  --muted-panel: #5c5c63; /* muted text on the light panel */
  --accent: #e84eb4; /* pink — primary */
  --accent-soft: #e87fc5; /* lighter pink — glow/hover */
  --accent-2: #f15a5a; /* coral — secondary */
  --rule: #111417; /* black framing rules */
  --line-dark: #5b626c; /* borders on dark */
  --line: #cfcfd6; /* borders on the light panel */
  --radius: 8px;
  --maxw: 1080px;
  --header-h: 52px;
  --font: "Afacad", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}
a {
  color: var(--accent);
}
a:hover {
  opacity: 0.85;
}
img {
  max-width: 100%;
  display: block;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Masthead banner + dark navbar --- */
.masthead {
  display: block;
  background: var(--bg);
  text-align: center;
  padding: 1.1rem 1rem 0.8rem;
}
/* Neon sign logo: unlit tubes underneath, lit layer on top whose opacity
   flickers like a neon sign with a bad transformer. */
.masthead:hover {
  opacity: 1; /* the sign flickers on hover instead of dimming like other links */
}
.neon-logo {
  position: relative;
  display: inline-block;
}
.neon-logo img {
  display: block;
  height: 88px;
  width: auto;
}
.neon-logo-on {
  position: absolute;
  inset: 0;
  animation: neon-flicker 100s linear infinite;
}
/* Hovering strikes a flicker immediately (overrides the ambient loop), then
   the sign holds steady-lit until the pointer leaves. */
.masthead:hover .neon-logo-on {
  animation: neon-hover-flicker 0.9s linear;
}
/* Idle power-down (driven by js/neon.js): after 10 minutes without
   interaction the sign goes fully dark, then sputters back to life.
   These come after the hover rule so a dark sign can't be lit by hovering. */
.neon-logo.is-dark .neon-logo-on {
  animation: none;
  opacity: 0;
}
.neon-logo.is-waking .neon-logo-on {
  animation: neon-wake 1.4s linear both;
}
/* Ambient loop. 100s duration so 1% = 1s: nine differently-shaped bursts
   spaced 2–20s apart. Every transition is 0.04–0.05% (40–50ms) so the tubes
   snap on/off like the hover flicker instead of cross-fading. */
@keyframes neon-flicker {
  0%     { opacity: 1; }
  /* double stutter */
  3%     { opacity: 1; }
  3.05%  { opacity: 0.2; }
  3.1%   { opacity: 1; }
  3.2%   { opacity: 1; }
  3.25%  { opacity: 0.3; }
  3.3%   { opacity: 1; }
  /* full dropout, ~1s dark, restrike sputter */
  9%     { opacity: 1; }
  9.05%  { opacity: 0; }
  10.1%  { opacity: 0; }
  10.15% { opacity: 1; }
  10.3%  { opacity: 1; }
  10.35% { opacity: 0.2; }
  10.4%  { opacity: 1; }
  /* quick blip */
  30%    { opacity: 1; }
  30.04% { opacity: 0.1; }
  30.08% { opacity: 1; }
  /* machine-gun stutter */
  34%    { opacity: 1; }
  34.05% { opacity: 0.3; }
  34.1%  { opacity: 1; }
  34.15% { opacity: 0.1; }
  34.2%  { opacity: 1; }
  34.25% { opacity: 0.5; }
  34.3%  { opacity: 1; }
  /* flickery brownout */
  48%    { opacity: 1; }
  48.04% { opacity: 0.5; }
  48.12% { opacity: 0.7; }
  48.16% { opacity: 0.3; }
  48.2%  { opacity: 1; }
  /* double blip */
  57%    { opacity: 1; }
  57.04% { opacity: 0.2; }
  57.08% { opacity: 1; }
  57.16% { opacity: 1; }
  57.2%  { opacity: 0.3; }
  57.24% { opacity: 1; }
  /* stutter into a long dropout, snap back with an afterblink */
  77%    { opacity: 1; }
  77.04% { opacity: 0.4; }
  77.08% { opacity: 1; }
  77.12% { opacity: 0; }
  78.1%  { opacity: 0; }
  78.14% { opacity: 1; }
  78.2%  { opacity: 1; }
  78.24% { opacity: 0.2; }
  78.28% { opacity: 1; }
  /* blip */
  85%    { opacity: 1; }
  85.04% { opacity: 0.3; }
  85.08% { opacity: 1; }
  /* stutter */
  97%    { opacity: 1; }
  97.04% { opacity: 0.2; }
  97.08% { opacity: 1; }
  97.14% { opacity: 0.5; }
  97.18% { opacity: 1; }
  97.24% { opacity: 0.1; }
  97.3%  { opacity: 1; }
  100%   { opacity: 1; }
}
@keyframes neon-hover-flicker {
  0%   { opacity: 1; }
  8%   { opacity: 0.2; }
  14%  { opacity: 1; }
  22%  { opacity: 0; }
  38%  { opacity: 0; }
  44%  { opacity: 1; }
  50%  { opacity: 0.4; }
  56%  { opacity: 1; }
  68%  { opacity: 0.2; }
  74%  { opacity: 1; }
  100% { opacity: 1; }
}
/* Cold tube striking up: two failed sputters, catches, then settles. */
@keyframes neon-wake {
  0%   { opacity: 0; }
  3%   { opacity: 0.7; }
  6%   { opacity: 0; }
  22%  { opacity: 0; }
  25%  { opacity: 0.8; }
  28%  { opacity: 0.15; }
  32%  { opacity: 1; }
  36%  { opacity: 0.4; }
  40%  { opacity: 1; }
  55%  { opacity: 1; }
  58%  { opacity: 0.3; }
  62%  { opacity: 1; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .neon-logo-on,
  .masthead:hover .neon-logo-on,
  .neon-logo.is-waking .neon-logo-on {
    animation: none;
  }
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--chrome);
  border-top: 2px solid var(--accent);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  min-height: var(--header-h);
}
.hamburger {
  justify-self: start;
  display: none;
  font-size: 1.25rem;
  line-height: 1;
  background: none;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--fg);
}
.primary-nav {
  grid-column: 2;
  display: flex;
  gap: 1.7rem;
  justify-content: center;
}
.primary-nav a {
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  padding: 0.9rem 0;
  border-bottom: 3px solid transparent;
}
.primary-nav a:hover {
  color: #fff;
  opacity: 1;
}
.primary-nav a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}
.header-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.tier-switch {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.tier-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tier-opt {
  text-decoration: none;
  text-transform: capitalize;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: var(--muted);
}
.tier-opt.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.auth-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.login-link {
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  white-space: nowrap;
  color: var(--fg);
}
.login-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}
.admin-ok {
  color: #6ee7b7;
  font-weight: 600;
}
a.admin-ok {
  text-decoration: none;
}
a.admin-ok:hover {
  text-decoration: underline;
  opacity: 1;
}
.logout-btn {
  background: none;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  font: inherit;
  color: var(--fg);
}
.sup-inactive {
  color: var(--muted);
}

/* Supporter login dropdown (header) */
.login-menu {
  position: relative;
}
.login-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
}
.login-menu summary::-webkit-details-marker {
  display: none;
}
.login-menu[open] summary {
  border-color: var(--accent);
  color: var(--accent);
}
.login-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: flex;
  flex-direction: column;
  min-width: 170px;
  background: var(--chrome);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0.3rem;
  z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.login-menu-items a {
  text-decoration: none;
  color: var(--fg);
  padding: 0.35rem 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  white-space: nowrap;
}
.login-menu-items a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent);
  opacity: 1;
}
.login-menu-items .login-admin {
  border-top: 1px solid var(--line-dark);
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  font-size: 0.8em;
  color: var(--muted);
}

/* Blurb under the reader nav: the comic's title + description. */
.reader-blurb {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid var(--rule);
}
.reader-blurb h2 {
  margin: 0 0 0.35rem;
}
/* Collection descriptions keep the line breaks the artist typed. */
.collection-desc {
  margin: 0;
  color: var(--muted-panel);
  max-width: 70ch;
  white-space: pre-line;
}

/* Login buttons on locked/paywall screens (these sit on light surfaces, so
   restyle .login-link as a solid accent button instead of the header outline) */
.locked-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.locked-actions .login-link {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 0.35rem 0.85rem;
}
.locked-actions .login-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: #fff;
}

/* --- Left links panel + content panel (light gray) --- */
.shell {
  max-width: var(--maxw);
  margin: 1.75rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1.25rem;
  align-items: start;
}
/* Wider column for the comic reader so pages render near full size. */
.shell-wide {
  max-width: min(1500px, 96vw);
}

/* Notification bubble on the header admin chip. */
.chip-bubble {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  min-width: 1.1rem;
  background: var(--accent-2);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.15rem;
  text-align: center;
  vertical-align: 1px;
}

/* Shop section headings on the public shop page. */
.shop-group + .shop-group {
  margin-top: 1.75rem;
}
.shop-group h2 {
  margin-bottom: 0.6rem;
}

/* --- Commission sheet --- */
.commission-note {
  color: var(--accent-2);
  font-size: 0.9rem;
  margin-top: -0.25rem;
}
.commission-section {
  margin-top: 1.75rem;
}
.commission-section h2 {
  margin-bottom: 0.6rem;
}
.commission-body {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.commission-prices {
  flex: 1 1 280px;
  border-collapse: collapse;
  min-width: 260px;
}
.commission-prices th,
.commission-prices td {
  text-align: left;
  font-weight: 400;
  padding: 0.4rem 0.7rem;
  background: var(--card);
  border-bottom: 2px solid var(--panel);
}
.commission-prices td {
  width: 30%;
  white-space: nowrap;
}
.commission-art {
  flex: 1 1 320px;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.commission-art a {
  flex: 1 1 200px;
  max-width: 320px;
}
.commission-art img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  background: var(--card);
}

/* Sidebar-links editor on /admin. */
.link-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.link-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.link-row input[data-field="label"],
.link-row input[name="label"] {
  flex: 0 1 180px;
}
.link-row input[data-field="href"],
.link-row input[name="href"] {
  flex: 1 1 280px;
}

/* "Needs attention" review lists on /admin. */
.attention {
  margin: 1rem 0 2rem;
}
.attention h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.attention .attention-more {
  font-size: 0.8em;
  font-weight: 400;
  margin-left: auto;
}
.links-panel {
  background: var(--panel);
  color: var(--fg-dark);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}
.links-panel .panel-title {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-panel);
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.3rem;
}
.social-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.social-links a {
  text-decoration: none;
  color: var(--fg-dark);
}
.social-links a:hover {
  color: var(--accent);
  opacity: 1;
}
.drawer-nav {
  display: none;
}
.content-panel {
  background: var(--panel);
  color: var(--fg-dark);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.content-panel::before,
.content-panel::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--rule);
}
.content-panel::before {
  margin-bottom: 1.5rem;
}
.content-panel::after {
  margin-top: 1.5rem;
}
.content-panel a {
  color: #1f3aa6;
}

/* Headings: gray, uppercase, underlined (their .left-title look) */
.content-panel h1,
.content-panel h2 {
  color: var(--muted-panel);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.3rem;
}
.content-panel h1 {
  font-size: 1.35rem;
}
.content-panel h2 {
  font-size: 1.1rem;
}
.listing + .listing {
  margin-top: 2rem;
}

/* --- Comic / gallery cover tiles --- */
.card-grid,
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.85rem;
}
.card {
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: 6px;
  overflow: hidden;
  background: #d2d2d8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(232, 78, 180, 0.5);
  opacity: 1;
}
.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
}
.card-cover .card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-cover > .card-thumb:not(img) {
  background: linear-gradient(135deg, #4d545c, #2d303f);
}
.card-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem 0.6rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}
.card-cap h3 {
  margin: 0;
  font-size: 1rem;
  color: #fff;
  text-transform: none;
  border: 0;
  padding: 0;
  letter-spacing: 0;
}
.card-meta {
  color: #dcdce0;
  font-size: 0.78rem;
}
.card .badge-paid {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}
.badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-paid {
  background: var(--accent);
  color: #fff;
}

/* Flat gallery tiles (plain covers) */
.tile {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #d2d2d8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lede {
  color: var(--muted-panel);
}
.hint {
  color: var(--muted-panel);
  font-size: 0.92rem;
}
.empty-note {
  color: var(--muted-panel);
  font-style: italic;
}
.muted {
  color: var(--muted-panel);
  font-weight: 400;
  font-size: 0.85em;
}
.empty,
.reader-locked {
  padding: 1.5rem 0;
}

/* --- Comic reader --- */
.reader-title {
  margin-bottom: 0.5rem;
}
.reader-stage {
  display: flex;
  justify-content: center;
  background: var(--stage);
  border-radius: var(--radius);
  min-height: 45vh;
  padding: 1rem;
}
/* Spans the stage; the full-width page image defines its height, and the
   click zones cover exactly the panel. */
.reader-frame {
  position: relative;
  display: flex;
  width: 100%;
}
.reader-image {
  /* Fill the stage width so dialogue stays readable; tall pages scroll. */
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 0.15s ease;
}
/* Fit-height mode (toggle above the reader): whole page in view, no scroll. */
.reader.fit-height .reader-frame {
  width: auto;
  max-width: 100%;
}
.reader.fit-height .reader-image {
  width: auto;
  max-width: 100%;
  max-height: 86vh;
}

/* Subtle Fit Height / Fit Width switch. Floats on the title row (no extra
   vertical space); the chosen mode is simply bold. */
.reader {
  position: relative;
}
.fit-toggle {
  position: absolute;
  top: 0.15rem;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted-panel);
  font-size: 0.85rem;
}
.fit-toggle button {
  background: none;
  border: none;
  padding: 0.1rem 0.2rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.fit-toggle button:hover {
  color: var(--fg-dark);
}
.fit-toggle button[aria-pressed="true"] {
  font-weight: 700;
}
@media (max-width: 700px) {
  /* Narrow screens: don't risk overlapping a long title. */
  .fit-toggle {
    position: static;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
  }
}
/* Click zones: left half of the panel goes back, right half advances. Custom
   arrow cursors (white chevron with black outline, visible on any art) with
   resize-arrow fallbacks. Zones are pointer affordances only — keyboard users
   have the nav buttons and arrow keys. */
.page-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}
.page-zone-prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%3E%3Cpath%20d='M18%204L8%2014l10%2010'%20fill='none'%20stroke='%23000'%20stroke-width='7'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3Cpath%20d='M18%204L8%2014l10%2010'%20fill='none'%20stroke='%23fff'%20stroke-width='3.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E")
      8 14,
    w-resize;
}
.page-zone-next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%3E%3Cpath%20d='M10%204l10%2010-10%2010'%20fill='none'%20stroke='%23000'%20stroke-width='7'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3Cpath%20d='M10%204l10%2010-10%2010'%20fill='none'%20stroke='%23fff'%20stroke-width='3.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E")
      20 14,
    e-resize;
}
.page-zone.is-disabled {
  cursor: default;
  pointer-events: none;
}
.reader-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 1rem 0 0.25rem;
}
/* Three centered clusters: [First·Prev] — [Extras·All pages·Jump] — [Next·Latest].
   Each group stays intact when the row wraps, so mobile shows tidy centered rows
   instead of an uneven overflow. */
.nav-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}
.nav-center {
  gap: 0.4rem 0.5rem;
}
.reader-nav button {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg-dark);
  cursor: pointer;
  font: inherit;
}
.reader-nav button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.reader-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}
#section-toggle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
#section-toggle:hover:not(:disabled) {
  color: #fff;
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
.reader-status {
  text-align: center;
  color: var(--muted-panel);
  font-size: 0.9rem;
}

/* --- Admin (white panels on the gray panel) --- */
.admin-table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
  background: var(--card);
  color: var(--fg-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.admin-table a {
  color: #1f3aa6;
}
.admin-form {
  display: grid;
  gap: 0.6rem;
  max-width: 480px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card);
  color: var(--fg-dark);
  border-radius: var(--radius);
}
.admin-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.admin-form input,
.admin-form select {
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}
.admin-form button[type="submit"],
.upload-form button,
.cover-form button {
  justify-self: start;
  padding: 0.45rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--muted-panel);
  font-size: 0.9rem;
}
.admin-result {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted-panel);
}
.btn-secondary {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg-dark);
  text-decoration: none;
  cursor: pointer;
}
.btn-danger {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
}
.row-actions {
  display: flex;
  gap: 0.4rem;
  white-space: nowrap;
}
.admin-gate {
  padding: 1.5rem 0;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}

/* Collection edit page */
.img-section {
  margin: 1rem 0 2rem;
}
.img-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.img-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--card);
  color: var(--fg-dark);
  border-radius: var(--radius);
  padding: 0.5rem;
}
.img-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #e7e7ee;
}
.img-fields {
  display: grid;
  gap: 0.35rem;
}
.img-fields label {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.img-fields input {
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}
.img-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.img-actions button {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--fg-dark);
  cursor: pointer;
  font: inherit;
}
.upload-form,
.cover-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.cover-block {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cover-preview {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #d2d2d8;
}
.cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-panel);
  font-size: 0.85rem;
  text-align: center;
  border: 1px solid var(--line);
}
.cover-controls {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.scrim {
  display: none;
}

@media (max-width: 760px) {
  .hamburger {
    display: inline-flex;
  }
  .primary-nav {
    display: none;
  }
  .tier-switch {
    display: none;
  }
  .neon-logo img {
    height: 60px;
  }
  .content-panel {
    padding: 1.25rem 1rem;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .drawer-nav {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .drawer-nav a {
    color: var(--fg-dark);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
  }
  .links-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 80vw;
    max-width: 300px;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
    overflow-y: auto;
  }
  body.drawer-open {
    overflow: hidden;
  }
  body.drawer-open .links-panel {
    transform: translateX(0);
  }
  body.drawer-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 30;
  }
}

/* --- Page transitions: cross-fade between documents (progressive enhancement;
   browsers without view transitions just navigate normally). --- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: ease;
}
@media (prefers-reduced-motion: reduce) {
  .reader-image {
    transition: none;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* --- Featured hero (home) --- */
.hero {
  margin-bottom: 1.6rem;
}
.hero-link {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.hero-art {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  background: linear-gradient(135deg, #4d545c, #2d303f);
}
.hero-art-empty {
  aspect-ratio: 16 / 7;
}
.hero-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 1.1rem 0.9rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  color: #fff;
}
.hero-kicker {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  font-weight: 700;
}
.hero-cap h1 {
  margin: 0.15rem 0;
  color: #fff;
  border: 0;
  padding: 0;
}
.hero-meta {
  font-size: 0.85rem;
  color: #dcdce0;
}

/* --- Tag chips + badges --- */
.tag-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0.6rem 0;
}
.tag-chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #d2d2d8;
  color: var(--fg-dark);
  text-decoration: none;
  font-size: 0.82rem;
}
.tag-chip:hover {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}
.badge-sold {
  background: var(--rule);
  color: #fff;
}
.badge-new {
  background: var(--accent-2);
  color: #fff;
  margin-left: 0.4rem;
}

/* --- Image detail + tag page --- */
.image-detail-fig {
  margin: 0.5rem 0;
  text-align: center;
}
.image-detail-fig img {
  margin: 0 auto;
  border-radius: 6px;
}
.image-detail-fig figcaption {
  margin-top: 0.5rem;
  color: var(--muted-panel);
  font-size: 0.9rem;
}
.tile a {
  display: block;
}
.tile-cap {
  padding: 0.3rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted-panel);
}

/* --- Paywall preview wall --- */
.reader-wall {
  margin: 1rem auto 0;
  max-width: 520px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg-dark);
  text-align: center;
}
.reader-wall p {
  margin: 0.35rem 0;
}

/* --- Comments --- */
.comments {
  margin-top: 2.5rem;
  border-top: 2px solid var(--rule);
  padding-top: 1.25rem;
}
.comments-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-dark);
}
.comments-title .muted {
  color: var(--muted-panel);
  font-weight: 600;
}

/* Composer */
.comment-form {
  display: grid;
  gap: 0.7rem;
  max-width: 620px;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.comment-form .field {
  display: grid;
  gap: 0.3rem;
}
.comment-form .field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-panel);
}
.comment-form input,
.comment-form textarea,
.reply-form input,
.reply-form textarea {
  font: inherit;
  padding: 0.55rem 0.65rem;
  color: var(--fg-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.comment-form textarea,
.reply-form textarea {
  resize: vertical;
  min-height: 3.2rem;
}
.comment-form input:focus,
.comment-form textarea:focus,
.reply-form input:focus,
.reply-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 78, 180, 0.18);
}
.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.comment-submit,
.reply-submit {
  padding: 0.5rem 1.3rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}
.comment-submit:hover,
.reply-submit:hover {
  background: var(--accent-soft);
}
.comment-result,
.reply-result,
.enquiry-result {
  font-size: 0.85rem;
  color: var(--muted-panel);
}

/* Thread list */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.comment {
  padding: 0.75rem 0.9rem;
  background: var(--card);
  color: var(--fg-dark);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.comment-avatar {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}
.comment-author {
  font-weight: 700;
}
.comment-date {
  margin-left: auto;
  color: var(--muted-panel);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.comment-body {
  margin: 0.5rem 0 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-actions {
  margin-top: 0.5rem;
}
.comment-reply-btn {
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
}
.comment-reply-btn:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* Replies — nested one level, coral thread line */
.comment-replies {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.comment-reply {
  border-left-color: var(--accent-2);
  box-shadow: none;
}
.comment-reply .comment-avatar {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.72rem;
  background: var(--accent-2);
}

/* Inline reply composer */
.reply-form {
  display: grid;
  gap: 0.5rem;
  margin: 0.75rem 0 0 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.reply-to {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-panel);
}
.reply-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.reply-submit {
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}
.reply-cancel {
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--muted-panel);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.reply-cancel:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

/* Login gate shown to signed-out readers */
.comment-gate {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Shared enquiry / shop-item form fields (kept from the comments block) */
.enquiry-form label,
.shop-item-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  color: var(--fg-dark);
}
.enquiry-form textarea,
.enquiry-form input {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 5px;
}

/* --- Shop --- */
.shop-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}
.shop-gallery img {
  width: 100%;
  border-radius: 6px;
}
.shop-gallery-empty {
  min-height: 200px;
  background: linear-gradient(135deg, #4d545c, #2d303f);
  border-radius: 6px;
}
.shop-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.3rem 0;
}
.shop-desc {
  white-space: pre-wrap;
}
.enquiry-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 560px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
/* honeypot: kept in the DOM for bots, hidden from people */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* --- Shop admin --- */
.shop-admin-item {
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 1rem;
}
.shop-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.shop-thumb {
  position: relative;
  width: 96px;
}
.shop-thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
}
.shop-thumb.is-cover img {
  border-color: var(--accent);
}
.shop-thumb-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}
.order-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.order {
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.order-new {
  border-left: 4px solid var(--accent-2);
}
.order-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.order-date {
  color: var(--muted);
  font-size: 0.8rem;
}
.order-msg {
  white-space: pre-wrap;
  margin: 0.4rem 0;
}
.order-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Featured toggle (admin table) --- */
.feature-toggle {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--line-dark);
  color: var(--fg);
  border-radius: 5px;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
}
.feature-toggle.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Gallery lightbox (full-view viewer) --- */
body.lb-open {
  overflow: hidden;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: env(safe-area-inset-top, 0.5rem) 0.5rem;
  background: rgba(10, 11, 15, 0.94);
}
.lb-figure {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 4rem);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}
.lb-cap {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.lb-btn {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lb-btn:hover {
  background: var(--accent);
}
.lb-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}
@media (max-width: 560px) {
  .lb-btn {
    width: 38px;
    height: 38px;
    font-size: 1.3rem;
  }
}

/* --- Reader: jump-to-page + thumbnail grid --- */
.reader-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.reader-jump[hidden] {
  display: none;
}
.grid-btn {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg-dark);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.grid-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
#page-jump {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--fg-dark);
  max-width: 8rem;
}

/* Thumbnail overview overlay */
body.pgrid-open {
  overflow: hidden;
}
.pgrid {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  background: rgba(18, 19, 26, 0.97);
  padding-top: env(safe-area-inset-top, 0);
}
.pgrid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-dark);
}
.pgrid-tabs {
  display: flex;
  gap: 0.4rem;
}
.pgrid-tab {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.pgrid-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pgrid-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.pgrid-close:hover {
  background: var(--accent);
}
.pgrid-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
}
.pgrid-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.7rem;
  max-width: var(--maxw);
  margin: 0 auto;
}
.pthumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #23252f;
  cursor: pointer;
  aspect-ratio: 3 / 4;
}
.pthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pthumb:hover {
  border-color: var(--accent-soft);
}
.pthumb.is-current {
  border-color: var(--accent);
}
.pthumb-num {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  border-top-right-radius: 6px;
}
