/* ==========================================================================
   GIGAKJV - Premium Bible Layout Style Sheet
   ========================================================================== */

:root {
  --carbon-dark: #000000;
  --carbon-light: #0d0d0d;
  --glass-bg: rgba(10, 10, 10, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --electric-blue: #00d2ff; /* primary accent - vibrant electric cyan */
  --electric-blue-hover: #00b0d8;
  --electric-blue-transparent: rgba(0, 210, 255, 0.08);
  --matte-gold: #00d2ff; /* secondary accent - warm gold */
  --cream-paper: #ffffff;
  --pure-white: #ffffff;
  --charcoal-paper: #000000;
  --text-dark: #000000;
  --text-light: #f4f4f5;
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-lora: 'Lora', Georgia, serif;
  --font-playfair: 'Playfair Display', Georgia, serif;
  --font-cinzel: 'Cinzel', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-original-kjv: 'UnifrakturMaguntia', 'Cinzel', 'Georgia', serif;
  --font-georgia: 'Georgia', 'EB Garamond', 'Lora', serif;
  --font-reading: var(--font-inter);
  --font-header: 'Syne', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 320px;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  /* Reading measure: keeps justified verse lines near ~90 characters on
     desktop instead of stretching across ultrawide monitors. */
  --page-max-width: 1000px;
}

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

::selection {
  background: rgba(0, 210, 255, 0.22); /* premium gold tint matching the brand */
  color: #ffffff;
}

::-moz-selection {
  background: rgba(0, 210, 255, 0.22);
  color: #ffffff;
}

.hidden {
  display: none !important;
}

.content-viewport {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-reading);
  background-color: var(--carbon-dark);
  color: var(--text-light);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* App Container Layout */
.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  width: 100dvw;
}

/* Sidebar Panel (Solid Black) */
.sidebar {
  width: var(--sidebar-width);
  background: #000000;
  border-right: 1px solid var(--glass-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex-shrink: 0;
  z-index: 10;
  transform: translateX(0);
}

/* Sidebar account chip (compact login + identity widget, lives above the footer) */
.sidebar-auth-widget {
  padding: 0.75rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  min-height: 0;
  position: relative;
}

.sidebar-auth-widget .auth-logged-out {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.sidebar-auth-widget .auth-logged-in {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #1a1a1d;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}

.sidebar-auth-btn:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.5);
  color: #00d2ff;
}

.sidebar-auth-btn.sidebar-auth-btn-signup {
  background: rgba(0, 210, 255, 0.14);
  border-color: rgba(0, 210, 255, 0.45);
  color: #00d2ff;
}

.sidebar-auth-btn.sidebar-auth-btn-signup:hover {
  background: rgba(0, 210, 255, 0.22);
  border-color: rgba(0, 210, 255, 0.7);
}

/* Scrollbar Customization for Sidebar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.06);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.brand-header-container {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1.25rem;
}

.brand-header {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}

.brand-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.brand-slogan {
  font-family: var(--font-reading);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
  border-left: 2px solid var(--electric-blue);
  padding-left: 0.6rem;
}

.logo-text {
  font-family: var(--font-header);
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--pure-white);
  letter-spacing: -0.04em;
  display: inline-block;
  white-space: nowrap;
}

.version-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--electric-blue);
  background: var(--electric-blue-transparent);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  margin-left: 0.45rem;
  letter-spacing: 0.05em;
  vertical-align: middle;
  border: 1px solid rgba(0, 210, 255, 0.2);
  white-space: nowrap;
}

.sidebar-section {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 1.5rem;
}

.sidebar-section:last-of-type {
  border-bottom: none;
}

.sidebar-section.install-cta-section {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.85rem;
}

/* Dropdown Select Controls */
.select-group {
  margin-bottom: 1rem;
}

.select-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.35rem;
}

.select-group select {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--pure-white);
  padding: 0.75rem 0.95rem;
  border-radius: 0px;
  outline: none;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.select-group select:focus {
  border-color: #ffffff;
  background: #050505;
}

.select-group select option {
  background: #000000;
  color: var(--pure-white);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  padding-right: 0.6rem;
  max-height: none !important;
  overflow-y: visible !important;
}

.chapter-grid::-webkit-scrollbar {
  width: 6px;
}

.chapter-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
}

.chapter-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 99px;
}

.chapter-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

.chapter-btn {
  aspect-ratio: 1;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  outline: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.chapter-btn:hover {
  background: #18181b;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.chapter-btn.active {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #ffffff !important;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Search Bar Components */
.search-section {
  position: relative;
}

.search-box {
  display: flex;
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--pure-white);
  padding: 0.75rem 2rem 0.75rem 0.95rem;
  border-radius: 0px;
  outline: none;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: #ffffff;
  background: #050505;
}

#search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#search-clear-btn:hover {
  color: var(--pure-white);
}

.search-clear-btn.hidden {
  display: none;
}

/* Search Results Container */
.search-results-container {
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0px;
  margin-top: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 50;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.search-results-count {
  position: sticky;
  top: 0;
  background: #0e0e0e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem;
  font-family: var(--font-header);
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  z-index: 2;
}

.search-results-count strong {
  color: var(--electric-blue);
  font-weight: 800;
  font-size: 0.85rem;
}

/* Search scope toggle buttons */
.search-scope-toggle {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.scope-btn {
  flex: 1;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 0px;
  padding: 0.45rem 0.5rem;
  min-height: 40px;
  font-size: 0.72rem;
  font-family: var(--font-header);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.scope-btn:hover {
  background: #111111;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.scope-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* Testament pill toggle */
.testament-pill-toggle {
  display: flex;
  gap: 0.35rem;
}

/* Brightness preset buttons */
.brightness-preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.brightness-preset-btn {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 0px;
  padding: 0.45rem 0.3rem;
  font-size: 0.7rem;
  font-family: var(--font-header);
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.brightness-preset-btn:hover {
  background: #111111;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.brightness-preset-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.search-results-container::-webkit-scrollbar {
  width: 4px;
}

.search-results-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(0, 210, 255, 0.06);
}

.search-result-ref {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--electric-blue);
  margin-bottom: 0.2rem;
}

.search-result-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

/* Display Controls */
.control-group {
  margin-bottom: 1.25rem;
}

.control-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.35rem;
}

.toggle-buttons {
  display: flex;
  background: #000000;
  border-radius: 0px;
  padding: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.5rem;
  min-height: 40px;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: 0px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-btn:hover {
  color: var(--pure-white);
}

.toggle-btn.active {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  box-shadow: none;
}

.size-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  border-radius: 0px;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.size-btn {
  background: transparent;
  border: none;
  color: var(--pure-white);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

#font-size-val {
  font-size: 0.85rem;
  font-weight: 600;
}

.theme-select-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.theme-pill-btn {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0px;
  color: rgba(255, 255, 255, 0.65);
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
}

.theme-pill-btn:hover {
  background: #111111;
  color: var(--pure-white);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-pill-btn.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
  box-shadow: none;
  font-weight: 600;
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.theme-dot-light {
  background: #ffffff;
  border-color: #dcdad5;
}

.theme-dot-dark {
  background: #1e1e1f;
}

.theme-dot-obsidian {
  background: #000000;
}

.theme-dot-navy {
  background: #0b132b;
}

.sidebar-footer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-top: auto;
  padding-top: 1.5rem;
}

.sidebar-footer .copyright {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.6);
}

/* PWA Install Button */
.pwa-install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.25);
  color: var(--electric-blue);
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 99px;
  cursor: pointer;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.1);
  transition: var(--transition-smooth);
}

.pwa-install-btn:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: rgba(0, 210, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.pwa-install-btn:active {
  transform: translateY(0);
}

.pwa-install-btn.hidden {
  display: none !important;
}

body.theme-light .pwa-install-btn {
  background: rgba(0, 102, 204, 0.06);
  border-color: rgba(0, 102, 204, 0.2);
  color: #0066cc;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.06);
}

body.theme-light .pwa-install-btn:hover {
  background: rgba(0, 102, 204, 0.12);
  border-color: rgba(0, 102, 204, 0.35);
  color: #004499;
}

body.theme-light .install-cta-section {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

/* Content Viewport */
.content-viewport {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 3rem 3rem 3rem 4.5rem;
  overflow-y: auto;
  background-color: #000000;
  position: relative;
  overflow-x: hidden;
}

.content-viewport.view-chat,
.content-viewport.view-devotional,
.content-viewport.view-community {
  align-items: stretch;
  padding: clamp(1rem, 2.5vw, 2rem);
}

.content-viewport.view-devotional {
  align-items: flex-start;
}

/* Scrollbar Customization for Viewport */
.content-viewport::-webkit-scrollbar {
  width: 8px;
}

.content-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.content-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

/* Bible Layout Wrapper */
#layout-wrapper {
  transition: var(--transition-smooth);
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* 1. PRINT PAGE SIMULATION (5.5" x 8.5" page size) */
#layout-wrapper.print-mode {
  padding: 20px;
  max-width: calc(var(--page-max-width) + 80px);
  width: 100%;
}

#layout-wrapper.print-mode .page-margin-box {
  background-color: var(--cream-paper);
  color: var(--text-dark);
  width: 100%;
  max-width: var(--page-max-width);
  min-height: 840px;
  padding: 4.5rem 3.5rem;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Theme adaptation for print page */
#layout-wrapper.print-mode.theme-light .page-margin-box {
  background-color: var(--pure-white);
  color: var(--text-dark);
}

#layout-wrapper.print-mode.theme-dark .page-margin-box {
  background-color: var(--charcoal-paper);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.05);
}

#layout-wrapper.print-mode.theme-obsidian .page-margin-box {
  background-color: #000000;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.08);
}

#layout-wrapper.print-mode.theme-navy .page-margin-box {
  background-color: #0b132b;
  color: #cbd5e1;
  border-color: rgba(28, 37, 65, 0.5);
}

/* Crop Marks for Print Box Simulation */
.crop-mark {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: var(--transition-smooth);
}

#layout-wrapper.theme-dark .crop-mark,
#layout-wrapper.theme-obsidian .crop-mark,
#layout-wrapper.theme-navy .crop-mark {
  border-color: rgba(255, 255, 255, 0.15);
}

.crop-mark.top-left {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.crop-mark.top-right {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}

.crop-mark.bottom-left {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

.crop-mark.bottom-right {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

/* Running Header & Footer */
.running-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-header);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.6rem;
  margin-bottom: 2rem;
}

#layout-wrapper.theme-dark .running-header,
#layout-wrapper.theme-obsidian .running-header,
#layout-wrapper.theme-navy .running-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.running-footer {
  display: flex;
  justify-content: center;
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  opacity: 0.5;
}

#layout-wrapper.theme-dark .running-footer,
#layout-wrapper.theme-obsidian .running-footer,
#layout-wrapper.theme-navy .running-footer {
  border-top-color: rgba(255, 255, 255, 0.05);
}

/* 2. REFLOWABLE E-READER MODE */
#layout-wrapper.reader-mode {
  max-width: var(--page-max-width);
  width: 100%;
  padding: 2rem 0;
}

#layout-wrapper.reader-mode .page-margin-box {
  background-color: #050505 !important;
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.25rem 2.5rem;
  width: 100%;
  min-width: 0;
  border-radius: 0px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

#layout-wrapper.reader-mode.theme-light .page-margin-box {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.1);
}

#layout-wrapper.reader-mode .crop-mark {
  display: block !important;
  border-color: rgba(255, 255, 255, 0.25);
}

#layout-wrapper.reader-mode.theme-light .crop-mark {
  border-color: rgba(0, 0, 0, 0.15);
}

#layout-wrapper.reader-mode .running-header,
#layout-wrapper.reader-mode .running-footer {
  display: none !important;
}

/* Bible Reading Typography */
.page-content {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  /* default font size, scaled dynamically */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.book-title {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
  text-align: center;
  margin-top: clamp(1rem, 6vh, 4rem);
  /* Drop head start pushing title to middle area of the page view */
}

.book-subtitle {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.6;
  text-align: center;
  margin-bottom: 1.25rem;
}

.section-divider {
  width: 40px;
  height: 2px;
  background: var(--electric-blue);
  margin: 0 auto 1.5rem auto;
}

.about-section-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2.5rem 0;
}

#layout-wrapper.theme-light .about-section-divider {
  background: rgba(0, 0, 0, 0.08);
}

.chapter-title {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  color: var(--electric-blue);
  text-align: center;
}

#layout-wrapper.theme-light .chapter-title {
  color: #9a3412;
}

#layout-wrapper.theme-light .section-divider {
  background: #0f172a;
}

#layout-wrapper.theme-light .operational-insight-box {
  background-color: rgba(0, 0, 0, 0.04);
  border-left-color: #0f172a;
}

#layout-wrapper.theme-light .insight-text {
  color: #334155;
}

#layout-wrapper.theme-dark .chapter-title,
#layout-wrapper.theme-obsidian .chapter-title,
#layout-wrapper.theme-navy .chapter-title {
  color: var(--electric-blue);
}

/* Paragraph View (Front Matter / Prefaces) */
.body-text {
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  text-align: justify;
  text-justify: inter-word;
}

.body-text.drop-cap::first-letter {
  font-family: var(--font-header);
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 8px;
  padding-left: 3px;
  font-weight: 800;
  color: var(--text-dark);
}

#layout-wrapper.theme-dark .body-text.drop-cap::first-letter,
#layout-wrapper.theme-obsidian .body-text.drop-cap::first-letter,
#layout-wrapper.theme-navy .body-text.drop-cap::first-letter {
  color: var(--pure-white);
}

/* Single-Column Verse View */
.verse-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  /* Double-space between verses */
  min-width: 0;
  max-width: 100%;
}

.verse-row {
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
  font-size: 1.05em;
  position: relative;
  padding: 0.35rem 0.5rem;
  margin: -0.35rem -0.5rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
  min-width: 0;
  max-width: 100%;
}


.verse-number {
  font-family: var(--font-header);
  font-size: 0.75em;
  font-weight: 700;
  color: #888888;
  width: 45px;
  /* Separate column for verse numbers */
  margin-right: 15px;
  /* Clear gutter separating number from text */
  flex-shrink: 0;
  margin-top: 3px;
  text-align: right;
  user-select: none;
}

.verse-text {
  flex: 1;
  min-width: 0;
  text-align: justify;
  text-justify: inter-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Bold Directives Highlight Style */
.verse-text strong,
.body-text strong {
  font-weight: inherit !important;
  color: inherit !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

#layout-wrapper.theme-dark .verse-text strong,
#layout-wrapper.theme-dark .body-text strong,
#layout-wrapper.theme-obsidian .verse-text strong,
#layout-wrapper.theme-obsidian .body-text strong,
#layout-wrapper.theme-navy .verse-text strong,
#layout-wrapper.theme-navy .body-text strong {
  color: inherit !important;
}

/* Zero-Pronoun Rule Highlight Box */
.zero-pronoun-tag {
  background-color: transparent !important;
  border-bottom: none !important;
  padding: 0 !important;
  font-weight: inherit !important;
  border-radius: 0 !important;
}

/* Interactive Covenant Word Highlighting */
.term-highlight {
  cursor: help !important;
  border-bottom: 2px dotted rgba(255, 255, 255, 0.4) !important;
  transition: all 0.2s ease !important;
}

.term-highlight:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-bottom-color: rgba(255, 255, 255, 0.8) !important;
}

/* Light Theme overrides for covenant words */
#layout-wrapper.theme-light .term-highlight {
  border-bottom-color: rgba(0, 0, 0, 0.3) !important;
}

#layout-wrapper.theme-light .term-highlight:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  border-bottom-color: rgba(0, 0, 0, 0.7) !important;
}

/* Operational Insight Card */
.operational-insight-box {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background-color: var(--electric-blue-transparent);
  border-left: 4px solid var(--electric-blue);
  border-radius: 0 8px 8px 0;
}

.insight-label {
  display: inline-block;
  font-family: var(--font-header);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--electric-blue-hover);
  margin-bottom: 0.5rem;
}

#layout-wrapper.theme-light .insight-label {
  color: #9a3412;
}

#layout-wrapper.theme-dark .insight-label,
#layout-wrapper.theme-obsidian .insight-label,
#layout-wrapper.theme-navy .insight-label {
  color: var(--electric-blue-hover);
}

.insight-text {
  font-size: 0.92em;
  line-height: 1.5;
  color: #3f4e5a;
  font-style: italic;
}

#layout-wrapper.theme-dark .insight-text,
#layout-wrapper.theme-obsidian .insight-text,
#layout-wrapper.theme-navy .insight-text {
  color: #cbd5e1;
}

/* Tooltip Popup */
.tooltip {
  position: absolute;
  background: #121215;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 10px;
  width: 250px;
  z-index: 100;
  color: #f1f5f9;
  font-size: 0.85rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #121215;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.tooltip.tooltip-below .tooltip-arrow {
  top: -6px;
  bottom: auto;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.tooltip-header {
  font-family: var(--font-header);
  font-weight: 700;
  color: var(--electric-blue);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Lexicon Browser in Sidebar */
.lexicon-details-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.85rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

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

.lexicon-details-content strong {
  color: var(--electric-blue);
  font-weight: 600;
}

.lexicon-details-content em {
  color: var(--matte-gold);
  font-style: italic;
}

.lexicon-search-btn {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--pure-white);
  padding: 0.55rem;
  border-radius: 0px;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lexicon-search-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* Slogan Marketing Badge & Legal Link Styles */
.giga-marketing-badge {
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.75);
}

.giga-marketing-badge .badge-title {
  display: block;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--electric-blue);
  margin-bottom: 0.25rem;
}

.giga-marketing-badge strong {
  color: var(--electric-blue);
  font-weight: 700;
}

.translation-explanation {
  margin-top: 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

.translation-explanation:hover {
  border-left-color: var(--electric-blue);
  background: rgba(255, 255, 255, 0.04);
}

/* "What is GIGAKJV?" Collapsible Panel */
.what-is-giga-btn {
  display: none;
  width: 100%;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0px;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.6rem 0.75rem;
  margin-top: 0.75rem;
  font-family: var(--font-header);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: var(--transition-smooth);
  align-items: center;
  justify-content: space-between;
}

.what-is-giga-btn:hover {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.what-is-giga-btn:active {
  background: #1a1a1a;
}

.what-is-giga-btn[aria-expanded="true"] .what-is-giga-chevron {
  transform: rotate(180deg);
}

.what-is-giga-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  opacity: 0.6;
}

.what-is-giga-panel {
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.what-is-giga-panel .giga-marketing-badge:first-child {
  margin-top: 0.75rem;
}

/* About link in footer */
#about-link {
  font-weight: 600;
}

.footer-quote {
  font-family: var(--font-reading);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
  font-style: italic;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  padding-left: 0.6rem;
  margin-bottom: 0.85rem;
  text-align: left;
}

.footer-links {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--electric-blue);
}

/* Legal Page Layout Templates */
.legal-body {
  overflow-y: auto !important;
  height: auto !important;
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
  background-color: #000000;
}

.legal-container {
  max-width: 800px;
  width: 100%;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0px;
  padding: 3.5rem 3rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

.legal-title {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--pure-white);
  background: linear-gradient(135deg, var(--pure-white) 40%, var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
  padding-right: 0.25em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.legal-subtitle {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--electric-blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pure-white);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.25rem;
}

.legal-content blockquote {
  border-left: 3px solid var(--matte-gold);
  background: rgba(0, 210, 255, 0.05);
  padding: 0.85rem 1rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.legal-content blockquote em {
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
}

.legal-content a {
  color: var(--electric-blue);
  text-decoration: underline;
}

.legal-content a:hover {
  color: #ffffff;
}

.legal-content ul,
.legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: rgba(255, 255, 255, 0.75);
}

.legal-content ul li,
.legal-content ol li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.back-home-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--electric-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.back-home-link:hover {
  color: var(--electric-blue-hover);
  transform: translateX(-4px);
}

/* ==========================================================================
   Responsive & Mobile Adaptations (Mobile / Tablet / PC)
   ========================================================================== */

/* 1. New responsive components styling */
.mobile-header {
  display: none;
  /* Hidden on PC */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(60px + env(safe-area-inset-top, 0px));
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 20;
  align-items: center;
  padding: env(safe-area-inset-top, 0px) 1.25rem 0;
}

.menu-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 14px 11px;
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle-btn.prompt-menu {
  animation: menu-prompt 2.2s ease-in-out 2;
}

@keyframes menu-prompt {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 210, 255, 0);
  }
  30% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(0, 210, 255, 0.12);
  }
  55% {
    transform: scale(1);
    box-shadow: 0 0 22px rgba(0, 210, 255, 0.75);
  }
}

.menu-toggle-btn .bar {
  width: 100%;
  height: 2px;
  background-color: var(--pure-white);
  border-radius: 99px;
  transition: var(--transition-smooth);
}

.mobile-logo {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-left: 1.25rem;
  letter-spacing: -0.02em;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 25;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open .sidebar-overlay {
  z-index: 9995;
}

.sidebar-close-btn {
  display: none;
  /* Hidden on PC */
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.4rem 0.6rem;
  min-width: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.sidebar-close-btn:hover {
  color: var(--pure-white);
  transform: translateY(-50%) scale(1.1);
}

/* 2. Responsive Media Queries */
@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
  }

  .app-container {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* Sidebar drawer behavior */
  .sidebar-overlay {
    z-index: 10000 !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 290px;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10005;
    box-shadow: 15px 0 30px rgba(0, 0, 0, 0.5);
    background: #111114;
    /* solid dark background for drawer */
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    /* Always-visible scroll indicator so new users know the drawer scrolls */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.06);
  }

  .sidebar::-webkit-scrollbar {
    width: 5px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 99px;
  }

  .sidebar.open {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  body.sidebar-open .sidebar {
    z-index: 10010;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .content-viewport {
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    /* offset for top header bar */
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
    height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
    height: calc(100dvh - 60px - env(safe-area-inset-top, 0px));
    width: 100%;
  }



  /* CONCISE MOBILE SIDEBAR — tight spacing, collapsible info panel */
  .sidebar {
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 2rem !important;
  }

  .what-is-giga-btn {
    display: flex;
  }

  .what-is-giga-panel.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }

  .what-is-giga-panel:not(.collapsed) {
    max-height: 500px;
    opacity: 1;
  }

  .brand-header-container {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }

  .sidebar-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  .sidebar-section .section-title {
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
  }

  .sidebar-section .control-group {
    margin-bottom: 0.65rem;
  }

  .sidebar-section .control-group label {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
  }

  .sidebar-section .select-group {
    margin-bottom: 0.5rem;
  }

  /* Sidebar panels must not be their own clipped scroll regions on mobile:
     let them expand fully (all chapters visible) and the drawer scrolls as
     one unit instead. */
  .sidebar-panel-content {
    flex: none;
    min-height: auto;
    overflow-y: visible;
  }

  .chapter-grid {
    gap: 0.3rem;
  }

  .chapter-btn {
    font-size: 0.8rem;
  }

  .sidebar-footer {
    margin-top: 0.5rem;
    font-size: 0.65rem;
  }

  .sidebar-footer .endorsement,
  .sidebar-footer .footer-links {
    display: none;
  }

  .install-cta-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .install-cta-section .section-title {
    display: none;
  }
}

@media (max-width: 768px) {
  .legal-container {
    padding: 2.5rem 1.5rem;
  }

  .legal-title {
    font-size: 1.8rem;
  }

  .content-viewport {
    padding: 60px 1rem calc(4rem + env(safe-area-inset-bottom, 0px)) 1rem;
    /* minimal mobile padding with extra bottom spacing */
  }

  #layout-wrapper.print-mode {
    padding: 10px 0;
  }

  /* Make print-mode margin box fluid and clean */
  #layout-wrapper.print-mode .page-margin-box {
    width: 100%;
    min-height: auto;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  }

  #layout-wrapper.reader-mode .page-margin-box {
    padding: 2.5rem 1.5rem;
  }

  /* Hide crop marks on mobile/tablet for clean space */
  .crop-mark {
    display: none !important;
  }

  .running-header {
    margin-bottom: 1.5rem;
    font-size: 0.65rem;
  }

  .running-footer {
    margin-top: 1.5rem;
  }

  .book-title {
    font-size: 1.7rem;
    margin-top: 1rem;
  }

  .book-subtitle {
    font-size: 0.75rem;
    margin-bottom: 0.85rem;
  }

  .chapter-title {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .verse-row {
    font-size: 0.95em;
    line-height: 1.55;
  }

  .verse-list {
    gap: 1.5rem;
  }

  .verse-number {
    width: 30px;
    margin-right: 10px;
    font-size: 0.68em;
    text-align: right;
  }

  .operational-insight-box {
    margin-top: 2rem;
    padding: 1.25rem 1rem;
  }

  .insight-text {
    font-size: 0.88em;
  }

  .book-title {
    margin-top: 0.5rem;
  }

  .book-subtitle {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
  }

  .section-divider {
    margin: 0 auto 0.75rem auto;
  }

  .verse-row {
    text-align: center;
    hyphens: none;
  }

  .body-text {
    text-align: center;
    hyphens: none;
  }

  /* Tooltip responsive adjustment */
  .tooltip {
    width: 220px;
    font-size: 0.8rem;
    padding: 0.85rem;
  }
}

@media (max-width: 480px) {
  .legal-container {
    padding: 2rem 1.25rem;
  }

  .legal-title {
    font-size: 1.5rem;
  }

  .content-viewport {
    padding: 60px 0.5rem calc(4.5rem + env(safe-area-inset-bottom, 0px)) 0.5rem;
  }

  #layout-wrapper.print-mode .page-margin-box {
    padding: 2rem 1rem;
  }

  #layout-wrapper.reader-mode .page-margin-box {
    padding: 2rem 1rem;
  }

  .running-header {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    border-bottom: none;
    padding-bottom: 0;
  }

  .running-header #header-right {
    display: none;
    /* Hide subtitle running header on small phones */
  }

  .running-footer {
    border-top: none;
    padding-top: 0;
  }
}

/* ==========================================================================
   GIGAKJV Reading Experience Enhancement Utilities
   ========================================================================== */

/* 1. Font Families and Overrides */
.font-inter .verse-text,
.font-inter .body-text,
.font-inter .declaration-text {
  font-family: var(--font-inter);
}

.font-lora .verse-text,
.font-lora .body-text,
.font-lora .declaration-text {
  font-family: var(--font-lora);
}

.font-playfair .verse-text,
.font-playfair .body-text,
.font-playfair .declaration-text {
  font-family: var(--font-playfair);
}

.font-cinzel .verse-text,
.font-cinzel .body-text,
.font-cinzel .declaration-text {
  font-family: var(--font-cinzel);
}

.font-mono .verse-text,
.font-mono .body-text,
.font-mono .declaration-text {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.font-original-kjv .verse-text,
.font-original-kjv .body-text,
.font-original-kjv .declaration-text {
  font-family: var(--font-original-kjv);
  font-size: 1.15em;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.font-georgia .verse-text,
.font-georgia .body-text,
.font-georgia .declaration-text {
  font-family: var(--font-georgia);
  line-height: 1.65;
}

/* 2. Words of Christ (Red Letter Standard — CMYK C:0 M:100 Y:100 K:0) */
.jesus-words {
  transition: color 0.3s ease;
  color: #E60000 !important;
  /* Classic Red Letter Bible red for dark backgrounds */
}

/* Themes with higher contrast for light viewports */
#layout-wrapper.theme-light .jesus-words {
  color: #CC0000 !important;
  /* Deep print-standard red for white backgrounds */
}


/* 3. Screen Dimming Brightness Overlay & Slider */
.brightness-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 999999;
  transition: opacity 0.15s ease;
}

/* 4. Staggered Entrance Animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

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

.verse-row,
.operational-insight-box,
.body-text {
  opacity: 0;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}



/* 6. PC Full-Screen Sidebar Collapse Styles */
.sidebar {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-right-color 0.3s ease;
}

@media (min-width: 1025px) {
  .app-container.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
    width: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-right-color: transparent;
  }
}

.sidebar-toggle-pc-btn {
  position: absolute;
  top: 1.5rem;
  left: calc(var(--sidebar-width) + 1.25rem);
  z-index: 100;
  background: rgba(22, 22, 26, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.7);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.sidebar-toggle-pc-btn:hover {
  background: var(--electric-blue);
  color: var(--carbon-dark);
  border-color: var(--electric-blue);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  transform: scale(1.1) translateZ(0);
}

/* Hamburger bars inside the PC toggle */
.sidebar-toggle-pc-btn .bar {
  width: 18px;
  height: 2px;
  background-color: currentColor;
  border-radius: 99px;
  transition: var(--transition-smooth);
}

/* Hide desktop toggle on mobile — mobile already has .menu-toggle-btn */
@media (max-width: 1024px) {
  .sidebar-toggle-pc-btn {
    display: none !important;
  }
}

/* When sidebar is collapsed, float button shifts left slightly but stays visible */
.app-container.sidebar-collapsed .sidebar-toggle-pc-btn {
  left: 1.25rem;
}

/* Toggle button active SVG toggle state */
/* Sidebar is open (default state): show close icon, hide menu icon */
.sidebar-toggle-pc-btn .icon-menu {
  display: none;
}

.sidebar-toggle-pc-btn .icon-close {
  display: inline;
}

/* Sidebar is collapsed (closed state): show menu icon, hide close icon */
.app-container.sidebar-collapsed .sidebar-toggle-pc-btn .icon-menu {
  display: inline;
}

.app-container.sidebar-collapsed .sidebar-toggle-pc-btn .icon-close {
  display: none;
}

/* Sparkling button animations & sweep triggered every 10 seconds */
.sidebar-toggle-pc-btn.sparkling {
  animation: sparkle-pulse 10s infinite;
}

.sidebar-toggle-pc-btn.sparkling::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.3) 30%,
      rgba(255, 255, 255, 0.8) 50%,
      rgba(255, 255, 255, 0.3) 70%,
      rgba(255, 255, 255, 0) 100%);
  transform: rotate(30deg);
  pointer-events: none;
  animation: sparkle-sweep 10s infinite;
}

@keyframes sparkle-pulse {

  0%,
  85%,
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    border-color: var(--glass-border);
  }

  90% {
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.8), 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
    border-color: var(--electric-blue);
  }

  92% {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.9), 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.18);
    border-color: #ffffff;
  }

  95% {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.8), 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.12);
    border-color: #ffffff;
  }
}

@keyframes sparkle-sweep {

  0%,
  85% {
    left: -150%;
  }

  95%,
  100% {
    left: 150%;
  }
}


/* ==========================================================================
   Side-by-Side Parallel Study Columns
   ========================================================================== */
.verse-row.side-by-side {
  display: grid;
  grid-template-columns: 45px 1fr 1fr;
  gap: 2.5rem;
  align-items: flex-start;
}

.verse-row.side-by-side .verse-text {
  text-align: justify;
  text-justify: inter-word;
}

/* Column headers when side-by-side mode is active */
.parallel-headers {
  display: grid;
  grid-template-columns: 45px 1fr 1fr;
  gap: 2.5rem;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--electric-blue);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.5rem;
}

#layout-wrapper.theme-dark .parallel-headers {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

#layout-wrapper.theme-light .parallel-headers {
  color: #0f172a;
}

.parallel-headers .header-col {
  padding-left: 0;
}

/* Slate colored visual highlight for KJV comparison text */
.kjv-col {
  color: #64748b;
  /* slate gray/green default */
}

#layout-wrapper.theme-dark .kjv-col {
  color: #94a3b8;
  /* blue-gray on dark mode */
}

#layout-wrapper.theme-light .kjv-col {
  color: #475569;
  /* slate gray on white paper */
}

/* 1611 KJV Original column on light theme: warm sepia "old paper" so it
   reads as a historical document sitting on the modern GIGAKJV page,
   rather than a near-black box that fights the light background. */
@media (min-width: 769px) {
  #layout-wrapper.theme-light .verse-row.side-by-side .kjv-col {
    background: #f4ecd8;
    color: #4a3a1f !important;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(74, 58, 31, 0.12);
    border-left: 3px solid #b08947;
    font-size: 0.95em;
    transition: background 0.25s ease, color 0.25s ease;
  }

  #layout-wrapper.theme-light .parallel-headers .header-col:nth-child(3) {
    background: #f4ecd8;
    color: #4a3a1f;
    padding: 0.5rem 1.25rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: -0.5rem;
    border-bottom: 1px solid rgba(74, 58, 31, 0.15);
    transition: background 0.25s ease, color 0.25s ease;
  }
}

/* Slightly softer verse-row hover hint in white mode so it doesn't flash blue. */
#layout-wrapper.theme-light .verse-row:hover:not(.highlighted) {
  background: rgba(11, 92, 173, 0.04);
}

#layout-wrapper.theme-obsidian .kjv-col {
  color: #8a99ad;
  /* high contrast slate gray on black */
}

#layout-wrapper.theme-navy .kjv-col {
  color: #8b9bb4;
  /* high contrast slate gray on deep navy */
}

@media (max-width: 768px) {
  .verse-row.side-by-side {
    grid-template-columns: 30px 1fr;
    gap: 0.5rem;
  }

  .verse-row.side-by-side .gigakjv-col,
  .verse-row.side-by-side .kjv-col {
    grid-column: 2;
    display: block;
    position: relative;
    padding: 0.5rem 0.75rem;
    margin: 0.35rem 0;
    border-radius: 6px;
  }

  /* GIGAKJV: bright, bold, accent border */
  .verse-row.side-by-side .gigakjv-col {
    color: #ffffff;
    font-weight: 500;
    background: rgba(0, 210, 255, 0.04);
    border-left: 3px solid var(--electric-blue);
  }

  .verse-row.side-by-side .gigakjv-col::before {
    content: 'GIGAKJV';
    display: block;
    font-family: var(--font-header);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--electric-blue);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
  }

  /* KJV: muted gray, italic, dashed border */
  .verse-row.side-by-side .kjv-col {
    color: #94a3b8 !important;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px dashed rgba(148, 163, 184, 0.4);
  }

  .verse-row.side-by-side .kjv-col::before {
    content: '1611 KJV';
    display: block;
    font-family: var(--font-header);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    font-style: normal;
  }

  /* Light theme: GIGAKJV on subtle modern paper, KJV on warm sepia. */
  #layout-wrapper.theme-light .verse-row.side-by-side .gigakjv-col {
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
  }

  #layout-wrapper.theme-light .verse-row.side-by-side .kjv-col {
    color: #4a3a1f !important;
    background: #f4ecd8;
    border-left: 3px solid #b08947;
    font-style: italic;
  }

  #layout-wrapper.theme-light .verse-row.side-by-side .kjv-col::before {
    color: #b08947;
  }

  .parallel-headers {
    display: none;
    /* Inline labels replace the column headers on mobile */
  }
}

/* ==========================================================================
   Epic Intro Splash Screen Overlay
   ========================================================================== */
.intro-splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #0c0c0e;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.intro-splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Skip Intro Loader Button */
.skip-splash-btn {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  padding: 0.55rem 1.1rem;
  min-height: 40px;
  border-radius: 99px;
  font-family: var(--font-header);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 10000000;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.skip-splash-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  border-color: rgba(0, 210, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.15);
}

.skip-splash-btn:active {
  transform: translateY(1px);
}

.intro-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: scale(0.92);
}

.intro-splash.fonts-loaded .intro-content {
  animation: introZoomIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-logo {
  font-family: var(--font-header);
  font-size: 4rem;
  font-weight: 900;
  color: var(--pure-white);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.intro-divider {
  width: 0px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--electric-blue), transparent);
  margin-bottom: 1.25rem;
}

.intro-splash.fonts-loaded .intro-divider {
  animation: growDivider 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.intro-tagline {
  font-family: var(--font-reading);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
}

.intro-splash.fonts-loaded .intro-tagline {
  animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) 1s forwards;
}

.intro-spinner-glow {
  width: 32px;
  height: 32px;
  margin-top: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--electric-blue);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.intro-splash.fonts-loaded .intro-spinner-glow {
  animation: spin 1s linear infinite;
}

@keyframes introZoomIn {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoGlowPulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
  }

  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
  }
}

@keyframes growDivider {
  0% {
    width: 0px;
  }

  100% {
    width: 200px;
  }
}

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

/* ==========================================================================
   Ambient Nebula Background Blobs
   ========================================================================== */
.ambient-glow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.04;
  /* extremely subtle, silent, not annoying */
  mix-blend-mode: screen;
  animation: floatAround 25s infinite alternate ease-in-out;
  pointer-events: none;
}

#layout-wrapper.theme-light~.ambient-glow-container .ambient-blob {
  opacity: 0.01;
  /* Dim/disable light theme ambient colors for readability */
}

.ambient-blob.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--electric-blue);
  top: -10%;
  left: 20%;
  animation-duration: 35s;
}

.ambient-blob.blob-2 {
  width: 600px;
  height: 600px;
  background: #00d2ff;
  /* Warm Gold */
  bottom: -15%;
  right: 15%;
  animation-duration: 45s;
  animation-delay: -5s;
}

.ambient-blob.blob-3 {
  width: 400px;
  height: 400px;
  background: #ff007f;
  /* Amber Pink Magenta */
  top: 40%;
  left: -10%;
  animation-duration: 40s;
  animation-delay: -10s;
}

@keyframes floatAround {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }

  33% {
    transform: translate(60px, -90px) scale(1.1) rotate(120deg);
  }

  66% {
    transform: translate(-40px, 50px) scale(0.85) rotate(240deg);
  }

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

/* ==========================================================================
   Interactive Glow Behind Cursor
   ========================================================================== */
.content-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(650px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.04),
      transparent 50%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s ease;
  opacity: 1;
}

.content-viewport:has(#layout-wrapper.theme-light)::after {
  opacity: 0.1;
  background: radial-gradient(650px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(0, 0, 0, 0.02),
      transparent 50%);
}

.content-viewport:has(#layout-wrapper.theme-obsidian)::after {
  background: radial-gradient(650px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(255, 255, 255, 0.05),
      transparent 50%);
}

/* ==========================================================================
   Logo Symbol Adjustments
   ========================================================================== */
.intro-logo-svg {
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.15));
}

.sidebar-logo-svg,
.mobile-logo-svg {
  flex-shrink: 0;
}

/* ==========================================================================
   YouVersion-Inspired Reading Innovations
   ========================================================================== */

/* Chapter Prev/Next Navigation (bottom of reading area only) */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 0;
}

.chapter-nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  min-height: 48px;
}

.chapter-nav-btn:hover {
  background: var(--electric-blue);
  color: var(--carbon-dark) !important;
  border-color: var(--electric-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

.chapter-nav-btn:active {
  transform: translateY(0);
}

.chapter-nav-btn .nav-arrow {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--electric-blue);
  font-weight: 400;
}

.chapter-nav-btn:hover .nav-arrow {
  color: var(--carbon-dark) !important;
}

.chapter-nav-spacer {
  flex: 1;
}

/* Light theme override */
#layout-wrapper.theme-light .chapter-nav-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.15);
  color: #1e293b;
}

#layout-wrapper.theme-light .chapter-nav-btn:hover {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

#layout-wrapper.theme-light .chapter-nav-btn .nav-arrow {
  color: #000000;
}

#layout-wrapper.theme-light .chapter-nav-btn:hover .nav-arrow {
  color: #ffffff !important;
}

/* Verse highlight (persistent) */
.verse-row.highlighted {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.18) 0%, rgba(255, 215, 0, 0.06) 100%);
  border-left: 3px solid #ffd700;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
  border-radius: 0 6px 6px 0;
}

#layout-wrapper.theme-light .verse-row.highlighted {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 215, 0, 0.12) 100%);
  border-left-color: #d4a017;
}

/* Color specific verse highlighting */
.verse-row.highlighted.hl-blue {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.14) 0%, rgba(0, 210, 255, 0.04) 100%);
  border-left-color: #00d2ff;
}
#layout-wrapper.theme-light .verse-row.highlighted.hl-blue {
  background: linear-gradient(90deg, rgba(0, 119, 182, 0.22) 0%, rgba(0, 119, 182, 0.06) 100%);
  border-left-color: #0077b6;
}

.verse-row.highlighted.hl-green {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.14) 0%, rgba(46, 204, 113, 0.04) 100%);
  border-left-color: #2ecc71;
}
#layout-wrapper.theme-light .verse-row.highlighted.hl-green {
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.22) 0%, rgba(39, 174, 96, 0.06) 100%);
  border-left-color: #27ae60;
}

.verse-row.highlighted.hl-purple {
  background: linear-gradient(90deg, rgba(155, 89, 182, 0.16) 0%, rgba(155, 89, 182, 0.04) 100%);
  border-left-color: #a855f7;
}
#layout-wrapper.theme-light .verse-row.highlighted.hl-purple {
  background: linear-gradient(90deg, rgba(142, 68, 173, 0.22) 0%, rgba(142, 68, 173, 0.06) 100%);
  border-left-color: #8e44ad;
}

/* Verse rows tappable */
.verse-row {
  cursor: pointer;
  transition: background-color 0.2s ease, padding-left 0.2s ease;
  border-radius: 4px;
}

.verse-row:hover:not(.highlighted) {
  background: rgba(0, 210, 255, 0.04);
}

#layout-wrapper.theme-light .verse-row:hover:not(.highlighted) {
  background: rgba(0, 100, 200, 0.05);
}

/* Verse Action Menu (Copy/Share/Highlight) */
.verse-action-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 18, 22, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  max-width: 480px;
  margin: 0 auto;
}

.verse-action-menu.visible {
  transform: translateY(0);
}

/* Close × button in top-right corner */
.vam-close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.35rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  z-index: 2;
}

.vam-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.vam-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
  position: relative;
  width: 100%;
}

.vam-ref {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--electric-blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.vam-reset-btn {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.25);
  border-radius: 6px;
  color: #ff4d4d;
  font-family: var(--font-header);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: var(--transition-smooth);
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
}

.vam-reset-btn:hover {
  background: rgba(255, 77, 77, 0.2);
  border-color: rgba(255, 77, 77, 0.45);
  color: #ff6666;
}

.vam-reset-btn:active {
  transform: scale(0.95);
}

body.theme-light .vam-reset-btn {
  background: rgba(211, 47, 47, 0.06);
  border-color: rgba(211, 47, 47, 0.18);
  color: #d32f2f;
}

body.theme-light .vam-reset-btn:hover {
  background: rgba(211, 47, 47, 0.12);
  border-color: rgba(211, 47, 47, 0.3);
  color: #b71c1c;
}

.vam-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.vam-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.65rem 0.5rem;
  font-family: var(--font-reading);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 56px;
}

.vam-btn span {
  font-size: 1.15rem;
  line-height: 1;
}

.vam-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: var(--electric-blue);
  color: #fff;
}

.vam-btn:active {
  transform: scale(0.96);
}

.vam-btn.vam-close {
  background: transparent;
  font-size: 1.1rem;
  min-width: 44px;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.5);
}

.vam-btn.vam-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Desktop popover style */
@media (min-width: 769px) {
  .verse-action-menu {
    position: fixed;
    bottom: auto;
    left: auto;
    right: auto;
    width: 320px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transform: translateY(8px);
    opacity: 0;
    padding: 0.85rem 1rem 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }

  .verse-action-menu.visible {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Toast */
.gigakjv-toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 24, 0.95);
  color: #fff;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.gigakjv-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile compactness */
@media (max-width: 768px) {
  .chapter-nav {
    margin: 1rem 0;
    gap: 0.5rem;
  }

  .chapter-nav-btn {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
    min-height: 44px;
  }

  .chapter-nav-btn .nav-label {
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   Brand Logo Style Overhaul (Anton & Inter)
   ========================================================================== */
.brand-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--pure-white);
}

.brand-logo-img {
  width: auto;
  height: auto;
  max-width: 100%;
  display: block;
}

.loader-logo-img {
  height: 140px;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  animation: logoPulse 3s ease-in-out infinite alternate;
}

.sidebar-logo-img {
  height: 120px;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

@keyframes logoPulse {
  0% {
    transform: scale(0.98);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
  }
  100% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.45));
  }
}


.brand-logo-title {
  font-family: 'Anton', 'Impact', 'Arial Black', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--pure-white);
  line-height: 0.85;
  letter-spacing: -0.01em;
}

.brand-logo-subtitle {
  font-family: var(--font-inter);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--pure-white);
  letter-spacing: 0.18em;
}

/* Loader Screen Logo Size & Cinematic Glow/Expand Animation */
.main-loader-logo .brand-logo-title {
  font-size: 5rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
  transform: scale(0.95);
}

.intro-splash.fonts-loaded .main-loader-logo .brand-logo-title {
  animation: loaderLogoExpand 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.main-loader-logo .brand-logo-subtitle {
  font-size: 0.95rem;
  margin-top: 0.8rem;
  opacity: 0;
  transform: translateY(8px);
}

.intro-splash.fonts-loaded .main-loader-logo .brand-logo-subtitle {
  animation: loaderSubtitleFadeIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes loaderLogoExpand {
  0% {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.15));
    transform: scale(0.95);
  }
  100% {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.5));
    transform: scale(1.03);
  }
}

@keyframes loaderSubtitleFadeIn {
  to {
    opacity: 0.7;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .main-loader-logo .brand-logo-title {
    font-size: 3.5rem;
  }

  .main-loader-logo .brand-logo-subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    margin-top: 0.6rem;
  }
}

/* Sidebar Logo Size */
.sidebar-logo {
  align-items: center;
  text-align: center;
}

/* The GIGAKJV wordmark is already rendered on the logo image itself, so the
   text title is redundant in the sidebar — hide it and let the larger image
   carry the brand. Subtitle ("AI BIBLE TRANSLATION") stays for context. */
.sidebar-logo .brand-logo-title {
  display: none;
}

.sidebar-logo .brand-logo-subtitle {
  font-size: 0.48rem;
  letter-spacing: 0.15em;
  margin-top: 0.25rem;
  opacity: 0.75;
}

/* Mobile Header Logo Size */
.mobile-logo-box {
  flex-direction: row;
  align-items: baseline;
  gap: 0.6rem;
  margin-left: 1rem;
}

.mobile-logo-box .brand-logo-title {
  font-size: 1.6rem;
}

.mobile-logo-box .brand-logo-subtitle {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

/* Loader sparkle star */
.loader-sparkle-star {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 28px;
  height: 28px;
  opacity: 0.7;
  color: var(--pure-white);
}

.intro-splash.fonts-loaded .loader-sparkle-star {
  animation: sparkleTwinkle 3.5s infinite ease-in-out;
}

@keyframes sparkleTwinkle {

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

  50% {
    opacity: 1;
    transform: scale(1.15) rotate(180deg);
  }
}

@media (max-width: 768px) {
  .loader-sparkle-star {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 22px;
    height: 22px;
  }
}

/* ==========================================================================
   Covenant Declarations Card Styling
   ========================================================================== */
.declarations-section {
  position: relative;
}

.declaration-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.15rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease;
  transform-style: preserve-3d;
}

.declaration-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.declaration-card-text {
  font-family: var(--font-lora);
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
  margin-bottom: 0.65rem;
  text-align: center;
  position: relative;
  z-index: 1;
  transform: translateZ(20px);
  /* 3D layer pop */
  transition: opacity 0.15s ease-in-out;
}

.declaration-subtitle {
  font-family: var(--font-reading);
  font-size: 0.68rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.declaration-card-ref {
  font-family: var(--font-header);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--electric-blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  transform: translateZ(10px);
  transition: opacity 0.15s ease-in-out, color 0.2s ease, border-color 0.2s ease;

  /* Underlined Link Style */
  cursor: pointer;
  display: block;
  width: fit-content;
  margin-left: auto;
  border-bottom: 1px dotted var(--electric-blue);
}

.declaration-card-ref:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
}

.declaration-actions {
  display: flex;
  gap: 0.5rem;
}

.declaration-action-btn {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem;
  font-size: 0.72rem;
  font-family: var(--font-header);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.declaration-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.declaration-action-btn:active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

@media (max-width: 1024px) {
  .declaration-card-text {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .declaration-action-btn {
    padding: 0.45rem;
    font-size: 0.68rem;
  }
}

/* Custom Select Dropdowns Styling (Prevents native OS overlays on mobile) */
.custom-select-container {
  position: relative;
  width: 100%;
  user-select: none;
}

.hidden-native-select {
  display: none !important;
}

.custom-select-trigger {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--pure-white);
  padding: 0.75rem 0.95rem;
  border-radius: 0px;
  outline: none;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.custom-select-trigger:focus,
.custom-select-container.open .custom-select-trigger {
  border-color: #ffffff;
  background: #050505;
}

.custom-select-chevron {
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
}

.custom-select-container.open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-options-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #000000;
  border: 1px solid #ffffff;
  border-top: none;
  z-index: 999;
  max-height: 250px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.custom-select-container.open .custom-select-options-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-select-option {
  padding: 0.75rem 0.95rem;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  color: var(--pure-white);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
  background: var(--electric-blue);
  color: var(--carbon-dark);
}

.custom-select-option.selected {
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.custom-select-option.selected:hover {
  background: var(--electric-blue);
  color: var(--carbon-dark);
}

.custom-select-options-list::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options-list::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-options-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
}

.custom-select-options-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Floating Highlight Session Bar */
.highlight-session-bar {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  width: calc(100% - 32px);
  max-width: 500px;
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  z-index: 10000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.highlight-session-bar.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.highlight-session-bar.hidden {
  display: none !important;
}

.hsb-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 480px) {
  .hsb-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hsb-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hsb-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--electric-blue);
  box-shadow: 0 0 10px var(--electric-blue);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 14px var(--electric-blue); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.hsb-count {
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pure-white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hsb-actions {
  display: flex;
  gap: 0.5rem;
}

.hsb-action-btn {
  padding: 0.5rem 0.85rem;
  font-family: var(--font-reading);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hsb-action-btn:active {
  transform: scale(0.96);
}

.hsb-action-btn.primary-btn {
  background: var(--electric-blue);
  border: 1px solid var(--electric-blue);
  color: var(--carbon-dark);
}

.hsb-action-btn.primary-btn:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

.hsb-action-btn.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.hsb-action-btn.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hsb-action-btn.close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.55);
}

.hsb-action-btn.close-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

/* Color picker in verse action menu */
.vam-color-picker {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  outline: none;
}

.color-dot:active {
  transform: scale(0.9);
}

.color-dot.blue {
  background-color: #00d2ff;
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.3);
}

.color-dot.green {
  background-color: #2ecc71;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

.color-dot.purple {
  background-color: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* Active ring around selected color */
.color-dot.active {
  border-color: var(--pure-white);
  transform: scale(1.15);
}

#layout-wrapper.theme-light ~ .verse-action-menu .color-dot.active,
#layout-wrapper.theme-light .color-dot.active {
  border-color: #000;
}

.color-dot.blue.active {
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.7);
}

.color-dot.green.active {
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.7);
}

.color-dot.purple.active {
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.7);
}

/* Highlight Copy Selector Modal */
.highlight-copy-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.highlight-copy-modal.visible {
  opacity: 1;
}

.highlight-copy-modal.hidden {
  display: none !important;
}

.hcm-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hcm-content {
  position: relative;
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 90%;
  max-width: 380px;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  z-index: 2;
}

.highlight-copy-modal.visible .hcm-content {
  transform: scale(1);
}

.hcm-title {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.hcm-desc {
  font-family: var(--font-reading);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.hcm-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.hcm-btn {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.hcm-btn:active {
  transform: scale(0.97);
}

.hcm-btn.all-btn {
  background: var(--pure-white);
  color: var(--carbon-dark);
}

.hcm-btn.all-btn:hover {
  background: var(--electric-blue);
  color: var(--carbon-dark);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.hcm-btn.color-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--pure-white);
}

.hcm-btn.color-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.hcm-btn .btn-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  color: inherit;
  font-weight: 700;
}

.hcm-btn.all-btn .btn-badge {
  background: rgba(0, 0, 0, 0.1);
}

.hcm-btn .color-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.hcm-btn .color-indicator::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.hcm-btn.hl-blue .color-indicator::before {
  background-color: #00d2ff;
  box-shadow: 0 0 8px #00d2ff;
}

.hcm-btn.hl-green .color-indicator::before {
  background-color: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.hcm-btn.hl-purple .color-indicator::before {
  background-color: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.hcm-cancel-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-reading);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
  margin-top: 0.5rem;
  outline: none;
}

.hcm-cancel-btn:hover {
  color: var(--pure-white);
}

/* Light theme support */
body.theme-light .highlight-copy-modal .hcm-content {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

body.theme-light .highlight-copy-modal .hcm-title {
  color: var(--text-dark);
}

body.theme-light .highlight-copy-modal .hcm-desc {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .highlight-copy-modal .hcm-btn.color-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-dark);
}

body.theme-light .highlight-copy-modal .hcm-btn.color-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.15);
}

body.theme-light .highlight-copy-modal .hcm-cancel-btn {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .highlight-copy-modal .hcm-cancel-btn:hover {
  color: #000;
}

/* Quick Highlight Mode active styling */
#layout-wrapper.highlight-mode-active .verse-row {
  opacity: 0.55;
  transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#layout-wrapper.highlight-mode-active .verse-row.highlighted {
  opacity: 1;
  transform: scale(1.008);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.08);
}

/* Floating Clear Chapter Highlights Button */
.clear-chapter-highlights-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-header);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 10;
  transition: var(--transition-smooth);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clear-chapter-highlights-btn:hover {
  background: rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.3);
  color: #ff4d4d;
}

.clear-chapter-highlights-btn.hidden {
  display: none !important;
}

/* Light theme support */
body.theme-light .clear-chapter-highlights-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .clear-chapter-highlights-btn:hover {
  background: rgba(255, 0, 0, 0.08);
  border-color: rgba(255, 0, 0, 0.2);
  color: #d32f2f;
}

/* ==========================================================================
   King James Chat Styles
   ========================================================================== */

.ai-chat-section {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
}

.ai-chat-section:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.ai-chat-toggle-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-header);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

@media (max-width: 1024px) {
  .ai-chat-toggle-btn {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
  }
}

.ai-chat-toggle-btn:hover {
  color: #ffffff;
}

.ai-chat-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.ai-chat-toggle-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-online-dot {
  width: 7px;
  height: 7px;
  background-color: #2ecc71;
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.25rem;
  position: relative;
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
  flex-shrink: 0;
}

.ai-online-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #2ecc71;
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.ai-chat-icon {
  opacity: 0.7;
  flex-shrink: 0;
}

.ai-chat-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.ai-chat-toggle-btn[aria-expanded="true"] .ai-chat-chevron {
  transform: rotate(180deg);
}

.ai-chat-panel {
  margin-top: 0.85rem;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.ai-chat-panel.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.ai-chat-panel:not(.collapsed) {
  max-height: 600px;
  opacity: 1;
}

.ai-chat-subtitle {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.ai-chat-window {
  height: 300px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  border-radius: 8px;
}

.ai-chat-window::-webkit-scrollbar {
  width: 5px;
}

.ai-chat-window::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat-window::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.ai-chat-window::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ai-chat-messages {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ai-message {
  padding: 0.75rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.55;
  font-family: var(--font-reading);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.ai-message p {
  margin-bottom: 0.75rem;
}

.ai-message p:last-child {
  margin-bottom: 0;
}

.ai-message ol,
.ai-message ul {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
  padding-left: 0;
}

.ai-message li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.ai-message li:last-child {
  margin-bottom: 0;
}

.ai-message-charlie {
  background: rgba(0, 210, 255, 0.04);
  border-left: 3px solid #00d2ff;
  border-radius: 0 12px 12px 12px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 95%;
  align-self: flex-start;
}

.ai-message-charlie::before {
  content: '👑 KING JAMES';
  display: block;
  font-family: var(--font-header);
  font-size: 0.62rem;
  font-weight: 700;
  color: #00d2ff;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

/* AI Welcome Specs Dashboard Styling */
.ai-welcome-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(0, 210, 255, 0.02);
  border: 1px solid rgba(0, 210, 255, 0.12);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  animation: fade-in 0.35s ease;
}
.ai-welcome-header {
  text-align: center;
}
.ai-welcome-crown {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.25rem;
}
.ai-welcome-title {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 800;
  color: #00d2ff;
  letter-spacing: 1.5px;
  margin: 0;
}
.ai-welcome-tagline {
  font-family: var(--font-reading);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}
.ai-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.ai-spec-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
  transition: all 0.2s ease;
}
.ai-spec-card:hover {
  background: rgba(0, 210, 255, 0.04);
  border-color: rgba(0, 210, 255, 0.25);
  transform: translateY(-2px);
}
.ai-spec-icon {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}
.ai-spec-title {
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}
.ai-spec-desc {
  font-family: var(--font-reading);
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
}
.ai-welcome-message-bubble {
  background: rgba(0, 210, 255, 0.04);
  border-left: 3px solid #00d2ff;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
}

.ai-message-user {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border-right: 3px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px 0 12px 12px;
  color: rgba(255, 255, 255, 0.95);
  text-align: left;
  max-width: 88%;
  align-self: flex-end;
  margin-left: auto;
}

.ai-user-message-actions {
  position: absolute;
  top: 4px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(-2px);
}

.ai-message-user:hover .ai-user-message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ai-user-message-retry-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.ai-user-message-retry-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.ai-message-user::before {
  content: 'YOU';
  display: block;
  font-family: var(--font-header);
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.ai-message strong {
  color: #ffffff;
  font-weight: 700;
}

/* System and Limit Messages */
.ai-message-system {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  align-self: center;
  max-width: 80%;
  margin: 1rem auto;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

body.theme-light .ai-message-system {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.5);
}

.main-chat-disclaimer {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.6rem;
  font-family: var(--font-reading);
  line-height: 1.4;
  text-align: center;
  overflow: visible;
}

body.theme-light .main-chat-disclaimer {
  color: rgba(0, 0, 0, 0.4);
}

.ai-chat-input-container {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.ai-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.65rem 0.8rem;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  border-radius: 6px;
  outline: none;
  transition: var(--transition-smooth);
}

.ai-chat-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.ai-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.ai-chat-send-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-send-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.ai-chat-send-btn:active {
  transform: scale(0.96);
}

.ai-chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ai-chat-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.4rem;
}

.ai-chat-footer-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-header);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.5rem 0.4rem;
  line-height: 1.4;
  overflow: visible;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-chat-footer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ai-chat-footer-btn.clear-btn:hover {
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.2);
  color: #ff6666;
}

.ai-typing-indicator {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 210, 255, 0.04);
  border-left: 3px solid #00d2ff;
  border-radius: 0 12px 12px 12px;
  max-width: 60px;
  align-self: flex-start;
  align-items: center;
  justify-content: center;
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  animation: ai-typing 1.4s infinite;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-typing {
  0%, 60%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ai-typing-indicator.ai-thinking {
  max-width: none;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.ai-thinking-star {
  color: #00d2ff;
  animation: ai-typing 1.4s infinite;
}

.ai-thinking-timer {
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
  min-width: 2.2em;
}

.ai-message .tw-pending {
  visibility: hidden;
}

.ai-chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.ai-chat-option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 0.85rem;
  font-family: var(--font-reading);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  overflow: visible;
  cursor: pointer;
  border-radius: 99px;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-align: left;
}

.ai-chat-option-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.ai-chat-error {
  background: rgba(255, 0, 0, 0.08);
  border-left: 2px solid rgba(255, 0, 0, 0.4);
  color: rgba(255, 150, 150, 0.9);
}

/* Light theme support for AI chat */
body.theme-light .ai-chat-section {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body.theme-light .ai-chat-section:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .ai-chat-toggle-btn {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .ai-chat-toggle-btn:hover {
  color: #000000;
}

body.theme-light .ai-chat-subtitle {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .ai-chat-window {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

body.theme-light .ai-chat-window::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

body.theme-light .ai-chat-window::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

body.theme-light .ai-message-charlie {
  background: rgba(197, 160, 40, 0.07);
  border-left-color: #c5a028;
  color: rgba(0, 0, 0, 0.85);
}

body.theme-light .ai-message-charlie::before {
  color: #a68018;
}

body.theme-light .ai-message-user {
  background: rgba(0, 0, 0, 0.04);
  border-right-color: rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.9);
}

body.theme-light .ai-message-user::before {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .ai-message strong {
  color: #000000;
}

body.theme-light .ai-chat-input {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: #000000;
}

body.theme-light .ai-chat-input:focus {
  border-color: rgba(0, 0, 0, 0.3);
  background: #ffffff;
}

body.theme-light .ai-chat-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .ai-chat-send-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .ai-chat-send-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.24);
  color: #000000;
}

body.theme-light .ai-chat-footer-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .ai-chat-footer-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #000000;
}

body.theme-light .ai-chat-footer-btn.clear-btn:hover {
  background: rgba(211, 47, 47, 0.06);
  border-color: rgba(211, 47, 47, 0.18);
  color: #d32f2f;
}

body.theme-light .ai-typing-indicator {
  background: rgba(197, 160, 40, 0.07);
  border-left-color: #c5a028;
}

body.theme-light .ai-typing-dot {
  background: rgba(0, 0, 0, 0.4);
}

body.theme-light .ai-typing-indicator.ai-thinking {
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .ai-thinking-star {
  color: #c5a028;
}

body.theme-light .ai-chat-option-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .ai-chat-option-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.22);
  color: #000000;
}

body.theme-light .ai-chat-error {
  background: rgba(255, 0, 0, 0.06);
  border-left-color: rgba(255, 0, 0, 0.4);
  color: rgba(200, 0, 0, 0.9);
}

/* Mobile responsive adjustments */
@media (max-width: 1024px) {
  .ai-chat-window {
    height: 280px;
  }
  
  .ai-message {
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   Clear Conversation Confirmation Modal
   ========================================================================== */

.ai-clear-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ai-clear-modal.visible {
  opacity: 1;
}

.ai-clear-modal.hidden {
  display: none !important;
}

.ai-clear-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ai-clear-content {
  position: relative;
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  width: 88%;
  max-width: 340px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  z-index: 2;
}

.ai-clear-modal.visible .ai-clear-content {
  transform: scale(1) translateY(0);
}

.ai-clear-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
}

.ai-clear-title {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ai-clear-desc {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

.ai-clear-actions {
  display: flex;
  gap: 0.75rem;
}

.ai-clear-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition-smooth);
}

.ai-clear-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
}

.ai-clear-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.ai-clear-btn-confirm {
  background: rgba(255, 60, 60, 0.15);
  border: 1px solid rgba(255, 60, 60, 0.35);
  color: rgba(255, 120, 120, 0.95);
}

.ai-clear-btn-confirm:hover {
  background: rgba(255, 60, 60, 0.25);
  border-color: rgba(255, 60, 60, 0.55);
  color: #ff6b6b;
}

.ai-clear-btn:active {
  transform: scale(0.97);
}

/* Light theme support */
body.theme-light .ai-clear-content {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

body.theme-light .ai-clear-icon {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .ai-clear-title {
  color: #000000;
}

body.theme-light .ai-clear-desc {
  color: rgba(0, 0, 0, 0.55);
}

body.theme-light .ai-clear-btn-cancel {
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .ai-clear-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  color: #000000;
}

body.theme-light .ai-clear-btn-confirm {
  background: rgba(220, 40, 40, 0.1);
  border-color: rgba(220, 40, 40, 0.3);
  color: rgba(200, 30, 30, 0.9);
}

body.theme-light .ai-clear-btn-confirm:hover {
  background: rgba(220, 40, 40, 0.18);
  border-color: rgba(220, 40, 40, 0.5);
  color: #c62828;
}

/* ==========================================================================
   Light Theme Sidebar and Viewport Support Overrides
   ========================================================================== */
body.theme-light .sidebar {
  /* The sidebar always stays charcoal — even in White theme — so the brand
     chrome (logo, settings, downloads) remains a familiar dark anchor and
     the main content viewport gets the full benefit of the light palette. */
  background-color: #1a1a1d;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

/* The white-theme override block below changes sidebar children to dark
   colors that assume a light sidebar background. Re-assert the dark-theme
   colors here so the sidebar reads correctly on the new charcoal surface. */
body.theme-light #app-sidebar .brand-logo-title,
body.theme-light #app-sidebar .brand-logo-subtitle { color: rgba(255, 255, 255, 0.85); }
body.theme-light #app-sidebar .brand-logo-subtitle { opacity: 1; }
body.theme-light #app-sidebar .sidebar-close-btn { color: rgba(255, 255, 255, 0.5); }
body.theme-light #app-sidebar .sidebar-close-btn:hover { color: #ffffff; }
body.theme-light #app-sidebar .section-title { color: rgba(255, 255, 255, 0.35); }
body.theme-light #app-sidebar .select-group label { color: rgba(255, 255, 255, 0.6); }
body.theme-light #app-sidebar .select-group select {
  background-color: #000000;
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
body.theme-light #app-sidebar .select-group select:focus { border-color: rgba(0, 210, 255, 0.6); }
body.theme-light #app-sidebar .select-group select option { background: #000000; color: #ffffff; }
body.theme-light #app-sidebar .scope-btn { color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .scope-btn:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
body.theme-light #app-sidebar .scope-btn.active { color: #000000; background: #ffffff; border-color: #ffffff; }
body.theme-light #app-sidebar .chapter-btn { color: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .chapter-btn:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
body.theme-light #app-sidebar .chapter-btn.active { color: #000000; background: #ffffff; border-color: #ffffff; }
body.theme-light #app-sidebar .search-box input {
  background-color: #000000;
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
body.theme-light #app-sidebar .search-box input:focus { border-color: rgba(0, 210, 255, 0.6); }
body.theme-light #app-sidebar #search-clear-btn { color: rgba(255, 255, 255, 0.4); }
body.theme-light #app-sidebar #search-clear-btn:hover { color: #ffffff; }
body.theme-light #app-sidebar .search-results-container { background: #000000; border-color: rgba(255, 255, 255, 0.08); }
body.theme-light #app-sidebar .search-results-count { color: rgba(255, 255, 255, 0.5); }
body.theme-light #app-sidebar .search-results-count strong { color: #00d2ff; }
body.theme-light #app-sidebar .search-result-item { border-bottom-color: rgba(255, 255, 255, 0.06); }
body.theme-light #app-sidebar .search-result-item:hover { background: rgba(255, 255, 255, 0.04); }
body.theme-light #app-sidebar .search-result-ref { color: #00d2ff; }
body.theme-light #app-sidebar .search-result-text { color: rgba(255, 255, 255, 0.75); }
body.theme-light #app-sidebar .search-no-results { color: rgba(255, 255, 255, 0.4); }
body.theme-light #app-sidebar .control-group label { color: rgba(255, 255, 255, 0.6); }
body.theme-light #app-sidebar .theme-pill-btn { color: rgba(255, 255, 255, 0.7); border-color: rgba(255, 255, 255, 0.15); }
body.theme-light #app-sidebar .theme-pill-btn:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.35); }
body.theme-light #app-sidebar .theme-pill-btn.active { color: #000000; background: #ffffff; border-color: #ffffff; }
body.theme-light #app-sidebar .size-controls { background: #000000; border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .size-btn { color: rgba(255, 255, 255, 0.6); }
body.theme-light #app-sidebar .size-btn:hover { color: #ffffff; }
body.theme-light #app-sidebar #font-size-val { color: rgba(255, 255, 255, 0.85); }
body.theme-light #app-sidebar .toggle-buttons { background: #000000; border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .toggle-btn { color: rgba(255, 255, 255, 0.6); }
body.theme-light #app-sidebar .toggle-btn:hover { color: #ffffff; }
body.theme-light #app-sidebar .toggle-btn.active { color: #000000; background: #ffffff; }
body.theme-light #app-sidebar .brightness-preset-btn { color: rgba(255, 255, 255, 0.6); border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .brightness-preset-btn:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
body.theme-light #app-sidebar .brightness-preset-btn.active { color: #000000; background: #ffffff; border-color: #ffffff; }
body.theme-light #app-sidebar .brand-header-container { border-bottom-color: rgba(255, 255, 255, 0.08); }
body.theme-light #app-sidebar .sidebar-section { border-bottom-color: rgba(255, 255, 255, 0.06); }
body.theme-light #app-sidebar .what-is-giga-btn { color: rgba(255, 255, 255, 0.75); border-color: rgba(255, 255, 255, 0.12); }
body.theme-light #app-sidebar .what-is-giga-btn:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.04); }
body.theme-light #app-sidebar .what-is-giga-btn:active { background: rgba(255, 255, 255, 0.08); }
body.theme-light #app-sidebar .giga-marketing-badge { background: rgba(0, 210, 255, 0.08); border-color: rgba(0, 210, 255, 0.25); }
body.theme-light #app-sidebar .giga-marketing-badge .badge-title { color: #00d2ff; }
body.theme-light #app-sidebar .giga-marketing-badge strong { color: #00d2ff; }
body.theme-light #app-sidebar .sidebar-footer { color: rgba(255, 255, 255, 0.4); border-top-color: rgba(255, 255, 255, 0.08); }
body.theme-light #app-sidebar .sidebar-footer .copyright { color: rgba(255, 255, 255, 0.35); }
body.theme-light #app-sidebar .sidebar-footer a { color: rgba(255, 255, 255, 0.55); }
body.theme-light #app-sidebar .sidebar-footer a:hover { color: #00d2ff; }
body.theme-light #app-sidebar .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); }
body.theme-light #app-sidebar .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

body.theme-light .brand-logo-title,
body.theme-light .brand-logo-subtitle {
  color: #0d0d0d;
}

body.theme-light .brand-logo-subtitle {
  opacity: 0.85;
}

body.theme-light .sidebar-close-btn {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .sidebar-close-btn:hover {
  color: #000000;
}

body.theme-light .section-title {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .select-group label {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .select-group select {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0d0d0d;
}

body.theme-light .select-group select:focus {
  border-color: #000000;
  background-color: #ffffff;
}

body.theme-light .select-group select option {
  background-color: #ffffff;
  color: #0d0d0d;
}

body.theme-light .scope-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
}

body.theme-light .scope-btn:hover {
  background-color: #f1f3f5;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.3);
}

body.theme-light .scope-btn.active {
  background-color: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

body.theme-light .chapter-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.8);
}

body.theme-light .chapter-btn:hover {
  background-color: #f1f3f5;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.4);
}

body.theme-light .chapter-btn.active {
  background-color: #0d0d0d !important;
  color: #ffffff !important;
  border-color: #0d0d0d !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.theme-light .search-box input {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0d0d0d;
}

body.theme-light .search-box input:focus {
  border-color: #000000;
  background-color: #ffffff;
}

body.theme-light #search-clear-btn {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light #search-clear-btn:hover {
  color: #000000;
}

body.theme-light .search-results-container {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

body.theme-light .search-results-count {
  background-color: #f1f3f5;
  border-bottom-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .search-results-count strong {
  color: #000000;
}

body.theme-light .search-result-item {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .search-result-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

body.theme-light .search-result-ref {
  color: #0d0d0d;
}

body.theme-light .search-result-text {
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .search-no-results {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .control-group label {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .theme-pill-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
}

body.theme-light .theme-pill-btn:hover {
  background-color: #f1f3f5;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.3);
}

body.theme-light .theme-pill-btn.active {
  background-color: #0d0d0d;
  border-color: #0d0d0d;
  color: #ffffff;
}

body.theme-light .size-controls {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .size-btn {
  color: #0d0d0d;
}

body.theme-light .size-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.theme-light #font-size-val {
  color: #0d0d0d;
}

body.theme-light .toggle-buttons {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .toggle-btn {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .toggle-btn:hover {
  color: #000000;
}

body.theme-light .toggle-btn.active {
  background-color: #0d0d0d;
  color: #ffffff;
}

body.theme-light .brightness-preset-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.75);
}

body.theme-light .brightness-preset-btn:hover {
  background-color: #f1f3f5;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.3);
}

body.theme-light .brightness-preset-btn.active {
  background-color: #0d0d0d;
  color: #ffffff;
  border-color: #0d0d0d;
}

body.theme-light .brand-header-container {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .sidebar-section {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .what-is-giga-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.8);
}

body.theme-light .what-is-giga-btn:hover {
  background-color: #f1f3f5;
  border-color: rgba(0, 0, 0, 0.3);
  color: #000000;
}

body.theme-light .what-is-giga-btn:active {
  background-color: #e9ecef;
}

body.theme-light .giga-marketing-badge {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.85);
}

body.theme-light .giga-marketing-badge .badge-title {
  color: #0d0d0d;
}

body.theme-light .giga-marketing-badge strong {
  color: #000000;
}

body.theme-light .translation-explanation {
  border-left-color: rgba(0, 0, 0, 0.3);
  background-color: rgba(0, 0, 0, 0.02);
}

body.theme-light .translation-explanation:hover {
  border-left-color: #000000;
  background-color: rgba(0, 0, 0, 0.04);
}

body.theme-light .lexicon-details-box {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

body.theme-light .lexicon-details-content strong {
  color: #000000;
}

body.theme-light .lexicon-search-btn {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0d0d0d;
}

body.theme-light .lexicon-search-btn:hover {
  background-color: #f1f3f5;
  border-color: rgba(0, 0, 0, 0.3);
  color: #000000;
}

body.theme-light .sidebar-footer {
  color: rgba(0, 0, 0, 0.6);
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .sidebar-footer .copyright {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .sidebar-footer a {
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .sidebar-footer a:hover {
  color: #000000;
}

body.theme-light .content-viewport {
  background-color: #f3f4f6;
}

body.theme-light .mobile-header {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .mobile-header .brand-logo-title,
body.theme-light .mobile-header .brand-logo-subtitle,
body.theme-light .mobile-header-view-title {
  color: #0d0d0d;
}

body.theme-light .menu-toggle-btn .bar {
  background-color: #0d0d0d;
}

body.theme-light .sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

body.theme-light .sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

body.theme-light .sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.theme-light .sidebar {
  scrollbar-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.04);
}

@media (max-width: 1024px) {
  body.theme-light .sidebar {
    background-color: #f8f9fa;
  }
}

/* ==========================================================================
   Viewport Tab Bar Switcher & Main Chat Styles
   ========================================================================== */

.main-viewport-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.85rem;
  margin-bottom: 1.75rem;
}

body.theme-light .main-viewport-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.viewport-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.55rem 0.95rem;
  font-family: var(--font-header);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.viewport-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.viewport-tab.active {
  color: var(--electric-blue);
  background: rgba(0, 210, 255, 0.06);
  border-color: rgba(0, 210, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.1);
}

/* Light Theme Switcher Styles */
body.theme-light .viewport-tab {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .viewport-tab:hover {
  color: #000000;
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .viewport-tab.active {
  color: #0066cc;
  background: rgba(0, 102, 204, 0.06);
  border-color: rgba(0, 102, 204, 0.2);
  box-shadow: 0 0 12px rgba(0, 102, 204, 0.08);
}

/* Main Layout modes toggle & heights */
.content-viewport.view-chat,
.content-viewport:has(.view-chat),
.content-viewport.view-community,
.content-viewport:has(.view-community),
.content-viewport.view-split,
.content-viewport:has(.view-split) {
  align-items: stretch;
  overflow-y: hidden;
}

#layout-wrapper.view-chat,
#layout-wrapper.view-community,
#layout-wrapper.view-devotional,
#layout-wrapper.view-split {
  height: 100%;
  min-height: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
}

#layout-wrapper.view-chat .page-margin-box,
#layout-wrapper.view-community .page-margin-box,
#layout-wrapper.view-split .page-margin-box {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 0;
  box-shadow: none;
  background: transparent;
}

#layout-wrapper.view-devotional {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#layout-wrapper.view-devotional .page-margin-box {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 0;
  box-shadow: none;
  background: transparent;
}

.main-content-layout-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.main-content-layout-wrapper.view-bible #bible-content {
  display: block;
}
.main-content-layout-wrapper.view-bible #main-chat-container {
  display: none !important;
}

.main-content-layout-wrapper.view-chat,
.main-content-layout-wrapper.view-community {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.main-content-layout-wrapper.view-chat #bible-content,
.main-content-layout-wrapper.view-community #bible-content {
  display: none !important;
}
.main-content-layout-wrapper.view-chat #main-chat-container {
  display: flex !important;
  flex: 1;
  height: 100% !important;
  min-height: 0;
  /* Outer bound on huge monitors; the header / messages / input inside are
     further capped to a ~980px readable column (ChatGPT / Gemini style). */
  width: 100%;
  max-width: min(100%, 1240px);
  margin-left: auto;
  margin-right: auto;
}
.main-content-layout-wrapper.view-community #community-container {
  display: flex !important;
  flex: 1;
  height: 100% !important;
  min-height: 0;
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Parallel Study View: Scripture & Chat */
.main-content-layout-wrapper.view-split {
  display: flex;
  flex-direction: row;
  gap: 2.25rem;
  width: 100%;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.main-content-layout-wrapper.view-split #bible-content {
  flex: 1.1;
  min-width: 0;
  display: block;
  height: 100%;
  overflow-y: auto;
}

.main-content-layout-wrapper.view-split #main-chat-container {
  flex: 0.9;
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  height: 100% !important;
  min-height: 0;
}

@media (max-width: 1024px) {
  .main-content-layout-wrapper.view-split {
    flex-direction: column;
    gap: 2rem;
  }
  .main-content-layout-wrapper.view-split #bible-content {
    flex: none;
    width: 100%;
    height: auto;
    overflow-y: visible;
  }
  .main-content-layout-wrapper.view-split #main-chat-container {
    flex: none;
    width: 100%;
    height: 550px !important;
  }
}

/* Main Chat Container Styles */
.main-chat-container {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-sizing: border-box;
}

.main-chat-container:has(.auth-cta-banner:not(.hidden)) .main-chat-header {
  display: none !important;
}

body.theme-light .main-chat-container {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.main-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.75rem;
  gap: 0.5rem;
  position: relative;
}

body.theme-light .main-chat-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.main-chat-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.main-chat-menu-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.main-chat-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body.theme-light .main-chat-menu-btn {
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .main-chat-menu-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #000000;
}

/* Chat Dropdown Menu */
.main-chat-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  width: 280px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.main-chat-dropdown.hidden {
  display: none;
}

body.theme-light .main-chat-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.main-chat-dropdown-header {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.35rem;
  margin-bottom: 0.25rem;
}

body.theme-light .main-chat-dropdown-header {
  color: rgba(0, 0, 0, 0.45);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.main-chat-dropdown .chat-account-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  width: 100%;
}

.main-chat-dropdown .chat-auth-btn {
  width: 100% !important;
  justify-content: center !important;
  padding: 8px 12px !important;
  font-size: 0.75rem !important;
  border-radius: 6px !important;
}

.dropdown-buttons-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.dropdown-buttons-row .main-chat-footer-btn {
  flex: 1;
  font-size: 0.7rem;
  padding: 8px;
}

.main-chat-dropdown .main-chat-disclaimer {
  display: block !important;
  font-size: 0.65rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.5rem;
  text-align: left;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.5rem;
}

body.theme-light .main-chat-dropdown .main-chat-disclaimer {
  color: rgba(0, 0, 0, 0.45);
  border-top-color: rgba(0, 0, 0, 0.06);
}

.main-chat-header-text {
  min-width: 0;
}

.main-chat-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.theme-light .main-chat-title {
  color: #0d0d0d;
}

.main-chat-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  font-family: var(--font-mono);
}

body.theme-light .main-chat-subtitle {
  color: rgba(0, 0, 0, 0.5);
}

/* Context Indicator */
.context-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.context-circle {
  width: 28px;
  height: 28px;
  transform: rotate(-90deg);
}

.context-circle-progress {
  transition: stroke-dasharray 0.4s ease, stroke 0.4s ease;
}

.context-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.55rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #ffffff;
  pointer-events: none;
  line-height: 1;
}

body.theme-light .context-percentage {
  color: #0d0d0d;
}

.context-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
  z-index: 10;
}

body.theme-light .context-tooltip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

.context-indicator:hover .context-tooltip,
.context-indicator:focus .context-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.context-warning .context-circle-progress {
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

.context-danger .context-circle-progress {
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.5));
}

/* Character Counter */
.char-counter {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
  padding: 0.15rem 0.5rem 0;
  margin-bottom: 0.25rem;
  transition: color 0.2s ease;
}

body.theme-light .char-counter {
  color: rgba(0, 0, 0, 0.35);
}

.char-counter-warning {
  color: #f59e0b !important;
}

body.theme-light .char-counter-warning {
  color: #d97706 !important;
}

/* Context Overflow Modal */
.ai-context-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-context-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.ai-context-content {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.theme-light .ai-context-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.ai-context-icon {
  color: #f59e0b;
  margin-bottom: 0.75rem;
}

.ai-context-title {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
}

body.theme-light .ai-context-title {
  color: #0d0d0d;
}

.ai-context-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

body.theme-light .ai-context-desc {
  color: rgba(0, 0, 0, 0.6);
}

.ai-context-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ai-context-btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.ai-context-btn-primary {
  background: var(--electric-blue);
  color: #ffffff;
}

.ai-context-btn-primary:hover {
  background: var(--electric-blue-hover);
}

.ai-context-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-context-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

body.theme-light .ai-context-btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.15);
}

body.theme-light .ai-context-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0d0d0d;
}

.main-chat-window {
  flex: 1;
  overflow-y: auto;
  border: none;
  background: transparent;
  margin-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body.theme-light .main-chat-window {
  border: none;
  background: transparent;
  scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.main-chat-window::-webkit-scrollbar {
  width: 6px;
}
.main-chat-window::-webkit-scrollbar-track {
  background: transparent;
}
.main-chat-window::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}
.main-chat-window::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.theme-light .main-chat-window::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}
body.theme-light .main-chat-window::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.main-chat-messages {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* User vs King James Message Differences */
.main-chat-messages .ai-message-charlie {
  background: rgba(0, 210, 255, 0.04);
  border-left: 3px solid #00d2ff;
  border-radius: 0 12px 12px 12px;
  color: rgba(255, 255, 255, 0.95);
  max-width: 90%;
  align-self: flex-start;
  padding: 0.95rem 1.15rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

body.theme-light .main-chat-messages .ai-message-charlie {
  background: rgba(197, 160, 40, 0.07);
  border-left-color: #c5a028;
  color: rgba(0, 0, 0, 0.88);
}

.main-chat-messages .ai-message-user {
  background: rgba(255, 255, 255, 0.05);
  border-right: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px 0 12px 12px;
  color: rgba(255, 255, 255, 0.95);
  max-width: 80%;
  align-self: flex-end;
  margin-left: auto;
  padding: 0.95rem 1.15rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

body.theme-light .main-chat-messages .ai-message-user {
  background: rgba(0, 0, 0, 0.04);
  border-right-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.9);
}

/* Input Form in Main Viewport */
.main-chat-bottom-wrapper {
  width: auto;
  max-width: 980px;
  margin: 0 12px 0.75rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

@media (min-width: 1004px) {
  .main-chat-bottom-wrapper {
    margin: 0 auto 0.75rem;
  }
}

.main-chat-input-container {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.main-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.85rem 1.15rem;
  font-family: var(--font-reading);
  font-size: 0.88rem;
  border-radius: 8px;
  outline: none;
  transition: var(--transition-smooth);
}

body.theme-light .main-chat-input {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: #000000;
}

.main-chat-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .main-chat-input:focus {
  border-color: rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

.main-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

body.theme-light .main-chat-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.main-chat-send-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  padding: 0 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.theme-light .main-chat-send-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.6);
}

.main-chat-send-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

body.theme-light .main-chat-send-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.24);
  color: #000000;
}

.main-chat-send-btn:active {
  transform: scale(0.96);
}

.main-chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Footer Actions in Main Viewport */
.main-chat-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.main-chat-footer-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-header);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.55rem;
  line-height: 1.4;
  overflow: visible;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.theme-light .main-chat-footer-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.5);
}

.main-chat-footer-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

body.theme-light .main-chat-footer-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.main-chat-footer-btn.clear-btn:hover {
  background: rgba(255, 77, 77, 0.08);
  border-color: rgba(255, 77, 77, 0.18);
  color: #ff6666;
}

body.theme-light .main-chat-footer-btn.clear-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #dc2626;
}

/* Gentle Response Highlight Animation */
@keyframes response-glow {
  0% {
    background: rgba(0, 210, 255, 0.28);
    box-shadow: 0 0 18px rgba(0, 210, 255, 0.25);
  }
  100% {
    background: rgba(0, 210, 255, 0.04);
    box-shadow: none;
  }
}

@keyframes response-glow-light {
  0% {
    background: rgba(197, 160, 40, 0.32);
    box-shadow: 0 0 18px rgba(197, 160, 40, 0.22);
  }
  100% {
    background: rgba(197, 160, 40, 0.07);
    box-shadow: none;
  }
}

.response-flash {
  animation: response-glow 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

body.theme-light .response-flash {
  animation: response-glow-light 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* ==========================================================================
   UI/UX Audit Enhancements
   ========================================================================== */

/* Fade-In Slide-Up Page Transition */
@keyframes viewportFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-content-layout-wrapper.view-bible #bible-content,
.main-content-layout-wrapper.view-chat #main-chat-container,
.main-content-layout-wrapper.view-split #bible-content,
.main-content-layout-wrapper.view-split #main-chat-container,
.main-content-layout-wrapper.view-community #community-container {
  animation: viewportFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Accessibility Focus rings */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.custom-select-trigger:focus-visible,
.viewport-tab:focus-visible {
  outline: 2px solid var(--electric-blue);
  outline-offset: 3px;
}

body.theme-light button:focus-visible,
body.theme-light input:focus-visible,
body.theme-light select:focus-visible,
body.theme-light .custom-select-trigger:focus-visible,
body.theme-light .viewport-tab:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 3px;
}

/* Light Theme Hover Tooltips Overrides */
body.theme-light .tooltip {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #1e293b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body.theme-light .tooltip-arrow {
  background: #ffffff;
  border-right-color: rgba(0, 0, 0, 0.12);
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .tooltip.tooltip-below .tooltip-arrow {
  border-left-color: rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Responsive Adaptations for King James Chat Viewport height and padding
   ========================================================================== */
@media (max-width: 768px) {
  .content-viewport.view-chat {
    padding-top: 52px !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.25rem) !important; /* adjust for bottom navigation bar */
  }

  .content-viewport.view-bible,
  .content-viewport.view-devotional,
  .content-viewport.view-community {
    padding-top: 60px !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.5rem) !important; /* adjust for bottom navigation bar */
  }
  
  #layout-wrapper.view-chat,
  #layout-wrapper.view-bible,
  #layout-wrapper.view-devotional,
  #layout-wrapper.view-community {
    padding: 0.25rem 0 !important;
  }
  
  #layout-wrapper.view-chat,
  #layout-wrapper.view-community {
    height: 100% !important;
  }
  
  #layout-wrapper.view-chat .page-margin-box,
  #layout-wrapper.view-community .page-margin-box {
    height: 100% !important;
  }
  
  #layout-wrapper.view-chat .page-margin-box {
    padding: 0.35rem 0.35rem !important;
  }

  #layout-wrapper.view-bible .page-margin-box,
  #layout-wrapper.view-devotional .page-margin-box {
    padding: 0.75rem 0.75rem !important;
  }

  #layout-wrapper.view-community .page-margin-box {
    padding: 0 !important;
    border: none !important;
  }
  
  .main-viewport-tabs {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  .viewport-tab {
    font-size: 11px !important;
    padding: 0.4rem 0.7rem !important;
    gap: 0.35rem !important;
  }
  
  .viewport-tab svg {
    width: 13px !important;
    height: 13px !important;
  }
  
  .view-chat .main-chat-container {
    padding: 0.5rem !important;
    flex: 1 !important;
    height: 100% !important;
    border-radius: 8px !important;
  }

  .view-community .community-container {
    padding: 0 !important;
    border-radius: 0 !important;
    flex: 1 !important;
    height: 100% !important;
  }

  .view-chat .main-chat-header {
    margin-bottom: 0.35rem !important;
    padding-bottom: 0.25rem !important;
  }

  .view-chat .main-chat-title {
    font-size: 1rem !important;
  }

  .view-chat .main-chat-subtitle {
    font-size: 0.7rem !important;
  }

  .view-chat .main-chat-window {
    margin-bottom: 0.5rem !important;
  }

  .view-chat .main-chat-messages {
    padding: 0.5rem !important;
    gap: 0.75rem !important;
  }

  .view-chat .main-chat-messages .ai-message-charlie,
  .view-chat .main-chat-messages .ai-message-user {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }

  .view-chat .ai-chat-options {
    gap: 0.3rem !important;
    margin-top: 0.5rem !important;
  }

  .view-chat .ai-chat-option-btn {
    padding: 0.4rem 0.7rem !important;
    font-size: 0.72rem !important;
  }

  .view-chat .main-chat-input-container {
    margin-bottom: 0.35rem !important;
    gap: 0.35rem !important;
  }

  .view-chat .main-chat-input {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
  }

  .view-chat .main-chat-footer-actions {
    gap: 0.4rem !important;
  }

  .view-chat .main-chat-footer-btn {
    padding: 0.4rem !important;
    font-size: 0.65rem !important;
  }

  .view-chat .main-chat-disclaimer {
    font-size: 0.6rem !important;
    margin-top: 0.3rem !important;
  }

  .view-chat .context-indicator {
    width: 24px !important;
    height: 24px !important;
  }

  .view-chat .context-circle {
    width: 24px !important;
    height: 24px !important;
  }

  .view-chat .context-percentage {
    font-size: 0.5rem !important;
  }

  .view-chat .context-tooltip {
    font-size: 0.6rem !important;
    padding: 0.25rem 0.4rem !important;
  }

  .view-chat .char-counter {
    font-size: 0.6rem !important;
    padding: 0.1rem 0.4rem 0 !important;
  }
}

@media (max-width: 480px) {
  .content-viewport.view-chat {
    padding-top: 48px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.15rem) !important; /* adjust for bottom tabs */
  }

  .content-viewport.view-bible,
  .content-viewport.view-devotional,
  .content-viewport.view-community {
    padding-top: 60px !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 0.25rem) !important; /* adjust for bottom tabs */
  }

  #layout-wrapper.view-chat,
  #layout-wrapper.view-bible,
  #layout-wrapper.view-devotional,
  #layout-wrapper.view-community {
    padding: 0 !important;
  }

  #layout-wrapper.view-chat,
  #layout-wrapper.view-community {
    height: 100% !important;
  }

  #layout-wrapper.view-chat .page-margin-box,
  #layout-wrapper.view-community .page-margin-box {
    height: 100% !important;
  }

  #layout-wrapper.view-chat .page-margin-box {
    padding: 0.2rem 0.2rem !important;
    border-radius: 0px !important;
    border-left: none !important;
    border-right: none !important;
  }

  #layout-wrapper.view-bible .page-margin-box,
  #layout-wrapper.view-devotional .page-margin-box {
    padding: 0.5rem 0.5rem !important;
    border-radius: 0px !important;
    border-left: none !important;
    border-right: none !important;
  }

  #layout-wrapper.view-community .page-margin-box {
    padding: 0 !important;
    border-radius: 0px !important;
    border: none !important;
  }

  .main-viewport-tabs {
    margin-bottom: 0.4rem !important;
    padding-bottom: 0.25rem !important;
  }

  .viewport-tab {
    font-size: 10px !important;
    padding: 0.3rem 0.5rem !important;
    gap: 0.25rem !important;
  }

  .viewport-tab svg {
    width: 12px !important;
    height: 12px !important;
  }

  .view-chat .main-chat-container {
    padding: 0.4rem !important;
    flex: 1 !important;
    height: 100% !important;
    border-radius: 4px !important;
    border: none !important;
  }

  .view-community .community-container {
    padding: 0 !important;
    border-radius: 0 !important;
    flex: 1 !important;
    height: 100% !important;
  }

  .view-chat .main-chat-header {
    margin-bottom: 0.2rem !important;
    padding-bottom: 0.15rem !important;
  }

  .view-chat .main-chat-title {
    font-size: 0.9rem !important;
    margin-bottom: 0.1rem !important;
  }

  .view-chat .main-chat-subtitle {
    display: none !important;
  }

  .view-chat .main-chat-header-right {
    gap: 0.35rem !important;
  }

  .view-chat .context-indicator {
    width: 20px !important;
    height: 20px !important;
  }

  .view-chat .context-circle {
    width: 20px !important;
    height: 20px !important;
  }

  .view-chat .context-percentage {
    display: none !important;
  }

  .view-chat .main-chat-menu-btn {
    padding: 2px !important;
  }

  .view-chat .chat-plan-pill {
    font-size: 8px !important;
    padding: 2px 6px !important;
  }

  .view-chat .main-chat-window {
    margin-bottom: 0.25rem !important;
  }

  .view-chat .main-chat-messages {
    padding: 0.35rem !important;
    gap: 0.5rem !important;
  }

  .view-chat .main-chat-messages .ai-message-charlie,
  .view-chat .main-chat-messages .ai-message-user {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    border-radius: 10px !important;
  }

  .view-chat .ai-chat-options {
    gap: 0.25rem !important;
    margin-top: 0.35rem !important;
  }

  .view-chat .ai-chat-option-btn {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.68rem !important;
    border-radius: 99px !important;
  }

  .view-chat .main-chat-input-container {
    margin-bottom: 0.2rem !important;
    gap: 0.25rem !important;
  }

  .view-chat .main-chat-input {
    padding: 0.55rem 0.7rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
  }

  .view-chat .main-chat-send-btn {
    padding: 0 0.85rem !important;
    border-radius: 8px !important;
  }

  .view-chat .main-chat-footer-actions {
    gap: 0.3rem !important;
  }

  .view-chat .main-chat-footer-btn {
    padding: 0.35rem !important;
    font-size: 0.58rem !important;
  }

  .view-chat .main-chat-disclaimer {
    font-size: 0.55rem !important;
    line-height: 1.2 !important;
    margin-top: 0.15rem !important;
  }

  .view-chat .chat-account-row {
    gap: 4px !important;
    padding: 2px 0 !important;
  }

  .view-chat .context-indicator {
    width: 22px !important;
    height: 22px !important;
  }

  .view-chat .context-circle {
    width: 22px !important;
    height: 22px !important;
  }

  .view-chat .context-percentage {
    font-size: 0.45rem !important;
  }

  .view-chat .context-tooltip {
    font-size: 0.55rem !important;
    padding: 0.2rem 0.35rem !important;
  }

  .view-chat .char-counter {
    font-size: 0.55rem !important;
    padding: 0.05rem 0.35rem 0 !important;
  }

  .ai-context-content {
    padding: 1rem !important;
    border-radius: 8px !important;
  }

  .ai-context-btn {
    padding: 0.5rem 0.8rem !important;
    font-size: 0.75rem !important;
  }
}

/* ==========================================================================
   Daily Devotional Styles
   ========================================================================== */

.devotional-container {
  width: 100%;
  max-width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0;
  animation: devotionalFadeIn 0.6s ease-out;
}

.pastor-james-devotional-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.16) 0%, rgba(13, 13, 13, 0.85) 50%, rgba(0, 210, 255, 0.05) 100%);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: 14px;
  padding: 0.95rem 1.4rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 15px rgba(0, 210, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.pastor-james-devotional-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.1), transparent);
  transition: all 0.6s ease;
}

.pastor-james-devotional-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.65);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 25px rgba(0, 210, 255, 0.25);
}

.pastor-james-devotional-banner:hover::before {
  left: 100%;
}

.pj-banner-crown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.5));
  transition: transform 0.3s ease;
}

.pastor-james-devotional-banner:hover .pj-banner-crown {
  transform: scale(1.12) rotate(3deg);
}

.pj-banner-crown-svg {
  display: block;
}

.pj-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pj-banner-name {
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #ffe259, #ffa751);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  filter: drop-shadow(0 0 4px rgba(0, 210, 255, 0.2));
}

.pj-banner-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

body.theme-light .pastor-james-devotional-banner {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12) 0%, rgba(255, 255, 255, 0.95) 50%, rgba(0, 210, 255, 0.05) 100%);
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 15px rgba(0, 210, 255, 0.05);
}

body.theme-light .pj-banner-subtitle {
  color: rgba(0, 0, 0, 0.55);
}

@keyframes devotionalFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.devotional-header {
  text-align: center;
  margin: 0 0 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.devotional-date {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.devotional-title {
  font-family: var(--font-header);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.devotional-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  font-size: 0.9rem;
}

.devotional-verse,
.devotional-reading {
  background: var(--electric-blue-transparent);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  padding: 0.35rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.devotional-body {
  font-family: var(--font-lora);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.devotional-body p {
  margin-bottom: 1.25rem;
}

.devotional-confession {
  background: var(--electric-blue-transparent);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  font-family: var(--font-lora);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
}

.devotional-confession::before {
  content: '\201C';
  font-family: var(--font-playfair);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.15);
  position: absolute;
  top: 0.25rem;
  left: 0.75rem;
  line-height: 1;
}

.devotional-confession-label {
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

.devotional-scripture {
  margin-bottom: 1.5rem;
}

.scripture-card {
  background: var(--electric-blue-transparent);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.scripture-toggle {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.scripture-toggle:hover {
  color: rgba(255, 255, 255, 0.8);
}

.scripture-toggle-icon {
  font-size: 0.65rem;
  display: inline-block;
  width: 0.7rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.scripture-card-text {
  font-family: var(--font-lora);
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.scripture-citation {
  display: block;
  font-family: var(--font-header);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0.75rem 0 0;
  text-transform: uppercase;
  white-space: normal;
}

.devotional-verse-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--electric-blue);
  margin-right: 0.35rem;
  vertical-align: super;
}

.scripture-not-found {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  font-size: 0.9rem;
}

.devotional-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.devotional-nav-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-header);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.devotional-nav-btn:hover {
  background: var(--electric-blue-transparent);
  border-color: rgba(255, 255, 255, 0.3);
}

.devotional-nav-btn:active {
  transform: scale(0.97);
}

/* View-specific layout helpers */
.view-devotional #bible-content,
.view-devotional #main-chat-container {
  display: none !important;
}

.view-bible #devotional-container,
.view-chat #devotional-container {
  display: none !important;
}

/* Light theme devotional overrides */
.theme-light .devotional-date {
  color: rgba(0, 0, 0, 0.4);
}

.theme-light .devotional-title {
  color: var(--text-dark);
}

.theme-light .devotional-verse,
.theme-light .devotional-reading {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.6);
}

.theme-light .devotional-body {
  color: var(--text-dark);
}

.theme-light .devotional-confession {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.75);
}

.theme-light .devotional-confession::before {
  color: rgba(0, 0, 0, 0.1);
}

.theme-light .devotional-confession-label {
  color: rgba(0, 0, 0, 0.4);
}

.theme-light .scripture-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .scripture-toggle {
  color: rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .scripture-toggle:hover {
  color: rgba(0, 0, 0, 0.7);
}

.theme-light .scripture-card-text {
  color: rgba(0, 0, 0, 0.75);
}

.theme-light .scripture-citation {
  color: rgba(0, 0, 0, 0.45);
}

.theme-light .devotional-verse-num {
  color: var(--electric-blue);
}

.theme-light .scripture-not-found {
  color: rgba(0, 0, 0, 0.4);
}

.theme-light .devotional-nav-btn {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-dark);
}

.theme-light .devotional-nav-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
  .devotional-container {
    padding: 1.25rem 1rem;
  }

  .devotional-title {
    font-size: 1.5rem;
  }

  .devotional-meta {
    flex-direction: column;
    align-items: center;
  }

  .devotional-body {
    font-size: 1rem;
  }
}

/* ==========================================================================
   Feedback & Bug Report Modal
   ========================================================================== */

.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 21000; /* slightly higher than clear modal */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.feedback-modal.visible {
  opacity: 1;
}

.feedback-modal.hidden {
  display: none !important;
}

.feedback-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.feedback-content {
  position: relative;
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 90%;
  max-width: 460px;
  padding: 2.25rem 2rem 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.feedback-modal.visible .feedback-content {
  transform: scale(1) translateY(0);
}

.feedback-close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.feedback-close-modal-btn:hover {
  color: #ffffff;
}

.feedback-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.feedback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(0, 210, 255, 0.25);
  background: rgba(0, 210, 255, 0.05);
  color: #00d2ff; /* Gold accent */
  border-radius: 50%;
  margin-bottom: 1rem;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.1);
}

.feedback-title {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.feedback-desc {
  font-family: var(--font-inter);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-family: var(--font-header);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.5rem;
}

.feedback-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  padding: 0.45rem 0.8rem;
  font-family: var(--font-reading);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.category-pill-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.category-pill-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00d2ff;
  color: #ffffff;
  font-weight: 600;
}

#feedback-email, #feedback-message {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  border-radius: 4px;
  outline: none;
  transition: var(--transition-smooth);
}

#feedback-email:focus, #feedback-message:focus {
  border-color: rgba(0, 210, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.08);
}

#feedback-email::placeholder, #feedback-message::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

#feedback-message {
  resize: vertical;
  min-height: 90px;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.error-msg {
  font-family: var(--font-reading);
  font-size: 0.7rem;
  color: #ff5252;
  min-height: 1rem;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
}

.feedback-context-info {
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid #00d2ff;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.5rem;
  display: none; /* hidden if no context */
}

.feedback-context-info.has-context {
  display: block;
}

.feedback-actions {
  display: flex;
  gap: 0.75rem;
}

.feedback-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.feedback-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.feedback-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.feedback-btn-submit {
  background: #00d2ff;
  border: 1px solid #00d2ff;
  color: #000000;
}

.feedback-btn-submit:hover {
  background: #e5bf48;
  border-color: #e5bf48;
  transform: translateY(-1px);
}

.feedback-btn-submit:active {
  transform: translateY(0);
}

.feedback-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Success Screen Styles */
.feedback-success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
}

.success-icon-wrap {
  margin-bottom: 1.5rem;
}

.checkmark-svg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #00d2ff;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #00d2ff;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #00d2ff;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes scale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

.success-title {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pure-white);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.success-desc {
  font-family: var(--font-inter);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2rem;
  line-height: 1.5;
  max-width: 300px;
}

.feedback-success-screen .feedback-btn-cancel {
  width: 100%;
}

/* Light Theme Support */
body.theme-light .feedback-content {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.theme-light .feedback-close-modal-btn {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .feedback-close-modal-btn:hover {
  color: #000000;
}

body.theme-light .feedback-icon {
  border-color: rgba(197, 160, 40, 0.3);
  background: rgba(197, 160, 40, 0.05);
  color: #c5a028;
  box-shadow: 0 0 15px rgba(197, 160, 40, 0.05);
}

body.theme-light .feedback-title,
body.theme-light .success-title {
  color: #000000;
}

body.theme-light .feedback-desc,
body.theme-light .success-desc {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .form-group label {
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .category-pill-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .category-pill-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  color: #000000;
}

body.theme-light .category-pill-btn.active {
  background: rgba(197, 160, 40, 0.15);
  border-color: #c5a028;
  color: #000000;
}

body.theme-light #feedback-email,
body.theme-light #feedback-message {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: #000000;
}

body.theme-light #feedback-email:focus,
body.theme-light #feedback-message:focus {
  border-color: rgba(197, 160, 40, 0.6);
  background: #ffffff;
}

body.theme-light #feedback-email::placeholder,
body.theme-light #feedback-message::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .char-count {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .feedback-context-info {
  background: rgba(0, 0, 0, 0.02);
  border-left-color: #c5a028;
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .feedback-btn-cancel {
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .feedback-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.25);
  color: #000000;
}

body.theme-light .feedback-btn-submit {
  background: #c5a028;
  border-color: #c5a028;
  color: #ffffff;
}

body.theme-light .feedback-btn-submit:hover {
  background: #008bb3;
  border-color: #008bb3;
}

body.theme-light .checkmark-svg,
body.theme-light .checkmark__circle {
  stroke: #c5a028;
}

/* ==========================================================================
   Community Global Chat & Moderation
   ========================================================================== */

.community-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Auth / Username Setup Card */
.community-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.4);
}

.auth-card {
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  padding: 3rem 2.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(0, 210, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  animation: scale-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scale-up-fade {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-icon {
  color: #00d2ff;
  margin-bottom: 1rem;
}

.auth-header h3 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--pure-white);
  margin-bottom: 0.5rem;
}

.auth-header p {
  font-family: var(--font-inter);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin-bottom: 1.75rem;
}

#community-username-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.8rem 1rem;
  font-family: var(--font-reading);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  outline: none;
  text-align: center;
  transition: var(--transition-smooth);
}

#community-username-input:focus {
  border-color: rgba(0, 210, 255, 0.75);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.18);
}

.auth-error-msg {
  font-family: var(--font-reading);
  font-size: 0.7rem;
  color: #ff5252;
  margin-top: 0.35rem;
  display: block;
  min-height: 1.1rem;
}

.community-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.community-btn-join {
  background: linear-gradient(135deg, #00d2ff, #f3e5ab);
  border: none;
  color: #000000;
  font-weight: 800;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.15);
}

.community-btn-join:hover {
  background: linear-gradient(135deg, #e5bf48, #ffffff);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.35);
}

/* Chat Panel Layout */
.community-chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Desktop Chat Header */
.community-desktop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.community-desktop-header h3 {
  font-family: var(--font-header);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pure-white);
  margin: 0;
}

.community-desktop-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.community-desktop-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Ban Warning Banner */
.community-ban-banner {
  background: rgba(255, 82, 82, 0.12);
  border-bottom: 1px solid rgba(255, 82, 82, 0.25);
  padding: 0.75rem 1.25rem;
  z-index: 10;
  animation: slide-down 0.25s ease;
}

@keyframes slide-down {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.ban-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.ban-banner-text {
  font-family: var(--font-reading);
  font-size: 0.8rem;
  color: #ff7676;
  font-weight: 600;
}

.ban-dispute-btn {
  background: transparent;
  border: 1px solid rgba(255, 118, 118, 0.35);
  color: #ff7676;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-header);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ban-dispute-btn:hover {
  background: rgba(255, 118, 118, 0.15);
  border-color: #ff7676;
  color: #ffffff;
}

/* Messages Area */
.community-chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.community-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Chat Message Bubbles */
.community-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 100% !important;
  align-self: flex-start !important;
  width: 100%;
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
  font-family: var(--font-mono), monospace !important;
}

.community-msg-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.community-msg-row.self {
  align-self: flex-start !important;
}

.terminal-msg-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.5;
}

.community-msg-author {
  font-family: var(--font-mono), monospace;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.community-msg-row.self .community-msg-author {
  color: #00d2ff;
}

.community-msg-giga-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: middle;
  border: 1px solid rgba(0, 210, 255, 0.4);
  text-transform: uppercase;
  white-space: nowrap;
}

.community-msg-time {
  font-family: var(--font-mono), monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
}

.community-msg-body {
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono), monospace !important;
  font-size: 0.82rem;
  word-break: break-word;
}

.community-msg-row.self .community-msg-body {
  color: #ffffff;
}

.community-msg-row.system-msg {
  align-self: center !important;
  max-width: 95%;
  text-align: center;
}

.community-msg-row.system-msg .community-msg-body {
  color: rgba(0, 210, 255, 0.7);
  font-size: 0.78rem;
  padding: 2px 8px;
}

/* Censored state */
.community-msg-body.censored-body {
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  font-size: 0.78rem;
}

/* Report & Reply Actions */
.community-msg-footer {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 2px;
  padding-left: 44px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.community-msg-row:hover .community-msg-footer {
  opacity: 1;
  pointer-events: auto;
}

.msg-reply-btn, .msg-report-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono), monospace;
  font-size: 0.62rem;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.msg-reply-btn:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00d2ff;
  color: #00d2ff;
}

.msg-report-btn:hover {
  background: rgba(255, 82, 82, 0.15);
  border-color: #ff5252;
  color: #ff5252;
}

.msg-report-btn:disabled {
  color: #ff5252 !important;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chat Mentions */
.chat-mention {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #00d2ff;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: bold;
}

/* Autocomplete Suggestion Container */
.community-autocomplete-container {
  position: absolute;
  bottom: 100px;
  left: 20px;
  right: 20px;
  background: #0f1015;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  max-height: 150px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.autocomplete-item {
  padding: 8px 12px;
  color: #ccc;
  cursor: pointer;
  font-family: var(--font-mono), monospace;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
}

/* Quick Emoji Selector Bar */
.community-emoji-bar {
  display: flex;
  gap: 8px;
  padding: 6px 1.25rem;
  background: rgba(10, 10, 12, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.emoji-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 4px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.15);
}

.emoji-btn:active {
  transform: scale(0.95);
}

/* AI Message Report Action */
.ai-charlie-message-actions {
  position: absolute;
  bottom: 4px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(2px);
}

.ai-message-charlie:hover .ai-charlie-message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ai-charlie-message-report-btn {
  background: rgba(0, 210, 255, 0.08) !important;
  border: 1px solid rgba(0, 210, 255, 0.25) !important;
  color: #00d2ff !important;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-charlie-message-report-btn:hover {
  background: rgba(0, 210, 255, 0.18) !important;
  border-color: #00d2ff !important;
}

/* Input Bar Container */
.community-chat-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.community-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-reading);
  font-size: 0.82rem;
  border-radius: 6px;
  outline: none;
  transition: var(--transition-smooth);
}

.community-chat-input:focus {
  border-color: rgba(0, 210, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.12);
}

.community-chat-send-btn {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.25);
  color: #00d2ff;
  padding: 0 1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-chat-send-btn:hover {
  background: #00d2ff;
  color: #000000;
  transform: scale(1.04);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}

.community-chat-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
}

/* Dispute Modal */
.community-dispute-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 22000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.community-dispute-modal.visible {
  opacity: 1;
}

.community-dispute-modal.hidden {
  display: none !important;
}

.dispute-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dispute-content {
  position: relative;
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  width: 90%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  text-align: center;
}

.community-dispute-modal.visible .dispute-content {
  transform: scale(1) translateY(0);
}

.dispute-content h4 {
  font-family: var(--font-header);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pure-white);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.dispute-info {
  font-family: var(--font-inter);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

#community-dispute-reason {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-reading);
  font-size: 0.8rem;
  border-radius: 4px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
}

#community-dispute-reason:focus {
  border-color: rgba(0, 210, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.dispute-error-msg {
  font-family: var(--font-reading);
  font-size: 0.7rem;
  color: #ff5252;
  min-height: 1.1rem;
  margin-bottom: 1rem;
}

.dispute-actions {
  display: flex;
  gap: 0.75rem;
}

.dispute-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  font-family: var(--font-header);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.dispute-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
}

.dispute-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.dispute-btn-submit {
  background: #00d2ff;
  border: 1px solid #00d2ff;
  color: #000000;
}

.dispute-btn-submit:hover {
  background: #e5bf48;
  border-color: #e5bf48;
}

/* Light Theme Support */
body.theme-light .community-auth-panel {
  background: rgba(0, 0, 0, 0.02);
}

body.theme-light .auth-card,
body.theme-light .dispute-content {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.theme-light .auth-icon {
  color: #c5a028;
}

body.theme-light .auth-header h3,
body.theme-light .dispute-content h4 {
  color: #000000;
}

body.theme-light .auth-header p,
body.theme-light .dispute-info {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light #community-username-input,
body.theme-light #community-dispute-reason,
body.theme-light .community-chat-input {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.12);
  color: #000000;
}

body.theme-light #community-username-input:focus,
body.theme-light #community-dispute-reason:focus,
body.theme-light .community-chat-input:focus {
  border-color: rgba(197, 160, 40, 0.6);
  background: #ffffff;
}

body.theme-light #community-username-input::placeholder,
body.theme-light #community-dispute-reason::placeholder,
body.theme-light .community-chat-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .community-btn-join,
body.theme-light .dispute-btn-submit {
  background: #c5a028;
  border-color: #c5a028;
  color: #ffffff;
}

body.theme-light .community-btn-join:hover,
body.theme-light .dispute-btn-submit:hover {
  background: #008bb3;
  border-color: #008bb3;
}

body.theme-light .community-ban-banner {
  background: rgba(220, 40, 40, 0.06);
  border-bottom-color: rgba(220, 40, 40, 0.15);
}

body.theme-light .ban-banner-text {
  color: #c62828;
}

body.theme-light .ban-dispute-btn {
  border-color: rgba(198, 40, 40, 0.35);
  color: #c62828;
}

body.theme-light .ban-dispute-btn:hover {
  background: rgba(198, 40, 40, 0.06);
  color: #b71c1c;
}

body.theme-light .community-chat-window {
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

body.theme-light .community-msg-author {
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .community-msg-row.self .community-msg-author {
  color: #c5a028;
}

body.theme-light .community-msg-giga-badge {
  background: rgba(197, 160, 40, 0.12);
  color: #c5a028;
  border-color: rgba(197, 160, 40, 0.4);
}

body.theme-light .community-msg-time {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .community-msg-body {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.85);
}

body.theme-light .community-msg-row.self .community-msg-body {
  background: rgba(197, 160, 40, 0.07);
  border-color: rgba(197, 160, 40, 0.18);
}

body.theme-light .community-msg-body.censored-body {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .community-msg-row.system-msg .community-msg-body {
  background: rgba(197, 160, 40, 0.04);
  border-color: rgba(197, 160, 40, 0.15);
  color: #a68018;
}

body.theme-light .msg-report-btn {
  color: rgba(0, 0, 0, 0.3);
}

body.theme-light .msg-report-btn:hover {
  color: #d32f2f;
}

body.theme-light .community-chat-input-container {
  background: rgba(0, 0, 0, 0.01);
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .community-chat-send-btn {
  background: rgba(197, 160, 40, 0.1);
  border-color: rgba(197, 160, 40, 0.2);
  color: #c5a028;
}

body.theme-light .community-chat-send-btn:hover {
  background: #c5a028;
  color: #ffffff;
}

body.theme-light .dispute-btn-cancel {
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.65);
}

body.theme-light .dispute-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.25);
  color: #000000;
}

/* ==========================================================================
   Custom Premium Alert Modal
   ========================================================================== */

.custom-alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 30000; /* highest stack */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.custom-alert-modal.visible {
  opacity: 1;
}

.custom-alert-modal.hidden {
  display: none !important;
}

.custom-alert-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.custom-alert-content {
  position: relative;
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: 90%;
  max-width: 440px;
  padding: 2.25rem 2rem;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.9);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  text-align: center;
}

.custom-alert-modal.visible .custom-alert-content {
  transform: scale(1) translateY(0);
}

.custom-alert-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}

.custom-alert-icon {
  color: #00d2ff;
  margin-bottom: 0.75rem;
}

.custom-alert-content h4 {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pure-white);
  margin: 0;
}

#custom-alert-message {
  font-family: var(--font-reading);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.custom-alert-scripture {
  border-left: 3px solid #00d2ff;
  background: rgba(0, 210, 255, 0.05);
  padding: 0.85rem 1rem;
  margin: 1.25rem 0 1.5rem;
  border-radius: 0 6px 6px 0;
  text-align: left;
}

.custom-alert-scripture.hidden {
  display: none !important;
}

.alert-scripture-citation {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(0, 210, 255, 0.8);
  margin-bottom: 0.35rem;
  letter-spacing: 0.03em;
}

.alert-scripture-text {
  font-family: var(--font-reading);
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  margin: 0;
}

.custom-alert-actions {
  display: flex;
  justify-content: center;
}

.custom-alert-btn {
  background: #00d2ff;
  border: 1px solid #00d2ff;
  color: #000000;
  font-family: var(--font-header);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
  max-width: 180px;
}

.custom-alert-btn:hover {
  background: #c5a028;
  border-color: #c5a028;
  transform: translateY(-1px);
}

.custom-alert-btn:active {
  transform: translateY(1px);
}

/* Light theme support */
body.theme-light .custom-alert-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

body.theme-light .custom-alert-content h4 {
  color: #000000;
}

body.theme-light #custom-alert-message {
  color: rgba(0, 0, 0, 0.7);
}

body.theme-light .custom-alert-scripture {
  background: rgba(197, 160, 40, 0.06);
}

body.theme-light .alert-scripture-citation {
  color: #a68018;
}

body.theme-light .alert-scripture-text {
  color: rgba(0, 0, 0, 0.75);
}

body.theme-light .custom-alert-btn {
  background: #c5a028;
  border-color: #c5a028;
  color: #ffffff;
}

body.theme-light .custom-alert-btn:hover {
  background: #008bb3;
  border-color: #008bb3;
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CREDIT BADGE & PREMIUM BADGE
   ═══════════════════════════════════════════════════════════════ */

.chat-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  font-size: 11px;
  font-weight: 600;
  color: #00d2ff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.credit-badge svg {
  flex-shrink: 0;
}
.credit-label {
  color: rgba(0, 210, 255, 0.7);
  font-weight: 400;
}
.credit-badge.low-credits {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}
.credit-badge.low-credits .credit-label {
  color: rgba(239, 68, 68, 0.65);
}
.credit-badge.no-credits {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  animation: creditPulse 2s ease-in-out infinite;
}
@keyframes creditPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.2); }
}
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2) 0%, rgba(0, 139, 179, 0.15) 100%);
  border: 1px solid rgba(0, 210, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
  color: #00d2ff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chat-plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2) 0%, rgba(0, 139, 179, 0.15) 100%);
  border: 1px solid rgba(0, 210, 255, 0.45);
  font-size: 10px;
  font-weight: 700;
  color: #00d2ff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: opacity 0.2s ease;
}

.chat-plan-pill.hidden {
  display: none;
}

.chat-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}
.chat-auth-btn:hover {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.3);
  color: #00d2ff;
}
.chat-register-btn {
  margin-left: 6px;
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.25);
  color: #00d2ff;
}
.chat-register-btn:hover {
  background: rgba(0, 210, 255, 0.2);
  border-color: rgba(0, 210, 255, 0.5);
  color: #33dfff;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH CTA BANNER
   ═══════════════════════════════════════════════════════════════ */

.auth-cta-banner {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0.08) 100%);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 12px;
  margin: 12px;
  padding: 16px 20px;
  animation: slideDown 0.3s ease-out;
}

/* Scoped overrides when inside bottom wrapper card */
.main-chat-bottom-wrapper:has(#auth-cta-banner:not(.hidden)) {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12) 0%, rgba(0, 210, 255, 0.06) 100%);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

body.theme-light .main-chat-bottom-wrapper:has(#auth-cta-banner:not(.hidden)) {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.08) 0%, rgba(0, 210, 255, 0.03) 100%);
  border-color: rgba(180, 130, 30, 0.25);
}

.main-chat-bottom-wrapper:has(#auth-cta-banner:not(.hidden)) .auth-cta-banner {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0 0 16px 0;
  border-bottom: 1px solid rgba(0, 210, 255, 0.15);
}

body.theme-light .main-chat-bottom-wrapper:has(#auth-cta-banner:not(.hidden)) .auth-cta-banner {
  border-bottom-color: rgba(180, 130, 30, 0.15);
}

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

.auth-cta-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-cta-icon {
  color: #00d2ff;
  flex-shrink: 0;
}

.auth-cta-text {
  flex: 1;
  min-width: 0;
}

.auth-cta-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  font-family: 'Inter', sans-serif;
}

.auth-cta-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', sans-serif;
}

.auth-cta-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cta-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.cta-btn-primary {
  background: linear-gradient(135deg, #00d2ff 0%, #33dfff 100%);
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.3);
}

.cta-btn-primary:hover {
  background: linear-gradient(135deg, #33dfff 0%, #f0d96f 100%);
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

.cta-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cta-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

body.theme-light .auth-cta-banner {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12) 0%, rgba(0, 210, 255, 0.06) 100%);
  border-color: rgba(180, 130, 30, 0.3);
}

body.theme-light .auth-cta-title {
  color: #1a1a1a;
}

body.theme-light .auth-cta-subtitle {
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .auth-cta-icon {
  color: #b45309;
}

body.theme-light .cta-btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.15);
}

body.theme-light .cta-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
  .auth-cta-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .auth-cta-buttons {
    flex-direction: column;
  }
  
  .cta-btn {
    width: 100%;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   USER PROFILE MODAL
   ═══════════════════════════════════════════════════════════════ */

.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 29000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-modal.visible {
  opacity: 1;
}

.profile-modal.hidden {
  display: none !important;
}

.profile-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.profile-modal-content {
  position: relative;
  background: rgba(15, 15, 18, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 90%;
  max-width: 400px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.9);
  transform: scale(0.94) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.profile-modal.visible .profile-modal-content {
  transform: scale(1) translateY(0);
}

.profile-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.profile-modal-close:hover {
  color: #ffffff;
}

.profile-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2) 0%, rgba(0, 139, 179, 0.1) 100%);
  border: 2px solid rgba(0, 210, 255, 0.35);
  color: #00d2ff;
  margin-bottom: 0.75rem;
}

.profile-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin: 0 0 0.25rem;
}

.profile-email {
  font-family: var(--font-reading);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  word-break: break-all;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.profile-info-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
}

.profile-info-label {
  display: block;
  font-family: var(--font-header);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.3rem;
}

.profile-info-value {
  display: block;
  font-family: var(--font-reading);
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-manage-btn {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0.08) 100%);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: #00d2ff;
}

.profile-manage-btn:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 210, 255, 0.15) 100%);
  border-color: rgba(0, 210, 255, 0.55);
  transform: translateY(-1px);
}

.profile-logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.profile-delete-btn {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: rgba(239, 68, 68, 0.7);
}

.profile-delete-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

.chat-profile-btn {
  margin-left: 6px;
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.2);
  color: rgba(0, 210, 255, 0.8);
}

.chat-profile-btn:hover {
  background: rgba(0, 210, 255, 0.18);
  border-color: rgba(0, 210, 255, 0.4);
  color: #00d2ff;
}

/* Light theme */
body.theme-light .profile-modal-content {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

body.theme-light .profile-modal-close {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .profile-modal-close:hover {
  color: #000000;
}

body.theme-light .profile-avatar {
  background: linear-gradient(135deg, rgba(197, 160, 40, 0.15) 0%, rgba(197, 160, 40, 0.06) 100%);
  border-color: rgba(197, 160, 40, 0.35);
  color: #a68018;
}

body.theme-light .profile-title {
  color: #000000;
}

body.theme-light .profile-email {
  color: rgba(0, 0, 0, 0.45);
}

body.theme-light .profile-info-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .profile-info-label {
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .profile-info-value {
  color: #000000;
}

body.theme-light .profile-manage-btn {
  background: linear-gradient(135deg, rgba(197, 160, 40, 0.12) 0%, rgba(197, 160, 40, 0.06) 100%);
  border-color: rgba(197, 160, 40, 0.35);
  color: #a68018;
}

body.theme-light .profile-manage-btn:hover {
  background: linear-gradient(135deg, rgba(197, 160, 40, 0.2) 0%, rgba(197, 160, 40, 0.12) 100%);
  border-color: rgba(197, 160, 40, 0.5);
}

body.theme-light .profile-logout-btn {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .profile-logout-btn:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

body.theme-light .profile-delete-btn {
  border-color: rgba(220, 38, 38, 0.18);
  color: rgba(220, 38, 38, 0.7);
}

body.theme-light .profile-delete-btn:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

body.theme-light .chat-profile-btn {
  background: rgba(197, 160, 40, 0.06);
  border-color: rgba(197, 160, 40, 0.2);
  color: #a68018;
}

body.theme-light .chat-profile-btn:hover {
  background: rgba(197, 160, 40, 0.14);
  border-color: rgba(197, 160, 40, 0.4);
  color: #8a6b12;
}

/* ═══════════════════════════════════════════════════════════════
   SUBSCRIBE BANNER
   ═══════════════════════════════════════════════════════════════ */

.subscribe-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.subscribe-banner.visible {
  transform: translateY(0);
}
.subscribe-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(18, 18, 22, 0.97) 0%, rgba(28, 24, 12, 0.97) 100%);
  border-top: 1px solid rgba(0, 210, 255, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.subscribe-banner-icon {
  font-size: 24px;
  color: #00d2ff;
  flex-shrink: 0;
}
.subscribe-banner-text {
  flex: 1;
  font-family: 'Inter', sans-serif;
}
.subscribe-banner-text strong {
  font-size: 14px;
  color: #00d2ff;
  display: block;
  margin-bottom: 2px;
}
.subscribe-banner-text p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  line-height: 1.4;
}
.subscribe-banner-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #00d2ff, #0094bc);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.subscribe-banner-btn:hover {
  background: linear-gradient(135deg, #00b0d8, #0094bc);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.3);
}
.subscribe-banner-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.subscribe-banner-dismiss:hover {
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   ACCOUNT CHIP (sidebar, new location: above footer)
   ═══════════════════════════════════════════════════════════════ */

.account-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-reading);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  position: relative;
}

.account-chip:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.35);
}

.account-chip:active {
  transform: scale(0.985);
}

.account-chip.open {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.4);
}

.account-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.22) 0%, rgba(0, 139, 179, 0.1) 100%);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #00d2ff;
  flex-shrink: 0;
}

.account-chip-body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  flex: 1;
}

.account-chip-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.account-chip-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  margin-top: 2px;
}

.account-chip-meta-sep {
  opacity: 0.5;
}

.account-chip-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
}

.account-chip-chevron {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.account-chip.open .account-chip-chevron {
  transform: rotate(180deg);
}

/* Account menu popover (appears under the chip) */
.account-menu-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(18, 18, 22, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 20;
  animation: accountMenuIn 0.18s ease-out;
}

@keyframes accountMenuIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-reading);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.account-menu-item svg {
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.account-menu-item:hover svg {
  color: #00d2ff;
}

.account-menu-item-danger {
  color: rgba(255, 120, 120, 0.9);
}

.account-menu-item-danger:hover {
  background: rgba(255, 90, 90, 0.1);
  color: #ff8585;
}

.account-menu-item-danger svg {
  color: rgba(255, 120, 120, 0.7);
}

/* Compact log-in / sign-up buttons inside the chip location */
.sidebar-account-chip .auth-logged-out {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}

.sidebar-account-chip .sidebar-auth-btn {
  flex: 1 1 0;
  padding: 6px 8px;
  font-size: 0.75rem;
}

.sidebar-account-chip .sidebar-auth-btn-signup {
  flex: 1.2 1 0;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOM AUTHENTICATION MODAL (Clerk Sign In / Sign Up)
   ═══════════════════════════════════════════════════════════════ */

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS Safari: track the visible viewport so centred modal content is not pushed under the address bar / home indicator */
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.auth-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal.hidden {
  display: none !important;
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  background: rgba(14, 14, 17, 0.97);
  background-image: radial-gradient(circle at top, rgba(0, 210, 255, 0.06) 0%, transparent 65%);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.85),
              0 0 0 1px rgba(0, 210, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 2;
}

.auth-modal.visible .auth-modal-card {
  transform: translateY(0) scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  z-index: 5;
  transition: color 0.2s, background 0.2s;
}

.auth-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.auth-modal-header {
  padding: 1.6rem 1.75rem 0.9rem;
  text-align: center;
}

.auth-modal-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.85rem;
}

.auth-modal-brand-mark {
  font-family: 'Anton', 'Impact', sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1;
}

.auth-modal-brand-sub {
  font-family: var(--font-inter);
  font-size: 0.55rem;
  font-weight: 500;
  color: rgba(0, 210, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 0.25rem;
}

.auth-modal-title {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem;
  letter-spacing: -0.005em;
  line-height: 1.4;
  padding-bottom: 0.15rem;
  overflow: visible;
}

.auth-modal-subtitle {
  font-family: var(--font-reading);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
  margin: 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.auth-tab-buttons {
  display: flex !important;
  width: auto;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.auth-tab-btn:focus,
.auth-tab-btn:focus-visible {
  outline: 2px solid var(--electric-blue);
  outline-offset: 2px;
}

.auth-tab-btn:active {
  outline: none;
}
.auth-modal-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.9rem 1.5rem 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 4px;
}

.auth-tab {
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  padding: 0.55rem 0.4rem;
  font-family: var(--font-header);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  border-radius: 7px;
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

.auth-tab.active {
  color: #000000;
}

.auth-tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: linear-gradient(135deg, #00d2ff 0%, #008bb3 100%);
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 210, 255, 0.35);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  transform: translateX(0);
}

.auth-modal-tabs[data-mode="signup"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-modal-body {
  padding: 1.1rem 1.5rem 1.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.auth-modal-body::-webkit-scrollbar {
  width: 6px;
}

.auth-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}

.auth-clerk-mount {
  min-height: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.auth-clerk-mount.clerk-ready {
  min-height: 0;
}

/* Loading skeleton shown before Clerk mounts */
.auth-clerk-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.5rem 0.25rem;
  animation: authSkelFade 1.2s ease-in-out infinite;
}

@keyframes authSkelFade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

.auth-skel-row {
  height: 14px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: authSkelShine 1.4s linear infinite;
}

@keyframes authSkelShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.auth-skel-title { width: 60%; height: 18px; margin-bottom: 0.4rem; }
.auth-skel-input { width: 100%; height: 38px; border-radius: 8px; }
.auth-skel-button { width: 100%; height: 40px; border-radius: 8px; margin-top: 0.3rem; }
.auth-skel-divider { width: 100%; height: 1px; margin: 0.6rem 0; }
.auth-skel-button-ghost { height: 38px; }

.auth-modal-fallback {
  text-align: center;
  padding: 1rem 0.5rem 0.25rem;
}

.auth-fallback-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18) 0%, rgba(0, 139, 179, 0.08) 100%);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: #00d2ff;
  margin: 0 auto 1rem;
}

.auth-fallback-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.45rem;
}

.auth-fallback-desc {
  font-family: var(--font-reading);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0 0 1.1rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.auth-fallback-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.auth-fallback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-header);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-fallback-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.auth-fallback-btn-primary {
  background: linear-gradient(135deg, #00d2ff 0%, #008bb3 100%);
  border-color: rgba(0, 210, 255, 0.6);
  color: #000000;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.25);
}

.auth-fallback-btn-primary:hover {
  background: linear-gradient(135deg, #e4bf47 0%, #c4a030 100%);
  border-color: rgba(0, 210, 255, 0.85);
  color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 210, 255, 0.35);
}

.auth-fallback-hint {
  font-family: var(--font-reading);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
  font-style: italic;
}

.auth-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.7rem 1.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-reading);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
}

.auth-modal-footer a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-modal-footer a:hover {
  color: #00d2ff;
}

.auth-modal-footer-sep {
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════
   CLERK APPEARANCE — override Clerk's defaults to match GIGAKJV
   (Clerk mounts inside #auth-modal-clerk-mount.)
   We use very high specificity (cl-* hooks) to win the cascade.
   ═══════════════════════════════════════════════════════════════ */

.cl-rootBox,
.cl-card,
.cl-modalContent,
.cl-signIn-root,
.cl-signUp-root,
.cl-signIn-start,
.cl-signUp-start,
.cl-alternativeMethods,
.cl-organizationSwitcherRoot,
.cl-userButtonRoot {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  font-family: var(--font-reading) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.cl-cardBox,
.cl-signIn-card,
.cl-signUp-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.cl-main,
.cl-form {
  gap: 0.7rem !important;
}

.cl-formButtonPrimary {
  background: linear-gradient(135deg, #00d2ff 0%, #008bb3 100%) !important;
  color: #000000 !important;
  font-weight: 700 !important;
  font-family: var(--font-header) !important;
  font-size: 0.85rem !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.2) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  transition: all 0.2s ease !important;
  height: 40px !important;
}

.cl-formButtonPrimary:hover {
  background: linear-gradient(135deg, #e4bf47 0%, #c4a030 100%) !important;
  box-shadow: 0 6px 18px rgba(0, 210, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}

.cl-formButtonPrimary:disabled {
  opacity: 0.55 !important;
  transform: none !important;
}

.cl-formFieldInput,
.cl-input,
.cl-textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-family: var(--font-reading) !important;
  font-size: 0.88rem !important;
  padding: 0.6rem 0.75rem !important;
  height: auto !important;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s !important;
}

.cl-formFieldInput:focus,
.cl-input:focus,
.cl-textarea:focus {
  border-color: rgba(0, 210, 255, 0.55) !important;
  background: rgba(0, 210, 255, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.12) !important;
  outline: none !important;
}

.cl-formFieldInput::placeholder,
.cl-input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

.cl-formFieldLabel,
.cl-formFieldLabelRow,
.cl-internal-label,
.cl-formLabelRow label {
  color: rgba(255, 255, 255, 0.75) !important;
  font-family: var(--font-header) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-bottom: 0.3rem !important;
}

.cl-formFieldAction,
.cl-formFieldAction__verification,
.cl-identityPreviewEditButton,
.cl-linkButton {
  color: #00d2ff !important;
  font-family: var(--font-reading) !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.cl-formFieldAction:hover,
.cl-linkButton:hover {
  color: #e4bf47 !important;
  text-decoration: underline !important;
}

.cl-dividerLine {
  background: rgba(255, 255, 255, 0.1) !important;
  height: 1px !important;
}

.cl-dividerText {
  color: rgba(255, 255, 255, 0.4) !important;
  font-family: var(--font-header) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  background: transparent !important;
  padding: 0 0.5rem !important;
}

.cl-socialButtons,
.cl-socialButtonsIconButton {
  gap: 0.5rem !important;
}

.cl-socialButtonsIconButton {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-family: var(--font-reading) !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  height: 40px !important;
}

.cl-socialButtonsIconButton:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(0, 210, 255, 0.4) !important;
  color: #ffffff !important;
}

.cl-socialButtonsIconButton svg,
.cl-socialButtonsIconButton img {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.cl-formHeaderTitle,
.cl-headerTitle {
  color: #ffffff !important;
  font-family: var(--font-header) !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  text-align: center !important;
  display: none !important;
}

.cl-formHeaderSubtitle,
.cl-headerSubtitle {
  color: rgba(255, 255, 255, 0.55) !important;
  font-family: var(--font-reading) !important;
  font-size: 0.82rem !important;
  text-align: center !important;
  line-height: 1.45 !important;
  display: none !important;
}

.cl-footer,
.cl-footerPages,
.cl-footerAction {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.55) !important;
  font-family: var(--font-reading) !important;
  font-size: 0.78rem !important;
}

.cl-footerActionLink,
.cl-footerAction__signIn,
.cl-footerAction__signUp {
  color: #00d2ff !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

.cl-footerActionLink:hover {
  color: #e4bf47 !important;
  text-decoration: underline !important;
}

.cl-alert,
.cl-alert__error,
.cl-formFieldErrorText,
.cl-errorMessage {
  background: rgba(255, 80, 80, 0.1) !important;
  border: 1px solid rgba(255, 80, 80, 0.3) !important;
  color: #ff9090 !important;
  border-radius: 6px !important;
  font-family: var(--font-reading) !important;
  font-size: 0.78rem !important;
  padding: 0.5rem 0.7rem !important;
}

.cl-otpCodeField,
.cl-otpCodeField input {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  font-family: var(--font-mono) !important;
}

.cl-otpCodeField input:focus {
  border-color: rgba(0, 210, 255, 0.55) !important;
}

.cl-avatarBox,
.cl-userButtonAvatarBox {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.3) 0%, rgba(0, 139, 179, 0.15) 100%) !important;
  border: 1px solid rgba(0, 210, 255, 0.4) !important;
  color: #00d2ff !important;
}

.cl-internal-icon,
.cl-formFieldInputShowPasswordButton,
.cl-formFieldInputHidePasswordButton {
  color: rgba(255, 255, 255, 0.5) !important;
}

.cl-internal-icon:hover,
.cl-formFieldInputShowPasswordButton:hover,
.cl-formFieldInputHidePasswordButton:hover {
  color: #00d2ff !important;
}

.cl-profileSection__content,
.cl-navbar,
.cl-userButtonPopoverMain,
.cl-userButtonPopoverActions {
  background: rgba(20, 20, 24, 0.98) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .auth-modal-card {
    max-width: 100%;
  }
  .auth-modal-header,
  .auth-modal-body {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
  .auth-modal-tabs {
    margin-left: 1.1rem;
    margin-right: 1.1rem;
  }
  .account-chip-name { max-width: 140px; }
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

body.theme-light .chat-auth-btn {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.6);
}
body.theme-light .chat-auth-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(180, 148, 45, 0.3);
  color: #9a7d1e;
}
body.theme-light .chat-register-btn {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(180, 148, 45, 0.25);
  color: #9a7d1e;
}
body.theme-light .chat-register-btn:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: rgba(180, 148, 45, 0.45);
  color: #b8982a;
}
body.theme-light .subscribe-banner-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 248, 230, 0.97) 100%);
  border-top-color: rgba(0, 210, 255, 0.3);
}
body.theme-light .subscribe-banner-text strong {
  color: #9a7d1e;
}
body.theme-light .subscribe-banner-text p {
  color: rgba(0, 0, 0, 0.5);
}

/* Auth modal + account chip — light theme */
body.theme-light .account-chip {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}
body.theme-light .account-chip:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(180, 148, 45, 0.3);
}
body.theme-light .account-chip.open {
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(180, 148, 45, 0.4);
}
body.theme-light .account-chip-name { color: rgba(0, 0, 0, 0.9); }
body.theme-light .account-chip-meta { color: rgba(0, 0, 0, 0.5); }
body.theme-light .account-chip-chevron { color: rgba(0, 0, 0, 0.45); }
body.theme-light .account-chip-avatar {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 139, 179, 0.1) 100%);
  border-color: rgba(180, 148, 45, 0.4);
  color: #9a7d1e;
}
body.theme-light .account-menu-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
body.theme-light .account-menu-item {
  color: rgba(0, 0, 0, 0.8);
}
body.theme-light .account-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #000000;
}
body.theme-light .account-menu-item svg { color: rgba(0, 0, 0, 0.5); }
body.theme-light .account-menu-item:hover svg { color: #9a7d1e; }
body.theme-light .account-menu-item-danger { color: rgba(180, 40, 40, 0.85); }
body.theme-light .account-menu-item-danger:hover { background: rgba(180, 40, 40, 0.08); color: #b82828; }
body.theme-light .account-menu-item-danger svg { color: rgba(180, 40, 40, 0.7); }

body.theme-light .sidebar-auth-widget {
  border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .auth-modal-card {
  background: rgba(252, 252, 250, 0.98);
  background-image: radial-gradient(circle at top, rgba(0, 210, 255, 0.08) 0%, transparent 65%);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.35);
}
body.theme-light .auth-modal-overlay {
  background: rgba(255, 255, 255, 0.6);
}
body.theme-light .auth-modal-brand-mark { color: #000000; }
body.theme-light .auth-modal-brand-sub { color: #9a7d1e; }
body.theme-light .auth-modal-title { color: #000000; }
body.theme-light .auth-modal-subtitle { color: rgba(0, 0, 0, 0.55); }
body.theme-light .auth-modal-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}
body.theme-light .auth-tab { color: rgba(0, 0, 0, 0.5); }
body.theme-light .auth-tab.active { color: #000000; }
body.theme-light .auth-modal-footer {
  color: rgba(0, 0, 0, 0.4);
  border-top-color: rgba(0, 0, 0, 0.05);
}
body.theme-light .auth-modal-footer a { color: rgba(0, 0, 0, 0.6); }
body.theme-light .auth-modal-footer a:hover { color: #9a7d1e; }
body.theme-light .auth-modal-close { color: rgba(0, 0, 0, 0.4); }
body.theme-light .auth-modal-close:hover { color: #000000; background: rgba(0, 0, 0, 0.05); }
body.theme-light .auth-fallback-title { color: #000000; }
body.theme-light .auth-fallback-desc { color: rgba(0, 0, 0, 0.6); }
body.theme-light .auth-fallback-hint { color: rgba(0, 0, 0, 0.4); }
body.theme-light .auth-fallback-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.9);
}
body.theme-light .auth-fallback-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.2);
  color: #000000;
}
body.theme-light .auth-skel-row {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.04) 100%);
  background-size: 200% 100%;
}
body.theme-light .auth-modal-body { scrollbar-color: rgba(0, 0, 0, 0.2) transparent; }
body.theme-light .auth-modal-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .subscribe-banner-content {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }
  .subscribe-banner-btn {
    width: 100%;
    text-align: center;
  }
}
/* ═══════════════════════════════════════════════════════════════
   PROFILE MODAL — Stay signed in, Active sessions, Install PWA
   ═══════════════════════════════════════════════════════════════ */

.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 4px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-reading);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
}

.profile-toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.profile-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}

.profile-toggle-row input[type="checkbox"]:checked ~ .profile-toggle-switch {
  background: linear-gradient(135deg, #00d2ff, #008bb3);
}

.profile-toggle-row input[type="checkbox"]:checked ~ .profile-toggle-switch::after {
  transform: translateX(16px);
}

.profile-toggle-row input[type="checkbox"]:focus-visible ~ .profile-toggle-switch {
  outline: 2px solid rgba(0, 210, 255, 0.55);
  outline-offset: 2px;
}

.profile-hint {
  font-family: var(--font-reading);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 4px 4px 8px;
  line-height: 1.45;
}

.profile-signout-everywhere-btn {
  background: rgba(255, 80, 80, 0.08);
  border-color: rgba(255, 80, 80, 0.25);
  color: rgba(255, 130, 130, 0.95);
}

.profile-signout-everywhere-btn:hover {
  background: rgba(255, 80, 80, 0.16);
  border-color: rgba(255, 80, 80, 0.4);
  color: #ff8080;
}

.profile-install-btn {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18) 0%, rgba(0, 139, 179, 0.1) 100%);
  border-color: rgba(0, 210, 255, 0.35);
  color: #00d2ff;
}

.profile-install-btn:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.28) 0%, rgba(0, 139, 179, 0.18) 100%);
  border-color: rgba(0, 210, 255, 0.55);
  color: #e4bf47;
}

body.theme-light .profile-toggle-row {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}

body.theme-light .profile-toggle-switch {
  background: rgba(0, 0, 0, 0.15);
}

body.theme-light .profile-hint {
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .profile-signout-everywhere-btn {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.2);
  color: rgba(180, 30, 30, 0.9);
}

body.theme-light .profile-signout-everywhere-btn:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #b82828;
}

body.theme-light .profile-install-btn {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.14) 0%, rgba(0, 139, 179, 0.08) 100%);
  border-color: rgba(180, 148, 45, 0.3);
  color: #9a7d1e;
}

/* ═══════════════════════════════════════════════════════════════
   AUTH MODAL — custom email + OTP screens (no Clerk UI)
   ═══════════════════════════════════════════════════════════════ */

.auth-screen {
  padding: 1.1rem 1.5rem 1.25rem;
  flex: 1;
  min-height: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field-label {
  font-family: var(--font-header);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-reading);
  font-size: 0.95rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.auth-field input:focus {
  border-color: rgba(0, 210, 255, 0.55);
  background: rgba(0, 210, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.12);
}

.auth-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  font-family: var(--font-reading);
  font-size: 0.82rem;
  color: #ff9090;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  line-height: 1.4;
}

.auth-primary-btn {
  position: relative;
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  color: #000000;
  background: linear-gradient(135deg, #00d2ff 0%, #008bb3 100%);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.2);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.auth-primary-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e4bf47 0%, #c4a030 100%);
  box-shadow: 0 6px 18px rgba(0, 210, 255, 0.3);
}

.auth-primary-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-primary-btn.is-busy .auth-primary-btn-label {
  opacity: 0.6;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(0, 0, 0, 0.85);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.auth-divider {
  position: relative;
  text-align: center;
  margin: 0.35rem 0 0.1rem;
  font-family: var(--font-header);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span { padding: 0 0.5rem; }

.auth-oauth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 0.6rem;
  font-family: var(--font-header);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-oauth-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.4);
  color: #ffffff;
}

.auth-oauth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-oauth-btn svg { flex-shrink: 0; }

.auth-otp-subtitle {
  font-family: var(--font-reading);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

.auth-otp-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-family: var(--font-reading);
  font-size: 0.82rem;
}

.auth-link-btn {
  background: none;
  border: 0;
  color: #00d2ff;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.auth-link-btn:hover:not(:disabled) {
  color: #e4bf47;
  background: rgba(0, 210, 255, 0.08);
  text-decoration: underline;
}

.auth-link-btn:disabled {
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
  text-decoration: none;
}

.auth-link-sep {
  color: rgba(255, 255, 255, 0.2);
}

.auth-fatal {
  margin: 1.1rem 1.5rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 8px;
  color: rgba(255, 200, 200, 0.95);
  font-family: var(--font-reading);
  font-size: 0.85rem;
  line-height: 1.4;
}

.auth-fatal-icon {
  flex-shrink: 0;
  color: #ff8080;
  margin-top: 1px;
}

.auth-fatal p { margin: 0; }

.auth-modal-footnote {
  margin: 0;
  padding: 0.85rem 1.5rem 1.1rem;
  font-family: var(--font-reading);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  font-style: italic;
}

@media (max-width: 480px) {
  .auth-oauth-row { grid-template-columns: 1fr; }
  .auth-screen { padding-left: 1.1rem; padding-right: 1.1rem; }
  .auth-fatal { margin-left: 1.1rem; margin-right: 1.1rem; }
  .auth-modal-footnote { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   HIDE STRAY CLERK UI (safety net for any rendered Clerk elements)
   ═══════════════════════════════════════════════════════════════ */
.clerk-badge,
.clerk-branding,
.cl-footer,
.cl-footerPages,
.cl-footerAction,
.cl-developmentModeBadge,
[class*="cl-internal-dev"],
.cl-internal-1k4xplo,
.cl-internal-15sslsc,
.cl-internal-yiqgn8,
.cl-internal-15sslsc,
#clerk-captcha,
.clerk-loading {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
}

body.theme-light .auth-field-label { color: rgba(0, 0, 0, 0.6); }
body.theme-light .auth-field input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
}
body.theme-light .auth-field input:focus {
  border-color: rgba(0, 210, 255, 0.7);
  background: #fffef9;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.18);
}
body.theme-light .auth-field input::placeholder { color: rgba(0, 0, 0, 0.3); }
body.theme-light .auth-error {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
  color: #b82828;
}
body.theme-light .auth-oauth-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.85);
}
body.theme-light .auth-oauth-btn:hover:not(:disabled) {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(180, 148, 45, 0.4);
  color: #000;
}
body.theme-light .auth-divider { color: rgba(0, 0, 0, 0.4); }
body.theme-light .auth-divider::before,
body.theme-light .auth-divider::after { background: rgba(0, 0, 0, 0.1); }
body.theme-light .auth-otp-subtitle { color: rgba(0, 0, 0, 0.6); }
body.theme-light .auth-link-btn:disabled { color: rgba(0, 0, 0, 0.3); }
body.theme-light .auth-link-sep { color: rgba(0, 0, 0, 0.2); }
body.theme-light .auth-fatal {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.25);
  color: #b82828;
}
body.theme-light .auth-modal-footnote { color: rgba(0, 0, 0, 0.45); }

/* ── Custom Auth Admin and Badge Styles ── */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 139, 179, 0.2) 100%);
  border: 1px solid rgba(0, 210, 255, 0.85);
  font-size: 11px;
  font-weight: 800;
  color: #00d2ff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
  animation: adminPulse 3s ease-in-out infinite;
}
@keyframes adminPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(0, 210, 255, 0.2); }
  50% { box-shadow: 0 0 12px rgba(0, 210, 255, 0.5); }
}

.ai-message-user.is-admin::before {
  content: '👑 ADMIN';
  color: #00d2ff !important;
  text-shadow: 0 0 4px rgba(0, 210, 255, 0.3);
}

body.theme-light .ai-message-user.is-admin::before {
  color: #a68018 !important;
}

/* ============================================================
   Telegram-Style Message Pinning & Pin History
   ============================================================ */

/* Pinned Message Banner */
.community-pinned-banner {
  background: rgba(0, 210, 255, 0.06);
  border-bottom: 1px solid rgba(0, 210, 255, 0.15);
  border-left: 3px solid #00d2ff;
  padding: 8px 16px;
  z-index: 9;
  position: relative;
  transition: all 0.25s ease;
}

.pinned-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pinned-icon {
  font-size: 1.1rem;
  color: #00d2ff;
  user-select: none;
  animation: bounce 2s infinite;
}

.pinned-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
}

.pinned-author {
  font-family: var(--font-mono), monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #00d2ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pinned-text {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinned-action-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pinned-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.pinned-action-btn svg {
  display: block;
}

/* Light Theme overrides for pinned banner */
body.theme-light .community-pinned-banner {
  background: rgba(166, 128, 24, 0.05);
  border-bottom-color: rgba(166, 128, 24, 0.15);
  border-left-color: #a68018;
}
body.theme-light .pinned-author {
  color: #a68018;
}
body.theme-light .pinned-text {
  color: #1a1a1a;
}
body.theme-light .pinned-action-btn {
  color: rgba(0, 0, 0, 0.5);
}
body.theme-light .pinned-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000000;
}

/* Highlight flash animation */
@keyframes highlight-pulse {
  0% { background-color: rgba(0, 210, 255, 0.25); }
  100% { background-color: transparent; }
}

.community-msg-row.highlight-flash {
  animation: highlight-pulse 2s ease-out;
  border-left: 2px solid #00d2ff !important;
}

/* Pin indicator in message header */
.msg-pin-indicator {
  font-size: 0.65rem;
  color: #00d2ff;
  margin-left: 6px;
  background: rgba(0, 210, 255, 0.1);
  padding: 1px 4px;
  border-radius: 2px;
  border: 1px solid rgba(0, 210, 255, 0.2);
  vertical-align: middle;
  font-family: var(--font-mono), monospace;
  font-weight: 700;
}

body.theme-light .msg-pin-indicator {
  color: #a68018;
  background: rgba(166, 128, 24, 0.08);
  border-color: rgba(166, 128, 24, 0.2);
}

/* Pin History Modal */
.community-pin-history-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-history-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.pin-history-card {
  position: relative;
  width: 90%;
  max-width: 480px;
  background: #141416;
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  max-height: 80%;
  z-index: 101;
  animation: modal-zoom-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-history-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pin-history-header h4 {
  font-family: var(--font-header), sans-serif;
  color: #00d2ff;
  font-size: 0.95rem;
  margin: 0;
  letter-spacing: 0.5px;
}

.pin-history-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.pin-history-close-btn:hover {
  color: #ffffff;
}

.pin-history-list {
  padding: 12px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 350px;
  scrollbar-width: thin;
}

.pin-history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-history-item:hover {
  background: rgba(0, 210, 255, 0.04);
  border-color: rgba(0, 210, 255, 0.15);
}

.pin-history-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pin-history-item-author {
  font-family: var(--font-mono), monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #00d2ff;
}

.pin-history-item-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

.pin-history-item-body {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  word-break: break-word;
}

.pin-history-item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.pin-history-unpin-btn {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.2);
  color: #ff5252;
  font-size: 0.65rem;
  font-family: var(--font-mono), monospace;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.pin-history-unpin-btn:hover {
  background: #ff5252;
  color: #ffffff;
  border-color: #ff5252;
}

.pin-history-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  padding: 24px 0;
  font-family: var(--font-mono), monospace;
}

/* Pin history modal light theme overrides */
body.theme-light .pin-history-card {
  background: #ffffff;
  border-color: rgba(166, 128, 24, 0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
body.theme-light .pin-history-header {
  border-bottom-color: rgba(0,0,0,0.06);
}
body.theme-light .pin-history-header h4 {
  color: #a68018;
}
body.theme-light .pin-history-close-btn {
  color: rgba(0, 0, 0, 0.4);
}
body.theme-light .pin-history-close-btn:hover {
  color: #000000;
}
body.theme-light .pin-history-item {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}
body.theme-light .pin-history-item:hover {
  background: rgba(166, 128, 24, 0.03);
  border-color: rgba(166, 128, 24, 0.12);
}
body.theme-light .pin-history-item-author {
  color: #a68018;
}
body.theme-light .pin-history-item-time {
  color: rgba(0, 0, 0, 0.4);
}
body.theme-light .pin-history-item-body {
  color: #1a1a1a;
}
body.theme-light .pin-history-empty {
  color: rgba(0, 0, 0, 0.4);
}

/* Mobile chat & auth layouts optimizations (max-width: 600px) */
@media (max-width: 600px) {
  .auth-cta-content {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
    padding: 8px 4px !important;
  }
  
  .auth-cta-buttons {
    width: 100% !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  
  .auth-cta-buttons .cta-btn {
    flex: 1 !important;
    text-align: center !important;
    font-size: 12px !important;
    padding: 8px 10px !important;
  }

  .main-chat-footer-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .chat-account-row {
    width: 100% !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  .main-chat-footer-btn {
    flex: 1 !important;
    width: auto !important;
    margin: 0 !important;
    font-size: 10px !important;
    padding: 6px !important;
  }

  .main-chat-disclaimer {
    display: none !important;
  }
}

/* ==========================================================================
   Terminal-Style Community Global Chat Innovations & Optimizations
   ========================================================================== */

/* Layout & Columns */
.community-chat-layout {
  display: flex;
  flex: 1;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  border-top: 1px solid rgba(74, 246, 38, 0.15); /* neon green line separator */
}

.community-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Reddit-Style Voting Layout on Message Rows */
.community-msg-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.community-msg-row:hover {
  background: rgba(74, 246, 38, 0.03) !important; /* neon green highlight */
}

.msg-vote-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 38px;
  user-select: none;
}

.vote-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 6px;
  transition: transform 0.1s ease, color 0.15s ease;
  line-height: 1;
}

.vote-btn:hover {
  transform: scale(1.2);
}

.vote-btn.upvote-btn:hover,
.vote-btn.upvote-btn.active {
  color: #ff5f1f !important; /* vibrant neon orange-red */
  text-shadow: 0 0 8px rgba(255, 95, 31, 0.6);
}

.vote-btn.downvote-btn:hover,
.vote-btn.downvote-btn.active {
  color: #00f0ff !important; /* vibrant neon cyan */
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.msg-score {
  font-family: var(--font-mono), monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.upvote-btn.active ~ .msg-score {
  color: #ff5f1f !important;
}

.downvote-btn.active ~ .msg-score {
  color: #00f0ff !important;
}

.msg-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* User Roles styling */
.community-msg-xp {
  font-size: 0.68rem;
  color: rgba(74, 246, 38, 0.5); /* translucent green neon */
  margin-left: 4px;
}

.msg-role-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.role-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0px 3px;
  border-radius: 2px;
  margin-right: 4px;
  text-transform: uppercase;
}

.admin-badge {
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.45);
  color: #ff5252;
}

.premium-badge {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: #00f0ff;
}

.admin-user {
  color: #ff5252 !important;
  font-weight: 900 !important;
  text-shadow: 0 0 6px rgba(255, 82, 82, 0.5);
  animation: text-flicker 4s infinite;
}

.premium-user {
  color: #00f0ff !important;
  font-weight: 800 !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

@keyframes text-flicker {
  0%, 100% { opacity: 1; }
  23% { opacity: 1; }
  24% { opacity: 0.85; }
  26% { opacity: 1; }
  78% { opacity: 1; }
  79% { opacity: 0.9; }
  80% { opacity: 1; }
}

/* Online Sidebar Layout */
.community-online-sidebar {
  width: 260px;
  height: 100%;
  background: rgba(10, 10, 12, 0.98);
  border-left: 1px solid rgba(74, 246, 38, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.online-sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(74, 246, 38, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.online-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

#community-desktop-online-count {
  font-family: var(--font-header);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #4af626;
  text-shadow: 0 0 6px rgba(74, 246, 38, 0.4);
}

.community-close-online-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.25rem;
  cursor: pointer;
  display: none; /* hidden on desktop */
  line-height: 1;
}

.community-close-online-btn:hover {
  color: #ffffff;
}

/* Online Status Telemetry Pulse */
.online-dot-flashing {
  width: 7px;
  height: 7px;
  background-color: #4af626;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #4af626;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(74, 246, 38, 0.7); }
  70% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 6px rgba(74, 246, 38, 0); }
  100% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 0 0 rgba(74, 246, 38, 0); }
}

.online-users-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Custom terminal scrollbars */
.online-users-list::-webkit-scrollbar,
.community-chat-window::-webkit-scrollbar {
  width: 5px;
}

.online-users-list::-webkit-scrollbar-track,
.community-chat-window::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.online-users-list::-webkit-scrollbar-thumb,
.community-chat-window::-webkit-scrollbar-thumb {
  background: rgba(74, 246, 38, 0.25);
  border-radius: 2px;
}

.online-users-list::-webkit-scrollbar-thumb:hover,
.community-chat-window::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 246, 38, 0.5);
}

.online-user-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  gap: 8px;
  transition: background 0.15s ease;
  user-select: none;
}

.online-user-item:hover {
  background: rgba(74, 246, 38, 0.06);
}

.online-user-status-dot {
  width: 5px;
  height: 5px;
  background-color: #4af626;
  border-radius: 50%;
  box-shadow: 0 0 4px #4af626;
}

.online-user-name {
  font-family: var(--font-mono), monospace;
  font-size: 0.78rem;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-xp {
  font-family: var(--font-mono), monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

.online-user-item:hover .online-user-xp {
  color: rgba(74, 246, 38, 0.6);
}

.online-user-empty {
  font-family: var(--font-mono), monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  padding: 20px 0;
}

/* Mobile header styling */
.community-mobile-header {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(10, 10, 12, 0.95);
  border-bottom: 1px solid rgba(74, 246, 38, 0.15);
}

.mobile-online-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

#community-mobile-online-count {
  font-family: var(--font-mono), monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4af626;
  text-shadow: 0 0 5px rgba(74, 246, 38, 0.3);
}

.community-toggle-online-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.community-toggle-online-btn:hover {
  color: #4af626;
  background: rgba(74, 246, 38, 0.08);
}

/* Mobile & Tablet Responsiveness overrides */
@media (max-width: 768px) {
  .community-mobile-header {
    display: flex; /* show header */
  }
  
  .community-close-online-btn {
    display: block; /* show close button inside drawer */
  }
  
  .community-online-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    width: 220px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  
  .community-online-sidebar.active {
    transform: translateX(0);
  }
}

/* ==========================================================================
   Sidebar Navigation & Panels Overhaul
   ========================================================================== */

/* Show and style viewport tabs as a sticky glassmorphic navigation dock on desktop/PC */
@media (min-width: 1025px) {
  .main-viewport-tabs {
    display: flex !important;
    position: sticky !important;
    top: 1rem !important;
    z-index: 1000 !important;
    background: rgba(10, 10, 12, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 9999px !important;
    padding: 0.35rem 0.5rem !important;
    margin-bottom: 2.25rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    justify-content: center !important;
    align-items: center !important;
    align-self: center !important;
    max-width: fit-content !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .viewport-tab {
    padding: 0.5rem 1.15rem !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .viewport-tab:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.03) !important;
  }

  .viewport-tab.active {
    color: var(--electric-blue) !important;
    background: rgba(0, 210, 255, 0.08) !important;
    border-color: rgba(0, 210, 255, 0.25) !important;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.15) !important;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.3) !important;
  }
}

/* Sidebar Navigation Tabs Grid/Stack */
@media (max-width: 1024px) {
  .sidebar-nav-tabs {
    display: none !important;
  }
}

.sidebar-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.sidebar-nav-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-header), sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav-tab svg {
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.sidebar-nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav-tab:hover svg {
  opacity: 1;
}

.sidebar-nav-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sidebar-nav-tab.active svg {
  opacity: 1;
}

/* Dynamic Sidebar Panels */
.sidebar-panel-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-panel-content.hidden {
  display: none !important;
}

/* AI Sidebar Panel Styles */
.ai-nav-section {
  padding: 0 1rem 0.5rem;
}

.ai-new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: 8px;
  font-family: var(--font-header), sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.ai-new-chat-btn:hover {
  background: #e5e5e5;
  border-color: #e5e5e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.1);
}

.ai-new-chat-btn:active {
  transform: translateY(0);
}

.ai-search-section {
  padding: 0 1rem 1rem;
}

.ai-search-section .search-box {
  position: relative;
  width: 100%;
}

#ai-chat-search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ffffff;
  font-family: var(--font-reading), sans-serif;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

#ai-chat-search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  outline: none;
}

/* Recent Chats List */
.recent-chats-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-top: 0.5rem;
}

.recent-chats-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  overflow-y: auto;
  flex: 1;
}

.recent-chat-empty {
  font-family: var(--font-reading), sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 2rem 0;
}

.recent-chat-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
}

.recent-chat-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.recent-chat-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-left: 2px solid #ffffff;
  border-radius: 0 8px 8px 0;
}

.recent-chat-icon {
  opacity: 0.5;
  flex-shrink: 0;
}

.recent-chat-item:hover .recent-chat-icon,
.recent-chat-item.active .recent-chat-icon {
  opacity: 0.9;
}

.recent-chat-title {
  font-family: var(--font-reading), sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 1.5rem; /* make space for delete button */
}

.recent-chat-delete-btn {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.1rem;
  font-weight: 400;
  cursor: pointer;
  opacity: 0;
  padding: 0.25rem;
  line-height: 1;
  transition: all 0.15s ease;
  border-radius: 4px;
}

.recent-chat-item:hover .recent-chat-delete-btn {
  opacity: 1;
}

.recent-chat-delete-btn:hover {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.1);
}

/* Devotional Panel Styles */
.devotional-sidebar-nav {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.devotional-sidebar-btn {
  flex: 1;
  padding: 0.55rem 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  font-family: var(--font-header), sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.devotional-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.devotional-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  overflow-y: auto;
  max-height: 350px;
}

.devotional-history-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.devotional-history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.devotional-history-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.devotional-history-title {
  font-family: var(--font-reading), sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devotional-history-date {
  font-family: var(--font-mono), monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.2rem;
}

/* Online Believers Sidebar Panel */
.online-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  max-height: 400px;
  padding: 0.5rem 0;
}

.online-user-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.15s ease;
  user-select: none;
}

.online-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.online-user-name {
  font-family: var(--font-reading), sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff !important; /* Force monochrome */
}

.online-user-xp {
  font-family: var(--font-mono), monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

.role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

.role-badge.admin-badge {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
}

.role-badge.premium-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Discord-like Monochrome Global Chat Layout
   ========================================================================== */

.community-msg-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.22rem 1rem;
  margin: 0.05rem 0;
  border-radius: 4px;
  background: transparent;
  border: none;
  transition: all 0.15s ease;
  position: relative;
  align-items: flex-start;
}

.community-msg-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.community-msg-row.self {
  background: transparent;
  border: none;
}

.community-msg-row.system-msg {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono), monospace;
  font-size: 0.8rem;
  padding: 0.35rem 1rem;
}

/* Avatar Column */
.chat-msg-avatar-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1a1c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-header), sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* Inline Vote Controls */
.chat-msg-header-votes {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.02rem 0.25rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-left: 0.25rem;
}

.chat-msg-header-votes .chat-vote-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 0.15rem;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.chat-msg-header-votes .chat-vote-btn:hover {
  color: #ffffff;
  transform: scale(1.2);
}

.chat-msg-header-votes .chat-vote-btn.active {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.chat-msg-header-votes .chat-msg-score {
  font-family: var(--font-mono), monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  min-width: 16px;
  text-align: center;
}

/* Content Area */
.chat-msg-content-area {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  padding-right: 6.5rem;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-header), sans-serif;
}

.community-msg-author {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff !important; /* Force monochrome */
}

.msg-role-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  user-select: none;
}

.msg-role-badge.admin-badge {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
}

.msg-role-badge.premium-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-msg-xp {
  font-family: var(--font-mono), monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
}

.chat-msg-time {
  font-family: var(--font-mono), monospace;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
}

.msg-pin-indicator {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.chat-msg-body {
  font-family: var(--font-reading), sans-serif;
  font-size: 0.85rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
  word-break: break-word;
  white-space: pre-wrap;
  margin-top: 0.1rem;
}

.chat-msg-body.censored-body {
  filter: blur(4px);
  user-select: none;
  opacity: 0.5;
  transition: filter 0.2s ease;
}

.chat-msg-body.censored-body:hover {
  filter: none;
}

.chat-mention {
  font-family: var(--font-mono), monospace;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.02rem 0.2rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Styling for current user's own messages (aligned right, green tint) */
.community-msg-row.self {
  flex-direction: row-reverse !important;
  text-align: right;
  align-self: flex-end !important;
}

.community-msg-row.self:hover {
  background: rgba(74, 222, 128, 0.04);
}

.community-msg-row.self .chat-msg-avatar-col {
  margin-left: 0;
}

.community-msg-row.self .chat-msg-content-area {
  align-items: flex-end;
  padding-right: 0;
  padding-left: 6.5rem;
}

.community-msg-row.self .chat-msg-header {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.community-msg-row.self .community-msg-author {
  color: #4ade80 !important; /* Premium emerald green */
}

.community-msg-row.self .chat-msg-body {
  color: #4ade80; /* Premium emerald green */
  text-align: right;
}

.community-msg-row.self .chat-msg-footer-actions {
  right: auto;
  left: 0.75rem;
  flex-direction: row-reverse;
}

/* Action Buttons Overlay Toolbar on Hover */
.chat-msg-footer-actions {
  display: flex;
  gap: 0.25rem;
  position: absolute;
  top: 0.25rem;
  right: 0.75rem;
  background: #0d0d0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 0.15rem 0.25rem;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.15s ease;
  z-index: 10;
}

.community-msg-row:hover .chat-msg-footer-actions {
  opacity: 1;
}

.chat-msg-footer-actions button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  font-family: var(--font-header), sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
}

.chat-msg-footer-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ==========================================================================
   Mobile Header and Responsive Overrides
   ========================================================================== */

.mobile-header-view-title {
  display: none;
  font-family: var(--font-header), sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-align: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .mobile-header-view-title {
    display: block;
  }
  
  .mobile-logo-box {
    display: none !important; /* Hide brand title on mobile header to make room */
  }

  .community-desktop-header {
    display: none !important;
  }

  .community-msg-row {
    margin: 0.05rem 0.25rem;
    padding: 0.22rem 0.5rem;
  }
  .chat-msg-content-area {
    padding-right: 0 !important;
  }
  .community-msg-row.self .chat-msg-content-area {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }
  .chat-msg-footer-actions {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
    margin-top: 0.35rem !important;
    margin-bottom: 0.1rem !important;
    opacity: 0.75 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .community-msg-row.self .chat-msg-footer-actions {
    right: auto !important;
    left: auto !important;
    align-items: flex-end !important;
  }
  .chat-msg-footer-actions button {
    padding: 0.1rem 0.25rem;
  }
  .community-msg-row:hover .chat-msg-footer-actions {
    opacity: 1 !important;
  }

  /* Fixed Bottom Navigation Bar on Mobile */
  .main-viewport-tabs {
    display: flex !important; /* override desktop hidden rule */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    background: rgba(10, 10, 12, 0.93) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
    padding: 4px 1rem calc(4px + env(safe-area-inset-bottom, 0px)) 1rem !important;
    margin: 0 !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4) !important;
  }

  .viewport-tab {
    flex-direction: column !important;
    font-size: 8px !important;
    padding: 0.2rem 0.4rem !important;
    gap: 3px !important;
    flex: 1 !important;
    height: 100% !important;
    justify-content: center !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.45) !important;
    transition: color 0.2s ease, transform 0.15s ease !important;
  }

  .viewport-tab svg {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    color: inherit !important;
  }

  .viewport-tab span {
    display: block !important;
    font-family: var(--font-header) !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    color: inherit !important;
    text-transform: uppercase !important;
  }

  .viewport-tab.active {
    color: var(--electric-blue) !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.45) !important;
  }
  
  /* Prevent community emoji bar overflow */
  .community-emoji-bar {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    padding: 6px 0.5rem !important;
    gap: 4px !important;
  }

  .community-emoji-bar .emoji-btn {
    padding: 6px 4px !important;
    font-size: 1rem !important;
    min-width: 32px !important;
    min-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* keyboard open optimizations */
  body.keyboard-open .main-viewport-tabs {
    display: none !important;
  }
  body.keyboard-open .char-counter {
    display: none !important;
  }
  body.keyboard-open .content-viewport {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    height: calc(100vh - 60px - env(safe-area-inset-top, 0px)) !important;
    height: calc(100dvh - 60px - env(safe-area-inset-top, 0px)) !important;
  }
  body.keyboard-open .community-emoji-bar {
    display: none !important;
  }
}

/* Floating Scroll to Top Helper */
.scroll-to-top-btn {
  position: fixed;
  bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--electric-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-to-top-btn:hover {
  background: var(--electric-blue);
  color: #000000;
  border-color: var(--electric-blue);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.scroll-to-top-btn:active {
  transform: scale(0.95);
}

.scroll-to-top-btn svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   UI/UX Responsiveness & Scrolling Improvements
   ========================================================================== */

/* 1. Mobile background scroll lock when sidebar is active */
body.sidebar-open,
body.sidebar-open .app-container,
body.sidebar-open .content-viewport {
  overflow: hidden !important;
  overflow-y: hidden !important;
  touch-action: none !important;
}

/* 2. Flex height containment to prevent double scrollbar conflicts in Chat view */
.main-chat-window,
.community-chat-layout,
.community-chat-main,
.community-chat-window {
  min-height: 0 !important;
}

/* 3. Modal height constraints and scrollability on short screen viewports */
.auth-modal-card,
.profile-modal-content,
.feedback-content,
.custom-alert-content {
  max-height: 90vh !important;
  max-height: 90dvh !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

/* AI Chat Highlight Styling */
.ai-message {
  position: relative !important;
  cursor: pointer;
  transition: background 0.25s ease, border-left-color 0.25s ease;
}

.ai-message:hover:not(.ai-highlighted) {
  background: rgba(255, 255, 255, 0.03);
}

#layout-wrapper.theme-light .ai-message:hover:not(.ai-highlighted) {
  background: rgba(0, 0, 0, 0.03);
}

.ai-message.ai-highlighted.hl-blue {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.12) 0%, rgba(0, 210, 255, 0.03) 100%) !important;
  border-left: 3px solid #00d2ff !important;
}

.ai-message.ai-highlighted.hl-green {
  background: linear-gradient(90deg, rgba(46, 204, 113, 0.12) 0%, rgba(46, 204, 113, 0.03) 100%) !important;
  border-left: 3px solid #2ecc71 !important;
}

.ai-message.ai-highlighted.hl-purple {
  background: linear-gradient(90deg, rgba(155, 89, 182, 0.14) 0%, rgba(155, 89, 182, 0.03) 100%) !important;
  border-left: 3px solid #a855f7 !important;
}

#layout-wrapper.theme-light .ai-message.ai-highlighted.hl-blue {
  background: linear-gradient(90deg, rgba(0, 119, 182, 0.16) 0%, rgba(0, 119, 182, 0.04) 100%) !important;
  border-left: 3px solid #0077b6 !important;
}

#layout-wrapper.theme-light .ai-message.ai-highlighted.hl-green {
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.16) 0%, rgba(39, 174, 96, 0.04) 100%) !important;
  border-left: 3px solid #27ae60 !important;
}

#layout-wrapper.theme-light .ai-message.ai-highlighted.hl-purple {
  background: linear-gradient(90deg, rgba(142, 68, 173, 0.16) 0%, rgba(142, 68, 173, 0.04) 100%) !important;
  border-left: 3px solid #8e44ad !important;
}

/* AI Action Menu Gold Brand Header */
.ai-action-menu .vam-ref {
  color: #00d2ff !important;
}

/* ==========================================================================
   NATIVE APP — READER-APP COMPLIANCE (App Store 3.1.1 / Google Play Payments)
   When the page runs inside the Capacitor shell, config.js adds `native-app`
   to <html>. We hide EVERY purchase/upsell/external-checkout surface so the
   app qualifies as a free "reader". Paid users still log in and get premium
   synced from their web purchase.
   ========================================================================== */
html.native-app #subscribe-banner,
html.native-app .about-premium-banner,
html.native-app #about-upgrade-cta,
html.native-app #profile-manage-sub-btn,
html.native-app .subscribe-banner,
html.native-app .subscribe-banner-btn,
html.native-app #sidebar-install-section,
html.native-app #sidebar-install-btn,
html.native-app .sidebar-install-btn,
html.native-app #pwa-install-btn,
html.native-app .pwa-install-btn {
  display: none !important;
}

/* ==========================================================================
   MOBILE / iOS / ANDROID READINESS
   Placed last so these rules win the cascade over earlier mobile overrides.
   ========================================================================== */

/* Prevent iOS text auto-inflation on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Remove the grey/blue tap-flash on iOS & Android for interactive elements */
a,
button,
input,
textarea,
select,
[role="button"],
[role="tab"],
.viewport-tab,
.chapter-btn {
  -webkit-tap-highlight-color: transparent;
}

/* Suppress the iOS long-press callout menu on UI controls (keep text selectable) */
button,
[role="button"],
[role="tab"],
.viewport-tab {
  -webkit-touch-callout: none;
}

/* iOS Safari zooms the page when a focused input has font-size < 16px.
   Force a minimum 16px on every form control at touch widths to stop the
   jarring auto-zoom while keeping the desktop typography untouched. */
@media (max-width: 1024px) {
  input,
  textarea,
  select,
  .main-chat-input,
  .community-chat-input,
  .search-box input,
  .auth-input-style,
  .view-chat .main-chat-input {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   Health Disclaimer Banner
   ========================================================================== */
.health-disclaimer-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(10, 10, 10, 0.97);
  border-top: 1px solid rgba(0, 210, 255, 0.4);
  padding: 0.9rem 1.25rem;
  animation: slideUpIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.health-disclaimer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.health-disclaimer-icon {
  color: #00d2ff;
  flex-shrink: 0;
}

.health-disclaimer-text {
  font-family: var(--font-reading);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  flex: 1;
}

.health-disclaimer-text strong {
  color: #00d2ff;
}

.health-disclaimer-dismiss {
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 210, 255, 0.45);
  background: rgba(0, 210, 255, 0.12);
  color: #00d2ff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.health-disclaimer-dismiss:hover {
  background: rgba(0, 210, 255, 0.22);
}

@keyframes slideUpIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

@media (max-width: 600px) {
  .health-disclaimer-banner {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0.75rem 1rem !important;
  }
  .health-disclaimer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .health-disclaimer-dismiss {
    align-self: flex-end;
  }
  .auth-card {
    max-width: 100% !important;
    padding: 2rem 1.25rem !important;
    margin: 0 0.75rem !important;
  }
  #community-username-input {
    font-size: 1rem !important;
    padding: 0.9rem 0.75rem !important;
  }
}

/* ==========================================================================
   ACCESSIBILITY & TOUCH AFFORDANCES
   Touch devices have no hover, so reveal hover-gated controls on tap; honour
   reduced-motion; lock background scroll behind open modals. Placed last to
   win the cascade.
   ========================================================================== */

/* Respect users who ask for less motion (also a native App Store quality cue) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Touch devices have no hover, so the hover-revealed retry button and context
   tooltip stay hidden there by design: tapping a message opens the action menu
   (Copy / Resend / Report), and the context percentage is already shown inside
   the indicator circle. Hide the hover-only affordances outright on touch so
   they can never half-appear from a stray tap. */
@media (hover: none) {
  .ai-user-message-actions {
    display: none !important;
  }
}

/* Tap feedback for primary interactive elements (touch has no hover state) */
.ai-chat-option-btn:active,
.main-chat-send-btn:active,
.ai-user-message-retry-btn:active,
.scope-btn:active,
.toggle-btn:active {
  transform: scale(0.97);
}

/* Lock background scroll while any modal is open. All modals share `.hidden`
   as their canonical closed state, so `:not(.hidden)` means visible. */
body:has(.auth-modal:not(.hidden)),
body.auth-modal-open,
body:has(.profile-modal:not(.hidden)),
body:has(.ai-context-modal:not(.hidden)),
body:has(.ai-clear-modal:not(.hidden)),
body:has(.feedback-modal:not(.hidden)),
body:has(.highlight-copy-modal:not(.hidden)),
body:has(.custom-alert-modal:not(.hidden)),
body:has(.community-dispute-modal:not(.hidden)),
body:has(.community-pin-history-modal:not(.hidden)) {
  overflow: hidden;
}




/* Hide page crop marks on non-Bible views */
#layout-wrapper.view-chat .crop-mark,
#layout-wrapper.view-community .crop-mark,
#layout-wrapper.view-devotional .crop-mark {
  display: none !important;
}
