:root {
  --pink: #ff4f91;
  --purple: #251b46;
  --lavender: #8b6df6;
  --mint: #42cfa5;
  --yellow: #ffc857;
  --bg: #f8f8fc;
  --text: #28233a;
  --muted: #777286;
  --line: #ebe8f4;
  --shadow: 0 14px 40px rgba(37, 27, 70, .08);
  --font-sans: Arial, "Helvetica Neue", Helvetica, "Noto Sans", "Segoe UI", sans-serif;
  --public-header-offset: 130px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img,
picture {
  max-width: 100%;
}
img,
picture {
  display: block;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid rgba(255, 79, 145, .4); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.public-header {
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(37, 27, 70, .08);
}
.header-main {
  width: min(100% - 32px, 1230px);
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) auto;
  align-items: center;
  gap: 22px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--pink);
  font-size: 1.55rem;
  line-height: .9;
  font-weight: 1000;
}
.logo-text {
  display: block;
  white-space: pre-line;
}
.logo.has-image {
  color: var(--purple);
}
.logo.logo-only {
  gap: 0;
}
.logo-cat {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 3px solid var(--pink);
  border-radius: 16px;
  background: #fff5fa;
}
.logo-image {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.logo.logo-only .logo-image {
  width: 136px;
}
.logo.logo-only .logo-cat {
  width: 136px;
}
.search-box { position: relative; min-width: 0; }
.search-bar {
  height: 44px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}
.search-suggestions {
  display: none;
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  z-index: 80;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search-suggestions.open { display: grid; }
.search-suggestions a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.search-suggestions a:last-child { border-bottom: 0; }
.search-suggestions img { width: 42px; height: 54px; object-fit: cover; border-radius: 7px; }
.search-suggestions strong { color: var(--purple); display: block; overflow-wrap: anywhere; }
.search-suggestions small { color: var(--muted); }
.search-bar input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 20px;
  outline: none;
}
.search-bar button {
  width: 70px;
  border: 0;
  background: var(--pink);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.header-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}
.search-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #fff1f7;
  color: var(--pink);
  font-size: 1.2rem;
  cursor: pointer;
  place-items: center;
}
.account-pill {
  background: var(--pink);
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 900 !important;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(255, 79, 145, .22);
}
.account-pill span:first-child {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  font-size: 1.15rem;
  line-height: 1;
}
.menu-toggle { display: none; border: 0; background: #fff1f7; color: var(--pink); border-radius: 8px; width: 42px; height: 42px; cursor: pointer; }
.main-nav {
  width: min(100% - 32px, 1230px);
  margin: 0 auto;
  display: flex;
  gap: 30px;
  align-items: center;
  overflow-x: auto;
}
.main-nav a {
  padding: 15px 0;
  color: var(--purple);
  text-transform: uppercase;
  font-weight: 900;
  font-size: .86rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.main-nav a.active, .main-nav a:hover { color: var(--pink); border-color: var(--pink); }
.mobile-nav { display: none; }

.page {
  width: 100%;
  padding-top: var(--public-header-offset);
}
.home-shell {
  width: min(100% - 32px, 1230px);
  margin: 18px auto 44px;
  display: grid;
  gap: 24px;
}
.hero-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr); gap: 14px; }
.hero-banner, .promo-banner {
  min-width: 0;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #eee9f7;
}
.hero-banner { min-height: 310px; }
.promo-banner { min-height: 148px; }
.hero-banner img, .promo-banner img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-banner::after, .promo-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(37,27,70,.76), rgba(37,27,70,.18));
}
.hero-copy, .promo-copy {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 32px;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.hero-copy h1 { font-size: clamp(2rem, 4vw, 3.4rem); max-width: 620px; margin: 14px 0 10px; line-height: 1.05; }
.hero-copy p { max-width: 520px; line-height: 1.55; margin: 0 0 20px; color: rgba(255,255,255,.9); }
.promo-stack { display: grid; gap: 14px; min-width: 0; }
.promo-copy { padding: 22px; }
.promo-copy h2 { margin: 10px 0 4px; font-size: 1.35rem; }
.promo-copy p { margin: 0 0 12px; color: rgba(255,255,255,.88); }
.promo-copy a, .btn-primary {
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 8px;
  padding: 9px 16px;
  color: #fff;
  font-weight: 900;
}
.hero-slider-full {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: clamp(320px, 42vw, 560px);
  overflow: hidden;
  background: #140f25;
  box-shadow: var(--shadow);
}
.hero-slider-track,
.hero-slide {
  position: relative;
  min-height: inherit;
}
.hero-slide {
  overflow: hidden;
}
.hero-slide picture,
.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-slide img {
  object-fit: cover;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,15,37,.74) 0%, rgba(20,15,37,.24) 52%, rgba(20,15,37,.1) 100%);
}
.hero-slide-copy {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1230px);
  min-height: inherit;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.hero-slide-copy h2 {
  margin: 14px 0 10px;
  max-width: 680px;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.02;
}
.hero-slide-copy p {
  margin: 0 0 22px;
  max-width: 620px;
  color: rgba(255,255,255,.9);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.65;
}
.hero-slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(20,15,37,.46);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.hero-slide-prev { left: 18px; }
.hero-slide-next { right: 18px; }
.hero-slide-dots {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-slide-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  padding: 0;
}
.hero-slide-dots button.active {
  width: 28px;
  border-radius: 999px;
  background: #fff;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255,79,145,.24);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4f91, #7c2350);
  color: #fff;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 14px 28px rgba(124,35,80,.18);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(124,35,80,.24);
}
.button.secondary {
  background: #fff;
  color: var(--purple);
  border-color: rgba(37,27,70,.12);
  box-shadow: 0 10px 24px rgba(37,27,70,.08);
}
.button.secondary:hover {
  border-color: rgba(255,79,145,.3);
  box-shadow: 0 14px 28px rgba(37,27,70,.12);
}
.ui-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: .78rem;
  font-weight: 900;
  color: #fff;
}
.ui-badge-pink { background: var(--pink); }
.ui-badge-lavender { background: var(--lavender); }

.card-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.quick-categories {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 16px;
}
.category-shortcut {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--purple);
  font-weight: 850;
  font-size: .92rem;
}
.category-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255,79,145,.16), rgba(139,109,246,.14));
}
.category-icon::before { content: "♡"; color: var(--pink); font-weight: 1000; }
.category-headphones::before { content: "♫"; color: var(--mint); }
.category-images::before { content: "▧"; color: var(--lavender); }
.category-sparkles::before { content: "✦"; color: var(--lavender); }
.category-building::before { content: "▥"; color: var(--mint); }
.category-scroll::before { content: "☰"; color: #c58a16; }
.category-grid::before { content: "▦"; color: var(--lavender); }

.story-section { min-width: 0; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin: 0;
  color: var(--purple);
  font-size: 1.45rem;
  line-height: 1.2;
}
.section-heading a { color: var(--pink); font-weight: 850; font-size: .92rem; white-space: nowrap; }
.section-heading.compact { margin-bottom: 12px; }
.section-heading.compact h2 { font-size: 1.18rem; }
.story-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.story-card { min-width: 0; }
.story-card a { display: block; }
.story-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: #eee9f7;
  box-shadow: var(--shadow);
}
.story-cover picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.story-cover img { width: 100%; height: 100%; object-fit: cover; }
.story-cover .ui-badge { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); }
.story-card h3 {
  margin: 10px 0 4px;
  color: var(--purple);
  font-size: .96rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.story-card p, .story-meta {
  margin: 0;
  display: block;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
}
.story-meta { color: var(--pink); font-weight: 850; margin-top: 4px; }
.content-panels { display: grid; grid-template-columns: 1.1fr .9fr .8fr; gap: 16px; align-items: start; }
.content-panels .card-panel { padding: 18px; min-width: 0; }
.story-list-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.story-list-item:last-child { border-bottom: 0; }
.story-list-item img, .ranking-list img {
  width: 58px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}
.story-list-item strong, .ranking-list strong {
  display: block;
  color: var(--purple);
  overflow-wrap: anywhere;
}
.story-list-item small, .ranking-list small { color: var(--muted); }
.ranking-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
}
.ranking-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--purple);
  background: #f8f4ff;
  font-weight: 850;
  white-space: nowrap;
}
.ranking-tabs .active { background: #fff1f7; color: var(--pink); }
.ranking-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ranking-list a {
  display: grid;
  grid-template-columns: 28px 50px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.rank-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff1f7;
  color: var(--pink);
  font-weight: 900;
}
.notice-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.notice-item:last-child { border-bottom: 0; }
.notice-item > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--pink);
  background: #fff1f7;
}
.notice-item strong { color: var(--purple); }
.notice-item p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; font-size: .92rem; }
.empty-state { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.pagination { display: flex; gap: 8px; justify-content: center; }
.pagination a { padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.pagination .active { background: var(--pink); color: #fff; }
.breadcrumb { display: flex; gap: 8px; color: var(--muted); }

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 34px max(16px, calc((100% - 1230px) / 2)) 18px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 26px; }
.footer-logo { margin-bottom: 10px; }
.site-footer h2 { margin: 0 0 10px; font-size: 1rem; color: var(--purple); }
.site-footer p, .site-footer a { color: var(--muted); line-height: 1.7; }
.site-footer section { display: grid; align-content: start; gap: 4px; }
.footer-bottom { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

.auth-card, .hero {
  width: min(100% - 24px, 540px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 52px);
  margin: 24px auto;
}
.wide { width: min(100%, 900px); }
.auth-card h1, .hero h1 { margin: 16px 0 10px; color: var(--purple); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.auth-card p, .hero p { color: var(--muted); line-height: 1.7; }
.form-stack { display: grid; gap: 14px; margin-top: 20px; }
.form-stack label { display: grid; gap: 7px; color: var(--purple); font-weight: 850; }
.form-stack input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  outline: 0;
}
.form-stack .check { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.form-stack .check input { width: 18px; height: 18px; }
.auth-login-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(124,35,80,.12);
  background:
    radial-gradient(circle at top right, rgba(255,79,145,.13), transparent 28%),
    radial-gradient(circle at bottom left, rgba(139,109,246,.12), transparent 30%),
    #fff;
  box-shadow: 0 24px 70px rgba(37,27,70,.12);
}
.auth-login-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,79,145,.08);
}
.auth-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 46px;
  gap: 10px;
  align-items: center;
}
.auth-captcha-input {
  text-transform: uppercase;
  letter-spacing: .18em;
  text-align: center;
  font-weight: 800;
}
.auth-captcha-image {
  width: 140px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.auth-captcha-refresh {
  width: 46px;
  height: 48px;
  border: 1px solid rgba(124,35,80,.16);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fff4f8);
  color: #7c2350;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37,27,70,.08);
}
.auth-login-button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  background: linear-gradient(135deg, #7c2350, #ff4f91);
  color: #fff;
  box-shadow: 0 18px 36px rgba(124,35,80,.28);
}
.auth-login-button span {
  font-weight: 900;
  letter-spacing: .01em;
}
.auth-login-button strong {
  font-size: 1.1rem;
  line-height: 1;
}
.auth-login-note {
  margin: 16px 0 0;
  color: #7a5b68 !important;
  font-size: .92rem;
}
.flash {
  width: min(100% - 32px, 760px);
  margin: 18px auto 0;
  padding: 13px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flash.success { color: #16876b; border-color: rgba(66,207,165,.35); }
.flash.error { color: #c22563; border-color: rgba(255,79,145,.35); }
.flash.debug { color: var(--purple); border-color: rgba(139,109,246,.35); overflow-wrap: anywhere; }

.skeleton { background-image: linear-gradient(90deg, #f3f1fa 0, #fff 45%, #f3f1fa 90%); background-size: 240% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton img { animation: reveal .35s ease forwards; }
@keyframes shimmer { to { background-position: -240% 0; } }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1024px) {
  .header-main { grid-template-columns: 170px minmax(240px, 1fr) auto; gap: 14px; }
  .header-actions a:not(.account-pill) span:last-child { display: none; }
  .hero-layout { grid-template-columns: 1fr; }
  .promo-stack { grid-template-columns: 1fr 1fr; }
  .quick-categories { grid-template-columns: repeat(4, 1fr); }
  .story-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content-panels { grid-template-columns: 1fr 1fr; }
  .notice-panel { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --public-header-offset: 88px; }
  .header-main { grid-template-columns: 1fr auto; padding: 12px 0; }
  .header-search { grid-column: 1 / -1; order: 3; }
  .header-actions a:not(.account-pill) { display: none; }
  .account-pill span:last-child { display: none; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .main-nav { display: none; }
  .mobile-nav {
    display: none;
    width: min(100% - 32px, 1230px);
    margin: 0 auto 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .mobile-nav.open { display: grid; gap: 8px; }
  .mobile-nav a { padding: 10px; border-radius: 8px; color: var(--purple); font-weight: 850; }
  .promo-stack { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .content-panels { grid-template-columns: 1fr; }
  .hero-slider-full { min-height: 360px; }
  .hero-slide-nav { width: 44px; height: 44px; }
}
@media (max-width: 520px) {
  :root { --public-header-offset: 84px; }
  .home-shell { width: min(100% - 24px, 1230px); margin-top: 12px; gap: 20px; }
  .header-main, .main-nav, .mobile-nav { width: min(100% - 24px, 1230px); }
  .logo { font-size: 1.15rem; }
  .logo-cat { width: 40px; height: 40px; border-radius: 13px; }
  .logo-image { width: 40px; height: 40px; border-radius: 12px; }
  .logo.logo-only .logo-image,
  .logo.logo-only .logo-cat { width: 112px; }
  .hero-banner { min-height: 284px; }
  .hero-slider-full { min-height: 320px; }
  .hero-copy, .promo-copy { padding: 20px; }
  .hero-copy h1 { font-size: 2rem; overflow-wrap: anywhere; }
  .hero-slide-copy { padding-block: 28px; }
  .hero-slide-copy h2 { font-size: 1.9rem; max-width: 90%; }
  .hero-slide-copy p { max-width: 92%; font-size: .95rem; }
  .hero-slide-nav { top: auto; bottom: 18px; transform: none; width: 40px; height: 40px; }
  .hero-slide-prev { left: 12px; }
  .hero-slide-next { right: 12px; }
  .hero-slide-dots { bottom: 16px; }
  .quick-categories { grid-template-columns: repeat(2, 1fr); padding: 12px; }
  .category-shortcut { justify-content: flex-start; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .section-heading h2 { font-size: 1.2rem; }
  .ranking-list a { grid-template-columns: 28px 44px minmax(0, 1fr); }
  .ranking-list small { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-captcha-row { grid-template-columns: 1fr; }
  .auth-captcha-image,
  .auth-captcha-refresh { width: 100%; }
}

.discovery-shell, .detail-shell {
  width: min(100% - 32px, 1230px);
  margin: 18px auto 44px;
  display: grid;
  gap: 20px;
}
.listing-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
  gap: 22px;
  align-items: center;
}
.listing-hero h1, .detail-info h1 {
  margin: 12px 0 8px;
  color: var(--purple);
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.listing-hero p { color: var(--muted); margin: 0; }
.filter-bar {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.filter-bar label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--purple);
  font-weight: 850;
  font-size: .85rem;
}
.filter-bar input, .filter-bar select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .92rem;
}
.breadcrumb a { color: var(--pink); font-weight: 850; }
.pagination { margin-top: 24px; }
.pagination .disabled { opacity: .45; pointer-events: none; }

.story-detail { overflow: hidden; }
.detail-banner {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: #eee9f7;
}
.detail-banner img { width: 100%; height: 100%; object-fit: cover; }
.detail-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(37,27,70,.05), rgba(37,27,70,.45)); }
.detail-content {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  padding: 0 24px 24px;
  margin-top: -78px;
  position: relative;
  z-index: 1;
}
.detail-cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #eee9f7;
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info {
  min-width: 0;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  align-self: end;
}
.detail-author { margin: 0 0 10px; color: var(--muted); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.detail-tags a {
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff1f7;
  color: var(--pink);
  font-weight: 850;
  font-size: .86rem;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.detail-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.detail-stats dt { color: var(--muted); font-size: .82rem; }
.detail-stats dd { margin: 3px 0 0; color: var(--purple); font-weight: 900; overflow-wrap: anywhere; }
.sale-price { color: var(--pink); font-weight: 850; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, .9fr);
  gap: 18px;
  align-items: start;
}
.detail-main, .related-panel { padding: 22px; }
.detail-main h2, .related-panel h2 { margin: 0 0 12px; color: var(--purple); }
.detail-main p { color: var(--muted); line-height: 1.75; }
.chapter-list form {
  margin: 0;
}
.chapter-list { display: grid; gap: 10px; }
.chapter-list article {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}
.chapter-list strong { color: var(--purple); overflow-wrap: anywhere; }
.chapter-list small { display: block; color: var(--muted); margin-top: 3px; }
.chapter-list button {
  flex: 0 0 auto;
  border: 1px solid rgba(255,79,145,.35);
  background: #fff;
  color: var(--pink);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 850;
}
.chapter-list .chapter-action {
  flex: 0 0 auto;
  min-width: 118px;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 79, 145, .12);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.chapter-list .chapter-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 79, 145, .18);
}
.chapter-list .chapter-action-preview {
  border-color: rgba(255, 79, 145, .24);
  background: linear-gradient(135deg, #fff7fb, #fff1f8);
  color: #d63e7f;
}
.chapter-list .chapter-action-login {
  border-color: rgba(139, 109, 246, .24);
  background: linear-gradient(135deg, #f7f3ff, #efe7ff);
  color: #6f48d9;
}

@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .discovery-shell, .detail-shell { width: min(100% - 24px, 1230px); }
  .listing-hero { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-content { grid-template-columns: 150px minmax(0, 1fr); padding: 0 16px 18px; gap: 16px; }
  .detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .filter-bar { grid-template-columns: 1fr; }
  .detail-banner { height: 170px; }
  .detail-content { grid-template-columns: 1fr; margin-top: -54px; }
  .detail-cover { width: 150px; }
  .detail-info { padding: 18px; }
  .chapter-list article { align-items: flex-start; flex-direction: column; }
  .detail-actions > *,
  .detail-actions form,
  .chapter-list .chapter-action,
  .chapter-list form {
    width: 100%;
  }
}

.admin-body {
  background: #f6f4fb;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}
.admin-shell {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: stretch;
}
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--purple);
  color: #fff;
  padding: 22px 16px;
  box-shadow: 12px 0 32px rgba(37, 27, 70, .14);
  z-index: 110;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.admin-sidebar::-webkit-scrollbar { display: none; }
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 20px;
  color: #fff;
}
.admin-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}
.admin-sidebar-head .admin-brand {
  flex: 1 1 auto;
  padding-bottom: 12px;
}
.admin-sidebar-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  margin-top: 6px;
  font-weight: 900;
}
.admin-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  font-weight: 1000;
  box-shadow: 0 14px 26px rgba(255, 79, 145, .24);
}
.admin-brand strong, .admin-profile strong, .admin-update-list strong, .admin-ranking strong { display: block; overflow-wrap: anywhere; }
.admin-brand small, .admin-profile small { display: block; color: rgba(255,255,255,.62); margin-top: 2px; }
.admin-nav { display: grid; gap: 6px; padding-bottom: 18px; }
.admin-nav a {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.76);
  font-weight: 800;
  font-size: .94rem;
}
.admin-nav a:hover, .admin-nav a.active {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255,79,145,.22);
}
.admin-nav-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.09);
  color: inherit;
  font-weight: 1000;
}
.admin-main {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(320px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgba(246,244,251,.92);
  border-bottom: 1px solid rgba(235,232,244,.9);
  backdrop-filter: blur(14px);
}
.admin-topbar-title {
  min-width: 0;
}
.admin-topbar-title strong {
  display: block;
  color: var(--purple);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.admin-search {
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 30px rgba(37,27,70,.05);
}
.admin-search span { color: var(--pink); font-size: 1.25rem; }
.admin-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
}
.admin-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37,27,70,.05);
}
.admin-mobile-menu-toggle { display: none; }
.admin-topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.admin-profile-menu {
  position: relative;
}
.admin-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37,27,70,.05);
  cursor: pointer;
}
.admin-profile > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--lavender));
  font-weight: 1000;
}
.admin-profile div { min-width: 0; }
.admin-profile strong { color: var(--purple); font-size: .92rem; }
.admin-profile small { color: var(--muted); font-size: .78rem; }
.admin-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(280px, 82vw);
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(37,27,70,.12);
}
.admin-profile-dropdown[hidden] { display: none; }
.admin-profile-dropdown-head {
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.admin-profile-dropdown-head strong {
  color: var(--purple);
}
.admin-profile-dropdown-head small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-profile-dropdown a,
.admin-profile-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--purple);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.admin-profile-dropdown a:hover,
.admin-profile-dropdown button:hover {
  background: #fff1f7;
  color: var(--pink);
}
.admin-profile-dropdown form { margin: 0; }
.admin-dashboard {
  width: min(100% - 32px, 1220px);
  margin: 22px auto 44px;
  display: grid;
  gap: 20px;
}
.admin-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}
.admin-kicker {
  margin: 0 0 8px;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .8rem;
  font-weight: 1000;
}
.admin-page-head h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.08;
}
.admin-page-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.admin-filter {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.admin-filter label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}
.admin-filter input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--purple);
}
.admin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--purple);
  background: #fff;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.admin-button.primary {
  border-color: var(--pink);
  color: #fff;
  background: var(--pink);
}
.admin-button.ghost { color: var(--pink); border-color: rgba(255,79,145,.28); }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.admin-stat-card, .admin-panel, .admin-state, .admin-flash {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.admin-stat-card {
  min-width: 0;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.admin-stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(139,109,246,.12);
}
.admin-stat-card.pink::after { background: rgba(255,79,145,.16); }
.admin-stat-card.purple::after { background: rgba(139,109,246,.16); }
.admin-stat-card.mint::after { background: rgba(66,207,165,.18); }
.admin-stat-card.yellow::after { background: rgba(255,200,87,.24); }
.admin-stat-card span { color: var(--muted); font-weight: 850; font-size: .84rem; }
.admin-stat-card strong {
  display: block;
  margin: 7px 0 4px;
  color: var(--purple);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.admin-stat-card small { color: var(--muted); }
.admin-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr);
  gap: 16px;
  align-items: stretch;
}
.admin-panel { min-width: 0; padding: 18px; }
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.admin-panel-head h2 {
  margin: 0;
  color: var(--purple);
  font-size: 1.12rem;
  line-height: 1.25;
}
.admin-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.admin-chart-wrap {
  position: relative;
  height: 320px;
  min-height: 260px;
}
.admin-chart-wrap.donut { height: 300px; }
.chart-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 8px;
  background-image: linear-gradient(90deg, #f3f1fa 0, #fff 45%, #f3f1fa 90%);
  background-size: 240% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.admin-empty-inline {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #f8f6fd;
}
.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}
.admin-content-grid-single {
  grid-template-columns: minmax(0, 1fr);
}
.admin-ranking {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
}
.admin-ranking li {
  display: grid;
  grid-template-columns: 30px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.admin-ranking .rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pink);
  background: #fff1f7;
  font-weight: 1000;
}
.admin-ranking img {
  width: 48px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee9f7;
}
.admin-ranking small, .admin-update-list small, .admin-activity-list small, .admin-table small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.admin-table th, .admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table td { color: var(--purple); }
.admin-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f3f0ff;
  color: var(--lavender);
  font-size: .8rem;
  font-weight: 900;
  white-space: nowrap;
}
.admin-pill.paid { background: #ecfff9; color: #15866a; }
.admin-pill.pending { background: #fff8e7; color: #a87307; }
.admin-pill.cancelled, .admin-pill.failed { background: #fff1f7; color: #c22563; }
.admin-update-list, .admin-activity-list { display: grid; gap: 10px; }
.admin-update-list a {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-update-list span {
  color: var(--pink);
  font-size: .78rem;
  font-weight: 1000;
}
.admin-activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.admin-activity-item > span {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 5px #fff1f7;
}
.admin-activity-body {
  min-width: 0;
}
.admin-activity-body p { margin: 0; color: var(--purple); line-height: 1.4; overflow-wrap: anywhere; }
.admin-empty, .admin-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfaff;
}
.admin-state.error, .admin-flash.error { color: #c22563; border-color: rgba(255,79,145,.36); }
.admin-flash.success { color: #16876b; border-color: rgba(66,207,165,.35); }
.admin-flash {
  width: min(100% - 32px, 1220px);
  margin: 16px auto 0;
  padding: 13px 16px;
}
.admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(37,27,70,.46);
}
.sidebar-collapsed { grid-template-columns: 86px minmax(0, 1fr); }
.sidebar-collapsed .admin-sidebar { padding-inline: 12px; }
.sidebar-collapsed .admin-brand span:not(.admin-brand-mark),
.sidebar-collapsed .admin-nav a span:last-child { display: none; }
.sidebar-collapsed .admin-nav a { grid-template-columns: 1fr; justify-items: center; padding-inline: 8px; }
.sidebar-collapsed .admin-sidebar-head {
  justify-content: center;
}
.sidebar-collapsed .admin-sidebar-head .admin-brand {
  flex: 0 0 auto;
}
.sidebar-collapsed .admin-sidebar-toggle {
  position: absolute;
  top: 28px;
  right: 12px;
}

@media (max-width: 1180px) {
  .admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-page-head { grid-template-columns: 1fr; }
  .admin-filter { width: 100%; }
}
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(86vw, 304px);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .admin-topbar-title { display: none; }
  .admin-profile { display: none; }
  .admin-mobile-menu-toggle { display: grid; }
  .admin-sidebar-toggle { display: none; }
  .admin-chart-grid, .admin-content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .admin-dashboard { width: min(100% - 24px, 1220px); margin-top: 16px; }
  .admin-topbar { padding: 12px; gap: 10px; }
  .admin-search { height: 42px; padding: 0 12px; }
  .admin-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-filter .admin-button { min-width: 0; }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .admin-stat-card, .admin-panel { padding: 14px; }
  .admin-chart-wrap { height: 260px; }
}
@media (max-width: 430px) {
  .admin-filter { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-topbar { grid-template-columns: auto minmax(0, 1fr); }
  .admin-topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .admin-topbar-actions > a.admin-icon-button { display: none; }
  .admin-profile-menu {
    justify-self: end;
  }
  .admin-profile { display: flex; }
}

.admin-crud .crud-grid {
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.6fr);
}
.modal-open {
  overflow: hidden;
}
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 20px;
}
.admin-modal[hidden] { display: none; }
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37,27,70,.5);
}
.admin-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(37,27,70,.18);
  padding: 18px;
}
.admin-modal-dialog-wide {
  width: min(1180px, calc(100vw - 32px));
}
.admin-modal-dialog-form {
  display: grid;
  gap: 16px;
}
.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-modal-head h2 {
  margin: 0;
  color: var(--purple);
}
.admin-modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}
.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-form {
  display: grid;
  gap: 12px;
}
.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--purple);
  font-weight: 850;
  font-size: .88rem;
}
.admin-form input,
.admin-form select,
.admin-form textarea,
.compact-filter input,
.compact-filter select,
.bulk-actions select,
.menu-item-row input,
.menu-item-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
}
.admin-form textarea { resize: vertical; }
.admin-check {
  display: inline-flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  color: var(--muted) !important;
}
.admin-check input { width: 18px; height: 18px; }
.admin-check.inline { white-space: nowrap; }
.admin-image-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f3f1fa;
}
.admin-image-preview.wide-preview {
  width: 100%;
  height: 150px;
}
.compact-filter {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
  box-shadow: none;
}
.bulk-form { display: grid; gap: 12px; }
.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.admin-sort-list { display: grid; gap: 10px; }
.admin-sort-list.sort-error { outline: 3px solid rgba(255,79,145,.28); outline-offset: 4px; }
.admin-sort-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 28px 48px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-sort-row.dragging { opacity: .45; }
.drag-handle {
  cursor: grab;
  color: var(--pink);
  font-weight: 1000;
  text-align: center;
}
.admin-sort-row img {
  width: 48px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f1fa;
}
.admin-sort-row small { display: block; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.menu-builder-panel { display: grid; gap: 18px; }
.menu-builder {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.menu-builder:last-child { border-bottom: 0; padding-bottom: 0; }
.menu-group-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.menu-group-list {
  display: grid;
  gap: 14px;
}
.menu-admin-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}
.menu-admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.menu-admin-card-head strong {
  display: block;
  color: var(--purple);
}
.menu-admin-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.menu-item-inline-list {
  display: grid;
  gap: 8px;
}
.menu-item-inline-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.3fr) minmax(180px, .8fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9fe;
  padding: 12px;
}
.menu-item-inline-main {
  min-width: 0;
  padding-left: calc(var(--menu-depth, 0) * 18px);
}
.menu-item-inline-main strong,
.menu-item-inline-main small,
.menu-item-inline-meta small {
  overflow-wrap: anywhere;
}
.menu-item-inline-main strong {
  display: block;
  color: var(--purple);
}
.menu-item-inline-main small,
.menu-item-inline-meta small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.menu-item-inline-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.menu-item-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.inline-form {
  grid-template-columns: 1.1fr 1fr 1fr 1fr .75fr .7fr auto auto auto;
  align-items: end;
}
.menu-item-list {
  gap: 14px;
}
.menu-item-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(37,27,70,.06);
  padding: 14px;
}
.menu-item-card.dragging {
  opacity: .45;
}
.menu-item-form {
  display: grid;
  gap: 14px;
}
.menu-item-card-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.menu-item-card-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.menu-item-card-title strong,
.menu-item-card-title small {
  overflow-wrap: anywhere;
}
.menu-item-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.menu-item-label {
  position: relative;
}
.menu-item-label input {
  padding-left: calc(10px + (var(--menu-depth, 0) * 18px));
}
.menu-item-fields label,
.menu-item-meta {
  display: grid;
  gap: 6px;
}
.menu-item-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.menu-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.banner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.banner-admin-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.banner-admin-card > img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f1fa;
}
.banner-admin-card strong { color: var(--purple); overflow-wrap: anywhere; }
.banner-admin-card small { display: block; color: var(--muted); margin-top: 4px; }
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.banner-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.banner-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.banner-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1100px) {
  .admin-crud .crud-grid { grid-template-columns: 1fr; }
  .compact-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-item-card-head { grid-template-columns: 1fr; }
  .menu-item-card .drag-handle { display: none; }
  .menu-item-fields { grid-template-columns: 1fr; }
  .menu-item-inline-row { grid-template-columns: minmax(0, 1fr); }
  .menu-item-inline-row .drag-handle { display: none; }
  .menu-item-inline-actions { justify-content: flex-start; }
  .menu-admin-card-head { display: grid; }
}
@media (max-width: 700px) {
  .admin-sort-row { grid-template-columns: auto 28px minmax(0, 1fr); }
  .admin-sort-row img, .admin-sort-row .admin-pill { display: none; }
  .admin-sort-row .admin-button { min-height: 34px; padding-inline: 10px; }
  .compact-filter, .inline-form, .banner-grid { grid-template-columns: 1fr; }
  .banner-page-head { align-items: stretch; flex-direction: column; }
  .banner-head-actions { width: 100%; }
  .menu-item-fields,
  .menu-item-actions { grid-template-columns: 1fr; }
  .menu-item-actions { flex-direction: column; }
  .menu-item-inline-actions { flex-direction: column; align-items: stretch; }
}

.text-story-form .form-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.text-story-form .form-columns > div,
.form-pair,
.form-actions {
  display: grid;
  gap: 12px;
}
.form-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-actions {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  margin-top: 14px;
}
.text-story-form .story-form-side {
  max-width: 100%;
}
.text-story-form .category-combobox,
.comic-story-form .category-combobox {
  display: grid;
  gap: 8px;
}
.text-story-form .category-combobox-tags,
.comic-story-form .category-combobox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.text-story-form .category-tag,
.comic-story-form .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f7d9e7;
  color: #7c2350;
  font-weight: 700;
}
.text-story-form .category-tag-remove,
.comic-story-form .category-tag-remove {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.autosave-status { color: var(--muted); font-size: .9rem; }
.table-actions,
.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.table-actions form,
.banner-actions form { margin: 0; }
.chapter-row {
  grid-template-columns: 28px minmax(0, 1fr) auto auto auto auto auto;
}
.comic-chapter-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
}
.audio-chapter-row {
  grid-template-columns: 28px minmax(220px, 1fr) auto auto minmax(180px, 220px) auto;
}
.audio-chapter-row audio {
  width: 100%;
}
.audio-chapter-summary,
.audio-chapter-preview,
.audio-chapter-actions {
  min-width: 0;
}
.audio-chapter-preview {
  display: flex;
  align-items: center;
}
.audio-chapter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.audio-chapter-actions form {
  margin: 0;
}
.import-form {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.import-form h3 { margin: 0; color: var(--purple); }
.import-form p { margin: 0; color: var(--muted); line-height: 1.5; }
.reader-panel {
  padding: clamp(20px, 4vw, 42px);
}
.reader-panel header {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}
.reader-panel h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.12;
}
.reader-panel h2 { color: var(--purple); }
.reader-panel p,
.reader-content,
.reader-intro {
  color: var(--text);
  line-height: 1.85;
}
.reader-content {
  max-width: 820px;
  margin: 24px auto 0;
  font-size: 1.05rem;
}
.reader-content p { margin: 0 0 1.1em; }
.reader-lock {
  margin-top: 24px;
  padding: 24px;
  border: 1px dashed rgba(255,79,145,.38);
  border-radius: 8px;
  background: #fff7fb;
}
.reader-lock p { color: var(--muted); }
.reader-lock-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.image-gallery-head { margin-top: 22px; }
.comic-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.comic-image-card {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.comic-image-card > img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f1fa;
}
.comic-image-card input[type="file"] {
  max-width: 190px;
  font-size: .8rem;
}
.comic-image-card small { color: var(--muted); }
.comic-image-section {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}
.comic-image-card-actions {
  display: grid;
  gap: 8px;
}
.comic-image-card-actions form {
  margin: 0;
  display: grid;
  gap: 8px;
}
.comic-image-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #faf8fe;
  color: var(--muted);
}
.comic-image-empty p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .story-form .form-columns,
  .form-pair,
  .form-actions { grid-template-columns: 1fr; }
  .chapter-row { grid-template-columns: 28px minmax(0, 1fr); }
  .chapter-row > span:not(.drag-handle),
  .chapter-row > a,
  .chapter-row > form { margin-left: 38px; }
  .comic-chapter-row { grid-template-columns: 1fr; }
  .comic-chapter-row > span,
  .comic-chapter-row > a,
  .comic-chapter-row > form,
  .comic-chapter-row > button { margin-left: 0; }
  .audio-chapter-row { grid-template-columns: 28px minmax(0, 1fr); }
  .audio-chapter-row > span:not(.drag-handle),
  .audio-chapter-row > .audio-chapter-preview,
  .audio-chapter-row > .audio-chapter-actions { margin-left: 38px; }
  .audio-chapter-actions { justify-content: flex-start; }
  .comic-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .comic-image-grid { grid-template-columns: 1fr; }
}
.audio-player-panel { padding: clamp(22px, 4vw, 42px); }
.audio-player-panel h1 { margin: 12px 0 6px; color: var(--purple); font-size: clamp(1.8rem,4vw,3rem); }
.cute-audio-player {
  position: sticky;
  bottom: 14px;
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  z-index: 30;
}
.audio-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.audio-controls button, .audio-controls select, .audio-controls .reader-nav-button {
  border: 1px solid rgba(255,79,145,.28);
  border-radius: 8px;
  background: #fff1f7;
  color: var(--pink);
  padding: 9px 12px;
  font-weight: 850;
}
.audio-controls .reader-nav-button {
  justify-content: center;
  text-align: center;
}
.cute-audio-player input[type="range"] { width: 100%; accent-color: var(--pink); }
.audio-time { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
@media (max-width: 520px) {
  .cute-audio-player { position: fixed; left: 10px; right: 10px; bottom: 10px; }
  .audio-reader { padding-bottom: 170px; }
  .audio-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .audio-controls .audio-checkbox {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .comic-watermark {
    padding: 0 14px;
    font-size: clamp(1rem, 4.8vw, 1.7rem);
    transform: none;
  }
}

.reader-toolbar {
  position: sticky;
  top: 82px;
  z-index: 34;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.text-reader-shell .reader-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  grid-template-areas:
    "toc font modes fullscreen"
    "size size line line";
  gap: 10px 12px;
  align-items: end;
}
.reader-chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
}
.comic-reader-toolbar-stack {
  display: grid;
  gap: 12px;
}
.comic-reader-toolbar-stack .reader-chapter-nav .reader-nav-button {
  flex: 1 1 0;
  text-align: center;
}
.reader-toolbar button,
.reader-toolbar select,
.reader-toolbar input,
.reader-nav-button,
.comic-page-actions button {
  border: 1px solid rgba(255,79,145,.28);
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  padding: 8px 11px;
  font-weight: 850;
}
.reader-toolbar button.active {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}
.reader-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 850;
}
.text-reader-shell .reader-toolbar > * { min-width: 0; }
.text-reader-shell .reader-toolbar button,
.text-reader-shell .reader-toolbar select,
.text-reader-shell .reader-toolbar .reader-mode-tabs button {
  padding: 8px 11px;
  min-height: 0;
  line-height: 1.2;
}
.text-reader-shell .reader-toolbar label {
  display: grid;
  gap: 6px;
  align-items: stretch;
  width: 100%;
}
.text-reader-shell .reader-toolbar label select,
.text-reader-shell .reader-toolbar label input[type="range"] {
  width: 100%;
}
.text-reader-shell .reader-toolbar .reader-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
}
.text-reader-shell .reader-toolbar .reader-mode-tabs button {
  width: auto;
}
.text-reader-shell .reader-toolbar .reader-tool-toc { grid-area: toc; justify-self: start; width: auto; }
.text-reader-shell .reader-toolbar .reader-tool-font { grid-area: font; }
.text-reader-shell .reader-toolbar .reader-tool-size { grid-area: size; }
.text-reader-shell .reader-toolbar .reader-tool-line { grid-area: line; }
.text-reader-shell .reader-toolbar .reader-tool-modes { grid-area: modes; justify-self: end; }
.text-reader-shell .reader-toolbar [data-reader-fullscreen] {
  grid-area: fullscreen;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  justify-self: end;
  width: auto;
}
.reader-toolbar input[type="range"] {
  width: 96px;
  accent-color: var(--pink);
}
.reader-nav-button.disabled {
  opacity: .45;
  pointer-events: none;
}
.comic-reader-shell .reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.comic-reader-shell .reader-toolbar > * {
  min-width: 0;
}
.reader-chapter-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 109, 246, .12);
}
.reader-toc {
  padding: 16px;
}
.reader-toc h2 {
  margin: 0 0 10px;
  color: var(--purple);
}
.reader-toc div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.reader-toc a {
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8f6fd;
  color: var(--purple);
  overflow-wrap: anywhere;
}
.reader-toc a.active {
  background: #fff1f7;
  color: var(--pink);
  font-weight: 900;
}
.text-reader-shell[data-mode="dark"] {
  --reader-bg: #151126;
  --reader-fg: #f6f1ff;
  --reader-soft: #cfc7e8;
}
.text-reader-shell[data-mode="sepia"] {
  --reader-bg: #fff7e8;
  --reader-fg: #3a2d22;
  --reader-soft: #806f5c;
}
.text-reader-shell[data-mode="light"] {
  --reader-bg: #fff;
  --reader-fg: var(--text);
  --reader-soft: var(--muted);
}
.text-reader-panel {
  background: var(--reader-bg, #fff);
  color: var(--reader-fg, var(--text));
}
.text-reader-panel .reader-content,
.text-reader-panel .reader-intro,
.text-reader-panel p {
  color: var(--reader-fg, var(--text));
}
.text-reader-panel .reader-content {
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: var(--reader-line);
}
.text-reader-panel h1,
.text-reader-panel h2 {
  color: inherit;
}
.comic-reader-panel {
  padding: clamp(16px, 3vw, 28px);
}
.comic-reader-panel header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.comic-reader-panel h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.7rem, 4vw, 2.7rem);
}
.comic-page-actions {
  display: none;
  gap: 10px;
  justify-content: center;
  margin: 0 0 16px;
}
.comic-pages {
  display: grid;
  gap: 18px;
  justify-items: center;
}
.comic-page {
  position: relative;
  width: min(100%, 920px);
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f1fa;
  box-shadow: 0 10px 30px rgba(37,27,70,.08);
}
.comic-page img {
  width: 100%;
  height: auto;
}
.comic-watermark {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100%;
  padding: 0 20px;
  overflow: hidden;
  color: rgba(255,79,145,.18);
  font-size: clamp(1rem, 4.2vw, 4rem);
  font-weight: 1000;
  text-align: center;
  transform: rotate(-14deg);
  word-break: break-word;
  text-shadow: 0 2px 18px rgba(37,27,70,.12);
}
.comic-page [data-retry] {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  border: 0;
  border-radius: 8px;
  background: var(--pink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
}
.comic-reader-shell[data-mode="single"] .comic-page {
  display: none;
}
.comic-reader-shell[data-mode="single"] .comic-page.active {
  display: block;
}
.comic-reader-shell[data-mode="single"] .comic-page-actions {
  display: flex;
}
.reader-counter {
  color: var(--muted);
  font-weight: 900;
  padding: 0 4px;
}
.audio-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--purple);
}
.audio-title-row span {
  color: var(--pink);
  font-weight: 850;
}
.audio-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 850;
}
.audio-checkbox input {
  width: 18px;
  height: 18px;
}
@media (max-width: 900px) {
  .reader-toolbar { top: 72px; }
  .reader-toc div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .reader-chapter-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .reader-toolbar {
    position: static;
  }
  .comic-reader-shell .reader-toolbar {
    justify-content: stretch;
  }
  .comic-reader-shell .reader-toolbar > * {
    flex: 1 1 135px;
  }
  .text-reader-shell .reader-toolbar {
    grid-template-columns: auto minmax(110px, 1fr) auto auto;
    grid-template-areas:
      "toc font modes fullscreen"
      "size size line line";
    gap: 8px;
    padding: 10px;
  }
  .text-reader-shell .reader-toolbar button,
  .text-reader-shell .reader-toolbar select,
  .text-reader-shell .reader-toolbar input,
  .text-reader-shell .reader-toolbar label {
    font-size: .8rem;
  }
  .text-reader-shell .reader-toolbar button,
  .text-reader-shell .reader-toolbar select,
  .text-reader-shell .reader-toolbar input,
  .text-reader-shell .reader-toolbar .reader-mode-tabs button {
    padding: 7px 9px;
  }
  .text-reader-shell .reader-toolbar input[type="range"] {
    width: 100%;
  }
  .text-reader-shell .reader-toolbar .reader-mode-tabs {
    justify-content: flex-start;
    gap: 6px;
  }
  .reader-toc div { grid-template-columns: 1fr; }
  .comic-reader-panel { padding: 12px; }
  .comic-pages { gap: 12px; }
  .comic-page {
    width: 100%;
    border-radius: 6px;
  }
  .audio-title-row { display: grid; }
}

.user-dashboard-shell {
  width: min(100% - 32px, 1230px);
  margin: 22px auto 46px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.user-sidebar {
  position: sticky;
  top: 94px;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.user-profile-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff1f7, #f3f0ff);
}
.user-profile-card img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
}
.user-profile-card strong {
  color: var(--purple);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}
.user-profile-card span {
  color: var(--muted);
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.membership-box {
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--lavender));
}
.membership-box span,
.membership-box small {
  display: block;
  color: rgba(255,255,255,.78);
}
.membership-box strong {
  display: block;
  margin: 5px 0;
  font-size: 1.12rem;
}
.user-nav {
  display: grid;
  gap: 6px;
}
.user-nav a,
.user-nav button {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 10px 11px;
  background: transparent;
  color: var(--purple);
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}
.user-nav a span,
.user-nav button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff1f7;
  color: var(--pink);
}
.user-nav a.active,
.user-nav a:hover,
.user-nav button:hover {
  background: var(--pink);
  color: #fff;
}
.user-nav a.active span,
.user-nav a:hover span,
.user-nav button:hover span {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.user-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}
.user-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}
.user-page-head h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.user-summary-pill {
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.user-summary-pill span {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
}
.user-summary-pill strong {
  color: var(--pink);
  font-size: 1.8rem;
}
.user-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.user-stat-grid article,
.user-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.user-stat-grid article {
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.user-stat-grid article::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(255,79,145,.13);
}
.user-stat-grid span {
  color: var(--muted);
  font-weight: 850;
}
.user-stat-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--purple);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  overflow-wrap: anywhere;
}
.user-panel {
  padding: 18px;
  min-width: 0;
}
.user-panel h2 {
  margin: 0 0 14px;
  color: var(--purple);
}
.user-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: start;
}
.user-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.user-library-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.user-recommend-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.user-progress-list,
.user-order-list,
.user-session-list,
.user-notice-list {
  display: grid;
  gap: 10px;
}
.user-progress-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.user-progress-item img {
  width: 64px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f1fa;
}
.user-progress-item h3 {
  margin: 7px 0 3px;
  color: var(--purple);
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.user-progress-item p,
.user-progress-item small,
.user-muted {
  color: var(--muted);
  line-height: 1.55;
}
.user-order-list a,
.user-session-list article,
.user-notice-list article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.user-order-list strong,
.user-session-list strong,
.user-notice-list strong {
  color: var(--purple);
}
.user-order-list span,
.user-session-list p,
.user-session-list small,
.user-notice-list p,
.user-notice-list small {
  color: var(--muted);
}
.user-session-list article,
.user-notice-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.user-notice-list article {
  grid-template-columns: 38px minmax(0, 1fr);
}
.user-notice-list article > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff1f7;
  color: var(--pink);
}
.user-notice-list .unread {
  border-color: rgba(255,79,145,.34);
  background: #fff9fc;
}
.user-table-wrap {
  overflow-x: auto;
}
.user-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.user-table th,
.user-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.user-table th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}
.user-table td {
  color: var(--purple);
}
.user-order-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
.user-order-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.user-order-summary dt {
  color: var(--muted);
  font-size: .84rem;
}
.user-order-summary dd {
  margin: 4px 0 0;
  color: var(--purple);
  font-weight: 900;
}
.user-avatar-preview {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff1f7;
}
.user-narrow-panel {
  max-width: 640px;
}
.submitted-story-section .section-heading {
  align-items: center;
}
.submitted-story-table td strong,
.submitted-story-table td small {
  display: block;
}
.submitted-story-preview {
  display: grid;
  gap: 18px;
}
.submitted-story-preview-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.submitted-story-cover {
  width: 100%;
  max-width: 280px;
}
.submitted-story-meta {
  display: grid;
  gap: 8px;
}
.submitted-story-meta p {
  margin: 0;
}
@media (max-width: 1080px) {
  .user-dashboard-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .user-stat-grid,
  .user-recommend-grid,
  .user-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .user-dashboard-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1230px);
  }
  .user-sidebar {
    position: static;
  }
  .user-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .user-two-col {
    grid-template-columns: 1fr;
  }
  .user-page-head {
    display: grid;
  }
  .submitted-story-preview-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 540px) {
  .user-stat-grid,
  .user-recommend-grid,
  .user-library-grid,
  .user-mini-grid,
  .user-nav {
    grid-template-columns: 1fr;
  }
  .user-progress-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .user-progress-item .admin-button {
    grid-column: 1 / -1;
  }
  .user-order-summary {
    grid-template-columns: 1fr;
  }
  .user-session-list article {
    grid-template-columns: 1fr;
  }
}

.payment-grid {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}
.payment-card,
.payment-info {
  padding: clamp(18px, 3vw, 28px);
}
.payment-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}
.payment-card h1 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.payment-amount {
  margin: 0;
  color: var(--pink);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 1000;
}
.payment-qr {
  width: min(100%, 360px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.payment-countdown,
.payment-status-line {
  color: var(--muted);
  font-weight: 850;
}
.payment-info h2 {
  margin: 0 0 12px;
  color: var(--purple);
}
.payment-info dl,
.payment-items {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}
.payment-info dl div,
.payment-items div {
  display: grid;
  grid-template-columns: minmax(110px, .5fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.payment-info dt {
  color: var(--muted);
}
.payment-info dd {
  margin: 0;
  color: var(--purple);
  font-weight: 900;
  overflow-wrap: anywhere;
}
.payment-items span {
  color: var(--purple);
  overflow-wrap: anywhere;
}
.payment-items strong {
  color: var(--pink);
  text-align: right;
}
.proof-form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.proof-form p {
  color: var(--muted);
  margin: 0;
}
.muted-text {
  color: var(--muted);
}
.ui-badge-yellow {
  background: rgba(255, 200, 87, .18);
  color: #9a6600;
}
.admin-button.danger {
  background: #fff1f4;
  color: #c12654;
  border-color: rgba(255, 79, 145, .32);
}
.proof-history {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.proof-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.proof-history-item div,
.proof-history-item p {
  min-width: 0;
}
.proof-history-item strong,
.proof-history-item span,
.proof-history-item p {
  overflow-wrap: anywhere;
}
.proof-history-item div span {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  margin-top: 2px;
}
.proof-history-item p {
  grid-column: 1 / -1;
  color: var(--muted);
  margin: 0;
}
.proof-review-list {
  display: grid;
  gap: 16px;
}
.proof-review-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}
.proof-preview {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.proof-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.proof-review-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.proof-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.proof-review-head h2,
.proof-review-head p {
  margin: 0;
  overflow-wrap: anywhere;
}
.proof-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.proof-meta-grid div,
.proof-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  overflow-wrap: anywhere;
}
.proof-meta-grid dt {
  color: var(--muted);
  font-size: .84rem;
}
.proof-meta-grid dd {
  margin: 4px 0 0;
  color: var(--purple);
  font-weight: 850;
}
.proof-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.proof-actions form {
  display: grid;
  gap: 10px;
  margin: 0;
}
.admin-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-settings-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--purple);
  font-weight: 850;
  box-shadow: var(--shadow);
}
.admin-settings-tabs a.active {
  border-color: var(--pink);
  background: #fff1f7;
  color: var(--pink);
}
.seo-settings-form {
  display: grid;
  gap: 14px;
}
.seo-preview {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.seo-social-preview {
  width: min(100%, 420px);
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.reader-content {
  -webkit-user-select: none;
  user-select: none;
}
.detail-actions form {
  margin: 0;
}
@media (max-width: 820px) {
  .payment-grid {
    grid-template-columns: 1fr;
  }
  .proof-review-card,
  .proof-actions,
  .proof-meta-grid {
    grid-template-columns: 1fr;
  }
  .proof-preview {
    max-height: 420px;
  }
}
@media (max-width: 520px) {
  .payment-info dl div,
  .payment-items div {
    grid-template-columns: 1fr;
  }
  .payment-items strong {
    text-align: left;
  }
  .proof-history-item {
    grid-template-columns: 1fr;
  }
  .admin-settings-tabs a {
    width: 100%;
  }
}

/* Performance/responsive hardening overrides */
.admin-table-wrap,
.user-table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.admin-table td,
.admin-table th {
  overflow-wrap: anywhere;
}
.hero-banner {
  aspect-ratio: 2.3 / 1;
  min-height: 0;
}
.promo-banner {
  aspect-ratio: 2.1 / 1;
  min-height: 0;
}
.header-actions,
.audio-controls,
.reader-toolbar {
  min-width: 0;
}
.audio-controls > *,
.reader-toolbar > * {
  min-width: 0;
}
@media (max-width: 1024px) {
  .header-main {
    grid-template-columns: 150px minmax(0, 1fr) auto;
  }
  .hero-banner {
    aspect-ratio: 2 / 1;
  }
  .promo-banner {
    aspect-ratio: 2.2 / 1;
  }
}
@media (max-width: 768px) {
  .search-bar {
    height: 42px;
  }
  .search-bar button {
    width: 58px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading a {
    white-space: normal;
    text-align: right;
  }
  .admin-table {
    min-width: 680px;
  }
  .reader-toolbar {
    gap: 8px;
  }
}
@media (max-width: 430px) {
  .home-shell,
  .discovery-shell,
  .detail-shell,
  .user-dashboard-shell,
  .admin-dashboard {
    width: min(100% - 20px, 1230px);
  }
  .header-main,
  .mobile-nav {
    width: min(100% - 20px, 1230px);
  }
  .hero-banner {
    aspect-ratio: 1.05 / 1;
  }
  .promo-banner {
    aspect-ratio: 1.45 / 1;
  }
  .story-card h3 {
    font-size: .9rem;
  }
  .story-meta,
  .story-card p {
    font-size: .8rem;
  }
  .reader-toolbar > *,
  .reader-toolbar label,
  .reader-toolbar select,
  .audio-controls > * {
    flex-basis: auto;
  }
  .cute-audio-player {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 54vh;
    overflow: auto;
  }
  .audio-reader {
    padding-bottom: 260px;
  }
}
@media (max-width: 375px) {
  .quick-categories {
    grid-template-columns: 1fr;
  }
  .story-grid {
    gap: 10px;
  }
  .story-cover .ui-badge {
    font-size: .68rem;
    padding: 4px 7px;
  }
  .filter-bar,
  .listing-hero {
    padding: 12px;
  }
}
@media (max-width: 320px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
  .header-actions {
    gap: 6px;
  }
  .account-pill {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    flex: 0 0 42px;
  }
  .logo span:last-child {
    display: none;
  }
}

/* Public homepage redesign */
:root {
  --home-width: 1368px;
  --home-pink: #ff5aa2;
  --home-pink-strong: #f24991;
  --home-ink: #29223a;
  --home-soft: #8d879a;
}

.public-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 90;
  background:
    radial-gradient(circle at 2% 0%, rgba(255, 128, 170, .14), transparent 18%),
    radial-gradient(circle at 98% 8%, rgba(255, 128, 170, .14), transparent 15%),
    rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(235,232,244,.95);
  box-shadow: 0 10px 30px rgba(41,34,58,.10);
  overflow: hidden;
}
.public-header::before,
.public-header::after,
.sakura::before,
.sakura::after {
  content: "✿";
  position: absolute;
  color: rgba(255, 124, 164, .42);
  pointer-events: none;
  line-height: 1;
}
.public-header::before { left: 6px; top: 6px; font-size: 34px; transform: rotate(-25deg); }
.public-header::after { right: 22px; bottom: 8px; font-size: 30px; transform: rotate(18deg); }
.sakura-left::before { left: 20px; top: 42px; font-size: 18px; transform: rotate(20deg); }
.sakura-left::after { left: 64px; top: 6px; font-size: 16px; transform: rotate(-16deg); }
.sakura-right::before { right: 58px; top: 12px; font-size: 18px; transform: rotate(-20deg); }
.sakura-right::after { right: 4px; top: 74px; font-size: 18px; transform: rotate(24deg); }

.header-main {
  width: min(100% - 56px, var(--home-width));
  min-height: 76px;
  grid-template-columns: 210px minmax(360px, 1fr) auto;
  gap: 28px;
  position: relative;
  z-index: 1;
}
.logo {
  color: var(--home-pink);
  font-weight: 900;
  font-size: 1.42rem;
  line-height: .86;
  gap: 10px;
}
.logo-cat {
  width: 48px;
  height: 48px;
  border: 2px solid var(--home-pink);
  border-radius: 16px;
  color: var(--home-pink);
  background: #fff;
  box-shadow: 0 10px 26px rgba(255,90,162,.16);
  font-size: 1.25rem;
}
.header-search { max-width: 640px; justify-self: center; width: 100%; }
.search-bar {
  height: 48px;
  border: 1px solid #ece8f1;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(41,34,58,.04);
}
.search-bar input {
  padding: 0 24px;
  color: var(--home-ink);
  font-size: .96rem;
}
.search-bar input::placeholder { color: #9a93a5; }
.search-bar button {
  width: 62px;
  background: var(--home-pink);
  font-size: 1.55rem;
  border-radius: 0 999px 999px 0;
}
.header-actions {
  gap: 24px;
  color: #696278;
  font-size: .92rem;
}
.header-actions a {
  color: #696278;
  font-weight: 650;
}
.header-actions a span:first-child {
  color: #5e5870;
  font-size: 1.3rem;
}
.account-pill {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 7px;
  background: var(--home-pink);
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(255,90,162,.22);
}
.account-pill span:first-child { color: #fff !important; }
.main-nav {
  width: min(100% - 56px, var(--home-width));
  min-height: 44px;
  gap: 0;
  overflow: visible;
}
.main-nav a {
  padding: 16px 26px 14px 0;
  margin-right: 22px;
  color: var(--home-ink);
  font-size: .83rem;
  font-weight: 850;
  letter-spacing: 0;
  border-bottom: 3px solid transparent;
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--home-pink-strong);
  border-color: var(--home-pink-strong);
}

.home-shell {
  width: min(100% - 56px, var(--home-width));
  margin: 16px auto 48px;
  gap: 18px;
}
.hero-layout {
  grid-template-columns: minmax(0, 1.86fr) minmax(360px, 1fr);
  gap: 12px;
}
.hero-banner,
.promo-banner {
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(41,34,58,.08);
  background: #efeaf4;
}
.hero-banner {
  aspect-ratio: 2.52 / 1;
  min-height: 0;
}
.promo-stack { gap: 12px; }
.promo-banner {
  aspect-ratio: 2.9 / 1;
  min-height: 0;
}
.hero-banner::after,
.promo-banner::after {
  background: linear-gradient(90deg, rgba(34,27,51,.72), rgba(34,27,51,.22) 45%, rgba(34,27,51,.02));
}
.hero-copy {
  padding: 36px 44px;
  justify-content: center;
}
.hero-copy h1 {
  max-width: 560px;
  margin: 12px 0 14px;
  font-size: clamp(2rem, 2.85vw, 3.12rem);
  line-height: 1.18;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 18px rgba(26,20,42,.28);
}
.hero-copy p {
  max-width: 500px;
  margin-bottom: 18px;
  font-size: .98rem;
  line-height: 1.7;
}
.btn-primary,
.promo-copy a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: var(--home-pink);
  color: #fff;
  padding: 0 22px;
  font-size: .84rem;
  font-weight: 850;
  text-transform: uppercase;
}
.promo-copy {
  padding: 20px 24px;
  justify-content: center;
}
.promo-copy h2 {
  margin: 9px 0 3px;
  color: #fff;
  font-size: 1.58rem;
  line-height: 1.18;
  font-weight: 900;
}
.promo-copy p {
  color: rgba(255,255,255,.94);
  margin-bottom: 12px;
  font-size: .98rem;
}
.promo-copy a {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.82);
  background: rgba(8,20,40,.28);
  padding-inline: 14px;
}
.ui-badge {
  border-radius: 5px;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 800;
}
.ui-badge-pink { background: var(--home-pink); }
.ui-badge-lavender { background: #84aaf5; }
.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 52px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.86);
  font-size: 3rem;
  line-height: 1;
  transform: translateY(-50%);
}
.hero-arrow-left { left: 14px; }
.hero-arrow-right { right: 14px; }
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.hero-dots span {
  width: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
}
.hero-dots span:first-child {
  width: 22px;
  background: #fff;
}

.quick-categories {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 24px;
  border-radius: 9px;
  border: 1px solid rgba(235,232,244,.95);
  box-shadow: 0 8px 24px rgba(41,34,58,.07);
}
.category-shortcut {
  justify-content: center;
  gap: 10px;
  color: var(--home-ink);
  font-size: .86rem;
  font-weight: 650;
}
.category-icon {
  width: 47px;
  height: 47px;
  border-radius: 50%;
  background: #fff1f7;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}
.category-icon::before {
  content: "♡";
  color: var(--home-pink);
  font-size: 1.35rem;
}
.category-sparkles { background: #eef3ff; }
.category-sparkles::before { content: "♧"; color: #6599f2; }
.category-scroll { background: #fff4e8; }
.category-scroll::before { content: "▤"; color: #c98032; }
.category-building { background: #eafcff; }
.category-building::before { content: "▥"; color: #2db8c4; }
.category-images { background: #e9fbf6; }
.category-images::before { content: "▧"; color: #32b99b; }
.category-headphones { background: #fff1df; }
.category-headphones::before { content: "♫"; color: #eb9335; }
.category-grid { background: #f0ecff; }
.category-grid::before { content: "▦"; color: #8b6df6; }

.section-heading {
  margin: 3px 2px 12px;
}
.section-heading h2 {
  color: var(--home-ink);
  font-size: 1.6rem;
  font-weight: 850;
}
.section-heading a {
  color: var(--home-pink);
  font-size: .82rem;
  font-weight: 650;
}
.story-grid-home,
.story-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 20px;
}
.story-card h3 {
  margin: 10px 0 8px;
  color: var(--home-ink);
  font-size: .93rem;
  line-height: 1.45;
  font-weight: 800;
}
.story-cover {
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(41,34,58,.08);
}
.story-cover .ui-badge {
  top: 7px;
  left: 7px;
  font-size: .72rem;
  padding: 5px 8px;
}
.story-audio-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8b6df6;
  box-shadow: 0 8px 18px rgba(139,109,246,.34);
}
.story-card p,
.story-meta {
  color: var(--home-soft);
  font-size: .82rem;
}
.story-card p strong { color: var(--home-pink); }

.home-lower-panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.home-lower-panels > .card-panel {
  display: grid;
  align-content: start;
}
.content-panels .card-panel {
  border-radius: 12px;
  border: 1px solid rgba(235,232,244,.95);
  box-shadow: 0 8px 24px rgba(41,34,58,.07);
  padding: 20px;
}
.ranking-panel {
  background: linear-gradient(145deg, #fff 45%, #fff0f8 100%);
}
.ranking-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
  overflow: visible;
}
.ranking-tabs button {
  border-radius: 999px;
  background: transparent;
  color: #665e75;
  width: 100%;
  min-width: 0;
  padding: 8px 14px;
  font-size: .86rem;
  line-height: 1.2;
  white-space: nowrap;
}
.ranking-tabs .active {
  background: #fff;
  color: var(--home-pink);
  box-shadow: 0 8px 18px rgba(255,90,162,.13);
}
.ranking-tab-panel[hidden] {
  display: none !important;
}
.story-list-item {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}
.story-list-item img,
.ranking-list img {
  width: 62px;
  height: 78px;
  border-radius: 8px;
}
.ranking-list {
  gap: 8px;
}
.ranking-list a {
  grid-template-columns: 28px 52px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
}
.ranking-list strong {
  line-height: 1.25;
}
.ranking-list small {
  font-size: .8rem;
  line-height: 1.2;
}
.notice-item {
  grid-template-columns: 48px minmax(0,1fr);
  gap: 12px;
  padding: 10px 0;
}
.notice-item > span {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--home-pink);
  background: #fff1f7;
}
.notice-item strong {
  color: var(--home-ink);
  font-size: .92rem;
}
.notice-item small {
  color: #a09aab;
  font-size: .78rem;
}
.notice-item p {
  margin-top: 4px;
  color: var(--home-soft);
  font-size: .84rem;
}

@media (max-width: 1180px) {
  .header-main {
    grid-template-columns: 180px minmax(260px, 1fr) auto;
    gap: 18px;
  }
  .header-actions { gap: 14px; }
  .story-grid-home,
  .story-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .header-main {
    grid-template-columns: 1fr auto;
    position: relative;
  }
  .header-search {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    max-width: none;
    z-index: 3;
  }
  .public-header.search-open { overflow: visible; }
  .public-header.search-open .header-search { display: block; }
  .public-header.search-open .header-search .search-box { box-shadow: 0 16px 36px rgba(41,34,58,.12); border-radius: 999px; }
  .search-toggle { display: inline-grid; }
  .header-actions { gap: 10px; }
  .header-actions a[href$="/lich-su"],
  .header-actions a[href$="/thong-bao"] { display: none; }
  .account-pill {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    border-radius: 8px;
  }
  .account-pill span:first-child {
    width: auto;
    font-size: 1.2rem;
  }
  .account-pill span:last-child { display: none; }
  .hero-layout { grid-template-columns: 1fr; }
  .promo-stack { grid-template-columns: 1fr 1fr; }
  .home-lower-panels { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .header-main,
  .main-nav,
  .home-shell {
    width: min(100% - 24px, var(--home-width));
  }
  .promo-stack { grid-template-columns: 1fr; }
  .story-grid-home,
  .story-grid,
  .quick-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy { padding: 24px; }
  .hero-copy h1 { font-size: 2rem; }
}
