/* ─────────────────────────────────────────────────────
   THEME VARIABLES
   --ca-bg / --ca-card / --ca-raised / --ca-border:
   space-separated RGB values so Tailwind opacity modifiers
   work:  bg-surface/80 → rgb(var(--ca-bg) / 0.8)
───────────────────────────────────────────────────── */
:root {
  /* Dark mode (default) — Premium dark color palette */
  --ca-bg: 10 13 15;
  /* Base: #0A0D0F */
  --ca-card: 30 37 43;
  /* Card: #1E252B */
  --ca-raised: 26 31 36;
  /* Elevated: #1A1F24 */
  --ca-border: 18 22 25;
  /* Panel: #121619 */
  --ca-text: 255 255 255;
  --ca-scrollbar: #0f1215;
}

[data-theme="light"] {
  --ca-bg: 245 250 245;
  --ca-card: 255 255 255;
  --ca-raised: 232 244 233;
  --ca-border: 196 222 200;
  --ca-text: 15 26 16;
  --ca-scrollbar: #b8d8bc;
}

/* ─── Base ─── */
:root {
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: rgb(var(--ca-bg));
  color: rgb(var(--ca-text));
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overscroll-behavior: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ─── Glassmorphism & Glow Effects ─── */
.glass {
  background: rgba(30, 37, 43, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(29, 186, 120, 0.15);
}

.glow {
  box-shadow: 0 0 12px rgba(29, 186, 120, 0.12), 0 0 24px rgba(29, 186, 120, 0.06);
}

.glow-lg {
  box-shadow: 0 0 20px rgba(29, 186, 120, 0.15), 0 0 40px rgba(29, 186, 120, 0.08);
}

.glow-hover:hover {
  box-shadow: 0 0 16px rgba(29, 186, 120, 0.15), 0 0 32px rgba(29, 186, 120, 0.1);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ca-scrollbar);
  border-radius: 999px;
}

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

.scroll-hide::-webkit-scrollbar {
  display: none;
}

/* ─── Skeleton shimmer ─── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Live/Completed cover badge sits 1px lower than the star-rating badge on
   mobile widths; keep desktop's existing top:1px but nudge mobile to match. */
@media (max-width: 639px) {
  .badge-top-fix {
    top: 2px !important;
  }
}

.skeleton {
  background: linear-gradient(90deg,
      rgba(29, 186, 120, 0.15) 25%,
      rgba(29, 186, 120, 0.25) 50%,
      rgba(29, 186, 120, 0.15) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  border: 0.5px solid rgba(29, 186, 120, 0.2);
}

/* ─── Bottom sheet ─── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sheet-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgb(var(--ca-card));
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgb(var(--ca-border));
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: calc(16px + var(--safe-area-bottom));
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgb(var(--ca-border));
  border-radius: 999px;
  margin: 12px auto 20px;
}

/* ─── Nav safe areas ─── */
.bottom-nav {
  padding-bottom: calc(8px + var(--safe-area-bottom));
}

.page-with-nav {
  padding-bottom: calc(72px + var(--safe-area-bottom));
}

.top-bar {
  padding-top: calc(12px + var(--safe-area-top));
}

.page-with-topbar {
  padding-top: 0px;
}

/* ─── Line clamp ─── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Focus ring ─── */
:focus-visible {
  outline: 2px solid #1DBA78;
  outline-offset: 2px;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: calc(80px + var(--safe-area-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  width: 100%;
  border: 1px solid rgba(29, 186, 120, 0.3);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(9.94px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
}

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--ca-text));
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.toast-close:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}

.toast-progress-track {
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
}

/* ─── Password strength bar ─── */
.strength-bar {
  display: flex;
  gap: 4px;
}

.strength-segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgb(var(--ca-border));
  transition: background 0.3s;
}

/* ─── OTP inputs ─── */
.otp-input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  background: rgb(var(--ca-card));
  border: 1.5px solid rgb(var(--ca-border));
  border-radius: 12px;
  color: rgb(var(--ca-text));
  caret-color: #1DBA78;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.otp-input:focus {
  border-color: #1DBA78;
  outline: none;
}

/* Remove native number input spinner (white up/down arrows) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ─── Chapter reader ─── */
.reader-content {
  font-size: 16px;
  line-height: 1.9;
  font-family: 'Lora', serif;
  letter-spacing: 0.01em;
  word-spacing: 0.04em;
}

.reader-content.font-sans {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
}

.reader-content.font-serif {
  font-family: 'Lora', serif;
}

.reader-content.font-georgia {
  font-family: Georgia, 'Times New Roman', serif;
}

.reader-content.size-sm {
  font-size: 14px;
}

.reader-content.size-md {
  font-size: 16px;
}

.reader-content.size-lg {
  font-size: 18px;
}

.reader-content.size-xl {
  font-size: 21px;
}

.reader-content.spacing-compact {
  line-height: 1.65;
}

.reader-content.spacing-comfort {
  line-height: 1.90;
}

.reader-content.spacing-spacious {
  line-height: 2.2;
}

.reader-content.indent-on .reader-para {
  text-indent: 1.5em;
}

/* Paragraph style — aligned left */
.reader-content .reader-para {
  margin-top: 0;
  margin-bottom: 0.15em;
  color: rgba(244, 241, 234, 0.92);
}

/* Section break ornament rendered inline */
.reader-section-break {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2.2em 0;
  opacity: 0.22;
  user-select: none;
}

.reader-section-break::before,
.reader-section-break::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
}

/* Reader backgrounds — independent of app theme */
.reader-bg-dark {
  background: #0a0e0a;
  color: rgba(222, 238, 222, 0.88);
}

.reader-bg-sepia {
  background: #1c1108;
  color: #d4a76a;
}

.reader-bg-light {
  background: #f8f4ec;
  color: #2a1e14;
}

/* Inline comment highlight */
.reader-comment-mark {
  background: rgba(29, 186, 120, 0.22);
  border-bottom: 1.5px solid rgba(0, 155, 125, 0.65);
  border-radius: 2px;
  cursor: pointer;
  padding: 0 1px;
  transition: background 0.15s;
}

.reader-comment-mark:hover {
  background: rgba(29, 186, 120, 0.4);
}

/* Settings / chapter panel */
.reader-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.reader-panel-right {
  right: 0;
  transform: translateX(100%);
}

.reader-panel-left {
  left: 0;
  transform: translateX(-100%);
}

.reader-panel.open {
  transform: translateX(0);
}

/* Option pill buttons */
.reader-opt {
  flex: 1;
  padding: 10px 6px;
  border-radius: 10px;
  border: 0.994px solid rgba(29, 186, 120, 0.3);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  text-align: center;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.08) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.6);
  backdrop-filter: blur(9.944751739501953px);
  color: rgba(255, 255, 255, 0.6);
}

.reader-opt:hover {
  border-color: rgba(29, 186, 120, 0.6);
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.15) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.8);
  color: rgba(255, 255, 255, 0.8);
}

.reader-opt.active {
  border-color: rgba(29, 186, 120, 0.6);
  color: #1DBA78;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.2) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.8);
  box-shadow: 0 0.994px 1.989px 0 rgba(29, 186, 120, 0.30);
}

/* ─── Reader settings toggle switch ─── */
.reader-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 0.994px solid rgba(29, 186, 120, 0.3);
  background: rgba(10, 14, 12, 0.6);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.reader-toggle:hover {
  border-color: rgba(29, 186, 120, 0.6);
}

.reader-toggle.active {
  background: linear-gradient(180deg, #1F7A4F 0%, #145C3A 100%);
  border-color: rgba(31, 122, 79, 0.6);
  box-shadow: 0 0.994px 1.989px 0 rgba(29, 186, 120, 0.30);
}

.reader-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s, background 0.2s;
}

.reader-toggle.active .reader-toggle-thumb {
  transform: translateX(18px);
  background: #E8E3D8;
}

/* ─── Cover scrim (adapts to theme) ─── */
.cover-scrim {
  background: linear-gradient(to top,
      rgb(var(--ca-bg) / 0.97) 0%,
      rgb(var(--ca-bg) / 0.45) 55%,
      transparent 100%);
}

/* ─── Hero card ─── */
.hero-card {
  width: 70vw;
  max-width: 280px;
  flex-shrink: 0;
}

/* ─── Rating stars ─── */
.star-filled {
  color: #f59e0b;
}

.star-empty {
  color: rgb(var(--ca-border));
}

/* ─── Admin / Author Sidebar — glass style ─── */
.sidebar {
  width: 240px;
  height: 100vh;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.12) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(29, 186, 120, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 2px 0 32px rgba(0, 0, 0, 0.5), inset -1px 0 0 rgba(29, 186, 120, 0.04);
}

/* Brand / logo area */
.sidebar-brand {
  padding: 16px 16px 13px;
  border-bottom: 1px solid rgb(var(--ca-border));
  flex-shrink: 0;
}

/* Scrollable nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 0;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

/* Section label */
.sidebar-group {
  margin-bottom: 4px;
}

.sidebar-group-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgb(var(--ca-text) / 0.28);
  padding: 10px 10px 4px;
}

/* Nav item */
.sidebar-item,
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgb(var(--ca-text) / 0.55);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  text-decoration: none;
  margin-bottom: 1px;
  border-left: 2px solid transparent;
  cursor: pointer;
}

.sidebar-item:hover,
.sidebar-link:hover {
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.12) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(29, 186, 120, 0.08);
  color: rgb(var(--ca-text) / 0.88);
  border-left-color: #1DBA78;
  backdrop-filter: blur(9.944751739501953px);
  border: 0.5px solid rgba(29, 186, 120, 0.3);
}

.sidebar-item.active,
.sidebar-link.active {
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.15) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(29, 186, 120, 0.1);
  color: #1DBA78;
  border-left-color: #1DBA78;
  font-weight: 600;
  backdrop-filter: blur(9.944751739501953px);
  border: 0.5px solid rgba(29, 186, 120, 0.4);
}

.sidebar-item.active svg,
.sidebar-link.active svg {
  color: #1DBA78;
}

/* Badge pill inside nav items */
.sidebar-badge {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(29, 186, 120, 0.25);
  color: #1DBA78;
  border: 0.5px solid rgba(29, 186, 120, 0.3);
}

.sidebar-badge.amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.sidebar-badge.red {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.sidebar-badge.brand {
  background: rgba(16, 185, 129, 0.2);
  color: #2dd4bf;
}

/* Footer area */
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid rgb(var(--ca-border));
  flex-shrink: 0;
}

/* User card in footer */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.15) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(29, 186, 120, 0.3);
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

/* Avatar circle */
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1DBA78 0%, #0D8A50 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

/* ─── Desktop Panel Top Bar ─── */
.panel-topbar {
  position: fixed;
  top: 0;
  left: 240px;
  right: 0;
  height: 56px;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.08) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(10, 14, 12, 0.90);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 0.994px solid rgba(29, 186, 120, 0.20);
  box-shadow: 0 1px 0 rgba(29, 186, 120, 0.10), 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 20;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  transition: background 0.2s, border-color 0.2s;
}

.panel-topbar-search {
  max-width: 260px;
  width: 100%;
  position: relative;
}

.panel-topbar-search input {
  width: 100%;
  background: rgba(29, 186, 120, 0.08);
  border: 0.5px solid rgba(29, 186, 120, 0.25);
  border-radius: 8px;
  padding: 6px 12px 6px 30px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: rgb(var(--ca-text));
  transition: border-color 0.15s, background 0.15s;
  backdrop-filter: blur(9.944751739501953px);
}

.panel-topbar-search input:focus {
  outline: none;
  border-color: rgba(29, 186, 120, 0.5);
  background: rgba(29, 186, 120, 0.12);
  backdrop-filter: blur(9.944751739501953px);
}

.panel-topbar-search input::placeholder {
  color: rgb(var(--ca-text) / 0.28);
}

.panel-topbar-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(29, 186, 120, 0.08);
  border: 0.5px solid rgba(29, 186, 120, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s, backdrop-filter 0.13s;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
  backdrop-filter: blur(9.944751739501953px);
}

.panel-topbar-action:hover {
  border-color: rgba(29, 186, 120, 0.4);
  background: rgba(29, 186, 120, 0.12);
  backdrop-filter: blur(9.944751739501953px);
}

.panel-notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid rgb(var(--ca-card));
}

/* ─── Sidebar content wrapper ─── */
.sidebar-content {
  margin-left: 240px;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-content {
    margin-left: 0;
  }
}

/* Dashboard pages padding for bottom nav */
.page-with-dashboard-nav {
  padding-bottom: calc(72px + var(--safe-area-bottom));
}

/* ─── Dashboard Drawer ─── */
.dashboard-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.dashboard-drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.dashboard-drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: rgb(var(--ca-card));
  border-right: 1px solid rgb(var(--ca-border));
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  padding: calc(12px + var(--safe-area-top)) 16px 16px;
  border-bottom: 1px solid rgb(var(--ca-border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgb(var(--ca-raised));
  border: 1px solid rgb(var(--ca-border));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: rgb(var(--ca-text));
  padding: 0;
}

.drawer-close:hover {
  background: rgb(var(--ca-border));
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.drawer-section {
  padding: 8px 0;
  border-bottom: 1px solid rgb(var(--ca-border) / 0.3);
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgb(var(--ca-text) / 0.28);
  padding: 10px 16px 4px;
  margin: 0;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgb(var(--ca-text) / 0.6);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.13s, color 0.13s;
  border-left: 3px solid transparent;
}

.drawer-item:hover {
  background: rgb(var(--ca-raised) / 0.5);
  color: rgb(var(--ca-text) / 0.8);
}

.drawer-item.active {
  background: rgba(30, 122, 42, 0.1);
  color: #1DBA78;
  border-left-color: #1DBA78;
  font-weight: 600;
}

.drawer-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(29, 186, 120, 0.2);
  color: #6BA989;
  margin-left: auto;
}

.drawer-badge.amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.drawer-badge.brand {
  background: rgba(16, 185, 129, 0.2);
  color: #2dd4bf;
}

.drawer-badge.red {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

/* ─── Tables remain scrollable on mobile (no card conversion) ─── */
@media (max-width: 768px) {
  .data-table {
    width: 100%;
    /* Tables remain in table format, parent div handles overflow-x-auto scrolling */
  }
}

/* ─── KPI Cards Mobile ─── */
.kpi-card {
  background: rgb(var(--ca-card));
  border: 1px solid rgb(var(--ca-border));
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: rgb(var(--ca-border) / 0.6);
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.kpi-trend.up {
  color: #1DBA78;
  background: rgba(16, 185, 129, 0.1);
}

.kpi-trend.down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.kpi-trend.neutral {
  color: rgb(var(--ca-text) / 0.4);
  background: rgb(var(--ca-border) / 0.2);
}

/* ─── Table ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgb(var(--ca-text) / 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgb(var(--ca-border));
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid rgb(var(--ca-border) / 0.4);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-sm {
  padding: 1px 7px;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.badge-green {
  background: rgba(29, 186, 120, 0.2);
  color: #1DBA78;
  border: 0.5px solid rgba(29, 186, 120, 0.4);
}

.badge-yellow {
  background: rgba(29, 186, 120, 0.15);
  color: #1DBA78;
  border: 0.5px solid rgba(29, 186, 120, 0.3);
}

.badge-red {
  background: #7f1d1d22;
  color: #fca5a5;
  border: 1px solid #7f1d1d44;
}

.badge-gray {
  background: rgb(var(--ca-border) / 0.25);
  color: rgb(var(--ca-text) / 0.45);
  border: 1px solid rgb(var(--ca-border));
}

/* ─── Book card ambient glow ─── */
.card-glow {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.25s;
}

.card-glow:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 22px rgba(29, 186, 120, 0.16);
  border-color: rgba(29, 186, 120, 0.25) !important;
}

/* ─── LIVE badge pulse ─── */
@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

.live-dot {
  animation: livePulse 1.6s ease-in-out infinite;
}

/* ─── Novel action buttons ─── */
.btn-action-read {
  background: rgba(29, 186, 120, 0.90);
  border: 1px solid rgba(29, 186, 120, 0.45);
  color: #fff;
  border-radius: 12px;
  transition: box-shadow 0.2s, background 0.2s;
  box-shadow: 0 0 12px rgba(29, 186, 120, 0.18);
}

.btn-action-read:hover {
  background: rgba(29, 186, 120, 1);
  box-shadow: 0 0 22px rgba(29, 186, 120, 0.35);
}

.btn-action-read.glow {
  box-shadow: 0 0 40px rgba(29, 186, 120, 0.55), 0 0 80px rgba(29, 186, 120, 0.22);
}

.btn-action-secondary {
  background: rgba(21, 28, 21, 0.9);
  border: 1px solid rgba(34, 45, 34, 0.9);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  transition: box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

.btn-action-secondary:hover {
  border-color: rgba(29, 186, 120, 0.35);
  color: rgba(255, 255, 255, 0.85);
}

.btn-action-secondary.glow {
  border-color: rgba(29, 186, 120, 0.5);
  box-shadow: 0 0 22px rgba(29, 186, 120, 0.28);
}

.btn-action-library {
  background: rgba(21, 28, 21, 0.9);
  border: 1px solid rgba(34, 45, 34, 0.9);
  color: rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  transition: box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

.btn-action-library:hover {
  border-color: rgba(239, 68, 68, 0.35);
  color: rgba(239, 68, 68, 0.6);
}

.btn-action-library.saved {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.25);
}

/* ─── Glass card — Admin & Author modules ─── */
.glass-card,
.kpi-card {
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.50),
    0 0 0 1px rgba(29, 186, 120, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.glass-card:hover,
.kpi-card:hover {
  border-color: rgba(29, 186, 120, 0.20);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(29, 186, 120, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Icon container inside KPI */
.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Trend chip */
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.kpi-trend.up {
  background: rgba(34, 197, 94, 0.14);
  color: #6BA989;
}

.kpi-trend.down {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.kpi-trend.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: rgb(var(--ca-text) / 0.45);
}

/* ─── Input base ─── */
.input-base {
  width: 100%;
  background: rgb(var(--ca-card));
  border: 1.5px solid rgb(var(--ca-border));
  border-radius: 12px;
  padding: 12px 14px;
  color: rgb(var(--ca-text));
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.input-base::placeholder {
  color: rgb(var(--ca-text) / 0.3);
}

.input-base:focus {
  border-color: #1DBA78;
  box-shadow: 0 0 0 3px rgba(29, 186, 120, 0.15);
  outline: none;
}

/* ─── Drag handle ─── */
.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

/* ═══════════════════════════════════════════════════
   LIGHT MODE — TAILWIND UTILITY OVERRIDES
   Tailwind hardcodes text-white as rgb(255 255 255 / X).
   These selectors have higher specificity and win.
═══════════════════════════════════════════════════ */
[data-theme="light"] .text-white {
  color: rgb(var(--ca-text));
}

[data-theme="light"] .text-white\/90 {
  color: rgb(var(--ca-text) / 0.92);
}

[data-theme="light"] .text-white\/85 {
  color: rgb(var(--ca-text) / 0.87);
}

[data-theme="light"] .text-white\/80 {
  color: rgb(var(--ca-text) / 0.82);
}

[data-theme="light"] .text-white\/70 {
  color: rgb(var(--ca-text) / 0.72);
}

[data-theme="light"] .text-white\/65 {
  color: rgb(var(--ca-text) / 0.67);
}

[data-theme="light"] .text-white\/60 {
  color: rgb(var(--ca-text) / 0.62);
}

[data-theme="light"] .text-white\/55 {
  color: rgb(var(--ca-text) / 0.57);
}

[data-theme="light"] .text-white\/50 {
  color: rgb(var(--ca-text) / 0.52);
}

[data-theme="light"] .text-white\/45 {
  color: rgb(var(--ca-text) / 0.47);
}

[data-theme="light"] .text-white\/40 {
  color: rgb(var(--ca-text) / 0.42);
}

[data-theme="light"] .text-white\/35 {
  color: rgb(var(--ca-text) / 0.37);
}

[data-theme="light"] .text-white\/30 {
  color: rgb(var(--ca-text) / 0.32);
}

[data-theme="light"] .text-white\/25 {
  color: rgb(var(--ca-text) / 0.27);
}

[data-theme="light"] .text-white\/20 {
  color: rgb(var(--ca-text) / 0.22);
}

[data-theme="light"] .text-white\/15 {
  color: rgb(var(--ca-text) / 0.17);
}

[data-theme="light"] .text-white\/10 {
  color: rgb(var(--ca-text) / 0.12);
}

/* hover: text variants */
[data-theme="light"] .hover\:text-white:hover {
  color: rgb(var(--ca-text));
}

[data-theme="light"] .hover\:text-white\/90:hover {
  color: rgb(var(--ca-text) / 0.92);
}

[data-theme="light"] .hover\:text-white\/80:hover {
  color: rgb(var(--ca-text) / 0.85);
}

[data-theme="light"] .hover\:text-white\/70:hover {
  color: rgb(var(--ca-text) / 0.75);
}

[data-theme="light"] .hover\:text-white\/60:hover {
  color: rgb(var(--ca-text) / 0.65);
}

[data-theme="light"] .hover\:text-white\/50:hover {
  color: rgb(var(--ca-text) / 0.55);
}

/* bg-white/X overlays */
[data-theme="light"] .bg-white\/5 {
  background-color: rgb(var(--ca-text) / 0.04);
}

[data-theme="light"] .bg-white\/8 {
  background-color: rgb(var(--ca-text) / 0.05);
}

[data-theme="light"] .bg-white\/10 {
  background-color: rgb(var(--ca-text) / 0.06);
}

[data-theme="light"] .bg-white\/12 {
  background-color: rgb(var(--ca-text) / 0.07);
}

[data-theme="light"] .bg-white\/14 {
  background-color: rgb(var(--ca-text) / 0.08);
}

[data-theme="light"] .bg-white\/15 {
  background-color: rgb(var(--ca-text) / 0.09);
}

[data-theme="light"] .bg-white\/20 {
  background-color: rgb(var(--ca-text) / 0.08);
}

[data-theme="light"] .bg-white\/25 {
  background-color: rgb(var(--ca-text) / 0.10);
}

[data-theme="light"] .hover\:bg-white\/8:hover {
  background-color: rgb(var(--ca-text) / 0.05);
}

[data-theme="light"] .hover\:bg-white\/10:hover {
  background-color: rgb(var(--ca-text) / 0.06);
}

[data-theme="light"] .hover\:bg-white\/14:hover {
  background-color: rgb(var(--ca-text) / 0.08);
}

[data-theme="light"] .hover\:bg-white\/15:hover {
  background-color: rgb(var(--ca-text) / 0.09);
}

/* border-white opacity variants */
[data-theme="light"] .border-white\/7 {
  border-color: rgb(var(--ca-text) / 0.08);
}

[data-theme="light"] .border-white\/8 {
  border-color: rgb(var(--ca-text) / 0.09);
}

[data-theme="light"] .border-white\/10 {
  border-color: rgb(var(--ca-text) / 0.11);
}

[data-theme="light"] .border-white\/12 {
  border-color: rgb(var(--ca-text) / 0.13);
}

[data-theme="light"] .border-white\/15 {
  border-color: rgb(var(--ca-text) / 0.15);
}

[data-theme="light"] .border-white\/20 {
  border-color: rgb(var(--ca-text) / 0.18);
}

[data-theme="light"] .border-white\/25 {
  border-color: rgb(var(--ca-text) / 0.22);
}

[data-theme="light"] .hover\:border-white\/25:hover {
  border-color: rgb(var(--ca-text) / 0.25);
}

/* Explicitly keep pure white backgrounds and black text */
[data-theme="light"] .bg-white {
  background-color: #ffffff;
}

[data-theme="light"] .text-black {
  color: #0f1a10;
}

/* ─── Desktop header neon line ─── */
#desktop-header {
  position: relative;
}


/* CTA button — premium teal gradient with institutional glow */
.btn-neon {
  border: 1px solid rgba(45, 212, 191, 0.40);
  color: #2dd4bf;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.15), inset 0 0 10px rgba(45, 212, 191, 0.05);
  font-weight: 600;
}

.btn-neon:hover {
  border-color: rgba(45, 212, 191, 0.70);
  color: #5eead4;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
  box-shadow: 0 0 30px rgba(45, 212, 191, 0.35), inset 0 0 12px rgba(45, 212, 191, 0.08);
  transform: translateY(-1px);
}

/* ─── Universal Button System (matching hero CTA style) ─── */
/* Primary button — emerald gradient (like "Citește acum" hero button) */
.btn-primary,
button.bg-brand-500:not(.btn-neon),
a.bg-brand-500,
.btn {
  background: linear-gradient(180deg, #1F7A4F 0%, #145C3A 100%);
  border: 1px solid rgba(31, 122, 79, 0.6);
  color: #D8EFE2;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover,
button.bg-brand-500:hover:not(.btn-neon),
a.bg-brand-500:hover,
.btn:hover {
  background: linear-gradient(180deg, #236B47 0%, #18693F 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.btn-primary:active,
button.bg-brand-500:active:not(.btn-neon),
a.bg-brand-500:active,
.btn:active {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Secondary button — outline style (like "Vezi capitole" hero button) */
.btn-secondary,
button.border-brand-500 {
  background: rgba(14, 20, 17, 0.7);
  color: #B8C8C0;
  border: 1px solid rgba(50, 100, 75, 0.32);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 23px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary:hover,
button.border-brand-500:hover {
  background: rgba(25, 50, 36, 0.7);
  border-color: rgba(50, 100, 75, 0.32);
  color: #D8EFE2;
}

/* Danger button — red teal variant */
.btn-danger,
button.bg-red-500 {
  background: rgba(159, 18, 26, 0.80);
  border: 1px solid rgba(239, 68, 68, 0.40);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover,
button.bg-red-500:hover {
  background: rgba(159, 18, 26, 0.95);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.30);
}

/* Small button variant */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 8px;
}

/* Large button variant */
.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 14px;
}

/* ─── Public pages: premium dark background + teal ambient ─── */
body.public-layout {
  background: #030403;
}

body.public-layout::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80vh;
  pointer-events: none;
  z-index: 0;
  background: transparent;
}

/* Glass effect on public book cards */
body.public-layout .card-glow {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(13, 28, 15, 0.72) !important;
}

/* ─── Genre pill tabs ─── */
.genre-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid rgba(45, 212, 191, 0.25);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(45, 212, 191, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.08), inset 0 0 12px rgba(255, 255, 255, 0.03);
  transition: all 0.18s;
  cursor: pointer;
  flex-shrink: 0;
}

.genre-pill:hover {
  border-color: rgba(45, 212, 191, 0.35);
  color: rgba(255, 255, 255, 0.82);
}

.genre-pill.active {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.18);
  color: #2dd4bf;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.22);
}

/* ─── Premium Typography System ─── */
h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Default heading font */
h1,
h3,
h4,
h5,
h6,
.font-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.section-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.875rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
}

body,
p,
span,
a,
.text-body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.text-medium,
.font-medium {
  font-weight: 500;
}

.chapter-text,
.reading-content {
  font-family: 'Literata', serif;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

/* ─── Floating Creator Widget (card design) ─── */
@keyframes widgetFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes creatorGlow {

  0%,
  100% {
    box-shadow: 0 0 18px rgba(29, 186, 120, 0.28), 0 0 40px rgba(29, 186, 120, 0.12), inset 0 0 0 1px rgba(29, 186, 120, 0.18);
  }

  50% {
    box-shadow: 0 0 30px rgba(29, 186, 120, 0.45), 0 0 60px rgba(29, 186, 120, 0.22), inset 0 0 0 1px rgba(29, 186, 120, 0.30);
  }
}

@keyframes sparkleWink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  35% {
    opacity: 0.6;
    transform: scale(1.25) rotate(20deg);
  }

  70% {
    opacity: 0.8;
    transform: scale(0.9) rotate(-10deg);
  }
}

.creator-widget {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: widgetFadeIn 0.5s 1.2s forwards;
}

.creator-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 14px;
  border-radius: 999px;
  background: radial-gradient(141.42% 141.42% at 0% 100%, rgba(29, 186, 120, 0.18) 0%, rgba(29, 186, 120, 0.00) 55%), rgba(8, 12, 12, 0.94);
  border: 1.5px solid rgba(29, 186, 120, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  animation: creatorGlow 3s ease-in-out infinite;
  transition: border-color 0.2s;
}

.creator-card:hover {
  border-color: rgba(29, 186, 120, 0.7);
}

.creator-card-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(ellipse at top, rgba(29, 186, 120, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.creator-card-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

.creator-card-text p {
  margin: 0;
  line-height: 1.3;
}

.creator-card-line1 {
  display: flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.creator-card-line2 {
  color: #1DBA78;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.creator-card-chevron {
  flex-shrink: 0;
  color: rgba(29, 186, 120, 0.7);
  transition: transform 0.2s;
}

.creator-card:hover .creator-card-chevron {
  transform: translateX(2px);
}

.creator-card-chevron i {
  width: 16px;
  height: 16px;
  display: block;
}

.creator-sparkle {
  font-size: 11px;
  color: #1DBA78;
  animation: sparkleWink 2.2s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* Animated icon well (inline, beside the text) */
.creator-icon-well {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 186, 120, 0.28) 0%, rgba(29, 186, 120, 0.05) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

.creator-feather-svg {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 0 4px rgba(29, 186, 120, 0.5));
}

.creator-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.creator-close-btn i {
  width: 14px;
  height: 14px;
}

.creator-close-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

/* ─── Creator widget — mobile: above bottom nav, more compact ─── */
@media (max-width: 767px) {
  .creator-widget {
    bottom: calc(72px + var(--safe-area-bottom) + 10px);
    right: 12px;
    left: auto;
    gap: 5px;
  }

  .creator-card {
    padding: 7px 12px 7px 11px;
    gap: 7px;
  }

  .creator-card-header {
    gap: 7px;
  }

  .creator-card-line1 {
    font-size: 10px;
  }

  .creator-card-line2 {
    font-size: 11px;
  }

  .creator-icon-well {
    width: 28px;
    height: 28px;
  }

  .creator-feather-svg {
    width: 22px;
    height: 22px;
  }

  .creator-close-btn {
    width: 22px;
    height: 22px;
  }

  .creator-close-btn i {
    width: 12px;
    height: 12px;
  }
}

/* ─── Desktop layout helpers ─── */
@media (min-width: 768px) {

  /* On md+: no bottom nav, so remove that padding from body */
  body.page-with-nav {
    padding-bottom: 0;
  }

  /* Desktop main content sits below the fixed desktop header (64px) */
  .page-with-topbar {
    padding-top: 0px;
  }

  /* Desktop section container — centered, max-width */
  .desktop-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Desktop hero height */
  .desktop-hero {
    height: 380px;
  }
}

@media (min-width: 1024px) {
  .desktop-container {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .desktop-hero {
    height: 420px;
  }
}

/* ─── Hero carousel slide transition ─── */
.hero-slide {
  will-change: opacity;
}

/* ─── Book cover — hover shadow only, no flip ─── */
.book-open {
  transition: box-shadow 250ms ease, border-color 150ms ease;
}

.book-open:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.50);
}

/* ─── Desktop genre tile ─── */
.genre-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: 16px;
  background: rgb(var(--ca-card));
  border: 1px solid rgb(var(--ca-border));
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  text-decoration: none;
}

.genre-tile:hover {
  background: rgb(var(--ca-raised));
  border-color: #1DBA7844;
  transform: translateY(-2px);
}

/* ─── Theme toggle icons (CSS-driven swap, no JS needed) ─── */
.theme-icon-light {
  display: none;
}

.theme-icon-dark {
  display: block;
}

[data-theme="light"] .theme-icon-light {
  display: block;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

/* ═══════════════════════════════════════════════════════
   PREMIUM GLASSMORPHISM SYSTEM — Public & Auth pages
   Fintech/institutional dark luxury aesthetic
   Primary: #1DBA78 | 70% black | 30% teal accent
═══════════════════════════════════════════════════════ */

/* Base glass layer */
.glass {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Premium glass panel */
.glass-premium {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(29, 186, 120, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Glass card for public sections */
.glass-card-public {
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 25px rgba(29, 186, 120, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.glass-card-public:hover {
  border-color: rgba(29, 186, 120, 0.18);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(29, 186, 120, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

/* Glass navigation bar */
.glass-nav {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(29, 186, 120, 0.10),
    0 4px 20px rgba(0, 0, 0, 0.40);
}

/* ─── Shared "tips popup" style confirm/action modal ───
   Canonical decorative shell used by Send Tip / Tip Confirmation
   popups; reused by other confirm-style modals (delete, publish,
   report, block, payout, etc.) for a consistent look site-wide. */
@keyframes tipsModalSparkle {
  0%, 100% { opacity: 0.3; transform: translateY(0) translateX(0); }
  50% { opacity: 0.8; transform: translateY(-10px) translateX(5px); }
}
@keyframes tipsModalParticle1 {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-30px) translateX(15px); }
}
@keyframes tipsModalParticle2 {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  10% { opacity: 0.5; }
  90% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-40px) translateX(-20px); }
}
@keyframes tipsModalParticle3 {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-35px) translateX(25px); }
}
@keyframes tipsModalAppear {
  0% { transform: scale(0.95) translateY(-20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.tips-modal-border {
  background: rgba(10, 14, 12, 0.95);
  border: 1px solid rgba(29, 186, 120, 0.3);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 50px rgba(29, 186, 120, 0.3);
  animation: tipsModalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tips-modal-border.tips-modal-danger {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 50px rgba(239, 68, 68, 0.25);
}
.tips-modal-glow {
  position: absolute;
  inset: 0;
  height: 200px;
  pointer-events: none;
  background: radial-gradient(ellipse at top, rgba(29, 186, 120, 0.25) 0%, transparent 70%);
  border-radius: 24px 24px 0 0;
}
.tips-modal-danger .tips-modal-glow {
  background: radial-gradient(ellipse at top, rgba(239, 68, 68, 0.22) 0%, transparent 70%);
}
.tips-modal-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(29, 186, 120, 0.7);
}
.tips-modal-danger .tips-modal-particles span {
  background: rgba(239, 68, 68, 0.7);
}
.tips-modal-border.tips-modal-warning {
  border-color: rgba(234, 179, 8, 0.35);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 50px rgba(234, 179, 8, 0.25);
}
.tips-modal-warning .tips-modal-glow {
  background: radial-gradient(ellipse at top, rgba(234, 179, 8, 0.22) 0%, transparent 70%);
}
.tips-modal-warning .tips-modal-particles span {
  background: rgba(234, 179, 8, 0.7);
}

/* Glass form card (auth containers) */
.glass-form-card {
  background: rgba(0, 0, 0, 0.70);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.60),
    0 0 80px rgba(29, 186, 120, 0.08),
    0 0 0 1px rgba(29, 186, 120, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Primary CTA button with teal glow */
.glass-btn-primary {
  background: #1DBA78;
  border: 1px solid rgba(29, 186, 120, 0.35);
  color: #ffffff;
  box-shadow:
    0 0 20px rgba(29, 186, 120, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
}

.glass-btn-primary:hover {
  background: #0D8A50;
  border-color: rgba(29, 186, 120, 0.55);
  box-shadow:
    0 0 32px rgba(29, 186, 120, 0.60),
    0 4px 16px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Secondary glass button */
.glass-btn-secondary {
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(29, 186, 120, 0.30);
  color: #1DBA78;
  box-shadow: 0 0 12px rgba(29, 186, 120, 0.12);
  transition: all 0.25s ease;
}

.glass-btn-secondary:hover {
  background: rgba(29, 186, 120, 0.16);
  border-color: rgba(29, 186, 120, 0.55);
  box-shadow: 0 0 22px rgba(29, 186, 120, 0.28);
}

/* Glass input fields */
.glass-input {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.glass-input:focus {
  border-color: rgba(29, 186, 120, 0.65);
  box-shadow: 0 0 0 3px rgba(29, 186, 120, 0.14);
  outline: none;
}

/* Enhanced desktop header */
#desktop-header {
  background: rgba(0, 0, 0, 0.78) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-bottom: 1px solid rgba(29, 186, 120, 0.10) !important;
  box-shadow:
    0 1px 0 rgba(29, 186, 120, 0.12),
    0 4px 24px rgba(0, 0, 0, 0.50) !important;
}

/* Auth pages — premium glass form card */
body.min-h-screen.flex-col>div.flex-1>div {
  position: relative;
}

/* Public surface-card enhanced glass — premium dark aesthetic */
body.public-layout .bg-surface-card,
body.public-layout .bg-surface-raised {
  background: rgba(18, 22, 28, 0.70) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(45, 212, 191, 0.08);
}

/* Teal accent dividers on public pages */
body.public-layout hr,
body.public-layout .border-surface-border {
  border-color: rgba(45, 212, 191, 0.10);
}

/* Premium teal scrollbar for public pages */
body.public-layout::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.25);
  border-radius: 4px;
}

body.public-layout::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.40);
}

/* Typography enhancements */
body.public-layout h1,
body.public-layout h2,
body.public-layout h3 {
  letter-spacing: 0.05em;
  font-weight: 900;
}

/* Link hover color */
body.public-layout a.text-brand-400:hover {
  color: #5eead4;
}

/* Bottom nav premium glass */
body.public-layout nav.bottom-nav,
body.public-layout .bottom-nav {
  background: rgba(10, 13, 15, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(45, 212, 191, 0.08);
}

/* Auth page background ambient glow */
body.min-h-screen:not(.public-layout):not(.admin-page):not(.author-page) {
  background:
    radial-gradient(ellipse 100% 55% at 50% -5%, rgba(29, 186, 120, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 63, 50, 0.06) 0%, transparent 50%),
    #000000;
}

/* ─── Rich Text Editor ─── */
.rich-editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: rgb(var(--ca-raised) / 0.5);
  border: 1px solid rgb(var(--ca-border));
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  align-items: center;
}

.toolbar-group {
  display: flex;
  gap: 2px;
  padding: 0 4px;
  border-right: 1px solid rgb(var(--ca-border) / 0.5);
}

.toolbar-group:last-child {
  border-right: none;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgb(var(--ca-text) / 0.6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.toolbar-btn:hover {
  background: rgb(var(--ca-card));
  color: rgb(var(--ca-text) / 0.85);
}

.toolbar-btn:active {
  background: rgb(var(--ca-border));
  color: rgb(var(--ca-text));
}

.toolbar-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgb(var(--ca-border));
  background: rgb(var(--ca-card));
  color: rgb(var(--ca-text) / 0.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.toolbar-select:hover {
  border-color: rgb(var(--ca-border) / 0.8);
  background: rgb(var(--ca-raised));
}

.toolbar-select:focus {
  outline: none;
  border-color: #1DBA78;
  box-shadow: 0 0 0 2px rgba(29, 186, 120, 0.2);
}

.rich-editor {
  min-height: 400px;
  padding: 20px;
  background: rgb(var(--ca-card));
  border: 1px solid rgb(var(--ca-border));
  border-radius: 0 0 12px 12px;
  border-top: none;
  color: rgb(var(--ca-text));
  font-family: 'Lora', serif;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  word-spacing: 0.04em;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow-y: auto;
}

.rich-editor:focus {
  border-color: rgb(var(--ca-border) / 0.8);
  box-shadow: 0 0 0 2px rgba(29, 186, 120, 0.1);
}

/* Placeholder styling */
.rich-editor.empty::before {
  content: attr(data-placeholder);
  color: rgb(var(--ca-text) / 0.28);
  pointer-events: none;
}

/* Editor content styling */
.rich-editor h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 24px 0 12px 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.rich-editor h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 20px 0 10px 0;
  line-height: 1.3;
}

.rich-editor h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  line-height: 1.4;
}

.rich-editor p {
  margin: 0 0 12px 0;
}

.rich-editor ul,
.rich-editor ol {
  margin: 12px 0;
  padding-left: 24px;
}

.rich-editor li {
  margin: 6px 0;
}

.rich-editor blockquote {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 4px solid #1DBA78;
  color: rgb(var(--ca-text) / 0.75);
  font-style: italic;
}

.rich-editor strong {
  font-weight: 600;
}

.rich-editor em {
  font-style: italic;
}

.rich-editor u {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.rich-editor s {
  text-decoration: line-through;
  color: rgb(var(--ca-text) / 0.6);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .rich-editor {
    min-height: 300px;
    padding: 16px;
    font-size: 15px;
  }

  .rich-editor-toolbar {
    gap: 4px;
    padding: 10px;
  }

  .toolbar-btn {
    width: 28px;
    height: 28px;
  }

  .toolbar-group {
    padding: 0 2px;
  }
}

/* Blog card with gradient border effect */
a.glass.rounded-lg[style*="background:linear-gradient"] {
  border: 1px solid transparent;
  background-image:
    linear-gradient(135deg, #1DBA78 0%, #1DBA78 100%),
    linear-gradient(135deg, rgba(70, 177, 134, 0.08) 0%, rgba(20, 20, 20, 0.15) 100%);
  background-origin: border-box, padding-box;
  background-clip: border-box, padding-box;
}