﻿@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");
@font-face {
  font-family: "Montserrat";
  src:
    url("/static/fonts/montserrat/Montserrat-VariableFont_wght.ttf") format("truetype"),
    local("Montserrat"),
    local("Montserrat Regular"),
    local("Montserrat SemiBold"),
    local("Montserrat Medium");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src:
    url("/static/fonts/montserrat/Montserrat-Italic-VariableFont_wght.ttf") format("truetype"),
    local("Montserrat Italic");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

:root {
  --page-accent-rgb: 142, 160, 182;
  --page-orb-a-rgb: 196, 206, 220;
  --page-orb-b-rgb: 145, 160, 180;
  --page-orb-c-rgb: 88, 104, 124;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  font-family: "Montserrat", "Segoe UI Variable Text", "Aptos", "Verdana", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--page-orb-a-rgb), 0.08), transparent 34%),
    radial-gradient(circle at right 8% top 12%, rgba(var(--page-orb-b-rgb), 0.06), transparent 30%),
    linear-gradient(180deg, #fbf8f2 0%, #f5f1e8 48%, #efe8dc 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%, rgba(255, 248, 236, 0.05) 100%);
  opacity: 0.85;
  z-index: 0;
}

html.dark body {
  background:
    radial-gradient(circle at top left, rgba(var(--page-accent-rgb), 0.05), transparent 35%),
    radial-gradient(circle at right 14% top 18%, rgba(var(--page-orb-c-rgb), 0.05), transparent 28%),
    linear-gradient(180deg, #17181b 0%, #1d1f23 46%, #181a1e 100%);
}

html.dark body::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%, rgba(0, 0, 0, 0.08) 100%);
  opacity: 1;
}

.ambient-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.28;
  z-index: 0;
}

html.dark .ambient-orb {
  filter: blur(84px);
  opacity: 0.18;
}

.ambient-a {
  width: 320px;
  height: 320px;
  left: -100px;
  top: 96px;
  background: rgba(var(--page-orb-a-rgb), 0.22);
}

.ambient-b {
  width: 360px;
  height: 360px;
  right: -120px;
  top: 140px;
  background: rgba(var(--page-orb-b-rgb), 0.18);
}

.ambient-c {
  width: 300px;
  height: 300px;
  left: 42%;
  bottom: -80px;
  background: rgba(var(--page-orb-c-rgb), 0.14);
}

.mica-panel {
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  animation: surface-enter 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html:not(.dark) .mica-panel {
  background: rgba(255, 250, 244, 0.84);
  border: 1px solid rgba(214, 203, 188, 0.78);
  box-shadow: 0 18px 44px rgba(68, 56, 36, 0.08);
}

html.dark .mica-panel {
  background: rgba(31, 33, 37, 0.9);
  border: 1px solid rgba(95, 100, 110, 0.56);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-mark {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.brand-logo-full {
  width: auto;
  max-width: min(100%, 270px);
}

.font-display,
.font-body {
  font-family: "Montserrat", "Segoe UI Variable Text", "Aptos", "Verdana", sans-serif !important;
  letter-spacing: 0.01em;
}

.profile-avatar {
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.26);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

a,
button,
select,
input,
textarea,
.mica-panel,
.reader-chip {
  transition:
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 320ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 320ms cubic-bezier(0.22, 1, 0.36, 1),
    color 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

button:active,
a:active {
  transform: scale(0.98);
}

.auth-icon-button,
#themeToggle {
  width: 2.7rem;
  height: 2.7rem;
  min-width: 2.7rem;
  min-height: 2.7rem;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 769px) {
  #themeToggle {
    width: auto;
    min-width: 7.6rem;
    padding-inline: 1rem;
    gap: 0.45rem;
    border-radius: 999px;
  }
}

.auth-icon-button {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

html.dark .auth-icon-button {
  background: rgba(17, 24, 39, 0.72);
}

html.dark #themeToggle {
  background: rgba(17, 24, 39, 0.76);
}

html:not(.dark) #themeToggle {
  background: rgba(255, 255, 255, 0.82);
}

.auth-viewer-link {
  overflow: hidden;
  max-width: min(100%, 240px);
}

.auth-viewer-link .profile-avatar {
  box-shadow: none;
}

.auth-viewer-meta,
.theme-toggle-label {
  display: none;
}

@media (min-width: 769px) {
  .auth-viewer-meta,
  .theme-toggle-label {
    display: block;
  }

  .theme-toggle-label {
    margin-left: 0.5rem;
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 600;
  }
}

.auth-logout-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

#themeToggle svg,
.auth-logout-button svg {
  flex-shrink: 0;
}

.site-header {
  animation: surface-enter 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#homeAccentSlider {
  position: fixed;
  left: var(--accent-tray-left, 8px);
  top: var(--accent-tray-top, 68px);
  width: var(--accent-tray-width, 320px);
  max-width: calc(100vw - 16px);
  z-index: 60;
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 250, 244, 0.92);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

html.dark #homeAccentSlider {
  background: rgba(20, 22, 28, 0.94);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
}

.home-accent-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.site-nav a,
.site-actions > button,
.site-actions > a,
#authControls > a,
#authControls > button {
  position: relative;
  overflow: hidden;
}

.site-nav a::after,
.site-actions > button::after,
.site-actions > a::after,
#authControls > a::after,
#authControls > button::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.14) 45%, transparent 100%);
  opacity: 0;
  transform: translateX(-14%);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), opacity 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav a:hover::after,
.site-actions > button:hover::after,
.site-actions > a:hover::after,
#authControls > a:hover::after,
#authControls > button:hover::after {
  opacity: 1;
  transform: translateX(8%);
}

.reader-disclosure + .reader-disclosure {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 1.1rem;
}

.reader-safe-area {
  padding-bottom: 10rem;
}

@media (max-width: 768px) {
  .reader-safe-area {
    padding-bottom: 16rem;
  }
}

.soft-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.7) transparent;
}

.soft-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.soft-scroll::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.6);
  border-radius: 999px;
}

.reader-body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(var(--page-accent-rgb), 0.04), transparent 38%),
    linear-gradient(180deg, #1a1c20 0%, #202227 45%, #191b1f 100%);
}

.reader-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
      radial-gradient(circle at center, rgba(var(--page-accent-rgb), 0.04), transparent 38%),
      linear-gradient(180deg, rgba(24, 26, 30, 0.98), rgba(24, 26, 30, 1));
}

.reader-stage-media {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  margin-inline: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  animation: reader-media-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.reader-stage-frame {
  width: fit-content;
  max-width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  justify-items: center;
  margin-inline: auto;
  transform-origin: center center;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-stage-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin-inline: auto;
}

.reader-stage-spread-two {
  gap: 0.75rem;
}

.reader-stage-spread-rtl {
  flex-direction: row-reverse;
}

.reader-stage-media-dual {
  width: calc(50% - 0.375rem);
}

.reader-hotzone {
  position: absolute;
  top: 0;
  bottom: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reader-hotzone[data-zone="prev"] {
  left: 0;
  width: 30%;
}

.reader-hotzone[data-zone="toggle"] {
  left: 30%;
  width: 40%;
}

.reader-hotzone[data-zone="next"] {
  right: 0;
  width: 30%;
}

.reader-panel-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 2rem));
  max-height: 0;
}

.reader-panel-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  max-height: min(74vh, 760px);
}

#readerPanel {
  transition: max-height 380ms cubic-bezier(0.22, 1, 0.36, 1), transform 380ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-chrome-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-18px);
}

.reader-chrome-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.reader-top-control {
  min-width: 4.25rem;
  min-height: 3rem;
  height: 3rem;
  z-index: 70;
  pointer-events: auto;
  touch-action: manipulation;
}

#readerPanel .reader-panel-head > .grid,
#readerPanelScroll > .reader-disclosure {
  width: min(100%, 720px);
  margin-inline: auto;
}

.reader-loader-overlay {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 12;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reader-loader-hidden {
  opacity: 0;
  visibility: hidden;
}

.reader-loader-spinner {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: reader-loader-spin 900ms linear infinite;
}

.reader-loader-text {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.comment-vote-active-up {
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45);
}

.comment-vote-active-down {
  box-shadow: 0 0 0 2px rgba(251, 113, 133, 0.45);
}

.reader-swipe-zone {
  display: grid;
  place-items: center;
  padding: 0.15rem 0 0.8rem;
}

.reader-swipe-zone-bar {
  display: block;
  width: 3rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.28);
}

.reader-chip {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(15, 23, 35, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

body:not(.reader-body) main > * {
  animation: surface-enter 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#readerPanel,
[data-reader-chrome="true"] {
  animation: reader-ui-fade-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reader-media-enter {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes reader-ui-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes reader-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  body:not(.reader-body) > .site-header,
  body:not(.reader-body) > main {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .site-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.68rem 0.72rem !important;
  }

  .site-brand {
    min-width: 0;
    flex: 0 0 auto;
  }

  .brand-logo-full {
    max-width: 132px;
  }

  .site-nav,
  .site-actions,
  #authControls {
    min-width: 0;
    flex-wrap: nowrap !important;
    gap: 0.32rem !important;
  }

  .site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    align-items: center;
    gap: 0.28rem !important;
  }

  .site-nav a,
  .site-actions > button,
  #authControls > a,
  #authControls > button {
    white-space: nowrap;
  }

  .site-nav a {
    padding: 0.5rem 0.62rem !important;
    font-size: 0.72rem;
    border-radius: 1rem !important;
  }

  body[data-page="title"] .site-nav a[href="#chapters"] {
    display: none;
  }

  #themeToggle,
  .auth-logout-button {
    padding: 0 !important;
    font-size: 0.74rem !important;
  }

  #themeToggle {
    min-width: 2.28rem !important;
    width: 2.28rem !important;
  }

  #authControls {
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .auth-viewer-link {
    width: 2.35rem !important;
    height: 2.35rem !important;
    max-width: 2.35rem;
    min-width: 2.35rem;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-radius: 999px !important;
    flex: 0 0 auto !important;
    aspect-ratio: 1 / 1;
  }

  .auth-viewer-meta {
    display: none;
  }

  .auth-viewer-link .profile-avatar {
    display: block;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  }

  .reader-top-control {
    min-height: 2.72rem;
    height: 2.72rem;
    padding-inline: 0.9rem !important;
  }

  .reader-top-control.fixed,
  [data-reader-chrome="true"].fixed {
    top: calc(env(safe-area-inset-top, 0px) + 0.5rem) !important;
  }

  #themeToggle,
  .auth-icon-button,
  .auth-logout-button {
    width: 2.28rem;
    height: 2.28rem;
    min-width: 2.28rem;
    min-height: 2.28rem;
  }

  .auth-logout-button {
    padding: 0 !important;
  }

  .auth-logout-button .logout-label {
    display: none;
  }
}

.reader-panel-shell {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.reader-panel-head {
  flex: 0 0 auto;
}

.reader-panel-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 232, 240, 0.34) transparent;
}

.reader-panel-hidden .reader-panel-scroll {
  opacity: 0;
  pointer-events: none;
}

.reader-panel-visible .reader-panel-scroll {
  opacity: 1;
  pointer-events: auto;
}

.reader-panel-handle {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0.9rem 0 0.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reader-panel-grip {
  display: block;
  width: 3.5rem;
  height: 0.32rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.52);
}

@media (max-width: 768px) {
  .site-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.78rem 0.85rem;
  }

  .site-brand {
    gap: 0.55rem;
    min-width: 0;
  }

  .site-brand .brand-logo-full {
    max-width: 148px;
    height: 2rem;
  }

  .site-brand .brand-mark {
    height: 2.5rem;
    width: 2.5rem;
  }

  .site-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    justify-content: center;
    align-items: center;
  }

  .site-nav a {
    white-space: nowrap;
    padding: 0.55rem 0.85rem;
  }

  .site-actions {
    gap: 0.5rem;
    width: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
  }

  .site-actions > button,
  .site-actions > div,
  .site-actions a {
    flex: 0 1 auto;
  }

  #authControls {
    gap: 0.5rem;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
  }

  #authControls .inline-flex,
  #authControls a,
  #authControls button {
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
  }

  .reader-hotzone[data-zone="prev"] {
    width: 34%;
  }

  .reader-hotzone[data-zone="toggle"] {
    left: 34%;
    width: 32%;
  }

  .reader-hotzone[data-zone="next"] {
    width: 34%;
  }

  .reader-stage-frame {
    max-width: calc(100vw - 0.5rem);
    height: calc(100vh - 0.5rem);
  }

  .reader-stage-spread-two {
    gap: 0.35rem;
  }

  .reader-stage-media-dual {
    width: calc(50% - 0.175rem);
  }

  .reader-chip.fixed.left-3,
  .reader-chip.fixed.right-3 {
    top: calc(env(safe-area-inset-top) + 0.75rem);
  }

  .reader-top-control {
    min-width: 3.5rem;
    min-height: 2.65rem;
    padding-inline: 0.85rem;
  }

  #readerPanel.reader-chip {
    bottom: calc(env(safe-area-inset-bottom) + 0.75rem);
  }

  .reader-panel-hidden {
    max-height: 0;
  }

  .reader-panel-visible {
    max-height: min(78vh, 82svh);
  }
}

@media (max-width: 640px) {
  .site-actions {
    width: auto !important;
  }

  #authControls .inline-flex,
  #authControls a,
  #authControls button {
    padding: 0.4rem 0.65rem;
  }
}

.reader-panel-shell {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.reader-panel-head {
  flex: 0 0 auto;
}

.reader-panel-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 232, 240, 0.34) transparent;
}

.reader-panel-hidden .reader-panel-scroll,
.reader-panel-hidden .reader-panel-head {
  opacity: 0;
  pointer-events: none;
}

.reader-panel-visible .reader-panel-scroll,
.reader-panel-visible .reader-panel-head {
  opacity: 1;
  pointer-events: auto;
}

.reader-panel-shell,
.reader-panel-head,
.reader-panel-scroll,
#readerSettingsPanel,
#readerCommentsPanel {
  transition: opacity 320ms cubic-bezier(0.22, 1, 0.36, 1), transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

#readerSettingsPanel:not(.hidden),
#readerCommentsPanel:not(.hidden) {
  animation: surface-enter 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}


/* r3 reader + history refinements */
.reading-history-row {
  scroll-snap-type: x proximity;
}

.reading-history-card {
  display: flex;
  align-items: stretch;
  min-width: min(92vw, 720px);
  max-width: 720px;
  padding: 0.28rem;
  scroll-snap-align: start;
}

.reading-history-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.82rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.52rem 0.65rem;
  border-radius: 1.15rem;
  background: rgba(0, 0, 0, 0.12);
}

.reading-history-cover {
  width: 64px;
  height: 86px;
  border-radius: 0.95rem;
  object-fit: cover;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.22);
}

.reading-history-copy {
  min-width: 0;
}

.reading-history-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: clamp(1rem, 1.4vw, 1.45rem);
  line-height: 1.1;
  font-weight: 700;
}

.reading-history-subtitle {
  margin-top: 0.22rem;
  color: rgba(148, 163, 184, 0.96);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reading-history-progress {
  margin-top: 0.18rem;
  font-size: clamp(0.86rem, 1.1vw, 1rem);
  color: rgba(241, 245, 249, 0.9);
}

.reading-history-bars {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.42rem;
}

.reading-history-bar {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.reading-history-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.reading-history-bar-primary {
  height: 0.48rem;
}

.reading-history-bar-primary span {
  background: linear-gradient(90deg, #ffb444, #ffd968);
}

.reading-history-bar-secondary {
  height: 0.24rem;
}

.reading-history-bar-secondary span {
  background: rgba(241, 245, 249, 0.9);
}

.reading-history-remove {
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 1.15rem;
  background: rgba(0, 0, 0, 0.14);
  color: #fb7185;
}

.home-accent-pill.is-active {
  border-color: rgba(var(--page-accent-rgb), 0.7);
  box-shadow: 0 10px 26px rgba(var(--page-accent-rgb), 0.18);
}

.reader-stage-frame {
  width: min(calc(100vw - 0.4rem), 1500px);
  max-width: min(calc(100vw - 0.1rem), 1600px);
  height: 100vh;
}

.reader-stage-frame-scaled {
  transform-origin: center center;
}

.reader-stage-spread:not(.reader-stage-spread-two) {
  width: 100%;
}

.reader-stage-spread:not(.reader-stage-spread-two) .reader-stage-media {
  width: min(100vw, 100%);
  max-width: 100vw;
  max-height: 100vh;
}

.reader-loader-text {
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.12em;
}

#homeAccentSlider {
  transition: opacity 240ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

#homeAccentSlider.hidden {
  display: none;
}

#homeAccentSlider.accent-tray-open {
  display: grid;
}

.profile-summary .profile-avatar {
  flex: 0 0 auto;
}

#readerSettingsPanel {
  transform: translateY(var(--reader-settings-drag, 0));
}

#readerSettingsPanel.reader-settings-closing {
  animation: reader-settings-close 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reader-settings-close {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(54px);
  }
}

@media (max-width: 768px) {
  #heroStats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .hero-stat-icon {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    flex: 0 0 1rem;
    display: block;
    transform: none !important;
    transform-origin: center center;
  }

  .hero-stat-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    min-height: 1rem;
    flex: 0 0 1rem;
  }

  .reading-history-card {
    min-width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }

  .reading-history-main {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.62rem;
    padding: 0.48rem 0.56rem;
  }

  .reading-history-cover {
    width: 56px;
    height: 76px;
    border-radius: 0.82rem;
  }

  .reading-history-title {
    font-size: 0.96rem;
  }

  .reading-history-subtitle,
  .reading-history-progress {
    font-size: 0.74rem;
  }

  .reading-history-remove {
    flex-basis: 44px;
    border-radius: 0.95rem;
  }

  .reader-loader-overlay {
    gap: 0.65rem;
  }

  .reader-loader-text {
    font-size: 0.72rem;
  }

  .reader-stage-frame {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
  }

  .reader-stage-spread:not(.reader-stage-spread-two) .reader-stage-media {
    width: 100vw;
    max-width: 100vw;
  }

  #homeAccentSlider {
    width: min(calc(100vw - 16px), 320px);
  }

  .home-accent-pill {
    padding: 0.5rem 0.72rem;
  }
}


.catalog-card {
  min-width: 0;
}

.profile-shell {
  align-items: start;
}

.profile-banner,
.profile-head,
.profile-settings-panel,
.profile-sidebar,
.profile-content {
  border-radius: 28px;
  padding: 1rem;
}

.profile-banner {
  position: relative;
  min-height: 180px;
  overflow: hidden;
}

.profile-banner-image,
.profile-banner-fallback {
  width: 100%;
  height: 100%;
  min-height: 180px;
  border-radius: 24px;
  object-fit: cover;
  display: grid;
  place-items: center;
}

.profile-banner-fallback {
  background: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
  color: #0f172a;
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 800;
}

.profile-settings-button {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.9);
  color: white;
}

.profile-head {
  margin-top: -2rem;
  display: flex;
  align-items: end;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.profile-head-avatar {
  margin-top: -3rem;
}

.profile-sidebar {
  display: grid;
  gap: 0.75rem;
  align-self: stretch;
}

.profile-side-chip,
.profile-tab-pill,
.profile-add-list {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255,255,255,0.72);
  color: #0f172a;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

html.dark .profile-side-chip,
html.dark .profile-tab-pill,
html.dark .profile-add-list {
  background: rgba(15, 23, 42, 0.74);
  color: white;
}

.profile-side-chip.is-active,
.profile-tab-pill.is-active {
  background: #0f172a;
  color: white;
}

html.dark .profile-side-chip.is-active,
html.dark .profile-tab-pill.is-active {
  background: #f8fafc;
  color: #0f172a;
}

.profile-tabs-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.profile-tabs-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  flex: 1;
}

.profile-add-list {
  min-width: 2.7rem;
  width: 2.7rem;
  height: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-history-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: 22px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(148,163,184,0.18);
}

html.dark .profile-history-card {
  background: rgba(15,23,42,0.42);
}

.profile-history-cover,
.profile-history-cover-link {
  width: 76px;
  height: 108px;
  border-radius: 18px;
  overflow: hidden;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  body:not(.reader-body) > .site-header,
  body:not(.reader-body) > main,
  body:not(.reader-body) > #profileRoot {
    width: min(calc(100vw - 10px), 100%);
    max-width: min(calc(100vw - 10px), 100%);
  }

  .profile-banner,
  .profile-head,
  .profile-settings-panel,
  .profile-sidebar,
  .profile-content {
    padding: 0.85rem;
    border-radius: 24px;
  }

  .profile-head {
    flex-direction: row;
    align-items: center;
    margin-top: -1.5rem;
  }

  .profile-head-avatar {
    margin-top: -2.6rem;
  }

  .profile-tabs-row {
    align-items: stretch;
  }

  .profile-history-card {
    grid-template-columns: 60px minmax(0, 1fr);
    padding: 0.75rem;
  }

  .profile-history-cover,
  .profile-history-cover-link {
    width: 60px;
    height: 84px;
    border-radius: 14px;
  }

  #catalogGrid {
    gap: 0.8rem;
  }

  .catalog-card {
    padding: 0.75rem;
    border-radius: 18px;
  }
}


/* r8 profile/mobile fixes */
html, body {
  overflow-x: clip;
}

.profile-main,
.profile-content,
.profile-list-layout,
.profile-head-copy,
.profile-history-block,
.profile-entry-card,
.profile-tabs-scroll,
.profile-sort-list {
  min-width: 0;
}

.profile-banner {
  min-height: 160px;
}

.profile-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.profile-settings-button {
  position: static;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.8rem 1.1rem;
  white-space: nowrap;
}

.profile-sidebar {
  align-self: start;
  padding: 0.9rem;
}

.profile-sort-list {
  display: grid;
  gap: 0.45rem;
}

.profile-side-chip {
  justify-content: flex-start;
  text-align: left;
  font-size: 0.94rem;
  padding: 0.68rem 0.9rem;
}

.profile-list-header {
  align-items: flex-start;
}

.profile-tab-pill {
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}

.profile-history-card,
.profile-entry-card {
  overflow: hidden;
}

@media (max-width: 900px) {
  .site-header {
    width: min(calc(100vw - 12px), 100%) !important;
    max-width: min(calc(100vw - 12px), 100%) !important;
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .site-brand {
    min-width: 0;
  }

  .brand-logo-full {
    height: 2.2rem;
  }

  .site-nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
  }

  .site-actions {
    flex: 0 0 auto;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  #themeToggle {
    min-width: 2.75rem;
    width: 2.75rem;
    padding-inline: 0.75rem;
  }

  .theme-toggle-label {
    display: none;
  }

  #authControls {
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .auth-viewer-link {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0.2rem !important;
    justify-content: center;
  }

  .auth-viewer-link .auth-viewer-meta,
  .auth-logout-button .logout-label {
    display: none;
  }

  .auth-logout-button {
    min-width: 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.2rem !important;
    justify-content: center;
  }

  #profileRoot,
  body:not(.reader-body) > main {
    width: min(calc(100vw - 12px), 100%) !important;
    max-width: min(calc(100vw - 12px), 100%) !important;
  }
}

@media (max-width: 768px) {
  .profile-shell {
    grid-template-columns: 1fr !important;
    gap: 0.8rem;
  }

  .profile-banner,
  .profile-head,
  .profile-settings-panel,
  .profile-sidebar,
  .profile-content {
    border-radius: 22px;
    padding: 0.8rem;
  }

  .profile-banner,
  .profile-banner-image,
  .profile-banner-fallback {
    min-height: 132px;
  }

  .profile-head {
    margin-top: -1.35rem;
    align-items: center;
    gap: 0.8rem;
  }

  .profile-head-avatar {
    margin-top: -2.2rem;
  }

  .profile-head-top {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .profile-settings-button {
    min-height: 38px;
    padding: 0.62rem 0.85rem;
    font-size: 0.88rem;
  }

  .profile-sidebar {
    order: 3;
  }

  .profile-sort-list {
    grid-template-columns: 1fr;
  }

  .profile-side-chip {
    padding: 0.62rem 0.78rem;
    font-size: 0.88rem;
  }

  .profile-tabs-row {
    gap: 0.55rem;
  }

  .profile-tabs-scroll {
    gap: 0.45rem;
  }

  .profile-tab-pill {
    padding: 0.6rem 0.82rem;
    font-size: 0.85rem;
  }

  .profile-add-list {
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
  }

  .profile-list-header {
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
  }

  .profile-history-card,
  .profile-entry-card {
    border-radius: 18px;
  }

  .profile-history-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .profile-history-cover,
  .profile-history-cover-link {
    width: 56px;
    height: 80px;
    border-radius: 14px;
  }
}

.hero-stat-icon {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  flex: 0 0 1rem;
  display: block;
  vertical-align: middle;
  transform: none !important;
}

.hero-stat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  flex: 0 0 1rem;
}

img,
svg {
  -webkit-user-drag: none;
}

.profile-banner-placeholder {
  object-fit: contain;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.45));
  padding: 0.85rem;
}

html.dark .profile-banner-placeholder {
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.82), rgba(15, 23, 42, 0.7));
}

.reader-zoom-control {
  min-width: 0;
}

.reader-zoom-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#readerZoomRange {
  width: 100%;
  min-width: 0;
}

@media (max-width: 768px) {
  #readerSettingsPanel .grid {
    gap: 0.7rem;
  }

  #readerSettingsPanel label {
    min-width: 0;
  }

  #catalogGrid[data-cols="2"] .catalog-card {
    padding: 0.65rem;
    gap: 0.5rem;
  }

  #catalogGrid[data-cols="2"] .catalog-card h3 {
    font-size: 0.92rem;
    line-height: 1.22;
  }

  #catalogGrid[data-cols="2"] .catalog-card .ui-btn,
  #catalogGrid[data-cols="2"] .catalog-card a[class*="btn"] {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.82rem;
  }
}

/* r11+ adaptive ui overrides */
input[type="range"] {
  accent-color: var(--ui-accent, #8EA0B6);
}

.profile-list-tools {
  display: grid;
  gap: 0.5rem;
}

.profile-tab-pill {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .site-nav a {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0 !important;
    border-radius: 999px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    position: relative;
  }

  .site-nav a::before {
    content: none;
  }

  .site-nav a[href="/"]::before {
    content: none;
  }

  .site-nav a[href="/profile"]::before {
    content: none;
  }

  .profile-head-copy h1 {
    font-size: clamp(1.2rem, 5.8vw, 1.7rem) !important;
    line-height: 1.15;
  }

  .profile-tab-pill {
    line-height: 1;
    white-space: nowrap;
  }
}

/* r13 control and icon refinements */
@media (max-width: 768px) {
  .site-nav a[href="/"]::before { content: none !important; }
  .site-nav a[href="/about"]::before { content: none !important; }
  .site-nav a[href="/profile"]::before { content: none !important; }
}

.iconized-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.iconized-button .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.iconized-button .btn-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.iconized-button.icon-only .btn-label {
  display: none;
}

.iconized-button.icon-only {
  min-width: 2.45rem;
  width: 2.45rem;
  padding-inline: 0 !important;
}

select,
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
textarea {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html.dark select,
html.dark input[type="text"],
html.dark input[type="password"],
html.dark input[type="search"],
html.dark input[type="number"],
html.dark textarea {
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(148, 163, 184, 0.2);
  color: #f8fafc;
}

input[type="file"]::file-selector-button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  margin-right: 0.6rem;
  cursor: pointer;
}

input[type="range"] {
  height: 1.1rem;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.38rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 42%, #1f2937 58%);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  margin-top: -0.26rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: var(--ui-accent, #8EA0B6);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}

input[type="range"]::-moz-range-track {
  height: 0.38rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 42%, #1f2937 58%);
}

input[type="range"]::-moz-range-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: var(--ui-accent, #8EA0B6);
}

/* r16 mobile/catalog/profile refinements */
.iconized-button {
  max-width: 100%;
  min-width: 0;
}

.catalog-card .mt-auto .iconized-button {
  flex: 1 1 0;
  min-width: 0;
}

.reading-history-bar-primary span,
.profile-progress-title-fill,
.profile-progress-chapter-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--ui-accent, #8EA0B6) 75%, #ffffff 25%), var(--ui-accent, #8EA0B6));
}

.reading-history-bar-secondary span {
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 65%, #cbd5e1 35%);
}

.profile-side-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 768px) {
  .site-nav {
    overflow-x: visible !important;
  }

  .site-nav a[href="/"]::before {
    content: none !important;
  }

  body[data-page="profile"] .site-nav a[href="/profile"] {
    display: none !important;
  }

  .profile-tabs-scroll {
    gap: 0.32rem;
  }

  .profile-tab-pill {
    padding: 0.32rem 0.64rem !important;
    min-height: 1.8rem;
    font-size: 0.78rem;
    border-radius: 0.82rem;
  }

  .profile-list-tools {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    align-self: center;
    overflow: visible;
  }

  .profile-add-list {
    width: 2.05rem !important;
    min-width: 2.05rem !important;
    height: 2.05rem !important;
  }
}

/* r17 compact profile lists + catalog actions */
.profile-tabs-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}

.profile-tabs-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(100 116 139 / 0.95);
  white-space: nowrap;
}

html.dark .profile-tabs-label {
  color: rgb(148 163 184 / 0.9);
}

.profile-tabs-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.profile-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.profile-list-tools {
  display: inline-flex !important;
  flex-direction: row !important;
  gap: 0.32rem;
  flex: 0 0 auto;
  align-items: center;
}

.profile-tab-pill {
  padding: 0.36rem 0.62rem !important;
  min-height: 1.6rem;
  font-size: 0.76rem !important;
  line-height: 1 !important;
}

.catalog-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.68rem, 2.1vw, 0.92rem) !important;
  line-height: 1.1;
}

.catalog-list-mini {
  width: 2.45rem;
  min-width: 2.45rem;
  max-width: 2.45rem;
  padding: 0 !important;
  font-size: 1.26rem !important;
  line-height: 1 !important;
  font-weight: 800;
}

.catalog-card .mt-auto {
  min-width: 0;
}

@media (max-width: 768px) {
  .profile-tabs-row {
    gap: 0.35rem;
  }

  .profile-tabs-label {
    font-size: 0.64rem;
  }

  .profile-tab-pill {
    padding: 0.28rem 0.52rem !important;
    min-height: 1.45rem;
    font-size: 0.72rem !important;
    border-radius: 0.74rem;
  }

  .profile-add-list {
    width: 1.86rem !important;
    min-width: 1.86rem !important;
    height: 1.86rem !important;
  }

  .catalog-list-mini {
    width: 2.1rem;
    min-width: 2.1rem;
    max-width: 2.1rem;
    font-size: 1.08rem !important;
  }
}

/* r19 banner glow, profile tabs layout, vector nav */
.profile-shell {
  position: relative;
  isolation: isolate;
  --banner-edge-left-rgb: 142 160 182;
  --banner-edge-right-rgb: 142 160 182;
  --banner-edge-top-rgb: 142 160 182;
}

.profile-shell::before {
  content: "";
  position: absolute;
  inset: -0.4rem;
  z-index: -1;
  pointer-events: none;
  border-radius: 36px;
  background:
    radial-gradient(56% 72% at 4% 14%, rgb(var(--banner-edge-left-rgb) / 0.24), transparent 72%),
    radial-gradient(56% 72% at 96% 14%, rgb(var(--banner-edge-right-rgb) / 0.24), transparent 72%),
    radial-gradient(48% 56% at 50% 0%, rgb(var(--banner-edge-top-rgb) / 0.2), transparent 78%);
  filter: blur(32px);
  opacity: 0.9;
  transition: background 420ms ease, opacity 260ms ease;
}

html.dark .profile-shell::before {
  opacity: 0.72;
}

.profile-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 21 / 6;
  min-height: clamp(210px, 24vw, 340px);
  max-height: min(45vh, 420px);
  border-radius: 26px !important;
  box-shadow:
    0 20px 42px rgb(var(--banner-edge-left-rgb) / 0.24),
    0 12px 32px rgb(var(--banner-edge-right-rgb) / 0.2);
}

.profile-banner-image,
.profile-banner-fallback {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 22px !important;
  object-fit: cover;
}

.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background:
    linear-gradient(
      120deg,
      rgb(var(--banner-edge-left-rgb) / 0.2) 0%,
      transparent 34%,
      transparent 66%,
      rgb(var(--banner-edge-right-rgb) / 0.2) 100%
    );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.profile-tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.profile-tabs-label {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none !important;
  color: rgb(30 41 59 / 0.95);
}

html.dark .profile-tabs-label {
  color: rgb(226 232 240 / 0.95);
}

.profile-tabs-row {
  display: block !important;
  margin-bottom: 0.95rem;
}

.profile-tabs-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.22rem;
}

.profile-tab-pill {
  padding: 0.52rem 0.9rem !important;
  min-height: 2.18rem;
  border-radius: 999px !important;
  font-size: 0.88rem !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

.profile-list-tools {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.profile-add-list {
  width: 2.42rem !important;
  min-width: 2.42rem !important;
  height: 2.42rem !important;
  padding: 0 !important;
}

.profile-add-list .btn-icon-svg {
  width: 1rem;
  height: 1rem;
}

.profile-side-chip .btn-icon-svg {
  width: 0.95rem;
  height: 0.95rem;
}

.catalog-list-mini .btn-icon-svg {
  width: 1.02rem;
  height: 1.02rem;
}

.site-nav a .nav-link-icon {
  display: none;
}

.site-nav a .nav-link-text {
  display: inline;
}

@media (max-width: 1024px) {
  .profile-banner {
    aspect-ratio: 18 / 7;
    min-height: clamp(180px, 30vw, 280px);
  }
}

@media (max-width: 768px) {
  .site-nav a::before,
  .site-nav a::after,
  .site-nav a[href="/"]::before,
  .site-nav a[href="/about"]::before,
  .site-nav a[href="/profile"]::before {
    content: none !important;
  }

  .site-nav a {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0 !important;
    border-radius: 999px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    position: relative;
  }

  .site-nav a .nav-link-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
  }

  .site-nav a .nav-link-icon-svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .site-nav a .nav-link-text {
    display: none;
  }

  .profile-banner {
    aspect-ratio: 16 / 8;
    min-height: clamp(156px, 44vw, 220px);
    border-radius: 22px !important;
  }

  .profile-banner-image,
  .profile-banner-fallback {
    border-radius: 18px !important;
  }

  .profile-tabs-head {
    gap: 0.55rem;
    margin-bottom: 0.42rem;
  }

  .profile-tabs-label {
    font-size: 0.92rem;
    font-weight: 800;
  }

  .profile-tab-pill {
    padding: 0.44rem 0.74rem !important;
    min-height: 1.9rem;
    font-size: 0.8rem !important;
  }

  .profile-add-list {
    width: 2.08rem !important;
    min-width: 2.08rem !important;
    height: 2.08rem !important;
  }
}

/* r20 profile settings bounds + unified sliders + larger 1-col actions */
.profile-settings-panel {
  max-width: 100%;
  overflow: hidden;
}

.profile-settings-panel form,
.profile-settings-panel label {
  min-width: 0;
}

.profile-settings-panel input:not([type="checkbox"]):not([type="radio"]),
.profile-settings-panel select,
.profile-settings-panel textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.profile-settings-panel input[type="file"] {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 1.2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 0.46rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ui-accent, #8EA0B6) 38%, transparent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--ui-accent, #8EA0B6) 42%, #f8fafc 58%),
    color-mix(in srgb, var(--ui-accent, #8EA0B6) 22%, #1f2937 78%)
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -0.42rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--ui-accent, #8EA0B6) 78%, #ffffff 22%),
    color-mix(in srgb, var(--ui-accent, #8EA0B6) 85%, #0f172a 15%)
  );
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}

input[type="range"]::-moz-range-track {
  height: 0.46rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ui-accent, #8EA0B6) 38%, transparent);
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 28%, #1f2937 72%);
}

input[type="range"]::-moz-range-progress {
  height: 0.46rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 74%, #ffffff 26%);
}

input[type="range"]::-moz-range-thumb {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-accent, #8EA0B6) 84%, #0f172a 16%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.28);
}

#catalogGrid[data-cols="1"] .catalog-primary-action {
  font-size: clamp(0.94rem, 2.45vw, 1.14rem) !important;
  font-weight: 700;
  line-height: 1.15;
}

@media (max-width: 768px) {
  #catalogGrid[data-cols="1"] .catalog-primary-action {
    font-size: clamp(0.94rem, 3.6vw, 1.06rem) !important;
  }
}

/* r21 auth flow redesign */
body[data-page="auth"] #authCard {
  max-width: 980px;
}

.auth-choice-shell {
  display: grid;
  gap: 1rem;
}

.auth-choice-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgb(100 116 139 / 0.95);
}

.auth-choice-title {
  margin: 0;
  font-size: clamp(1.8rem, 4.1vw, 2.75rem);
  line-height: 1.05;
  font-weight: 800;
  color: rgb(15 23 42 / 0.95);
}

html.dark .auth-choice-title {
  color: rgb(248 250 252 / 0.98);
}

.auth-choice-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 64px;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition: transform 220ms ease, filter 220ms ease;
}

.auth-choice-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.auth-choice-btn-max {
  color: #fff;
  font-size: clamp(1.5rem, 3.3vw, 2.1rem);
  font-weight: 700;
  background: linear-gradient(94deg, #942ca8 0%, #2f63d6 72%, #1f78e1 100%);
  box-shadow: 0 14px 34px rgba(58, 76, 186, 0.34);
}

.auth-choice-btn-max::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 24px rgba(65, 99, 210, 0.26);
}

.auth-choice-logo-max {
  height: 34px;
  width: auto;
}

.auth-choice-btn-gos {
  min-height: 56px;
  border-radius: 999px;
  border: 1.5px solid #3564c6;
  background: #f7f9ff;
  color: #1f4ba9;
  font-size: 1.08rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(53, 100, 198, 0.12);
}

.auth-choice-gos-prefix {
  font-size: 1rem;
  color: #3558a8;
}

.auth-choice-logo-gos {
  height: 24px;
  width: auto;
}

.auth-form-message {
  min-height: 1.4rem;
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: rgb(100 116 139 / 0.96);
}

.auth-form-message-ok {
  color: rgb(5 150 105 / 0.96);
}

.auth-form-message-error {
  color: rgb(225 29 72 / 0.96);
}

body[data-page="auth"].auth-service-page {
  background: #dfe1e5;
  color: #0f172a;
}

body[data-page="auth"] {
  font-family: "Helvetica Neue", "Helvetica", "Segoe UI", "Arial", sans-serif;
}

body[data-page="auth"].auth-max-page {
  background: #ebedf0;
  color: #0f172a;
}

body[data-page="auth"].auth-gos-page {
  background: #e4ecfd;
  color: #0f172a;
}

body[data-page="auth"].auth-service-page .ambient-orb,
body[data-page="auth"].auth-service-page .site-header {
  display: none !important;
}

body[data-page="auth"].auth-service-page main {
  min-height: 100vh;
  padding: 0;
  display: block;
}

body[data-page="auth"].auth-service-page #authCard {
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.auth-max-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: clamp(1.2rem, 4.5vw, 4.8rem);
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 7vw, 7.2rem);
}

.auth-max-brand {
  display: grid;
  gap: 1.2rem;
  align-content: center;
  max-width: 560px;
}

.auth-max-brand-logo {
  width: 132px;
  height: auto;
}

.auth-max-brand-text {
  margin: 0;
  max-width: 420px;
  color: #666f7c;
  font-size: clamp(0.98rem, 1.3vw, 1.15rem);
  line-height: 1.35;
}

.auth-max-card {
  width: 100%;
  border-radius: 44px;
  background: #f7f7f8;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  box-shadow: 0 16px 34px rgba(30, 41, 59, 0.14);
}

.auth-max-title {
  margin: 0;
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
  text-align: center;
  font-weight: 700;
}

.auth-max-subtitle {
  margin: 0.6rem 0 1.1rem;
  color: #677185;
  text-align: center;
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
}

.auth-max-form {
  display: grid;
  gap: 0.9rem;
}

.auth-max-input {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #f5f5f5;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  outline: none;
}

.auth-max-submit {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: #05070b;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-max-note {
  margin: 0.95rem 0 0;
  color: #657084;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-max-legal-link {
  color: #68727d;
  text-decoration: none;
  transition: text-decoration-color 180ms ease, color 180ms ease;
}

.auth-max-legal-link:hover {
  color: #5d6874;
  text-decoration: underline;
}

.auth-gos-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.auth-gos-card {
  width: min(92vw, 520px);
  border-radius: 22px;
  border: 1.5px solid #3d63ba;
  background: #f9fbff;
  padding: 1.35rem;
  box-shadow: 0 14px 34px rgba(61, 99, 186, 0.16);
}

.auth-gos-logo {
  height: 34px;
  width: auto;
  margin: 0 auto 0.95rem;
  display: block;
}

.auth-gos-title {
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  color: #274a9b;
  font-weight: 700;
}

.auth-gos-subtitle {
  margin: 0.45rem 0 1rem;
  text-align: center;
  color: #4e5b74;
}

.auth-gos-form {
  display: grid;
  gap: 0.8rem;
}

.auth-gos-input {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid #c8d5f4;
  background: #f5f7fa;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  outline: none;
}

.auth-gos-submit {
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid #3564c6;
  background: #f7f9ff;
  color: #1f4ba9;
  font-size: 1.06rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 980px) {
  .auth-max-layout {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1rem;
  }

  .auth-max-brand {
    justify-items: center;
    text-align: center;
  }

  .auth-max-brand-logo {
    width: 152px;
  }

  .auth-max-submit {
    font-size: 1.25rem;
  }
}

.site-footer-shell {
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(var(--page-accent-rgb), 0.16), transparent 48%),
    radial-gradient(120% 180% at 100% 100%, rgba(var(--page-orb-c-rgb), 0.12), transparent 52%),
    rgba(255, 250, 244, 0.78);
  border: 1px solid rgba(190, 176, 157, 0.48);
  box-shadow: 0 18px 44px rgba(68, 56, 36, 0.1);
}

html.dark .site-footer-shell {
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(var(--page-accent-rgb), 0.16), transparent 48%),
    radial-gradient(120% 180% at 100% 100%, rgba(var(--page-orb-c-rgb), 0.16), transparent 52%),
    rgba(24, 26, 30, 0.86);
  border: 1px solid rgba(98, 106, 120, 0.52);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

.site-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.64);
  padding: 0.42rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgb(15 23 42 / 0.95);
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.site-footer-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(100, 116, 139, 0.42);
}

html.dark .site-footer-link {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(248, 250, 252, 0.96);
}

html.dark .site-footer-link:hover {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.34);
}

/* r28 profile fixes: settings icon clipping + banner visibility on desktop */
.profile-settings-button,
.profile-add-list {
  overflow: visible;
}

.profile-settings-button .btn-icon,
.profile-add-list .btn-icon {
  width: 0.86rem;
  height: 0.86rem;
  line-height: 1;
}

.profile-settings-button .btn-icon-svg,
.profile-add-list .btn-icon-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.profile-banner {
  height: clamp(210px, 24vw, 340px);
}

.profile-banner-image,
.profile-banner-fallback {
  display: block !important;
  object-position: center center;
}

html:not(.dark) .profile-banner {
  background: rgba(226, 232, 240, 0.64);
}

html.dark .profile-banner {
  background: rgba(15, 23, 42, 0.54);
}

@media (max-width: 1024px) {
  .profile-banner {
    height: clamp(180px, 30vw, 280px);
  }
}

@media (max-width: 768px) {
  .profile-banner {
    height: clamp(156px, 44vw, 220px);
  }
}

/* r29 readability + admin refresh + custom menu controls */
select option,
select optgroup {
  background: rgba(248, 250, 252, 0.98);
  color: rgb(15 23 42 / 0.96);
}

html.dark select option,
html.dark select optgroup {
  background: rgba(15, 23, 42, 0.98);
  color: rgb(248 250 252 / 0.96);
}

#siteModalRoot input[type="checkbox"][data-delete-list-id] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.32rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.92);
  display: inline-grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
}

#siteModalRoot input[type="checkbox"][data-delete-list-id]::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 0.18rem;
  transform: scale(0);
  transition: transform 160ms ease;
  background: var(--ui-accent, #8EA0B6);
}

#siteModalRoot input[type="checkbox"][data-delete-list-id]:checked::after {
  transform: scale(1);
}

html.dark #siteModalRoot input[type="checkbox"][data-delete-list-id] {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.92);
}

body[data-page="admin"] main {
  width: min(1480px, calc(100% - 16px)) !important;
  gap: 1rem !important;
}

body[data-page="admin"] .mica-panel {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(var(--page-accent-rgb), 0.14), transparent 48%),
    rgba(255, 250, 244, 0.78);
}

html.dark body[data-page="admin"] .mica-panel {
  border-color: rgba(100, 116, 139, 0.44);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(var(--page-accent-rgb), 0.16), transparent 48%),
    rgba(21, 24, 28, 0.88);
}

body[data-page="admin"] .bg-gradient-to-r.from-sky-400.to-cyan-300 {
  background: linear-gradient(140deg, #ffe3a1, #f4c969) !important;
  color: #1f2937 !important;
  box-shadow: 0 12px 32px rgba(244, 201, 105, 0.28) !important;
}

html.dark body[data-page="admin"] .bg-gradient-to-r.from-sky-400.to-cyan-300 {
  background: linear-gradient(140deg, #d4a63e, #c78a2b) !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 32px rgba(215, 161, 51, 0.24) !important;
}

body[data-page="admin"] #chapterPagesEditor {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  align-items: stretch;
}

body[data-page="admin"] #adminCatalog .grid,
body[data-page="admin"] #adminUsers .grid {
  min-width: 0;
}

@media (max-width: 900px) {
  body[data-page="admin"] main {
    width: min(1180px, calc(100% - 12px)) !important;
  }
}


/* r30 footer + comments + reader theme + admin collapses */
.site-footer-nav-wrap {
  justify-content: flex-end;
}

.site-footer-extra {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-footer-mobile-install {
  display: none;
}

.site-footer-gos-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: center;
}

.site-footer-sns-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  flex-wrap: wrap;
}

.site-footer-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.site-footer-right {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.site-footer-nav-wrap {
  align-items: center;
}

.site-footer-link {
  min-height: 3rem;
}

.site-footer-gos {
  display: block;
  height: 1.45rem;
  width: auto;
  opacity: 0.92;
}

.site-footer-sns-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8.4rem;
  height: 3.15rem;
  min-width: 8.4rem;
  max-width: 8.4rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  overflow: visible;
  cursor: pointer;
}

html.dark .site-footer-sns-link {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.site-footer-sns-link:hover {
  transform: translateY(-1px) scale(1.03);
}

.site-footer-sns-link:focus-visible {
  outline: none;
}

.site-footer-sns-link::after {
  content: "";
  position: absolute;
  inset: 0.08rem 0.22rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(var(--page-accent-rgb), 0.28), rgba(var(--page-accent-rgb), 0) 72%);
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
  pointer-events: none;
  filter: blur(10px);
}

.site-footer-sns-link:hover::after,
.site-footer-sns-link:focus-visible::after {
  opacity: 1;
  transform: scale(1.16);
}

.site-footer-sns-icon {
  width: 100%;
  max-width: 7.2rem;
  height: 1.95rem;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 0 rgba(var(--page-accent-rgb), 0));
  transition: filter 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.site-footer-sns-link:hover .site-footer-sns-icon {
  transform: scale(1.05);
  filter:
    drop-shadow(0 0 6px rgba(var(--page-accent-rgb), 0.62))
    drop-shadow(0 0 14px rgba(var(--page-accent-rgb), 0.34));
}

.site-footer-sns-dark {
  display: none;
}

html.dark .site-footer-sns-light {
  display: none;
}

html.dark .site-footer-sns-dark {
  display: block;
}

.site-footer-max-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.62rem);
  transform: translate(-50%, 10px) scale(0.94);
  min-width: max-content;
  max-width: min(240px, 82vw);
  padding: 0.55rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 250, 244, 0.96);
  color: rgb(15 23 42 / 0.96);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  transition: opacity 240ms ease, transform 240ms ease, visibility 240ms ease;
}

html.dark .site-footer-max-bubble {
  background: rgba(15, 23, 42, 0.96);
  color: rgba(248, 250, 252, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.site-footer-max-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 1px);
  width: 0.75rem;
  height: 0.75rem;
  background: inherit;
  border-right: inherit;
  border-bottom: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.site-footer-sns-link.is-bubble-visible .site-footer-max-bubble {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.site-footer-sns-trigger {
  user-select: none;
  -webkit-user-select: none;
}

.site-footer-sns-link.is-shaking {
  animation: footer-max-shake 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes footer-max-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-2px) rotate(-2deg); }
  36% { transform: translateX(3px) rotate(2deg); }
  54% { transform: translateX(-3px) rotate(-2deg); }
  72% { transform: translateX(2px) rotate(1deg); }
}

.site-footer-gos {
  height: 1.45rem;
  width: auto;
  opacity: 0.92;
}

.site-footer-gos-dark {
  display: none;
}

html.dark .site-footer-gos-light {
  display: none;
}

html.dark .site-footer-gos-dark {
  display: block;
}

@media (max-width: 768px) {
  .site-footer-shell {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .site-footer-nav-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    justify-content: stretch;
    gap: 0.8rem;
  }

  .site-footer-mobile-install {
    display: inline-flex;
  }

  .site-footer-sns-wrap {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    gap: 0.7rem;
  }

  .site-footer-sns-link {
    width: 6.6rem;
    height: 2.7rem;
    min-width: 6.6rem;
    max-width: 6.6rem;
    padding: 0.22rem 0.38rem;
  }

  .site-footer-sns-icon {
    max-width: 5.75rem;
    height: 1.5rem;
  }

  .site-footer-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    width: 100%;
  }

  .site-footer-right {
    display: contents;
  }

  .site-footer-link {
    width: 100%;
    justify-content: center;
  }

  .site-footer-mobile-install,
  #clearSiteCacheButton {
    min-width: 3.25rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .site-footer-mobile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-footer-mobile-icon .btn-icon-svg {
    width: 1.15rem;
    height: 1.15rem;
  }

  .site-footer-mobile-install .site-footer-mobile-text,
  #clearSiteCacheButton .site-footer-mobile-text {
    display: none;
  }

  .site-footer-mobile-install {
    grid-column: 1 / -1;
  }

  .site-footer-gos-wrap {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.comment-card,
.comment-content {
  min-width: 0;
}

.comment-content,
.comment-content * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-code {
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(226, 232, 240, 0.46);
  padding: 0.07rem 0.34rem;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.88em;
}

html.dark .comment-code {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.68);
}

.comment-link {
  color: rgb(37 99 235 / 0.95);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

html.dark .comment-link {
  color: rgb(147 197 253 / 0.96);
}

.comment-quote-line,
.comment-list-line {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  border-radius: 0.85rem;
  padding: 0.28rem 0.7rem;
  margin: 0.06rem 0;
}

.comment-quote-line {
  border-left: 3px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
}

.comment-list-line {
  background: rgba(148, 163, 184, 0.08);
}

.comment-list-bullet {
  color: rgb(59 130 246 / 0.9);
  font-weight: 700;
  line-height: 1.5;
}

html.dark .comment-quote-line {
  border-left-color: rgba(165, 180, 252, 0.55);
  background: rgba(99, 102, 241, 0.16);
}

html.dark .comment-list-line {
  background: rgba(148, 163, 184, 0.12);
}

.comment-editor-shell {
  overflow: hidden;
  border-radius: 1.15rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  width: 100%;
}

html.dark .comment-editor-shell,
.comment-editor-shell-dark {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.comment-editor-textarea {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  resize: vertical;
  width: 100%;
  min-height: 8.5rem;
  padding-bottom: 0.5rem !important;
}

.comment-editor-stage {
  position: relative;
  min-height: 8.5rem;
}

.comment-editor-live-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden auto;
  padding: 0.75rem 1rem 0.5rem;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.75;
  color: rgb(15 23 42 / 0.96);
}

html.dark .comment-editor-live-preview,
.comment-editor-live-preview-dark {
  color: rgb(248 250 252 / 0.98);
}

.comment-editor-textarea-live {
  position: relative;
  z-index: 2;
  color: transparent !important;
  caret-color: currentColor;
}

.comment-editor-textarea-live::placeholder {
  color: rgba(148, 163, 184, 0.84) !important;
}

.comment-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.8rem 1rem 0.95rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(148, 163, 184, 0.05));
}

.comment-editor-toolbar-dark {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(15, 23, 42, 0.24));
}

.comment-editor-tools,
.comment-editor-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.comment-editor-tool,
.comment-editor-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.comment-editor-tool:hover,
.comment-editor-tool:focus-visible,
.comment-editor-secondary:hover,
.comment-editor-secondary:focus-visible {
  background: rgba(148, 163, 184, 0.14);
  transform: translateY(-1px);
}

.comment-editor-tool svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.comment-editor-secondary {
  min-width: auto;
  padding: 0 0.75rem;
  color: rgba(71, 85, 105, 0.95);
}

html.dark .comment-editor-secondary {
  color: rgba(226, 232, 240, 0.9);
}

@media (max-width: 640px) {
  .comment-editor-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .comment-editor-actions {
    justify-content: flex-end;
  }
}

.comment-spoiler {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border: 1px solid rgba(99, 102, 241, 0.38);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.12));
  color: inherit;
  border-radius: 0.82rem;
  padding: 0.12rem 0.56rem;
  margin: 0 0.16rem;
  cursor: pointer;
  vertical-align: baseline;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.comment-spoiler:hover,
.comment-spoiler:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.56);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.18);
}

.comment-spoiler-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(79 70 229 / 0.95);
}

.comment-spoiler-content {
  filter: blur(0.4rem);
  opacity: 0.9;
  transition: filter 220ms ease, opacity 220ms ease, color 220ms ease;
}

.comment-spoiler.is-open .comment-spoiler-content {
  filter: none;
  opacity: 1;
}

.comment-spoiler.is-open .comment-spoiler-label {
  opacity: 0.78;
}

.comment-spoiler.is-open {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(16, 185, 129, 0.1));
  border-color: rgba(16, 185, 129, 0.38);
}

.comment-spoiler.is-open .comment-spoiler-label {
  color: rgb(5 150 105 / 0.95);
}

html.dark .comment-spoiler {
  border-color: rgba(129, 140, 248, 0.46);
  background: linear-gradient(135deg, rgba(49, 46, 129, 0.46), rgba(91, 33, 182, 0.26));
}

html.dark .comment-spoiler-label {
  color: rgb(165 180 252 / 0.96);
}

html.dark .comment-spoiler:hover,
html.dark .comment-spoiler:focus-visible {
  border-color: rgba(165, 180, 252, 0.72);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.28);
}

html.dark .comment-spoiler.is-open {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.68), rgba(5, 150, 105, 0.24));
  border-color: rgba(52, 211, 153, 0.4);
}

html.dark .comment-spoiler.is-open .comment-spoiler-label {
  color: rgb(110 231 183 / 0.96);
}

#siteModalRoot h3 {
  color: rgb(15 23 42 / 0.96) !important;
}

html.dark #siteModalRoot h3 {
  color: rgb(248 250 252 / 0.96) !important;
}

#siteModalRoot .site-modal-surface {
  background: rgba(255, 251, 245, 0.96);
  border-color: rgba(148, 163, 184, 0.35);
}

html.dark #siteModalRoot .site-modal-surface {
  background: rgba(17, 23, 38, 0.96);
  border-color: rgba(100, 116, 139, 0.5);
}

html.dark #siteModalRoot .site-modal-list-row {
  background: rgba(30, 41, 59, 0.9) !important;
  color: rgba(241, 245, 249, 0.96) !important;
  border-color: rgba(100, 116, 139, 0.68) !important;
}

html:not(.dark) .reading-history-main {
  background: rgba(255, 255, 255, 0.82);
}

html:not(.dark) .reading-history-title {
  color: rgb(15 23 42 / 0.96);
}

html:not(.dark) .reading-history-subtitle {
  color: rgb(71 85 105 / 0.9);
}

html:not(.dark) .reading-history-progress {
  color: rgb(15 23 42 / 0.82);
}

html:not(.dark) .reading-history-bar {
  background: rgba(100, 116, 139, 0.26);
}

html:not(.dark) .reading-history-remove {
  background: rgba(226, 232, 240, 0.9);
  color: #e11d48;
}

.auth-anubis-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.auth-anubis-gif {
  display: block;
  width: min(100%, 380px);
  max-height: 160px;
  object-fit: contain;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
  -webkit-user-drag: none;
}

#catalogDensityControl span {
  white-space: nowrap;
}

#catalogDensityControl {
  min-width: 174px;
}

.reader-body.reader-theme-dark {
  background:
    radial-gradient(circle at top, rgba(var(--page-accent-rgb), 0.04), transparent 38%),
    linear-gradient(180deg, #1a1c20 0%, #202227 45%, #191b1f 100%);
}

.reader-body.reader-theme-dark .reader-shell {
  background:
    radial-gradient(circle at center, rgba(var(--page-accent-rgb), 0.04), transparent 38%),
    linear-gradient(180deg, rgba(24, 26, 30, 0.98), rgba(24, 26, 30, 1));
}

.reader-body.reader-theme-light {
  background:
    radial-gradient(circle at top, rgba(var(--page-accent-rgb), 0.08), transparent 40%),
    linear-gradient(180deg, #edf2f8 0%, #e6ebf1 54%, #e1e7ee 100%);
}

.reader-body.reader-theme-light .reader-shell {
  background:
    radial-gradient(circle at center, rgba(var(--page-accent-rgb), 0.08), transparent 40%),
    linear-gradient(180deg, rgba(236, 241, 248, 0.98), rgba(227, 233, 241, 1));
}

.reader-body.reader-theme-sepia {
  background:
    radial-gradient(circle at top, rgba(var(--page-accent-rgb), 0.05), transparent 40%),
    linear-gradient(180deg, #efe4d3 0%, #e8dbc8 52%, #e2d5c3 100%);
}

.reader-body.reader-theme-sepia .reader-shell {
  background:
    radial-gradient(circle at center, rgba(var(--page-accent-rgb), 0.07), transparent 40%),
    linear-gradient(180deg, rgba(243, 233, 216, 0.98), rgba(232, 220, 201, 1));
}

#readerPanel,
#readerPanel * {
  min-width: 0;
}

#readerPanel select,
#readerPanel textarea,
#readerPanel input[type="range"] {
  max-width: 100%;
}

.profile-settings-button .btn-icon-svg,
.profile-add-list .btn-icon-svg {
  width: 0.86rem !important;
  height: 0.86rem !important;
}

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

.admin-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(255, 255, 255, 0.76);
  color: rgb(15 23 42 / 0.92);
  min-height: 2rem;
  padding: 0.32rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
}

html.dark .admin-collapse-toggle {
  background: rgba(15, 23, 42, 0.78);
  color: rgb(248 250 252 / 0.95);
  border-color: rgba(148, 163, 184, 0.28);
}

.profile-banner {
  overflow: hidden;
}

.profile-banner-image,
.banner-crop-image {
  --banner-crop-x: 0%;
  --banner-crop-y: 0%;
  --banner-crop-scale: 1;
  transform: translate3d(var(--banner-crop-x), var(--banner-crop-y), 0) scale(var(--banner-crop-scale));
  transform-origin: center center;
  will-change: transform;
}

.banner-crop-modal {
  display: grid;
  gap: 0.75rem;
}

.banner-crop-viewport {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 16 / 5;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.2) 25%, transparent 25%, transparent 50%, rgba(148, 163, 184, 0.2) 50%, rgba(148, 163, 184, 0.2) 75%, transparent 75%, transparent 100%),
    rgba(15, 23, 42, 0.12);
  background-size: 12px 12px;
  touch-action: none;
}

.banner-crop-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

.banner-crop-viewport:active .banner-crop-image {
  cursor: grabbing;
}

.banner-crop-range-row {
  display: grid;
  gap: 0.45rem;
}

.banner-crop-range-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgb(51 65 85 / 0.92);
}

html.dark .banner-crop-range-label {
  color: rgb(226 232 240 / 0.92);
}

.banner-crop-summary {
  margin: 0;
  font-size: 0.78rem;
  color: rgb(71 85 105 / 0.95);
}

html.dark .banner-crop-summary {
  color: rgb(203 213 225 / 0.92);
}
