/* Ranoteka light theme. Dark remains the default in ranoteka-v09.css. */
html[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #eaf0f8;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --panel-3: #edf2fa;
  --line: rgba(38, 54, 86, .16);
  --line-strong: rgba(102, 73, 198, .42);
  --text: #1d2638;
  --muted: #647089;
  --accent: #6841d8;
  --accent-2: #9a50dc;
  --pink: #cc3270;
  --danger: #c83658;
  --warning: #a56800;
  --success: #168052;
  color-scheme: light;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% -12%, rgba(126, 91, 226, .14), transparent 36rem),
    radial-gradient(circle at 90% 12%, rgba(222, 106, 183, .08), transparent 28rem),
    linear-gradient(180deg, #f8faff, #f2f5fb 45%, #edf2f9);
  color: var(--text);
}
html[data-theme="light"] body::before {
  opacity: .34;
  background-image: linear-gradient(rgba(56, 74, 112, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 74, 112, .035) 1px, transparent 1px);
}
html[data-theme="light"] .header {
  border-bottom-color: rgba(38, 54, 86, .13);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 30px rgba(42, 60, 98, .10);
}
html[data-theme="light"] .logo {
  background: linear-gradient(100deg, #27334e 0%, #6340bb 62%, #a34fcf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
html[data-theme="light"] .nav { color: #59657d; }
html[data-theme="light"] .nav a:hover,
html[data-theme="light"] .nav a[aria-current="page"] { color: #2f3c58; }
html[data-theme="light"] .header-search {
  border-color: rgba(52, 70, 105, .18);
  background: rgba(255, 255, 255, .92);
}
html[data-theme="light"] .header-search input { color: var(--text); }
html[data-theme="light"] .header-search input::placeholder { color: #8994a9; }
html[data-theme="light"] .header-search button { color: #66738d; }
html[data-theme="light"] .menu-toggle,
html[data-theme="light"] .header-icon {
  border-color: rgba(52, 70, 105, .18);
  background: #fff;
  color: #394762;
}
html[data-theme="light"] .header-icon:hover { border-color: rgba(102, 73, 198, .48); background: #f0ebff; }
html[data-theme="light"] .header-icon .header-mail-glyph { color:#d69d19; text-shadow:0 0 10px rgba(214,157,25,.2); }
html[data-theme="light"] .header-icon b { border-color: #fff; }
html[data-theme="light"] .balance-pill {
  border-color: rgba(52, 70, 105, .18);
  background: #fff;
  color: #5e3db1;
  box-shadow: none;
}
html[data-theme="light"] .balance-pill:hover {
  border-color: rgba(102, 73, 198, .48);
  background: #f0ebff;
}

html[data-theme="light"] .theme-toggle-form { display: contents; }
html[data-theme="light"] .theme-toggle,
.theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(102, 73, 198, .30);
  border-radius: 11px;
  color: #6642c4;
  background: #f1edff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.theme-toggle:hover { border-color: rgba(102, 73, 198, .62); background: #e7e0ff; transform: translateY(-1px); }
.theme-toggle:disabled { cursor: wait; opacity: .65; }
html[data-theme="dark"] .theme-toggle { color: #d5c5ff; border-color: rgba(175, 122, 255, .34); background: rgba(125, 60, 255, .12); }

/* Draw a deliberate crescent in the light theme instead of relying on a thin
   font glyph that can look clipped on some platforms. */
html[data-theme="light"] .theme-toggle { --theme-toggle-surface: #f1edff; }
html[data-theme="light"] .theme-toggle:hover { --theme-toggle-surface: #e7e0ff; }
html[data-theme="light"] .theme-toggle__icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: block;
  font-size: 0;
  line-height: 0;
}
html[data-theme="light"] .theme-toggle__icon::before,
html[data-theme="light"] .theme-toggle__icon::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
html[data-theme="light"] .theme-toggle__icon::before {
  inset: 2px;
  background: currentColor;
}
html[data-theme="light"] .theme-toggle__icon::after {
  width: 15px;
  height: 15px;
  top: -1px;
  left: 7px;
  background: var(--theme-toggle-surface);
}

html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .rail-card,
html[data-theme="light"] .store-section,
html[data-theme="light"] .home-benefits,
html[data-theme="light"] .book-card,
html[data-theme="light"] .stat,
html[data-theme="light"] .notification-item,
html[data-theme="light"] .conversation-user,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .messages-layout,
html[data-theme="light"] .conversation-list,
html[data-theme="light"] .library-tabs,
html[data-theme="light"] .premium-section,
html[data-theme="light"] .premium-book-card,
html[data-theme="light"] .premium-continue__item,
html[data-theme="light"] .premium-promo-carousel {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(42, 60, 98, .07);
}
html[data-theme="light"] .showcase-card,
html[data-theme="light"] .popular-card {
  border-color: var(--line);
  background: linear-gradient(180deg, #fff, #f2f5fb);
}
html[data-theme="light"] .showcase-card__body h3,
html[data-theme="light"] .popular-card h3,
html[data-theme="light"] .book-card h3,
html[data-theme="light"] .premium-book-card__title,
html[data-theme="light"] .premium-continue__item strong { color: var(--text); }
html[data-theme="light"] .showcase-card:hover,
html[data-theme="light"] .book-card:hover { border-color: rgba(102, 73, 198, .55); box-shadow: 0 15px 30px rgba(83, 59, 154, .14); }
html[data-theme="light"] .book-card__cover { background: #e6ebf4; }
html[data-theme="light"] .section-link,
html[data-theme="light"] .premium-section__head a,
html[data-theme="light"] .auth-switch a,
html[data-theme="light"] .auth-links a { color: #6841c8; }
html[data-theme="light"] .muted,
html[data-theme="light"] .premium-book-card__meta,
html[data-theme="light"] .premium-continue__item small { color: var(--muted); }

html[data-theme="light"] .btn {
  border-color: rgba(52, 70, 105, .20);
  color: #27334b;
  background: linear-gradient(180deg, #fff, #edf1f8);
  box-shadow: 0 5px 14px rgba(42, 60, 98, .07);
}
html[data-theme="light"] .btn:hover { border-color: rgba(102, 73, 198, .52); filter: none; background: #f3efff; }
html[data-theme="light"] .btn--primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, #7042dd, #8a45ce); box-shadow: 0 10px 24px rgba(102, 73, 198, .24); }
html[data-theme="light"] .btn--glass { color: #34415c; background: rgba(255, 255, 255, .72); }
html[data-theme="light"] .btn--outline { color: #6841c8; background: transparent; }
html[data-theme="light"] .badge { border-color: rgba(52, 70, 105, .16); color: #4c5a73; background: #f0f3f8; }
html[data-theme="light"] .badge--free { color: #197447; border-color: rgba(25, 133, 80, .25); background: #e7f7ed; }
html[data-theme="light"] .badge--paid { color: #8a5b00; border-color: rgba(165, 104, 0, .25); background: #fff5dc; }

html[data-theme="light"] .input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  border-color: rgba(52, 70, 105, .20);
  color: var(--text);
  background: #fff;
}
html[data-theme="light"] .input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #8a95a9; }
html[data-theme="light"] .input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus { border-color: #7650d7; box-shadow: 0 0 0 3px rgba(118, 80, 215, .13); }
html[data-theme="light"] .notice { color: #78520b; background: #fff8e8; }
html[data-theme="light"] .notice--danger { color: #a22d4b; background: #fff0f3; }
html[data-theme="light"] .notice--success { color: #176d48; background: #eaf9f0; }
html[data-theme="light"] .flash { border-color: rgba(52, 70, 105, .18); color: #27334b; background: #fff; box-shadow: 0 18px 50px rgba(42, 60, 98, .18); }
html[data-theme="light"] table th { color: #52617a; }
html[data-theme="light"] table td { border-color: var(--line); }

html[data-theme="light"] .account-drawer__panel {
  border-color: rgba(102, 73, 198, .30);
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(246,248,253,.99));
  box-shadow: 0 26px 70px rgba(42, 60, 98, .20), 0 0 0 1px rgba(102, 73, 198, .04);
}
html[data-theme="light"] .account-drawer__label { color: #7650c8; }
html[data-theme="light"] .account-drawer__panel a,
html[data-theme="light"] .account-drawer__logout { color: #34415b; }
html[data-theme="light"] .account-drawer__panel a span,
html[data-theme="light"] .account-drawer__logout span { color: #7650c8; }
html[data-theme="light"] .account-drawer__panel a:hover,
html[data-theme="light"] .account-drawer__panel a.is-current,
html[data-theme="light"] .account-drawer__logout:hover { color: #2b214e; background: #f0ebff; }
html[data-theme="light"] .account-drawer__separator { background: rgba(52, 70, 105, .12); }
html[data-theme="light"] .account-drawer__trigger:hover { background: rgba(102, 73, 198, .08); }
html[data-theme="light"] .account-drawer__chevron { color: #7650c8; }
html[data-theme="light"] .account-drawer__panel a.account-drawer__balance {
  border-color: rgba(183, 137, 28, .32);
  background: linear-gradient(135deg, #fff8df, #f4efff);
}
html[data-theme="light"] .account-drawer__panel a.account-drawer__balance:hover {
  border-color: rgba(183, 137, 28, .55);
  background: linear-gradient(135deg, #fff3c4, #eee7ff);
}
html[data-theme="light"] .account-drawer__panel a.account-drawer__balance > .account-drawer__balance-icon {
  color: #a56a00;
  background: rgba(214, 157, 25, .14);
  text-shadow: none;
}
html[data-theme="light"] .account-drawer__panel a.account-drawer__balance > .account-drawer__balance-action {
  color: #8a5a00;
}

html[data-theme="light"] .profile-hero { background: radial-gradient(circle at 15% 15%, rgba(126, 84, 217, .11), transparent 30%), #fff; }
html[data-theme="light"] .profile-meta span { border-color: var(--line); background: #f5f7fb; }
html[data-theme="light"] .rank-pill { border-color: rgba(102, 73, 198, .22); color: #6240b2; background: #f1edff; }
html[data-theme="light"] .rank-progress { background: #e3e8f1; }
html[data-theme="light"] .rank-large > span { border-color: rgba(102, 73, 198, .24); color: #6642c4; background: #f1edff; }
html[data-theme="light"] .continue-card { border-color: var(--line); background: linear-gradient(145deg, #fff, #f3f6fb); }
html[data-theme="light"] .continue-card strong { color: var(--text); }
html[data-theme="light"] .footer { border-top-color: rgba(52, 70, 105, .13); color: #647089; background: rgba(237, 242, 249, .86); }
html[data-theme="light"] .footer-grid strong { color: #34415b; }
html[data-theme="light"] .footer-bottom { border-top-color: rgba(52, 70, 105, .12); }
html[data-theme="light"] .socials span { border-color: var(--line); color: #52617a; background: #fff; }
html[data-theme="light"] .presence-status--online { color: #168052; }
html[data-theme="light"] .friends-panel { background: #fff; }
html[data-theme="light"] .friend-card,
html[data-theme="light"] .friend-request { background: #f8f9fc; }
html[data-theme="light"] .friend-card__main > a,
html[data-theme="light"] .friend-request__identity a { color: var(--text); }
html[data-theme="light"] .friends-empty { background: #fbfcfe; }

/* Keep the footer compact and anchored after short pages. */
body { display: flex; flex-direction: column; }
main.main { width: 100%; flex: 1 0 auto; }
footer.footer {
  flex: 0 0 auto;
  margin-top: auto !important;
  padding: 14px 0 8px !important;
}
footer.footer .footer-grid {
  gap: 18px !important;
  row-gap: 8px !important;
}
footer.footer .footer-grid > div:not(.footer-brand) {
  gap: 5px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}
footer.footer .footer-grid strong { font-size: 13px !important; }
footer.footer .footer-brand p { margin: 6px 0 !important; font-size: 11px !important; line-height: 1.4 !important; }
footer.footer .footer-bottom {
  margin-top: 10px !important;
  padding-top: 8px !important;
  gap: 10px !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}

html[data-theme="light"] .settings-card,
html[data-theme="light"] .settings-notes > div {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 12px 32px rgba(42, 60, 98, .07);
}
html[data-theme="light"] .settings-card__kicker { color: #6841c8; }
html[data-theme="light"] .settings-avatar-preview { border-color: rgba(102, 73, 198, .34); background: linear-gradient(145deg, #eee9ff, #f7eafb); box-shadow: 0 15px 40px rgba(42, 60, 98, .12); }
html[data-theme="light"] .avatar-crop-dialog__backdrop { background:rgba(33,39,58,.56); }
html[data-theme="light"] .avatar-crop-dialog__panel { border-color:rgba(102,73,198,.3); background:linear-gradient(150deg,#fff,#f4f6fb); box-shadow:0 28px 90px rgba(42,60,98,.25); }
html[data-theme="light"] .avatar-crop-dialog__close { background:rgba(255,255,255,.7); }
html[data-theme="light"] .avatar-crop-stage { border-color:rgba(102,73,198,.7); background:#edf0f7; box-shadow:0 0 0 8px rgba(102,73,198,.09),0 18px 45px rgba(42,60,98,.18); }
html[data-theme="light"] .settings-upload { border-color: rgba(102, 73, 198, .35); background: #f8f6ff; }
html[data-theme="light"] .settings-upload:hover,
html[data-theme="light"] .settings-upload.is-dragover { border-color: rgba(102, 73, 198, .7); background: #f1edff; }
html[data-theme="light"] .settings-upload__icon { border-color: rgba(102, 73, 198, .28); color: #6841c8; background: #eee9ff; }
html[data-theme="light"] .settings-theme-option { background: #f8f9fc; }
html[data-theme="light"] .settings-theme-option.is-selected { border-color: rgba(102, 73, 198, .55); background: #f1edff; }
html[data-theme="light"] .settings-inline-link { color: #6841c8; }
html[data-theme="light"] .settings-inline-link:hover { color: #4d2d9f; }

/* Keep the appearance save action readable while it is being pressed or hovered. */
html[data-theme="light"] .settings-card--appearance .btn--primary:hover,
html[data-theme="light"] .settings-card--appearance .btn--primary:focus-visible,
html[data-theme="light"] .settings-card--appearance .btn--primary:active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #7042dd, #8a45ce);
  box-shadow: 0 10px 24px rgba(102, 73, 198, .24);
  filter: brightness(1.04);
}

/* Authentication screens use a second stylesheet with dark literals. */
html[data-theme="light"] .auth-shell .auth-panel,
html[data-theme="light"] .auth-result-card,
html[data-theme="light"] .auth-reset-panel,
html[data-theme="light"] .auth-reset-result,
html[data-theme="light"] .auth-recovery-panel {
  border-color: var(--line);
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 50px rgba(42, 60, 98, .12);
}
html[data-theme="light"] .auth-shell .auth-panel h1,
html[data-theme="light"] .auth-result-card h1,
html[data-theme="light"] .auth-reset-panel h1,
html[data-theme="light"] .auth-reset-result h1,
html[data-theme="light"] .auth-recovery-panel h1 { color: #25324b; }
html[data-theme="light"] .auth-shell .auth-panel p,
html[data-theme="light"] .auth-result-card p,
html[data-theme="light"] .auth-reset-intro,
html[data-theme="light"] .auth-recovery-intro { color: #65728a; }
html[data-theme="light"] .auth-login-brand-copy strong,
html[data-theme="light"] .auth-login-brand-copy span { color: #33415e; }
html[data-theme="light"] .auth-login-icon,
html[data-theme="light"] .auth-reset-icon,
html[data-theme="light"] .auth-recovery-icon { box-shadow: 0 10px 25px rgba(102, 73, 198, .12); }

@media (max-width: 760px) {
  .theme-toggle { width: 40px; height: 40px; flex-basis: 40px; }
}

/* RANOTEKA_LIGHT_THEME_HARDENING_V1
 * The home stylesheet contains historical layout layers with !important
 * dark literals. Keep the light theme readable by overriding those layers
 * in one final, scoped block. Image-led heroes and promo artwork stay dark
 * on purpose; every regular surface gets a light background and dark ink. */
html[data-theme="light"] {
  --text-strong: #182235;
  --text-soft: #4e5d75;
  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --surface-alt: #edf2fa;
  --border-light: rgba(38, 54, 86, .16);
}

html[data-theme="light"] .premium-section__head h2,
html[data-theme="light"] .premium-section h2,
html[data-theme="light"] .section__head h2,
html[data-theme="light"] .section__head h1 {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .premium-section__head > a,
html[data-theme="light"] .premium-section__head a,
html[data-theme="light"] .section-link {
  color: #5d3bb8 !important;
}
html[data-theme="light"] .premium-section__eyebrow {
  color: #6540bd !important;
  border-color: rgba(102, 73, 198, .24) !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .premium-section__eyebrow--hot {
  color: #bd3157 !important;
  border-color: #e5a2b4 !important;
  background: #f9e4ea !important;
  box-shadow: 0 5px 14px rgba(189, 49, 87, .10) !important;
}
html[data-theme="light"] .premium-section__eyebrow:not(.premium-section__eyebrow--hot) {
  color: #6540bd !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
html[data-theme="light"] .premium-section::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .98)) !important;
}

/* Home shelves and cards. Covers remain image-led; text rows are not dark. */
html[data-theme="light"] .premium-filter {
  color: #53617a !important;
  border-color: rgba(52, 70, 105, .18) !important;
  background: #f4f6fb !important;
}
html[data-theme="light"] .premium-filter:hover {
  color: #4f32a3 !important;
  border-color: rgba(102, 73, 198, .42) !important;
  background: #eeeaff !important;
}
html[data-theme="light"] .premium-filter.is-active {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #7042dd, #8a45ce) !important;
}
html[data-theme="light"] .premium-book-card {
  color: var(--text-strong) !important;
  border-color: var(--border-light) !important;
  background: linear-gradient(180deg, #fff, #f5f7fb) !important;
  box-shadow: 0 10px 24px rgba(42, 60, 98, .12) !important;
}
html[data-theme="light"] .premium-book-card__body {
  color: var(--text-strong) !important;
  background: #fff !important;
}
html[data-theme="light"] .premium-book-card__title {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .premium-book-card__ratings span,
html[data-theme="light"] .premium-book-card__ratings small,
html[data-theme="light"] .premium-book-card__footer {
  color: var(--text-soft) !important;
}
html[data-theme="light"] .premium-book-card__ratings b { color: #a36a00 !important; }
html[data-theme="light"] .premium-book-card__ratings span:nth-child(2) b { color: #6540bd !important; }
html[data-theme="light"] .premium-book-strip__arrow {
  color: #33415c !important;
  border-color: rgba(52, 70, 105, .2) !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 8px 20px rgba(42, 60, 98, .16) !important;
}
html[data-theme="light"] .premium-book-strip__arrow:hover {
  color: #4f32a3 !important;
  background: #f0ebff !important;
}

html[data-theme="light"] .premium-continue__card,
html[data-theme="light"] .premium-continue__item {
  color: var(--text-strong) !important;
  border-color: var(--border-light) !important;
  background: linear-gradient(145deg, #fff, #f3f6fb) !important;
  box-shadow: 0 10px 24px rgba(42, 60, 98, .10) !important;
}
html[data-theme="light"] .premium-continue__card strong,
html[data-theme="light"] .premium-continue__item strong { color: var(--text-strong) !important; }
html[data-theme="light"] .premium-continue__card small,
html[data-theme="light"] .premium-continue__item small { color: var(--text-soft) !important; }
html[data-theme="light"] .premium-continue__card b,
html[data-theme="light"] .premium-continue__item b { color: #6841c8 !important; }

html[data-theme="light"] .premium-fandom {
  color: var(--text-strong) !important;
  border-color: transparent !important;
  background-color: transparent !important;
}
html[data-theme="light"] .premium-fandom__body strong { color: var(--text-strong) !important; }
html[data-theme="light"] .premium-fandom__body span { color: var(--text-soft) !important; }
html[data-theme="light"] .premium-fandom:hover .premium-fandom__body strong { color: #5b38b3 !important; }
html[data-theme="light"] .public-chat-preview > .panel,
html[data-theme="light"] .public-chat__message { color: var(--text-strong) !important; }
html[data-theme="light"] .public-chat__message p { color: var(--text-strong) !important; }
html[data-theme="light"] .public-chat__write,
html[data-theme="light"] .public-chat__forwarded a,
html[data-theme="light"] .public-chat__quote span { color: #6841c8; }
html[data-theme="light"] .public-chat__write:hover { color: #4d2d9f; }
html[data-theme="light"] .public-chat__quote,
html[data-theme="light"] .chat-compose__context { border-left-color: rgba(102, 73, 198, .55); background: #f1edff; }
html[data-theme="light"] .chat-compose__context.is-error { border-left-color: #c83658; color: #a22d4b; background: #fff0f3; }
html[data-theme="light"] .public-chat__quote strong,
html[data-theme="light"] .chat-compose__context { color: var(--text-strong); }
html[data-theme="light"] .public-chat__action { color: #647089; }
html[data-theme="light"] .public-chat__action:hover,
html[data-theme="light"] .public-chat__action:focus-visible { border-color: rgba(102, 73, 198, .32); color: #394762; background: #f1edff; }
html[data-theme="light"] .public-chat__action--like.is-liked { border-color: rgba(204, 50, 112, .28); color: #b32a61; background: #fff0f4; }
html[data-theme="light"] .chat-compose__cancel:hover { background: rgba(52, 70, 105, .08); }

/* Catalog, book details, comments and ordinary content panels. */
html[data-theme="light"] .book-card,
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .stat,
html[data-theme="light"] .chapter,
html[data-theme="light"] .rating-panel,
html[data-theme="light"] .comment,
html[data-theme="light"] .comment-form,
html[data-theme="light"] .empty-comments,
html[data-theme="light"] .book-taxonomy,
html[data-theme="light"] .package-panel {
  color: var(--text-strong) !important;
  border-color: var(--border-light) !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(42, 60, 98, .07) !important;
}
html[data-theme="light"] .book-card h3,
html[data-theme="light"] .book-info h1,
html[data-theme="light"] .book-info__description,
html[data-theme="light"] .chapter__title strong,
html[data-theme="light"] .comment__body p,
html[data-theme="light"] .comment-form h3,
html[data-theme="light"] .rating-panel h2,
html[data-theme="light"] .package-panel h2,
html[data-theme="light"] .package-panel h3 {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .book-info__description,
html[data-theme="light"] .comment__body p { color: #4e5d75 !important; }
html[data-theme="light"] .book-rating-line,
html[data-theme="light"] .meta-line,
html[data-theme="light"] .chapter__title span,
html[data-theme="light"] .comment__body header span,
html[data-theme="light"] .comment__body time,
html[data-theme="light"] .comment-form__bottom small,
html[data-theme="light"] .empty-comments,
html[data-theme="light"] .field-hint {
  color: var(--text-soft) !important;
}
html[data-theme="light"] .book-rating-line b,
html[data-theme="light"] .rating-score > strong { color: #9c6500 !important; }
html[data-theme="light"] .book-rating-line__metric > small { color: #65728a !important; }
html[data-theme="light"] .rating-panel__item { border-color: var(--border-light) !important; background: #f7f9fd !important; }
html[data-theme="light"] .rating-panel__heading > div:first-child > strong { color: var(--text-strong) !important; }
html[data-theme="light"] .rating-panel__heading > div:first-child > small { color: var(--text-soft) !important; }
html[data-theme="light"] .rating-panel__item--translation .stars { color: #7e55c5 !important; }
html[data-theme="light"] .book-taxonomy { background: #f7f9fd !important; }
html[data-theme="light"] .book-taxonomy__label { color: #5d6a80 !important; }
html[data-theme="light"] .genre-cloud span,
html[data-theme="light"] .badge--fandom {
  color: #6340b6 !important;
  border-color: rgba(102, 73, 198, .24) !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .chapter { background: #f7f9fd !important; }
html[data-theme="light"] .chapter:hover { border-color: rgba(102, 73, 198, .44) !important; }
html[data-theme="light"] .package-button {
  color: var(--text-strong) !important;
  border-color: rgba(102, 73, 198, .26) !important;
  background: linear-gradient(145deg, #fff, #f1edff) !important;
}
html[data-theme="light"] .package-button strong { color: #4d347f !important; }
html[data-theme="light"] .package-button small { color: #66738a !important; }
html[data-theme="light"] .package-button del { color: #7d879a !important; }
html[data-theme="light"] .promo-book-panel { color:var(--text-strong); border-color:var(--border-light); background:#fff; box-shadow:0 8px 22px rgba(42,60,98,.06); }
html[data-theme="light"] .promo-book-panel summary:hover { background:#f5f2ff; }
html[data-theme="light"] .promo-book-panel__summary-copy strong { color:var(--text-strong); }
html[data-theme="light"] .promo-book-panel__summary-copy small,
html[data-theme="light"] .promo-book-panel__chevron { color:var(--text-soft); }
html[data-theme="light"] .promo-book-panel__body { border-top-color:var(--border-light); }
html[data-theme="light"] .remaining-package-offer { border-color:rgba(214,157,25,.34) !important; background:linear-gradient(145deg,#fffaf0,#fff) !important; }
html[data-theme="light"] .remaining-package-offer__count { border-color:rgba(214,157,25,.42); color:#a86d00; background:#fff4d4; }
html[data-theme="light"] .remaining-package-offer__summary > strong { color:#9c6500; }
html[data-theme="light"] .remaining-package-offer__summary > small { color:#8a6b24; }
html[data-theme="light"] .confirm-modal__backdrop { background:rgba(33,39,58,.52); }
html[data-theme="light"] .confirm-modal__dialog { border-color:rgba(102,73,198,.34); background:linear-gradient(145deg,#fff,#f4f6fb); color:#1d2638; box-shadow:0 28px 90px rgba(42,60,98,.28); }
html[data-theme="light"] .confirm-modal__dialog h2 { color:#1d2638; }
html[data-theme="light"] .confirm-modal__dialog p { color:#647089; }
html[data-theme="light"] .confirm-modal__icon { box-shadow:0 12px 28px rgba(102,73,198,.2); }
html[data-theme="light"] .rating-choices span {
  color: #53617a !important;
  border-color: rgba(52, 70, 105, .2) !important;
  background: #f5f7fb !important;
}
html[data-theme="light"] .rating-form > span { color: var(--text-soft) !important; }

/* Reader: the page is a paper surface in light mode, with comfortable ink. */
html[data-theme="light"] .reader-toolbar {
  border-color: var(--border-light) !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 8px 24px rgba(42, 60, 98, .10) !important;
}
html[data-theme="light"] .reader {
  color: #293247 !important;
  border-color: var(--border-light) !important;
  background: #fff !important;
  box-shadow: 0 14px 36px rgba(42, 60, 98, .10) !important;
}
html[data-theme="light"] .reader h1,
html[data-theme="light"] .reader p { color: #293247 !important; }
html[data-theme="light"] .reader-book-title { color: #6841c8 !important; }
html[data-theme="light"] .reader-discussion .section__head h2 { color: var(--text-strong) !important; }
html[data-theme="light"] .reader-completion { border-color: rgba(102,73,198,.24); background: linear-gradient(145deg,#fff,#f4f6fb); box-shadow: 0 12px 30px rgba(42,60,98,.08); }
html[data-theme="light"] .reader-completion__head h2 { color: var(--text-strong); }
html[data-theme="light"] .completion-recommendation { color: var(--text-strong); border-color: var(--border-light); background: #fff; }
html[data-theme="light"] .completion-recommendation:hover { border-color: rgba(102,73,198,.52); background: #f4f0ff; }
html[data-theme="light"] .completion-recommendation img { background: #e8edf5; }
html[data-theme="light"] .completion-recommendation small { color: var(--text-soft); }
html[data-theme="light"] .completion-recommendation em { color: #6841c8; }
html[data-theme="light"] .reader-completion__empty { border-color: rgba(52,70,105,.22); color: var(--text-soft); }
html[data-theme="light"] .notification-item { color: var(--text-strong) !important; border-color: var(--border-light); background: #fbfaf7; }
html[data-theme="light"] .notification-item.is-unread { border-color: rgba(102,73,198,.36); background: linear-gradient(120deg,#f4f0ff,#fbfaf7); }
html[data-theme="light"] .notification-item strong { color: var(--text-strong); font-size: 15px; }
html[data-theme="light"] .notification-item p { color: #53617a; font-size: 13px; }
html[data-theme="light"] .notification-item small { color: #66738a; font-size: 10px; }
html[data-theme="light"] .notification-icon { color: #6841c8; border-color: rgba(102,73,198,.28); background: #f0ebff; }
html[data-theme="light"] .rank-upgrade-notice { border-color: rgba(214,157,25,.42); background: linear-gradient(110deg,#fff8e8,#fff); }
html[data-theme="light"] .rank-upgrade-notice h2 { color: var(--text-strong); }
html[data-theme="light"] .rank-upgrade-notice p { color: var(--text-soft); }

/* Forms, legal pages, admin tables and secondary text. */
html[data-theme="light"] .field label,
html[data-theme="light"] .catalog-filter-grid legend,
html[data-theme="light"] legend { color: #34415b !important; }
html[data-theme="light"] .check-row,
html[data-theme="light"] .prose,
html[data-theme="light"] .claims-intro p { color: #4e5d75 !important; }
html[data-theme="light"] .check-row a,
html[data-theme="light"] .prose a { color: #5f3ab5 !important; }
html[data-theme="light"] .code { color: #53617a !important; }
html[data-theme="light"] .prose h2 { color: var(--text-strong) !important; }
html[data-theme="light"] .legal-status { color: #775313 !important; background: #fff8e8 !important; }
html[data-theme="light"] .data-table b { color: #4e397e !important; }
html[data-theme="light"] .claims-intro,
html[data-theme="light"] .claim-steps span { color: var(--text-strong) !important; }
html[data-theme="light"] .claim-steps span { background: #fff !important; }
html[data-theme="light"] table th { color: #53617a !important; }
html[data-theme="light"] table td { color: var(--text-strong) !important; }
html[data-theme="light"] .input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  color: var(--text-strong) !important;
  border-color: rgba(52, 70, 105, .22) !important;
  background: #fff !important;
}
html[data-theme="light"] .input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #8490a5 !important; }

/* Keep status/CTA colors intentional rather than inheriting white text. */
html[data-theme="light"] .notice { color: #775313 !important; background: #fff8e8 !important; }
html[data-theme="light"] .notice--danger { color: #a22d4b !important; background: #fff0f3 !important; }
html[data-theme="light"] .notice--success { color: #176d48 !important; background: #eaf9f0 !important; }
html[data-theme="light"] .badge { color: #4e5d75 !important; background: #f0f3f8 !important; }
html[data-theme="light"] .btn--danger { color: #a22d4b !important; background: #fff0f3 !important; }

/* Authentication result/recovery surfaces share the same readable ink. */
html[data-theme="light"] .auth-shell .auth-panel,
html[data-theme="light"] .auth-result-card,
html[data-theme="light"] .auth-reset-panel,
html[data-theme="light"] .auth-reset-result,
html[data-theme="light"] .auth-recovery-panel,
html[data-theme="light"] .auth-story-shell,
html[data-theme="light"] .auth-login-shell {
  color: var(--text-strong) !important;
  border-color: var(--border-light) !important;
  background: #fff !important;
}
html[data-theme="light"] .auth-shell h1,
html[data-theme="light"] .auth-shell h2,
html[data-theme="light"] .auth-shell strong,
html[data-theme="light"] .auth-result-card h1,
html[data-theme="light"] .auth-reset-panel h1,
html[data-theme="light"] .auth-recovery-panel h1 { color: var(--text-strong) !important; }
html[data-theme="light"] .auth-shell p,
html[data-theme="light"] .auth-shell .muted,
html[data-theme="light"] .auth-shell .field-hint,
html[data-theme="light"] .auth-result-card > .muted,
html[data-theme="light"] .auth-result-card .notice,
html[data-theme="light"] .auth-reset-intro,
html[data-theme="light"] .auth-recovery-intro { color: var(--text-soft) !important; }

/* Dark hero/promo copy stays white because it sits over artwork. */
html[data-theme="light"] .top-hero h1,
html[data-theme="light"] .top-hero p,
html[data-theme="light"] .premium-hero h1,
html[data-theme="light"] .premium-hero p,
html[data-theme="light"] .premium-promo,
html[data-theme="light"] .premium-promo strong,
html[data-theme="light"] .premium-promo small,
html[data-theme="light"] .premium-promo b { color: #fff !important; }

/* Book purchase area: keep the optional promo code compact and below the offers. */
.package-panel {
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 16px !important;
}
.package-panel > * {
  grid-column: 1 !important;
  min-width: 0 !important;
}
.package-panel > .package-grid {
  align-self: start !important;
  width: 100% !important;
}
.package-grid { min-width: 0; }

/* Catalog filters: readable labels and a compact, top-aligned sort control. */
.catalog-filter-grid legend,
.catalog-filter-grid > .field > label {
  font-size: 13px !important;
  line-height: 1.3 !important;
}
.catalog-option {
  gap: 9px !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}
.catalog-option input {
  width: 16px !important;
  height: 16px !important;
  margin-top: 1px !important;
}
.catalog-options {
  max-height: 190px !important;
  gap: 8px !important;
}
.catalog-filter-grid > .field {
  align-self: start !important;
  align-content: start !important;
  gap: 9px !important;
}
.catalog-filter-grid > .field .input {
  min-height: 48px !important;
  height: 48px !important;
}

@media (max-width: 760px) {
  .catalog-option { font-size: 14px !important; }
  .catalog-filter-grid legend,
  .catalog-filter-grid > .field > label { font-size: 14px !important; }
}

/* Book proposal page: make the allowance, form and history read as one flow. */
.proposals-page { padding-top: 4px; }
.proposal-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}
.proposal-intro h1 { margin: 10px 0 10px; }
.proposal-intro p { max-width: 720px; margin: 0; line-height: 1.65; }
.proposal-ranks-link { flex: 0 0 auto; white-space: nowrap; }
.proposal-allowance {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 22px 24px;
  border-color: rgba(151, 103, 255, .34) !important;
  background: linear-gradient(135deg, rgba(48, 28, 92, .92), rgba(18, 21, 38, .96)) !important;
  box-shadow: 0 16px 34px rgba(24, 12, 62, .18) !important;
}
.proposal-allowance__count {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 86px;
  padding-right: 24px;
  border-right: 1px solid rgba(198, 165, 255, .25);
}
.proposal-allowance__count strong { color: #fff; font-size: 42px; line-height: 1; }
.proposal-allowance__count span { color: #d3c0f6; font-size: 12px; font-weight: 800; }
.proposal-allowance__copy { min-width: 0; }
.proposal-allowance__copy h2 { margin: 0 0 6px; font-size: 20px; }
.proposal-allowance__copy p { margin: 0; color: #e1d9f3; line-height: 1.55; }
.proposal-allowance__copy small { display: block; margin-top: 8px; color: #aea4c6; line-height: 1.45; }
.proposal-form { gap: 18px; }
.proposal-form__head { padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.proposal-form__head h2 { margin: 0 0 6px; }
.proposal-form__head p { margin: 0; line-height: 1.5; }
.proposal-form > .btn { justify-self: start; }
.proposal-history { margin-top: 30px; }
.proposal-history .section__head { margin-bottom: 14px; }
.proposal-history .section__head h2 { margin-bottom: 5px; }
.proposal-history .section__head p { margin: 0; }
.proposal-list { display: grid; gap: 10px; }
.proposal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: start;
}
.proposal-row > div { display: grid; gap: 5px; min-width: 0; }
.proposal-row strong { overflow-wrap: anywhere; }
.proposal-row small { overflow-wrap: anywhere; color: var(--muted); }
.proposal-row > .muted { grid-column: 1 / -1; margin: 0; line-height: 1.5; }

html[data-theme="light"] .proposal-allowance {
  border-color: rgba(102, 73, 198, .24) !important;
  background: linear-gradient(135deg, #f0ebff, #f8f9fd) !important;
  box-shadow: 0 16px 34px rgba(42, 60, 98, .10) !important;
}
html[data-theme="light"] .proposal-allowance__count { border-color: rgba(102, 73, 198, .20); }
html[data-theme="light"] .proposal-allowance__count strong { color: #5d3bb8; }
html[data-theme="light"] .proposal-allowance__count span { color: #6841c8; }
html[data-theme="light"] .proposal-allowance__copy h2 { color: var(--text-strong); }
html[data-theme="light"] .proposal-allowance__copy p { color: #3f4d66; }
html[data-theme="light"] .proposal-allowance__copy small { color: #65728a; }

@media (max-width: 700px) {
  .proposal-intro { align-items: stretch; flex-direction: column; gap: 14px; }
  .proposal-ranks-link { align-self: flex-start; }
  .proposal-allowance { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .proposal-allowance__count { min-height: 0; padding: 0 0 16px; border-right: 0; border-bottom: 1px solid rgba(198, 165, 255, .25); }
  html[data-theme="light"] .proposal-allowance__count { border-bottom-color: rgba(102, 73, 198, .20); }
  .proposal-form > .btn { width: 100%; }
  .proposal-row { grid-template-columns: 1fr; gap: 10px; }
  .proposal-row > .badge { justify-self: start; }
}

/* Book taxonomy chips are real catalog filters, not decorative labels. */
.book-taxonomy { gap: 13px !important; }
.book-taxonomy__label { font-size: 13px !important; }
.book-taxonomy__row .badges { gap: 8px 9px !important; }
.book-taxonomy .taxonomy-link {
  min-height: 33px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  color: #d7dced !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.book-taxonomy .taxonomy-link:hover,
.book-taxonomy .taxonomy-link:focus-visible {
  color: #fff !important;
  border-color: rgba(174, 119, 255, .72) !important;
  background: rgba(119, 57, 205, .28) !important;
  transform: translateY(-1px);
}
.book-taxonomy .taxonomy-link.badge--fandom { color: #eadcff !important; }
html[data-theme="light"] .book-taxonomy .taxonomy-link { color: #4e5d75 !important; }
html[data-theme="light"] .book-taxonomy .taxonomy-link:hover,
html[data-theme="light"] .book-taxonomy .taxonomy-link:focus-visible {
  color: #5533a8 !important;
  border-color: rgba(102, 73, 198, .48) !important;
  background: #e9e3ff !important;
}
html[data-theme="light"] .book-taxonomy .taxonomy-link.badge--fandom { color: #6340b6 !important; }

@media (max-width: 620px) {
  .book-taxonomy .taxonomy-link { font-size: 13px !important; }
}

/* Shared switch between direct messages and the public chat. */
.messages-mode-switch {
  display: inline-flex;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid rgba(159, 102, 255, .32);
  border-radius: 13px;
  background: rgba(12, 15, 29, .78);
  scrollbar-width: none;
}
.messages-mode-switch::-webkit-scrollbar { display: none; }
.messages-mode-switch__link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #aeb6ca;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.messages-mode-switch__link > span { font-size: 16px; line-height: 1; }
.messages-mode-switch__link:hover,
.messages-mode-switch__link:focus-visible {
  color: #f4efff;
  border-color: rgba(173, 117, 255, .48);
  background: rgba(119, 57, 205, .22);
  transform: translateY(-1px);
}
.messages-mode-switch__link.is-active {
  color: #fff;
  border-color: rgba(184, 126, 255, .62);
  background: linear-gradient(135deg, #7132eb, #9343dd);
  box-shadow: 0 8px 20px rgba(91, 42, 196, .26);
}
html[data-theme="light"] .messages-mode-switch {
  border-color: rgba(102, 73, 198, .24);
  background: #f4f1fb;
}
html[data-theme="light"] .messages-mode-switch__link { color: #59657d; }
html[data-theme="light"] .messages-mode-switch__link:hover,
html[data-theme="light"] .messages-mode-switch__link:focus-visible {
  color: #4f329c;
  border-color: rgba(102, 73, 198, .38);
  background: #e9e3ff;
}
html[data-theme="light"] .messages-mode-switch__link.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7042dd, #8a45ce);
}
@media (max-width: 620px) {
  .messages-mode-switch { display: flex; width: 100%; }
  .messages-mode-switch__link { min-width: 0; flex: 1 1 0; padding-inline: 10px; font-size: 12px; }
}

/* Give the catalog title a little more hierarchy without enlarging other page headings. */
.catalog-page > .section__head h1 { font-size: 34px; line-height: 1.1; }
@media (max-width: 620px) {
  .catalog-page > .section__head h1 { font-size: 30px; }
}

.top-hero[data-autoplay="false"] .hero-progress { display: none !important; }

/* Compact footer spacing while keeping the established type scale intact. */
footer.footer {
  margin-top: 10px !important;
  padding: 20px 0 10px !important;
}
footer.footer .footer-grid {
  gap: 24px !important;
  row-gap: 12px !important;
}
footer.footer .footer-grid > div:not(.footer-brand) { gap: 6px !important; }
footer.footer .footer-brand p { margin: 8px 0 !important; line-height: 1.45 !important; }
footer.footer .footer-bottom {
  margin-top: 14px !important;
  padding-top: 10px !important;
  gap: 12px !important;
}
@media (max-width: 760px) {
  footer.footer { padding: 16px 14px 12px !important; }
  footer.footer .footer-grid { gap: 16px 14px !important; row-gap: 12px !important; }
  footer.footer .footer-grid > div:not(.footer-brand) { gap: 6px !important; }
  footer.footer .footer-brand { margin-bottom: 12px !important; }
}

/* Library tabs use one vertical book-card geometry across bookmarks and purchases. */
.library-tabs [data-tab-panel="library"] .grid,
.library-tabs [data-tab-panel="purchases"] .grid {
  align-items: stretch;
}
.library-tabs [data-tab-panel="library"] .book-card,
.library-tabs [data-tab-panel="purchases"] .book-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.library-tabs [data-tab-panel="library"] .book-card__main,
.library-tabs [data-tab-panel="purchases"] .book-card__main {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
}
.library-tabs [data-tab-panel="library"] .book-card__cover,
.library-tabs [data-tab-panel="purchases"] .book-card__cover {
  flex: 0 0 auto !important;
  aspect-ratio: 2 / 3 !important;
}
.library-tabs [data-tab-panel="library"] .book-card__body,
.library-tabs [data-tab-panel="purchases"] .book-card__body {
  display: flex !important;
  height: 82px !important;
  min-height: 82px !important;
  overflow: hidden !important;
  align-items: flex-start !important;
  padding: 10px !important;
}
.library-tabs [data-tab-panel="library"] .book-card h3,
.library-tabs [data-tab-panel="purchases"] .book-card h3 {
  display: -webkit-box !important;
  max-height: 3.96em !important;
  margin: 0 !important;
  overflow: hidden !important;
  line-height: 1.32 !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

/* Warm-neutral light surfaces keep the page and book-card bodies visually
 * connected without turning the interface into a yellow/beige palette. */
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 50% -12%, rgba(126, 91, 226, .12), transparent 36rem),
    radial-gradient(circle at 90% 12%, rgba(222, 106, 183, .06), transparent 28rem),
    linear-gradient(180deg, #fafaf8, #f4f5f2 45%, #eef1ee) !important;
}
html[data-theme="light"] {
  --panel: #fbfaf7;
  --panel-2: #f6f5f1;
  --panel-3: #eeefeb;
  --surface: #fbfaf7;
  --surface-muted: #f4f3ef;
  --surface-alt: #eceeea;
}
html[data-theme="light"] .header,
html[data-theme="light"] .header-search,
html[data-theme="light"] .menu-toggle,
html[data-theme="light"] .header-icon,
html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .book-card,
html[data-theme="light"] .stat,
html[data-theme="light"] .notification-item,
html[data-theme="light"] .conversation-user,
html[data-theme="light"] .chat-panel,
html[data-theme="light"] .messages-layout,
html[data-theme="light"] .conversation-list,
html[data-theme="light"] .library-tabs,
html[data-theme="light"] .premium-section,
html[data-theme="light"] .premium-book-card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .settings-notes > div,
html[data-theme="light"] .profile-hero {
  background-color: #fbfaf7 !important;
}
html[data-theme="light"] .premium-book-card,
html[data-theme="light"] .book-card {
  background: linear-gradient(180deg, #fbfaf7, #f5f4f0) !important;
}
html[data-theme="light"] .premium-book-card__body,
html[data-theme="light"] .book-card__body {
  background: #fbfaf7 !important;
}
html[data-theme="light"] .premium-section::after {
  background: linear-gradient(90deg, transparent, rgba(251, 250, 247, .98)) !important;
}
html[data-theme="light"] .premium-filter {
  background: #f4f3ef !important;
}
html[data-theme="light"] .premium-book-strip__arrow,
html[data-theme="light"] .top-hero__arrow {
  background: rgba(251, 250, 247, .96) !important;
}
html[data-theme="light"] .input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #fdfcf9 !important;
}
html[data-theme="light"] .header-search__results {
  border-color: rgba(102, 73, 198, .24);
  background: rgba(251, 250, 247, .98);
  box-shadow: 0 18px 46px rgba(42, 60, 98, .16);
}
html[data-theme="light"] .header-search__result { color: var(--text-strong); }
html[data-theme="light"] .header-search__result:hover,
html[data-theme="light"] .header-search__result:focus-visible,
html[data-theme="light"] .header-search__result.is-active {
  border-color: rgba(102, 73, 198, .28);
  background: #f0ebff;
}
html[data-theme="light"] .header-search__result img { background: #e7e9e5; }
html[data-theme="light"] .header-search__result-copy strong { color: var(--text-strong); }
html[data-theme="light"] .header-search__result-copy small,
html[data-theme="light"] .header-search__empty { color: var(--text-soft); }

/* The book-of-the-day hero follows the selected theme; managed promo banners
 * keep their own artwork and full-bleed treatment below the hero. */
html[data-theme="light"] .home-premium .premium-hero {
  border-color: transparent !important;
  background: var(--surface) !important;
  box-shadow: 0 14px 34px rgba(42, 60, 98, .09) !important;
}
html[data-theme="light"] .home-premium .premium-hero__slide {
  background: linear-gradient(135deg, #fff 0%, #f4f6fb 100%) !important;
}
html[data-theme="light"] .home-premium .premium-hero__shade {
  background:
    radial-gradient(circle at 12% 15%, rgba(112, 71, 215, .10), transparent 32%),
    radial-gradient(circle at 88% 76%, rgba(224, 79, 164, .08), transparent 35%),
    linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0)) !important;
}
html[data-theme="light"] .home-premium .premium-hero__art {
  border-color: rgba(52, 70, 105, .18) !important;
  box-shadow: 0 18px 34px rgba(42, 60, 98, .18), 0 0 0 6px rgba(52, 70, 105, .035) !important;
}
html[data-theme="light"] .home-premium .premium-hero h1 {
  color: var(--text-strong) !important;
  text-shadow: none !important;
}
html[data-theme="light"] .home-premium .premium-hero__description {
  color: var(--text-soft) !important;
  text-shadow: none !important;
}
html[data-theme="light"] .home-premium .premium-hero__tags span {
  color: #4e5d75 !important;
  border-color: rgba(52, 70, 105, .14) !important;
  background: rgba(255, 255, 255, .78) !important;
}
html[data-theme="light"] .home-premium .premium-hero__stats {
  color: #647089 !important;
}
html[data-theme="light"] .home-premium .premium-hero__history-rating,
html[data-theme="light"] .home-premium .premium-hero__history-rating > span {
  color: #d52d79 !important;
}
html[data-theme="light"] .home-premium .premium-hero__history-rating > span {
  text-shadow: 0 0 10px rgba(213, 45, 121, .28);
}
html[data-theme="light"] .home-premium .premium-hero__heart {
  color: #35425c !important;
  border-color: rgba(52, 70, 105, .18) !important;
  background: rgba(255, 255, 255, .86) !important;
  box-shadow: 0 6px 16px rgba(42, 60, 98, .08) !important;
}
html[data-theme="light"] .home-premium .premium-hero__heart:hover,
html[data-theme="light"] .home-premium .premium-hero__heart.is-active {
  color: #d52d79 !important;
  border-color: rgba(213, 45, 121, .48) !important;
  background: #fff0f4 !important;
}
html[data-theme="light"] .home-premium .top-hero__arrow {
  color: #35425c !important;
  border-color: rgba(52, 70, 105, .18) !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: 0 8px 20px rgba(42, 60, 98, .14) !important;
}
html[data-theme="light"] .home-premium .top-hero__arrow:hover {
  color: #4f32a3 !important;
  border-color: rgba(102, 73, 198, .42) !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .home-premium .premium-hero__dots button,
html[data-theme="light"] .home-premium .premium-hero__dots [data-hero-dot] {
  background: rgba(52, 70, 105, .24) !important;
}
html[data-theme="light"] .home-premium .premium-hero__dots button.is-active,
html[data-theme="light"] .home-premium .premium-hero__dots [data-hero-dot].is-active {
  background: #6841c8 !important;
  box-shadow: 0 0 12px rgba(102, 73, 198, .24) !important;
}

/* Top-up dialog: use the same warm light surface as the rest of the light
 * theme. The modal has intentionally rich dark defaults in the home sheet,
 * so every readable surface and action is scoped here explicitly. */
html[data-theme="light"] .sparks-modal {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .sparks-modal::backdrop {
  background: rgba(33, 39, 58, .52) !important;
}
html[data-theme="light"] .sparks-modal__shell {
  border-color: rgba(102, 73, 198, .26) !important;
  background: linear-gradient(180deg, #fffefa 0%, #fbfaf7 100%) !important;
  box-shadow: 0 30px 90px rgba(42, 60, 98, .28), 0 0 0 1px rgba(102, 73, 198, .04) !important;
}
html[data-theme="light"] .sparks-modal__content {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .sparks-modal__close {
  border-color: rgba(52, 70, 105, .18) !important;
  color: #394762 !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 8px 22px rgba(42, 60, 98, .13) !important;
}
html[data-theme="light"] .sparks-modal__close:hover {
  border-color: rgba(102, 73, 198, .48) !important;
  color: #5533a8 !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .sparks-topup-head__eyebrow,
html[data-theme="light"] .sparks-custom-amount__eyebrow {
  color: #6841c8 !important;
}
html[data-theme="light"] .sparks-topup-head h2,
html[data-theme="light"] .sparks-custom-amount__head h3 {
  color: var(--text-strong) !important;
}
html[data-theme="light"] .sparks-topup-head p,
html[data-theme="light"] .sparks-custom-amount__description,
html[data-theme="light"] .sparks-custom-amount form small,
html[data-theme="light"] .sparks-custom-amount > p:last-child {
  color: var(--text-soft) !important;
}

html[data-theme="light"] .sparks-modal .sparks-carousel__arrow {
  border-color: rgba(52, 70, 105, .2) !important;
  color: #394762 !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 10px 24px rgba(42, 60, 98, .16) !important;
}
html[data-theme="light"] .sparks-modal .sparks-carousel__arrow:hover:not(:disabled) {
  border-color: rgba(102, 73, 198, .48) !important;
  color: #5533a8 !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .sparks-modal .sparks-carousel__position {
  border-color: rgba(102, 73, 198, .22) !important;
  color: #4e5d75 !important;
  background: rgba(255, 255, 255, .94) !important;
}
html[data-theme="light"] .sparks-modal .sparks-carousel__position strong {
  color: #5533a8 !important;
}

html[data-theme="light"] .sparks-modal .spark-package-card {
  opacity: .5;
  filter: saturate(.72) brightness(1.02);
}
html[data-theme="light"] .sparks-modal .spark-package-card.is-active {
  opacity: 1;
  filter: none;
}
html[data-theme="light"] .sparks-modal .spark-package-card__button {
  border-color: rgba(102, 73, 198, .26) !important;
  color: #27334b !important;
  background: linear-gradient(145deg, #fff, #f4f1ff) !important;
  box-shadow: 0 16px 34px rgba(42, 60, 98, .13), inset 0 1px 0 rgba(255, 255, 255, .95) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card--impulse .spark-package-card__button {
  background: linear-gradient(145deg, #fff, #edf7ff) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card--flame .spark-package-card__button {
  background: linear-gradient(145deg, #fff, #fff1ea) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card--supernova .spark-package-card__button {
  background: linear-gradient(145deg, #fff, #fff0f8) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card--infinity .spark-package-card__button {
  background: linear-gradient(145deg, #fff, #fff8e2) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card.is-active .spark-package-card__button {
  border-color: rgba(102, 73, 198, .58) !important;
  box-shadow: 0 18px 40px rgba(102, 73, 198, .16), 0 0 0 3px rgba(102, 73, 198, .08) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__button::before {
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08)), var(--spark-package-image, none) !important;
  opacity: .2 !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__number {
  color: #68748a !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__bonus-percent {
  border-color: rgba(214, 157, 25, .38) !important;
  color: #8b5d00 !important;
  background: #fff4d4 !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__figure {
  border-color: rgba(102, 73, 198, .2) !important;
  background: radial-gradient(circle, rgba(126, 84, 217, .15), rgba(126, 84, 217, .035) 66%) !important;
  box-shadow: inset 0 0 32px rgba(102, 73, 198, .05), 0 0 28px rgba(102, 73, 198, .12) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__figure > span {
  color: #6841c8 !important;
  filter: drop-shadow(0 0 12px rgba(102, 73, 198, .28)) !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__name {
  color: #5533a8 !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__sparks {
  color: #182235 !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__sparks small {
  color: #68748a !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__bonus {
  color: #9c6500 !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__price {
  color: #27334b !important;
}
html[data-theme="light"] .sparks-modal .spark-package-card__pay {
  border: 1px solid rgba(102, 73, 198, .24) !important;
  color: #5533a8 !important;
  background: #f0ebff !important;
}

html[data-theme="light"] .sparks-selection {
  border-color: rgba(25, 133, 80, .26) !important;
  color: #1f5d43 !important;
  background: linear-gradient(135deg, #eaf9f0, #f8fcf8) !important;
}
html[data-theme="light"] .sparks-selection strong {
  color: #205d43 !important;
}
html[data-theme="light"] .sparks-selection span {
  color: #4d7563 !important;
}
html[data-theme="light"] .sparks-modal .btn-primary,
html[data-theme="light"] .sparks-modal .btn--primary {
  border-color: rgba(102, 73, 198, .22) !important;
  color: #3f2c78 !important;
  background: linear-gradient(180deg, #fff, #f0ebff) !important;
  box-shadow: 0 7px 18px rgba(42, 60, 98, .1) !important;
}
html[data-theme="light"] .sparks-modal .btn-primary:hover,
html[data-theme="light"] .sparks-modal .btn--primary:hover {
  border-color: rgba(102, 73, 198, .52) !important;
  color: #4d2d9f !important;
  background: #f0ebff !important;
}

html[data-theme="light"] .sparks-custom-amount {
  border-color: rgba(102, 73, 198, .2) !important;
  background: linear-gradient(145deg, #fff, #f7f5ff) !important;
  box-shadow: 0 10px 26px rgba(42, 60, 98, .08) !important;
}
html[data-theme="light"] .sparks-custom-amount__hint {
  color: #6841c8 !important;
  background: #f0ebff !important;
}
html[data-theme="light"] .sparks-custom-amount form {
  display: grid;
  gap: 12px;
}
html[data-theme="light"] .sparks-custom-amount form .field {
  gap: 7px;
}
html[data-theme="light"] .sparks-custom-amount form .field label {
  color: #53617a !important;
}
html[data-theme="light"] .sparks-custom-amount form .input {
  border-color: rgba(52, 70, 105, .2) !important;
  color: #27334b !important;
  background: #fdfcf9 !important;
}
html[data-theme="light"] .sparks-custom-amount form button {
  justify-self: start;
}
html[data-theme="light"] .sparks-custom-amount form small {
  display: block;
  line-height: 1.45;
}
html[data-theme="light"] .sparks-custom-amount .notice {
  color: #775313 !important;
  background: #fff8e8 !important;
}

@media (max-width: 650px) {
  html[data-theme="light"] .sparks-custom-amount form button {
    width: 100%;
  }
}

/* Messages search should read as an active action, not secondary metadata. */
.new-message-search label {
  color: #c8d0e2 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}
.new-message-search .input {
  min-height: 48px;
}
.new-message-search .input::placeholder {
  color: #aeb7ca !important;
  opacity: 1;
}
.new-message-search .btn {
  min-height: 48px;
}
.conversation-users > .muted {
  color: #c0c9dc !important;
  font-size: 14px;
  line-height: 1.5;
}
html[data-theme="light"] .new-message-search label {
  color: #52617a !important;
}
html[data-theme="light"] .new-message-search .input::placeholder {
  color: #7c899f !important;
}
html[data-theme="light"] .conversation-users > .muted {
  color: #53617a !important;
}

html[data-theme="light"] .site-mode-panel {
  border-color: rgba(102, 73, 198, .24);
  background: linear-gradient(145deg, #ffffff, #f4f1ff);
  box-shadow: 0 18px 42px rgba(60, 70, 110, .09);
}
html[data-theme="light"] .site-mode-panel.is-paused {
  border-color: rgba(180, 115, 24, .35);
  background: linear-gradient(145deg, #fffaf0, #f7f3ff);
}
html[data-theme="light"] .site-mode-switch {
  border-color: rgba(102, 73, 198, .18);
  background: rgba(102, 73, 198, .055);
}
html[data-theme="light"] .site-mode-preview {
  border-color: rgba(102, 73, 198, .14);
  background: #f7f9fd;
}
html[data-theme="light"] .site-mode-preview__lock { color: #674ba0; }
html[data-theme="light"] .maintenance-card {
  border-color: rgba(102, 73, 198, .2);
  background: radial-gradient(circle at 50% -20%, rgba(126, 91, 226, .17), transparent 48%), linear-gradient(145deg, #ffffff, #f2f4fb);
  box-shadow: 0 28px 80px rgba(66, 78, 120, .16), inset 0 1px 0 rgba(255,255,255,.9);
}
html[data-theme="light"] .maintenance-card h1 { color: #202b43; }
html[data-theme="light"] .maintenance-card__message { color: #4f5c73; }
html[data-theme="light"] .maintenance-card__hint { color: #718099; }

/* Keep the fixed mobile navigation in the same visual system as the light
   page instead of leaving its dark-theme surface behind. */
html[data-theme="light"] .mobile-bottom-nav {
  border-top-color: rgba(38, 54, 86, .14);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -12px 32px rgba(42, 60, 98, .12);
  backdrop-filter: blur(18px) saturate(120%);
}
html[data-theme="light"] .mobile-bottom-nav a {
  color: #64728b;
}
html[data-theme="light"] .mobile-bottom-nav a:hover,
html[data-theme="light"] .mobile-bottom-nav a:focus-visible {
  color: #5d3bb3;
}
html[data-theme="light"] .mobile-bottom-nav b {
  border-color: #fff;
}

html[data-theme="light"] .chat-placeholder {
  color: #647089;
}
html[data-theme="light"] .chat-placeholder > span {
  color: #7b67bd;
  opacity: .7;
}
html[data-theme="light"] .chat-placeholder h2 {
  color: #26344f;
}
html[data-theme="light"] .chat-placeholder p {
  color: #647089;
}

/* Fandom heroes need the same light surface as the rest of the page. */
html[data-theme="light"] .fandom-hero {
  color: #182235 !important;
  border-color: rgba(102, 73, 198, .28) !important;
  background-color: #f5f7fb !important;
  box-shadow: 0 18px 42px rgba(42, 60, 98, .12) !important;
}
html[data-theme="light"] .fandom-hero__shade {
  background: linear-gradient(90deg, rgba(247, 249, 253, .98) 0%, rgba(247, 249, 253, .9) 42%, rgba(247, 249, 253, .28) 78%, rgba(247, 249, 253, .04) 100%), linear-gradient(0deg, rgba(247, 249, 253, .72), transparent 58%) !important;
}
html[data-theme="light"] .fandom-hero__content h1 {
  color: #182235 !important;
  text-shadow: none !important;
}
html[data-theme="light"] .fandom-hero__content > p.muted {
  color: #53617a !important;
}
html[data-theme="light"] .fandom-hero__description p {
  color: #33415e !important;
}
html[data-theme="light"] .fandom-hero__description i {
  background: #7950d8 !important;
  box-shadow: 0 0 12px rgba(121, 80, 216, .28) !important;
}
html[data-theme="light"] .fandom-hero .btn {
  color: #3d2a75 !important;
  border-color: rgba(102, 73, 198, .34) !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 8px 18px rgba(42, 60, 98, .12) !important;
}
html[data-theme="light"] .fandom-hero .btn:hover,
html[data-theme="light"] .fandom-hero .btn:focus-visible {
  color: #30205f !important;
  border-color: rgba(102, 73, 198, .58) !important;
  background: #fff !important;
}

/* Enlarge footer type without changing its width, border, or outer frame. */
footer.footer .footer-brand .logo { font-size: 26px !important; }
footer.footer .footer-grid > div:not(.footer-brand) { font-size: 14px !important; line-height: 1.35 !important; gap: 7px !important; }
footer.footer .footer-grid strong { font-size: 15px !important; }
footer.footer .footer-brand p { font-size: 13px !important; line-height: 1.45 !important; }
footer.footer .footer-bottom { font-size: 11px !important; line-height: 1.4 !important; }

/* Disabled actions must stay readable instead of looking washed out on hover. */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  cursor: not-allowed !important;
}
html[data-theme="light"] .btn:disabled,
html[data-theme="light"] .btn[aria-disabled="true"] {
  color: #53617a !important;
  border-color: rgba(52, 70, 105, .2) !important;
  background: #e9edf4 !important;
  box-shadow: none !important;
}
html[data-theme="light"] .btn:disabled:hover,
html[data-theme="light"] .btn[aria-disabled="true"]:hover {
  color: #53617a !important;
  border-color: rgba(102, 73, 198, .35) !important;
  background: #e9edf4 !important;
}
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn[aria-disabled="true"] {
  color: #b6bfd2 !important;
  border-color: rgba(151, 166, 210, .26) !important;
  background: #20283b !important;
  box-shadow: none !important;
}

/* Keep every light-theme button variant readable on hover and focus. */
html[data-theme="light"] .btn--primary:hover:not(:disabled),
html[data-theme="light"] .btn--primary:focus-visible:not(:disabled),
html[data-theme="light"] .btn--primary:active:not(:disabled) {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, #7042dd, #8a45ce) !important;
  box-shadow: 0 10px 24px rgba(102, 73, 198, .24) !important;
  filter: brightness(1.05) !important;
}
html[data-theme="light"] .btn--danger:hover:not(:disabled),
html[data-theme="light"] .btn--danger:focus-visible:not(:disabled) {
  color: #8f2442 !important;
  border-color: rgba(204, 50, 88, .42) !important;
  background: #ffe7ed !important;
}
html[data-theme="light"] .btn--outline:hover:not(:disabled),
html[data-theme="light"] .btn--outline:focus-visible:not(:disabled) {
  color: #5738a6 !important;
  border-color: rgba(102, 73, 198, .58) !important;
  background: #f3efff !important;
}
html[data-theme="light"] .btn--glass:hover:not(:disabled),
html[data-theme="light"] .btn--glass:focus-visible:not(:disabled) {
  color: #34415c !important;
  border-color: rgba(102, 73, 198, .38) !important;
  background: rgba(255, 255, 255, .94) !important;
}
