:root {
  --bg-main: #090e1a;
  --bg-card: rgba(18, 25, 43, 0.85);
  --bg-card-hover: rgba(28, 38, 64, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(56, 189, 248, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --c-blue: #38bdf8;
  --c-amber: #fbbf24;
  --c-emerald: #34d399;
  --c-red: #f87171;
  --c-indigo: #818cf8;
  --c-slate: #94a3b8;
  --c-purple: #c084fc;
  
  --player-bg: rgba(15, 23, 42, 0.96);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Cinzel', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  touch-action: pan-y;
}

.container {
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Background Glow */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.bg-glow-1 {
  top: -100px;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #38bdf8, #1e3a8a);
}

.bg-glow-2 {
  top: 400px;
  right: 5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #f59e0b, #7c2d12);
  opacity: 0.15;
}

.bg-glow-3 {
  bottom: 200px;
  left: 20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #6366f1, #312e81);
  opacity: 0.12;
}

/* Header & Author Card */
.site-header {
  position: relative;
  z-index: 1;
  padding: 40px 0 20px;
}

.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 52px;
  display: flex;
  align-items: center;
  gap: 52px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.author-avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.8);
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.25);
}

.avatar-ring {
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  animation: rotateRing 30s linear infinite;
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.author-info {
  flex-grow: 1;
}

.author-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.author-name {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.author-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 5px 14px;
  border-radius: 20px;
  margin: 0;
  white-space: nowrap;
}

.author-subtitle {
  font-size: 1.02rem;
  color: var(--c-blue);
  font-weight: 500;
  margin-bottom: 10px;
  text-align: left;
}

.author-bio {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
  max-width: 100%;
  text-align: left;
}

.header-stats-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.stat-pill strong {
  color: var(--c-amber);
}

.social-links {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.tg-btn {
  background: rgba(41, 169, 234, 0.15);
  border-color: rgba(41, 169, 234, 0.4);
  color: #38bdf8;
}
.tg-btn:hover {
  background: #29a9ea;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(41, 169, 234, 0.4);
}

.fb-btn {
  background: rgba(24, 119, 242, 0.15);
  border-color: rgba(24, 119, 242, 0.4);
  color: #60a5fa;
}
.fb-btn:hover {
  background: #1877f2;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(24, 119, 242, 0.4);
}

.ig-btn {
  background: rgba(225, 48, 108, 0.15);
  border-color: rgba(225, 48, 108, 0.4);
  color: #f472b6;
}
.ig-btn:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(225, 48, 108, 0.4);
}

/* Search Section */
.categories-section {
  position: relative;
  z-index: 1;
  padding: 20px 0 28px;
}

.search-bar-wrap {
  position: relative;
  max-width: 100%;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

#searchInput {
  width: 100%;
  padding: 14px 48px 14px 48px;
  background: #101726;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
}

#searchInput:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  background: #141e33;
}

.clear-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  display: none;
  line-height: 1;
  padding: 4px;
}

.clear-search-btn:hover {
  color: #ffffff;
}

/* 6 Category Grid - Exact Screenshot Look */
.category-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.cat-card-btn {
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cat-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 10px;
  border-radius: 8px;
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cat-folder-icon {
  font-size: 0.95rem;
}

.cat-num {
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.cat-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.cat-card-meta {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 400;
}

/* Exact Background Tints from Screenshot */
.cat-blue {
  background: #182b42;
  border-color: #2b4b73;
}
.cat-blue:hover, .cat-blue.active-category {
  background: #1e3754;
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.cat-red {
  background: #391c21;
  border-color: #6b2d35;
}
.cat-red:hover, .cat-red.active-category {
  background: #4a242a;
  border-color: #f87171;
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.3);
  transform: translateY(-2px);
}

.cat-amber {
  background: #382c16;
  border-color: #6b5223;
}
.cat-amber:hover, .cat-amber.active-category {
  background: #4a3a1d;
  border-color: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
  transform: translateY(-2px);
}

.cat-emerald {
  background: #143526;
  border-color: #245e43;
}
.cat-emerald:hover, .cat-emerald.active-category {
  background: #1a4531;
  border-color: #34d399;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
  transform: translateY(-2px);
}

.cat-indigo {
  background: #1c2642;
  border-color: #2d3e6e;
}
.cat-indigo:hover, .cat-indigo.active-category {
  background: #243256;
  border-color: #818cf8;
  box-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
  transform: translateY(-2px);
}

.cat-slate {
  background: #232c3d;
  border-color: #3c4b66;
}
.cat-slate:hover, .cat-slate.active-category {
  background: #2c384d;
  border-color: #94a3b8;
  box-shadow: 0 0 20px rgba(148, 163, 184, 0.3);
  transform: translateY(-2px);
}

/* Filter status reset bar */
.filter-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #ffffff;
  margin-top: 12px;
}

.btn-show-all {
  background: var(--c-blue);
  color: #090e1a;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-show-all:hover {
  background: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Main Catalog */
.catalog-container {
  position: relative;
  z-index: 1;
  padding-bottom: 130px;
}

.cycle-section {
  margin-bottom: 48px;
}

.cycle-header {
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.cycle-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cycle-icon {
  font-size: 1.6rem;
}

.cycle-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #dce6f0;
}

.cycle-count-badge {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--c-amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
}

.cycle-desc {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Books Grid & Perfect Equal Height Cards */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

.book-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

.book-card-top {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 28px;
}

.book-badges-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.book-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}


/* Book folder badge (yellow, replaces order badge) */
.book-folder-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #090e1a;
  background: var(--c-amber);
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  white-space: nowrap;
}

.book-genre {
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5f3fc;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.book-length {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

/* Guaranteed 2-line title height for perfect alignment */
.book-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #b8c5d9;
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 2.7em;
  max-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Guaranteed 3-line snippet height for perfect uniform cards */
.book-snippet {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 18px;
  min-height: 4.65em;
  max-height: 4.65em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Book Actions block */
.book-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.audio-controls-row {
  margin-top: 10px;
}

.audio-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  color: var(--c-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-audio:hover {
  background: var(--c-blue);
  color: #090e1a;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.btn-audio.active-playing {
  background: var(--c-amber);
  color: #090e1a;
  border-color: var(--c-amber);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
}

.download-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
}

.btn-read-online {
  flex: 2;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.1);
  color: var(--c-amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-read-online:hover {
  background: var(--c-amber);
  color: #090e1a;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.btn-dl {
  flex: 0 0 auto;
  min-width: 54px;
  max-width: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 5px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-dl:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-dl-fb2:hover { border-color: var(--c-indigo); color: var(--c-indigo); }
.btn-dl-txt:hover { border-color: var(--c-emerald); color: var(--c-emerald); }
.btn-dl-mp3 { color: #fde68a; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.btn-dl-mp3:hover { border-color: var(--c-amber); color: #090e1a; background: var(--c-amber); box-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
.btn-dl-tg:hover { border-color: var(--c-blue); color: var(--c-blue); }

.btn-share-link {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-share-link:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--c-blue);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Online Text Reader Modal */
.reader-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.reader-modal-dialog {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.reader-modal-header {
  padding: 10px 18px;
  height: 52px;
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.reader-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.reader-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.reader-badge {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.15);
  color: var(--c-amber);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.reader-book-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reader-theme-toggle, .reader-font-controls {
  height: 32px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
}

.btn-theme-reader, .btn-font-size {
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 0 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-reader.active, .btn-theme-reader:hover, .btn-font-size:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-autoscroll-reader {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-autoscroll-reader:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-autoscroll-reader.active-scroll {
  background: rgba(251, 191, 36, 0.22);
  color: var(--c-amber);
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
  animation: pulseScroll 2s infinite ease-in-out;
}

@keyframes pulseScroll {
  0%, 100% { box-shadow: 0 0 6px rgba(251, 191, 36, 0.25); }
  50% { box-shadow: 0 0 16px rgba(251, 191, 36, 0.6); }
}

.btn-fullscreen-reader {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-fullscreen-reader:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-close-reader {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-close-reader:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.reader-modal-overlay.is-fullscreen {
  padding: 0;
}

.reader-modal-dialog.fullscreen-mode {
  max-width: 100vw;
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: none;
}

.reader-modal-dialog.fullscreen-mode .reader-modal-body {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 30px;
}

.reader-modal-body {
  padding: 32px 40px;
  overflow-y: auto;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: #e2e8f0;
  flex-grow: 1;
  user-select: text;
  -webkit-overflow-scrolling: touch;
}

.reader-modal-body p {
  margin-bottom: 1.2em;
  text-indent: 1.8em;
}

/* End of book actions block inside body */
.reader-end-actions {
  margin-top: 48px;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
}

.reader-end-divider {
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  color: var(--c-amber);
  margin-bottom: 14px;
  opacity: 0.85;
}

.reader-end-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 18px;
}

.reader-end-listen-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-reader-listen {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--c-blue);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-reader-listen:hover {
  background: var(--c-blue);
  color: #090e1a;
}

.reader-end-dl-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reader-end-dl-row .btn-dl {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Reader Themes */
.reader-theme-sepia {
  background: #fbf0d9 !important;
  color: #2c2518 !important;
  border-color: #e4d3b6 !important;
}
.reader-theme-sepia .reader-book-title { color: #2c2518 !important; }
.reader-theme-sepia .reader-modal-body { color: #3d3221 !important; }
.reader-theme-sepia .reader-modal-header, 
.reader-theme-sepia .reader-modal-footer {
  background: #f4e5c8 !important;
  border-color: #dec8a2 !important;
}

.reader-theme-light {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
.reader-theme-light .reader-book-title { color: #0f172a !important; }
.reader-theme-light .reader-modal-body { color: #1e293b !important; }
.reader-theme-light .reader-modal-header,
.reader-theme-light .reader-modal-footer {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

/* Sticky Audio Player */
.sticky-player {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: var(--player-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.75);
  padding: 12px 0;
  transform: translateY(115%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-player.visible { transform: translateY(0); }

.player-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 260px;
  flex-shrink: 0;
}

.player-cover {
  width: 44px;
  height: 44px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.player-meta { overflow: hidden; }

.player-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-voice {
  font-size: 0.78rem;
  color: var(--c-amber);
  font-weight: 500;
}

.player-center {
  flex-grow: 1;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-controls { display: flex; align-items: center; gap: 14px; }

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 6px;
  border-radius: 50%;
}

.ctrl-btn:hover { color: var(--text-main); transform: scale(1.08); }

.ctrl-btn.play-btn {
  width: 42px;
  height: 42px;
  background: var(--c-blue);
  color: #090e1a;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.ctrl-btn.play-btn:hover { transform: scale(1.08); background: #7dd3fc; }

.player-timeline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.seek-slider-wrap {
  position: relative;
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
}

#seekSlider {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0; z-index: 3;
}

.seek-progress {
  position: absolute;
  top: 0; left: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--c-blue), var(--c-amber));
  border-radius: 3px;
  pointer-events: none;
}

.player-right {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 320px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Volume slider */
.volume-control-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-volume {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.btn-volume:hover { color: #ffffff; }

.vol-slider {
  width: 65px;
  height: 4px;
  accent-color: var(--c-blue);
  cursor: pointer;
}

.speed-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-badge:hover {
  background: rgba(255, 255, 255, 0.15);
}

.voice-toggle-wrap {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px;
}

.btn-voice-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 18px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-voice-toggle.active {
  background: var(--c-amber);
  color: #090e1a;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.btn-close-player { font-size: 1.3rem; line-height: 1; color: var(--text-dim); }

/* Toast Notification */
.toast-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  background: rgba(15, 23, 42, 0.95);
  color: var(--c-blue);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  transform: translateY(-50px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: rgba(6, 10, 19, 0.96);
  padding: 18px 0;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.footer-left {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}

.footer-copy {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer-author-link,
.footer-copy a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-author-link:hover,
.footer-copy a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.footer-badges {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.footer-badge-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.5;
  filter: grayscale(15%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.footer-badge-btn:hover {
  opacity: 1;
  filter: none;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.35);
  color: #ffffff;
}

.badge-gin-it {
  padding: 0 10px 0 6px;
}

.badge-img-gin {
  height: 24px;
  width: auto;
  max-width: 32px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.badge-text-gin {
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-text-gin strong {
  color: #38bdf8;
  font-weight: 800;
}

.badge-stat-btn {
  padding: 0 10px 0 6px;
}

.badge-img-stat {
  height: 20px;
  width: 20px;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

.badge-text-stat {
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-text-stat strong {
  color: #38bdf8;
  font-weight: 800;
}

@media (max-width: 900px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .footer-left {
    justify-content: center;
  }
  .footer-badges {
    justify-content: center;
  }
}

.catalog-loading, .catalog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--c-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsiveness */

/* ==========================================================================
   Cycle Section Block Colors (match category button colors)
   ========================================================================== */
.cycle-block {
  margin-bottom: 52px;
  border-radius: 14px;
  padding: 24px 22px 28px;
  border-left: 4px solid transparent;
}

.cycle-01 { background: rgba(24, 43, 66, 0.55); border-left-color: #38bdf8; }
.cycle-02 { background: rgba(57, 28, 33, 0.55); border-left-color: #f87171; }
.cycle-03 { background: rgba(56, 44, 22, 0.55); border-left-color: #fbbf24; }
.cycle-04 { background: rgba(20, 53, 38, 0.55); border-left-color: #34d399; }
.cycle-05 { background: rgba(28, 38, 66, 0.55); border-left-color: #818cf8; }
.cycle-06 { background: rgba(35, 44, 61, 0.55); border-left-color: #94a3b8; }

/* Cycle badge colored border */
.cycle-01 .cycle-badge { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.08); }
.cycle-02 .cycle-badge { color: #f87171; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.cycle-03 .cycle-badge { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.cycle-04 .cycle-badge { color: #34d399; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.cycle-05 .cycle-badge { color: #818cf8; border-color: rgba(129, 140, 248, 0.4); background: rgba(129, 140, 248, 0.08); }
.cycle-06 .cycle-badge { color: #94a3b8; border-color: rgba(148, 163, 184, 0.4); background: rgba(148, 163, 184, 0.08); }

/* cycle-badge style itself */
.cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-icon {
  font-size: 1.1rem;
}

/* ==========================================================================
   Mobile responsive fix for book title color in @media sections
   ========================================================================== */
@media (max-width: 1024px) {
  .category-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .books-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (max-width: 768px) {
  .container {
    padding: 0 14px;
  }

  .site-header {
    padding: 20px 0 12px;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
    padding: 22px 16px;
    gap: 16px;
  }

  .author-avatar-wrap {
    width: 110px;
    height: 110px;
    margin: 0 auto;
  }

  .author-top-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .author-name {
    font-size: 1.65rem;
    text-align: center;
  }

  .author-badge {
    font-size: 0.72rem;
    padding: 4px 12px;
  }

  .author-subtitle {
    text-align: center;
    font-size: 0.92rem;
  }

  .author-bio {
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .header-stats-row {
    justify-content: center;
    gap: 6px;
  }

  .stat-pill {
    font-size: 0.76rem;
    padding: 3px 8px;
  }

  .social-links {
    justify-content: center;
    gap: 8px;
  }

  .social-btn {
    font-size: 0.82rem;
    padding: 6px 12px;
  }

  .categories-section {
    padding: 12px 0 20px;
  }

  #searchInput {
    padding: 12px 42px 12px 42px;
    font-size: 0.92rem;
  }

  .category-grid-6 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cat-card-btn {
    padding: 14px 16px;
    gap: 6px;
  }

  .cat-card-title {
    font-size: 0.96rem;
  }

  .cat-card-meta {
    font-size: 0.8rem;
  }

  .filter-status-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px 14px;
  }

  .cycle-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  .cycle-title {
    font-size: 1.25rem;
  }

  .cycle-count-badge {
    align-self: flex-start;
  }

  .books-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .book-card {
    padding: 16px 14px;
  }

  .book-title {
    font-size: 1.08rem;
    min-height: auto;
    max-height: none;
    -webkit-line-clamp: 3;
  }

  .book-snippet {
    font-size: 0.86rem;
    line-height: 1.5;
    min-height: auto;
    max-height: none;
    -webkit-line-clamp: 4;
    margin-bottom: 14px;
  }

  .bg-glow {
    display: none !important;
  }

  .catalog-container {
    padding-bottom: 140px;
  }

  /* Mobile Reader Modal - True 100% Fullscreen E-Reader Mode */
  .reader-modal-overlay {
    padding: 0 !important;
    margin: 0 !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999;
    border-radius: 0 !important;
    background: #0f172a;
  }

  .reader-modal-dialog {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    background: #0f172a;
  }

  .reader-modal-header {
    padding: 8px 12px;
    height: 50px;
    min-height: 50px;
    background: rgba(8, 12, 22, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
  }

  .reader-header-left {
    min-width: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .reader-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .reader-badge {
    height: 32px;
    font-size: 0.84rem;
    font-weight: 800;
    padding: 0 10px;
    border-radius: 8px;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reader-book-title {
    display: none !important;
  }

  .reader-header-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
  }

  .reader-theme-toggle, .reader-font-controls {
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
  }

  .btn-theme-reader {
    height: 26px;
    padding: 0 5px;
    font-size: 0.76rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-font-size {
    height: 26px;
    padding: 0 5px;
    font-size: 0.74rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-autoscroll-reader {
    height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    font-size: 0.72rem;
    gap: 3px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .btn-autoscroll-reader svg {
    width: 12px;
    height: 12px;
  }

  .btn-fullscreen-reader {
    display: none !important;
  }

  .btn-close-reader {
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .btn-close-reader:active {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
  }

  .reader-modal-body {
    padding: 18px 16px 40px;
    font-size: 1.05rem;
    line-height: 1.7;
    flex-grow: 1;
    height: calc(100vh - 50px);
    height: calc(100dvh - 50px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reader-modal-body p {
    margin-bottom: 1.1em;
    text-indent: 1.2em;
  }

  .reader-end-actions {
    margin-top: 36px;
    padding: 22px 14px;
  }

  .reader-end-heading {
    font-size: 0.92rem;
  }

  .reader-end-listen-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .btn-reader-listen {
    padding: 9px 4px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .reader-end-dl-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .reader-end-dl-row .btn-dl {
    padding: 8px 4px;
    font-size: 0.78rem;
  }

  /* Fixed footer removed on mobile - actions are at the end of the text */
  .reader-modal-footer {
    display: none !important;
  }

  /* Sticky Audio Player on Mobile */
  .sticky-player {
    padding: 10px 0 12px;
  }

  .player-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 14px;
    position: relative;
  }

  .player-left {
    width: calc(100% - 36px);
    gap: 10px;
  }

  .player-cover {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .player-title {
    font-size: 0.86rem;
  }

  .player-voice {
    font-size: 0.74rem;
  }

  .player-center {
    width: 100%;
    max-width: 100%;
    order: 2;
    gap: 4px;
  }

  .player-controls {
    gap: 12px;
  }

  .ctrl-btn.play-btn {
    width: 38px;
    height: 38px;
  }

  .player-timeline {
    font-size: 0.72rem;
    gap: 8px;
  }

  .player-right {
    width: 100%;
    order: 3;
    justify-content: space-between;
    gap: 8px;
  }

  .volume-control-wrap {
    display: none;
  }

  .speed-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  .voice-toggle-wrap {
    padding: 2px;
  }

  .btn-voice-toggle {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .btn-close-player {
    position: absolute;
    right: 12px;
    top: 8px;
    padding: 4px;
  }
}

@media (max-width: 480px) {
  .download-buttons {
    gap: 4px;
  }

  .btn-read-online {
    padding: 6px 2px;
    font-size: 0.92rem;
  }

  .btn-dl {
    padding: 6px 2px;
    font-size: 0.72rem;
    gap: 2px;
  }

  .btn-dl svg {
    width: 11px;
    height: 11px;
  }

  .btn-share-link {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  .btn-share-link svg {
    width: 12px;
    height: 12px;
  }

  .audio-buttons {
    gap: 6px;
  }

  .btn-audio {
    padding: 7px 4px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .btn-audio svg {
    width: 13px;
    height: 13px;
  }
}


/* ==========================================================================
   Author Avatar Socials & Language Switcher
   ========================================================================== */

.author-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.author-avatar-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.avatar-social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.avatar-social-btn:hover {
  transform: translateY(-3px) scale(1.14);
}

.avatar-social-btn.tg-circle {
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  box-shadow: 0 4px 14px rgba(34, 158, 217, 0.45);
}
.avatar-social-btn.tg-circle:hover {
  box-shadow: 0 6px 20px rgba(34, 158, 217, 0.7);
}

.avatar-social-btn.wa-circle {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}
.avatar-social-btn.wa-circle:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.7);
}

.author-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 3px 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 16px;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  user-select: none;
  outline: none;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-1px) scale(1.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.lang-btn .flag-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.lang-btn .lang-code {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* All 4 languages always displayed; active language is highlighted */
.lang-btn.active-lang {
  display: inline-flex !important;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
  font-weight: 800;
}

/* ==========================================================================
   Non-RU Audio Hiding & Selective Features
   ========================================================================== */

body.no-audio .stat-audio-only,
body.no-audio #stickyPlayer,
body.no-audio .btn-audio,
body.no-audio .audio-controls-row,
body.no-audio .reader-listen-row {
  display: none !important;
}

/* ==========================================================================
   Hebrew RTL Support
   ========================================================================== */

html[dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: 'Assistant', var(--font-sans);
}

html[dir="rtl"] .author-card {
  text-align: right;
}

html[dir="rtl"] .author-top-row {
  flex-direction: row-reverse;
}

html[dir="rtl"] .author-top-right {
  flex-direction: row-reverse;
}

html[dir="rtl"] .author-subtitle,
html[dir="rtl"] .author-bio {
  text-align: right;
}

html[dir="rtl"] .header-stats-row {
  justify-content: flex-start;
}

html[dir="rtl"] .social-links {
  justify-content: flex-start;
}

html[dir="rtl"] .reader-modal-dialog {
  text-align: right;
}

html[dir="rtl"] .reader-modal-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .reader-header-controls {
  flex-direction: row-reverse;
}

html[dir="rtl"] .reader-modal-body {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .book-card-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .book-card-body {
  text-align: right;
}

html[dir="rtl"] .cat-card-btn {
  text-align: right;
}

html[dir="rtl"] .cat-badge-wrap {
  flex-direction: row-reverse;
}

html[dir="rtl"] .search-bar-wrap {
  flex-direction: row-reverse;
}

html[dir="rtl"] .search-bar-wrap input {
  text-align: right;
}


/* ==========================================================================
   Refined Theme & UI Overrides
   ========================================================================== */
.flag-svg {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
}

/* Category Yellow Folder Badges (Dark background with yellow border) */
.cat-badge-yellow {
  background: rgba(0, 0, 0, 0.55) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border: 1px solid rgba(251, 191, 36, 0.65) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cat-badge-yellow .cat-folder-icon,
.cat-badge-yellow .badge-icon {
  font-size: 0.95rem;
}

.cat-badge-yellow .cat-num,
.cat-badge-yellow .badge-num {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* Book Cyan/Blue Folder Badges */
.book-folder-badge {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #090e1a !important;
  background: #38bdf8 !important;
  padding: 3px 10px !important;
  border-radius: 8px !important;
  letter-spacing: 0.03em !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35) !important;
}

/* Book Title - Soft gray-white (not harsh stark white) */
.book-title {
  color: #cbd5e1 !important;
  font-size: 1.12rem !important;
  font-weight: 600 !important;
}

.book-snippet {
  color: #94a3b8 !important;
}

/* Cycle Banner Header in Catalog */
.cycle-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: wrap;
}

.cycle-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 45%;
  max-width: 55%;
}

.cycle-header-main .cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  padding: 5px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.cycle-header-main .cycle-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  line-height: 1.2;
}

.cycle-header-banner .cycle-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  margin: 0;
  flex: 1 1 40%;
  max-width: 44%;
  line-height: 1.45;
  text-align: right;
}

@media (max-width: 768px) {
  .cycle-header-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .cycle-header-main {
    max-width: 100%;
  }
  .cycle-header-banner .cycle-desc {
    max-width: 100%;
    text-align: left;
  }
}

/* Action Buttons Widths and Spacing */
.download-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.btn-read-online {
  flex: 1 1 auto !important;
  min-width: 110px !important;
  padding: 7px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
}

.btn-dl {
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  padding: 7px 4px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  text-align: center !important;
}

.btn-share-link {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
}

.audio-controls-row {
  margin-top: 14px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.audio-buttons {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}


.footer-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-counter a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.footer-counter img {
  border-radius: 4px;
  vertical-align: middle;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-counter a:hover img {
  opacity: 0.85;
  transform: scale(1.05);
}