/* ══════════════════════════════════════════════════════════════════════════
   BIBLE — ZEN PASTEL & MATTE CHARCOAL DESIGN SYSTEM (modeled on monogenesis)
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Light Mode: Serene lavender-tinted stone & crisp white surfaces */
  --bg-main: #f3f2f7;
  --bg-surface: #ffffff;
  --bg-subtle: #eae8f1;
  --bg-hover: #e0ddeb;
  --border-color: #dedbe8;
  --border-focus: #887d9f;

  --text-primary: #211e29;
  --text-secondary: #585366;
  --text-muted: #8d879d;

  --accent-zen: #756c88;
  --accent-zen-light: #ece8f4;
  --accent-slate: #6b788c;
  --accent-slate-light: #ebf0f5;
  --accent-rose: #a86c65;
  --accent-rose-light: #f7ebe9;
  --accent-emerald: #10b981;
  --accent-emerald-light: rgba(16, 185, 129, 0.12);

  --primary: #685e7d;
  --primary-hover: #564c6a;

  /* Typing specific colors */
  --char-untyped: #8a839b;
  --char-correct: #1e1b26;
  --char-correct-bg: rgba(16, 185, 129, 0.09);
  --char-current-bg: rgba(104, 94, 125, 0.18);
  --char-current-border: #685e7d;
  --char-error-text: #dc2626;
  --char-error-bg: rgba(220, 38, 38, 0.18);

  --shadow-sm: 0 1px 3px rgba(33, 30, 41, 0.04);
  --shadow-md: 0 4px 16px rgba(33, 30, 41, 0.05);
  --shadow-lg: 0 12px 30px rgba(33, 30, 41, 0.07);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode: Matte charcoal with soothing lavender-grey typography */
  --bg-main: #141318;
  --bg-surface: #1e1d26;
  --bg-subtle: #262430;
  --bg-hover: #2f2d3b;
  --border-color: #2b2937;
  --border-focus: #827599;

  --text-primary: #cfcbd6;
  --text-secondary: #9c97a8;
  --text-muted: #6e697a;

  --accent-zen: #978aa9;
  --accent-zen-light: #23202c;
  --accent-slate: #8893a5;
  --accent-slate-light: #1b1e25;
  --accent-rose: #bc827b;
  --accent-rose-light: #261c1b;
  --accent-emerald: #34d399;
  --accent-emerald-light: rgba(52, 211, 153, 0.14);

  --primary: #82759a;
  --primary-hover: #9689af;

  --char-untyped: #666173;
  --char-correct: #e2dfe8;
  --char-correct-bg: rgba(52, 211, 153, 0.11);
  --char-current-bg: rgba(130, 117, 154, 0.28);
  --char-current-border: #a597bf;
  --char-error-text: #f87171;
  --char-error-bg: rgba(239, 68, 68, 0.26);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.55);
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   NAVBAR & TOP BAR WPM / CPM STATS PILLS
   ══════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background-color: rgba(243, 242, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
  flex-wrap: wrap;
}

[data-theme="dark"] .navbar {
  background-color: rgba(19, 18, 23, 0.94);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  min-height: 36px;
  transition: all var(--transition-fast);
}

.nav-back-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ── Navbar Center Tools: Search, Browse Drawer & Translation Select ── */
.nav-center-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  max-width: 660px;
  justify-content: center;
  margin: 0 0.5rem;
  min-width: 0;
}

.nav-search-wrapper {
  position: relative;
  flex: 1;
  max-width: 320px;
  min-width: 140px;
}

.nav-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0.7;
}

.nav-search-input {
  width: 100%;
  padding: 0.38rem 0.75rem 0.38rem 1.95rem;
  font-size: 0.82rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  min-height: 34px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(104, 94, 125, 0.15);
}

.nav-browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-browse-btn:hover,
.nav-browse-btn.is-open {
  border-color: var(--primary);
  background: var(--accent-zen-light);
  color: var(--primary);
}

.nav-browse-caret {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.nav-translation-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.38rem 1.6rem 0.38rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238d879d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  transition: all var(--transition-fast);
}

.nav-translation-select:hover {
  border-color: var(--primary);
}

.chapter-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  max-height: 340px;
  overflow-y: auto;
  padding: 0.35rem;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.is-first {
  background: var(--bg-hover);
}

.search-result-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.search-result-left strong {
  font-size: 0.84rem;
}

.search-result-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.search-done-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: var(--accent-emerald-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.search-partial-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .search-partial-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
}

.search-go-hint {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
}

/* ── Browse Drawer (Dropdown from Title Bar) ───────────────────── */
.browse-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 60;
}

.browse-drawer {
  position: fixed;
  top: var(--browse-top, 64px);
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - var(--browse-top, 64px) - 1.5rem);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 65;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1.25rem;
}

.book-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.book-browser-tabs {
  display: flex;
  gap: 0.35rem;
}

.book-tab-btn {
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.book-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.book-browser-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.book-browser-books-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-right: 0.4rem;
  border-right: 1px solid var(--border-color);
  max-height: 400px;
}

.drawer-book-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.drawer-book-item:hover {
  background: var(--bg-hover);
}

.drawer-book-item.active {
  background: var(--accent-zen-light);
  border-color: var(--primary);
  font-weight: 600;
}

.drawer-book-progress {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.drawer-book-item.is-book-complete .drawer-book-progress {
  color: var(--accent-emerald);
  font-weight: 600;
}

.book-browser-chapters-panel {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 400px;
  padding-right: 0.35rem;
}

.drawer-chapters-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.84rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.drawer-chapters-header span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.drawer-chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.35rem;
}

.drawer-chapter-pill {
  position: relative;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: all var(--transition-fast);
}

.drawer-chapter-pill:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.drawer-chapter-pill.is-completed {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
  font-weight: 600;
}

.drawer-chapter-pill.is-partial {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  font-weight: 600;
}

.drawer-chapter-pill.is-drawer-selected {
  box-shadow: 0 0 0 2px var(--primary);
}

.drawer-ch-bar {
  width: 80%;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.drawer-ch-bar i {
  display: block;
  height: 100%;
  background: var(--accent-emerald);
  border-radius: 999px;
}

.drawer-verses-section {
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.drawer-verses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  flex-wrap: wrap;
}

.drawer-verses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.25rem;
}

.drawer-verse-pill {
  position: relative;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.drawer-verse-pill:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  color: var(--primary);
}

.drawer-verse-pill.is-completed {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  font-weight: 600;
}

.drawer-v-check {
  font-size: 0.55rem;
  margin-left: 1px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.nav-about-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  min-height: 36px;
}

.nav-about-btn:hover {
  background: var(--bg-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.nav-about-btn.active {
  background: var(--accent-zen-light);
  color: var(--primary);
  border-color: var(--primary);
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem 0.25rem 0.3rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-hover);
}

.btn-signout {
  padding: 0.42rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-signout:hover {
  background: var(--accent-rose-light);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* ══════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT & BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.85rem 1.25rem 3.5rem;
  min-height: calc(100vh - 65px);
  width: 100%;
}

.screen-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.screen-lang-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent-zen-light);
  border: 1px solid var(--border-color);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.55rem;
}

.screen-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.screen-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  max-width: 640px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 40px;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-focus);
}

.btn-sm {
  padding: 0.4rem 0.78rem;
  font-size: 0.79rem;
  min-height: 34px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════════════════════
   SIGN IN SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.signin-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  padding: 1.5rem 0.5rem;
}

.signin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.signin-logo {
  font-size: 2.6rem;
  margin-bottom: 0.65rem;
}

.signin-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
  color: var(--text-primary);
}

.signin-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.85rem;
  line-height: 1.55;
}

.signin-btn-container {
  display: flex;
  justify-content: center;
  min-height: 48px;
  margin-bottom: 1.5rem;
}

.signin-features-mini {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.signin-feature-pill {
  font-size: 0.73rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.signin-footer {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME HUB SCREEN & FEATURE CARD (modeled on monogenesis scripts hub)
   ══════════════════════════════════════════════════════════════════════════ */
.hub-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hub-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.hub-card-top {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.hub-glyph {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--accent-zen-light);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.95rem;
  flex-shrink: 0;
}

.hub-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--primary);
}

.hub-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
}

.hub-title-link {
  color: var(--text-primary);
  text-decoration: none;
}

.hub-native {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hub-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.58;
}

.hub-subcards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.hub-subitem-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.hub-subitem-info strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.hub-subitem-info span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.hub-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hub-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.hub-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

.hub-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
/* ── No-Scroll Screen Fitting for Typing Screen ──────────────── */
html.typing-active-view,
body.typing-active-view {
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

body.typing-active-view {
  display: flex;
  flex-direction: column;
}

body.typing-active-view #nav-container {
  flex-shrink: 0;
}

body.typing-active-view .main-content {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  padding: 0.25rem 1.25rem 2.25rem; /* Generous padding at the bottom of the card */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.typing-screen-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  gap: 0.45rem;
  box-sizing: border-box;
}

/* ── Sleek Borderless Summary Bar (No background, no border) ────── */
.typing-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.2rem 0.25rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.summary-line-top {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-line-bottom {
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-color);
}

.summary-line-bottom[hidden] {
  display: none !important;
}

.summary-nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary-actions-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.summary-metrics-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.summary-stat-divider {
  color: var(--border-color);
  font-weight: 700;
  user-select: none;
}

.summary-step-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.summary-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.summary-tr-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--accent-zen-light);
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.summary-action-btn {
  font-size: 0.76rem;
  padding: 0.25rem 0.6rem;
  min-height: 28px;
  white-space: nowrap;
}

.summary-stat-box {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.summary-stat-box .stat-lbl {
  font-size: 0.64rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.summary-stat-box .stat-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.skip-completed-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.skip-completed-toggle-pill.is-on {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  font-weight: 600;
}

.skip-completed-toggle-pill.is-off {
  opacity: 0.65;
}

.typing-options-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  min-height: 28px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius-sm);
  letter-spacing: normal;
}

.advance-step-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  min-height: 28px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.advance-step-btn.is-ready {
  background: var(--accent-emerald) !important;
  color: #ffffff !important;
  border-color: var(--accent-emerald) !important;
  font-weight: 700;
  animation: pulseAdvance 2s infinite ease-in-out;
}

@keyframes pulseAdvance {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
}

/* ── Typing Options Modal ───────────────────────────────────────── */
.typing-options-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 19, 24, 0.62);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3rem, 9vh, 5.5rem) 1.25rem 2rem;
  overflow-y: auto;
}

.typing-options-backdrop[hidden] {
  display: none !important;
}

.typing-options-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.15rem 1.35rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform-origin: top center;
  animation: modalSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-options-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.typing-options-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.options-close-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.options-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.typing-options-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Mode Tabs inside Options Modal */
.modal-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
  margin-bottom: 0.35rem;
}

.modal-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.52rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.modal-mode-tab:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-mode-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

[data-theme="dark"] .modal-mode-tab.active {
  background: var(--bg-surface);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.modal-tab-panels-wrapper {
  display: grid;
  grid-template-areas: "tabpanel";
  min-height: 155px;
}

.modal-tab-panel {
  grid-area: tabpanel;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s ease;
}

.modal-tab-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.typing-options-section-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.3rem 0 0.05rem;
}

.typing-options-section-divider span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

.typing-options-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.typing-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.typing-option-row:hover {
  background: var(--bg-surface-elevated, var(--bg-surface));
}

.typing-option-row.option-action-row {
  cursor: default;
}

.typing-option-row.typing-option-subrow {
  margin-left: 0.75rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--accent-emerald);
}

.typing-option-row .option-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}

.option-select-inline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.option-select-inline:focus {
  border-color: var(--accent-emerald);
}

.option-select-inline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Compact iOS toggle switch */
.option-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 20px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  outline: none;
  border: 1px solid var(--border-color);
  transition: background 0.2s ease, border-color 0.2s ease;
  margin: 0;
  flex-shrink: 0;
}

.option-switch:checked {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.option-switch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.option-switch::after {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  width: 15px;
  height: 15px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.option-switch:checked::after {
  transform: translateX(18px);
}

.typing-options-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.chapter-completed-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

.chapter-partial-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

[data-theme="dark"] .chapter-partial-pill {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

/* ── Progress Track & Error Alert ──────────────────────────────── */
.typing-chapter-progress-track {
  width: 100%;
  height: 3px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.typing-chapter-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-emerald));
  border-radius: var(--radius-full);
  transition: width 0.12s ease;
}

.typing-error-alert {
  background: var(--char-error-bg);
  border: 1px solid var(--char-error-text);
  color: var(--char-error-text);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-align: center;
  flex-shrink: 0;
}

/* ── Main Scripture Typing Viewport (fits content up to max card size) ───── */
.typing-viewport-wrapper {
  position: relative;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  cursor: text;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden !important;
  flex: 0 1 auto;
  min-height: 110px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.typing-viewport-wrapper.is-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(104, 94, 125, 0.12), var(--shadow-md);
}

.typing-viewport-wrapper.has-active-error {
  border-color: var(--char-error-text);
}

.typing-hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  left: 0;
  top: 0;
}

.typing-focus-banner {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  z-index: 10;
  background: var(--accent-zen-light);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.typing-passage-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 1.6rem 2.25rem 2.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.typing-passage-content {
  font-family: var(--font-mono);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 2.05;
  color: var(--char-untyped);
  user-select: none;
  word-break: normal;
  overflow-wrap: break-word;
}

.verse-block {
  display: inline;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.verse-block.is-active-verse .verse-num {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Visible Verse Number Badge (Never Typed!) */
.verse-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.16rem 0.42rem;
  margin-right: 0.28rem;
  margin-left: 0.15rem;
  vertical-align: super;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  user-select: none;
  pointer-events: none;
}

.t-word {
  display: inline-block;
  white-space: nowrap;
}

.t-char {
  display: inline;
  position: relative;
  border-radius: 3px;
  transition: color 0.05s ease, background-color 0.05s ease;
}

.t-char.t-space {
  white-space: pre;
}

.t-char.is-correct {
  color: var(--char-correct);
  background-color: var(--char-correct-bg);
}

.t-char.is-current {
  color: var(--text-primary);
  background-color: var(--char-current-bg);
  box-shadow: -2px 0 0 0 var(--char-current-border);
}

.t-char.is-error {
  color: var(--char-error-text) !important;
  background-color: var(--char-error-bg) !important;
  text-decoration: underline wavy var(--char-error-text);
}

.t-char.is-error-caret {
  box-shadow: -2px 0 0 0 var(--char-error-text);
}

.typing-loading-state,
.typing-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 220px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ── Completion Celebration Modal ──────────────────────────────── */
.completion-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 19, 24, 0.62);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.completion-modal-backdrop[hidden] {
  display: none !important;
}

.completion-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 520px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.completion-badge-icon {
  font-size: 2.6rem;
  margin-bottom: 0.4rem;
}

.completion-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  margin-bottom: 0.25rem;
}

.completion-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.completion-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.comp-highlight-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.comp-highlight-pill.is-emerald {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.comp-highlight-pill.is-lavender {
  background: var(--accent-zen-light);
  color: var(--primary);
}

.completion-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.completion-stat-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.c-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.c-stat-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.completion-reach-summary {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comp-reach-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.completion-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   TYPING PROGRESS & BIBLE COMPLETENESS SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.progress-screen-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.kpi-value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
}

.kpi-value small {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.kpi-mini-bar {
  margin-top: 0.35rem;
  height: 5px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.kpi-mini-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: var(--radius-full);
}

.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.section-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-card-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.filter-active-badge {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--accent-zen-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.reach-header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.chart-toggle-pills {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.18rem;
  gap: 0.18rem;
}

.pill-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Subtle Per-Translation Completeness Drawer ────────────────── */
.translation-breakdown-drawer {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tr-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tr-drawer-hint {
  font-size: 0.79rem;
  color: var(--text-secondary);
}

.tr-breakdown-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tr-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tr-stat-pill:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.tr-stat-pill.has-progress {
  border-color: rgba(16, 185, 129, 0.45);
}

.tr-stat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.tr-pill-code {
  font-weight: 600;
}

.tr-pill-count {
  opacity: 0.85;
  font-family: var(--font-mono);
  font-size: 0.71rem;
}

/* ── 66-Book Completeness Grid ─────────────────────────────────── */
.books-reach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.book-reach-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color var(--transition-fast);
}

.book-reach-card.has-book-progress {
  background: var(--bg-surface);
  border-color: var(--border-focus);
}

.book-reach-card.is-book-complete {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
}

.book-reach-top {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.book-reach-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
}

.book-reach-count {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.book-reach-bar-track {
  height: 5px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.book-reach-bar-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: var(--radius-full);
}

.book-reach-chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-color);
}

.reach-ch-cell {
  height: 26px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.69rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.reach-ch-cell:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.reach-ch-cell.is-done {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
  font-weight: 700;
}

.reach-ch-cell.is-read {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.reach-ch-cell.is-both {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  border-color: #10b981;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

.reach-ch-cell.is-partial {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
  color: #b45309;
  font-weight: 600;
}

[data-theme="dark"] .reach-ch-cell.is-read {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

[data-theme="dark"] .reach-ch-cell.is-both {
  background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
  border-color: #10b981;
  color: #ffffff;
}

[data-theme="dark"] .reach-ch-cell.is-partial {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.65);
  color: #fbbf24;
}

/* ── Completeness Legend Bar ───────────────────────────────────── */
.completeness-legend-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.legend-swatch.is-done {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.legend-swatch.is-read {
  background: #3b82f6;
  border-color: #2563eb;
}

.legend-swatch.is-both {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  border-color: #10b981;
}

.legend-swatch.is-partial {
  background: rgba(245, 158, 11, 0.4);
  border-color: rgba(245, 158, 11, 0.6);
}

/* ── KPI Read & Both Cards ─────────────────────────────────────── */
.kpi-card.is-primary-kpi {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

.kpi-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.kpi-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
}

.kpi-badge.is-read {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.kpi-badge.is-done {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-badge.is-both {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.kpi-note-text {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Read Status Badges & Buttons ──────────────────────────────── */
.mark-read-btn.is-read-active {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  font-weight: 600;
}

[data-theme="dark"] .mark-read-btn.is-read-active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !important;
}

.votd-mark-btn.is-read-active {
  background: rgba(59, 130, 246, 0.12) !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  font-weight: 600;
}

[data-theme="dark"] .votd-mark-btn.is-read-active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
  color: #93c5fd !important;
}

.votd-top-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.votd-read-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
}

.votd-read-badge.is-read {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.votd-read-badge.is-done {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.votd-read-badge.is-both {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.hero-progress-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-progress-banner strong {
  color: var(--text-primary);
}

.hero-progress-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.3rem;
}

.hero-progress-link:hover {
  text-decoration: underline;
}

sup.verse-num.is-read {
  color: #3b82f6;
  font-weight: 700;
}

sup.verse-num.is-both {
  color: #7c3aed;
  font-weight: 700;
}

.chapter-completed-pill.is-read {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.chapter-completed-pill.is-both {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ── Speed Chart & Historic Sessions Table ─────────────────────── */
.speed-chart-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.speed-chart-svg {
  width: 100%;
  height: auto;
  min-width: 480px;
  display: block;
}

.chart-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.history-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.history-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.hist-passage-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hist-passage-cell span {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.hist-tr-badge {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--accent-zen-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 600;
}

.hist-date-cell {
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.hist-action-cell {
  text-align: right;
}

@media (max-width: 720px) {
  .navbar {
    padding: 0.6rem 0.9rem;
  }

  .nav-user-name,
  .nav-stat-label {
    display: none;
  }

  .book-browser-body {
    grid-template-columns: 1fr;
    max-height: 420px;
  }

  .book-browser-books-list {
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
  }

  .typing-passage-scroll {
    padding: 1.25rem;
    height: 48vh;
  }

  .completion-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   LANDING PAGE HERO & 3D FLIPPABLE PREVIEW CARDS (modeled on monogenesis)
   ══════════════════════════════════════════════════════════════════════════ */
.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 2rem 0.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--accent-zen-light);
  border: 1px solid var(--border-color);
  color: var(--accent-zen);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.15rem;
}

[data-theme="dark"] .hero-badge {
  color: var(--text-primary);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 3.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
  max-width: 620px;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.55;
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  min-height: 48px;
  border-radius: var(--radius-lg);
}

.votd-card-wrapper {
  width: 100%;
  max-width: 660px;
  margin: 2.25rem auto 0;
}

.votd-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.85rem 2.25rem;
  box-shadow: var(--shadow-md);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.votd-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.votd-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.votd-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent-zen-light);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
}

.votd-action-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  margin-left: auto;
}

.votd-quote {
  font-family: var(--font-sans);
  font-size: clamp(1.08rem, 2.2vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-primary);
  font-style: normal;
  letter-spacing: -0.01em;
}

.votd-quote .verse-num {
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
  vertical-align: baseline;
  margin-right: 0.45rem;
}

.votd-ref-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.votd-ref-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.votd-ref-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.votd-bottom-row,
.votd-ctas {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
  border-top: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   GLOBAL UNAUTHENTICATED WARNING BANNER & SIGN-IN UNAUTHENTICATED SECTION
   ══════════════════════════════════════════════════════════════════════════ */
.unauth-warning-banner {
  background: rgba(217, 119, 6, 0.14);
  border-bottom: 1px solid rgba(217, 119, 6, 0.38);
  color: #92400e;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  line-height: 1.4;
}

[data-theme="dark"] .unauth-warning-banner {
  background: rgba(245, 158, 11, 0.16);
  border-bottom-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.unauth-warning-content {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.unauth-warning-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.unauth-warning-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  background: #d97706;
  color: #ffffff;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.unauth-warning-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.signin-unauth-section {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.signin-divider {
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signin-divider::before,
.signin-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.signin-divider span {
  padding: 0 0.75rem;
}

.signin-unauth-btn {
  width: 100%;
  max-width: 280px;
  justify-content: center;
  font-weight: 600;
  padding: 0.65rem 1rem;
}

.signin-unauth-warning {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #b45309;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  max-width: 320px;
  text-align: center;
}

[data-theme="dark"] .signin-unauth-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
}
