:root {
  /* Warm Pastel Design Tokens */
  --bg-obsidian: #FAF8F5; /* Warm Alabaster / Ivory */
  --bg-sapphire-dark: #F6F2EB; /* Linen / Soft Cream */
  --bg-sapphire-card: #FFFFFF; /* Pure White */
  
  /* Primary & Accent Tones */
  --color-clay: #D87D62;      /* Terracotta accent */
  --color-sage: #76A087;      /* Sage green */
  --color-gold: #D4A35B;      /* Warm Gold/Ochre */
  --color-gold-hover: #E3B877; /* Soft Light Gold */
  --color-peach: #F0B097;     /* Soft Peach */
  --color-teal: #769EA0;      /* Muted Teal */
  
  /* Text Contrast - Charcoal & Muted Warm Grey */
  --color-text-primary: #2E2A25; /* Deep Coffee / Charcoal */
  --color-text-muted: #70685F;    /* Muted Warm Taupe */
  
  /* Borders and Interactive highlights */
  --color-border: rgba(180, 150, 120, 0.18);
  --color-border-focus: rgba(216, 125, 98, 0.4);
  
  /* Glassmorphism for Porcelain aesthetic */
  --glass-bg: rgba(255, 254, 252, 0.72);
  --glass-blur: blur(12px);
  --shadow-premium: 0 8px 30px rgba(112, 104, 95, 0.06), 0 2px 8px rgba(112, 104, 95, 0.03);
  
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  background:
    linear-gradient(180deg, rgba(118, 158, 160, 0.12) 0%, rgba(250, 248, 245, 0) 34%),
    var(--bg-obsidian);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}

::-webkit-scrollbar-thumb {
  background: rgba(46, 42, 37, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-clay);
}

/* Typography & Layout Utilities */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-clay) 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* App Header */
header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(112, 104, 95, 0.04);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.8rem;
  animation: float 4s ease-in-out infinite;
}

.logo-mark {
  align-items: center;
  background: #1f5f5b;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(31, 95, 91, 0.16);
  color: #ffffff;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.logo-mark svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 24px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  background: var(--bg-sapphire-dark);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn:hover {
  border-color: var(--color-clay);
  color: var(--color-clay);
  background: var(--bg-sapphire-card);
  box-shadow: 0 4px 12px rgba(216, 125, 98, 0.08);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-clay) 0%, #c56549 100%);
  color: #ffffff;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(216, 125, 98, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e48d73 0%, var(--color-clay) 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(216, 125, 98, 0.25);
  transform: translateY(-1px);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
  aspect-ratio: 1;
}

.mini-icon,
.chevron {
  color: currentColor;
  display: inline-block;
  flex: 0 0 auto;
  height: 18px;
  position: relative;
  width: 18px;
}

.split-icon::before,
.split-icon::after {
  border: 2px solid currentColor;
  border-radius: 3px;
  content: '';
  height: 13px;
  position: absolute;
  top: 2px;
  width: 6px;
}

.split-icon::before { left: 1px; }
.split-icon::after { right: 1px; }

.note-icon::before {
  border: 2px solid currentColor;
  border-radius: 3px;
  content: '';
  height: 15px;
  left: 2px;
  position: absolute;
  top: 1px;
  width: 12px;
}

.note-icon::after {
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
  content: '';
  height: 2px;
  left: 5px;
  position: absolute;
  top: 6px;
  width: 8px;
}

.settings-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.settings-icon::before {
  background: currentColor;
  border-radius: 50%;
  content: '';
  height: 6px;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 6px;
}

.back-icon::before,
.chevron::before {
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: '';
  height: 8px;
  left: 5px;
  position: absolute;
  top: 4px;
  transform: rotate(45deg);
  width: 8px;
}

.chevron.right::before {
  left: 3px;
  transform: rotate(225deg);
}

/* Dropdowns & Selectors */
.select-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

select {
  background: var(--bg-sapphire-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1.8rem 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2370685f'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
  transition: var(--transition-smooth);
}

select:hover, select:focus {
  border-color: var(--color-clay);
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 125, 98, 0.1);
}

/* Main Container Layout */
.main-wrapper {
  display: flex;
  flex: 1;
  position: relative;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Dashboard / Home Panel */
#dashboard-view {
  flex: 1;
  padding: 3.5rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-grid-container {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 3.5rem;
  width: 100%;
  align-items: start;
}

.dashboard-left-panel {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: sticky;
  top: 0;
}

.dashboard-right-panel {
  display: flex;
  flex-direction: column;
}

.welcome-section {
  text-align: left;
}

.eyebrow {
  color: var(--color-sage);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.welcome-section h1 {
  font-size: 4rem;
  margin-bottom: 0.85rem;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.welcome-section p {
  color: var(--color-text-muted);
  font-size: 1.2rem;
  line-height: 1.5;
}

.daily-card {
  background: #ffffff;
  border: 1px solid rgba(118, 160, 135, 0.28);
  border-left: 4px solid var(--color-sage);
  border-radius: 8px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.daily-card-top {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.level-pill {
  background: #1f5f5b;
  border-radius: 999px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
}

.daily-label {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.daily-card h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.daily-card p:last-child {
  color: var(--color-text-muted);
  line-height: 1.55;
}

.btn-large {
  align-self: flex-start;
  font-size: 1rem;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
}

.quest-panel {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quest-actions {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(31, 95, 91, 0.15);
  border-radius: 8px;
  box-shadow: var(--shadow-premium);
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr auto;
  padding: 1rem;
}

.quest-actions strong {
  color: var(--color-text-primary);
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.25rem;
}

.quest-actions p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.quest-buttons {
  display: flex;
  gap: 0.55rem;
}

.storage-note {
  border-top: 1px dashed var(--color-border);
  grid-column: 1 / -1;
  padding-top: 0.75rem;
}

.stat-card {
  background: var(--bg-sapphire-card);
  border: 1px solid rgba(31, 95, 91, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow-premium);
  color: var(--color-text-muted);
  min-height: 112px;
  padding: 1rem;
}

.stat-card strong {
  color: var(--color-text-primary);
  display: block;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1.1;
  margin-top: 0.45rem;
}

.stat-label {
  color: #1f5f5b;
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.week-track {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 1rem;
}

.week-dot {
  align-items: center;
  background: rgba(112, 104, 95, 0.08);
  border: 1px solid rgba(112, 104, 95, 0.12);
  border-radius: 6px;
  color: var(--color-text-muted);
  display: flex;
  font-size: 0.68rem;
  font-weight: 700;
  height: 30px;
  justify-content: center;
}

.week-dot.done {
  background: #1f5f5b;
  border-color: #1f5f5b;
  color: #ffffff;
}

.companion-map {
  background: #ffffff;
  border: 1px solid rgba(216, 125, 98, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.map-step {
  align-items: flex-start;
  background: rgba(250, 248, 245, 0.74);
  border: 1px solid rgba(180, 150, 120, 0.18);
  border-radius: 8px;
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem;
}

.map-step.active {
  background: rgba(216, 125, 98, 0.08);
  border-color: rgba(216, 125, 98, 0.24);
}

.step-index {
  align-items: center;
  background: var(--color-clay);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.map-step strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.map-step p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Mood Grid Selector */
.mood-container {
  width: 100%;
}

.mood-title {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 0;
}

.mood-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.mood-card {
  backdrop-filter: var(--glass-blur);
  padding: 1rem 1.15rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 15px rgba(112, 104, 95, 0.03);
}

.mood-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(112, 104, 95, 0.08);
}

.mood-icon {
  color: #ffffff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
  position: relative;
}

.mood-icon::before,
.mood-icon::after,
.mood-icon span,
.mood-icon span::before,
.mood-icon span::after {
  content: '';
  display: block;
  position: absolute;
}

.mood-icon-team::before,
.mood-icon-team::after,
.mood-icon-team span {
  border: 2px solid currentColor;
  border-radius: 50%;
  height: 12px;
  width: 12px;
}

.mood-icon-team::before {
  left: 13px;
  top: 16px;
}

.mood-icon-team::after {
  right: 13px;
  top: 16px;
}

.mood-icon-team span {
  bottom: 15px;
  left: 25px;
}

.mood-icon-team span::before,
.mood-icon-team span::after {
  background: currentColor;
  height: 2px;
  top: -10px;
  transform-origin: left center;
  width: 15px;
}

.mood-icon-team span::before {
  left: -9px;
  transform: rotate(-32deg);
}

.mood-icon-team span::after {
  left: 6px;
  transform: rotate(-148deg);
}

.mood-icon-finance::before {
  border: 2px solid currentColor;
  border-radius: 50%;
  height: 24px;
  left: 19px;
  top: 12px;
  width: 24px;
}

.mood-icon-finance::after {
  background: currentColor;
  border-radius: 2px;
  bottom: 15px;
  box-shadow: 10px -6px 0 currentColor, 20px -12px 0 currentColor;
  height: 12px;
  left: 15px;
  width: 6px;
}

.mood-icon-business::before {
  border: 2px solid currentColor;
  border-radius: 4px;
  height: 24px;
  left: 14px;
  top: 22px;
  width: 34px;
}

.mood-icon-business::after {
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  height: 8px;
  left: 24px;
  top: 14px;
  width: 14px;
}

.mood-icon-business span {
  background: currentColor;
  height: 2px;
  left: 14px;
  top: 32px;
  width: 34px;
}

.mood-icon-leadership::before {
  background: currentColor;
  border-radius: 2px;
  height: 34px;
  left: 19px;
  top: 15px;
  width: 3px;
}

.mood-icon-leadership::after {
  border-bottom: 9px solid transparent;
  border-left: 22px solid currentColor;
  border-top: 9px solid transparent;
  height: 0;
  left: 22px;
  top: 15px;
  width: 0;
}

.mood-icon-encouragement::before {
  border: 2px solid currentColor;
  border-radius: 16px 16px 20px 20px;
  height: 31px;
  left: 19px;
  top: 14px;
  width: 24px;
}

.mood-icon-encouragement::after {
  background: currentColor;
  height: 16px;
  left: 31px;
  top: 22px;
  width: 2px;
}

.mood-icon-encouragement span {
  background: currentColor;
  height: 2px;
  left: 25px;
  top: 29px;
  width: 14px;
}

.mood-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.mood-card h3 {
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

.mood-card h4 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
  margin-bottom: 0.4rem;
}

.mood-card p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Category-specific Pastel washes */
.mood-card.mood-team {
  background: hsla(145, 25%, 94%, 0.65);
  border: 1px solid rgba(118, 160, 135, 0.22);
}
.mood-card.mood-team:hover {
  background: hsla(145, 25%, 91%, 0.8);
  border-color: rgba(118, 160, 135, 0.45);
}
.mood-card.mood-team .mood-icon {
  background: #47745b;
}

.mood-card.mood-finance {
  background: hsla(38, 48%, 94%, 0.65);
  border: 1px solid rgba(212, 163, 91, 0.22);
}
.mood-card.mood-finance:hover {
  background: hsla(38, 48%, 91%, 0.8);
  border-color: rgba(212, 163, 91, 0.45);
}
.mood-card.mood-finance .mood-icon {
  background: #a8742b;
}

.mood-card.mood-business {
  background: hsla(14, 45%, 94%, 0.65);
  border: 1px solid rgba(216, 125, 98, 0.22);
}
.mood-card.mood-business:hover {
  background: hsla(14, 45%, 91%, 0.8);
  border-color: rgba(216, 125, 98, 0.45);
}
.mood-card.mood-business .mood-icon {
  background: #b85e43;
}

.mood-card.mood-leadership {
  background: hsla(20, 50%, 94%, 0.65);
  border: 1px solid rgba(240, 176, 151, 0.22);
}
.mood-card.mood-leadership:hover {
  background: hsla(20, 50%, 91%, 0.8);
  border-color: rgba(240, 176, 151, 0.45);
}
.mood-card.mood-leadership .mood-icon {
  background: #9c5b44;
}

.mood-card.mood-encouragement {
  background: hsla(180, 20%, 94%, 0.65);
  border: 1px solid rgba(118, 158, 160, 0.22);
}
.mood-card.mood-encouragement:hover {
  background: hsla(180, 20%, 91%, 0.8);
  border-color: rgba(118, 158, 160, 0.45);
}
.mood-card.mood-encouragement .mood-icon {
  background: #466f75;
}

/* Quick Start Selection */
.quick-start-section {
  width: 100%;
  background: var(--bg-sapphire-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-premium);
}

.quick-start-title {
  font-size: 1.15rem;
  color: var(--color-text-primary);
}

.quick-start-selectors {
  display: flex;
  gap: 1rem;
}

.quick-start-selectors select {
  flex: 1;
}

/* Reading View Layout */
#study-view {
  display: none; /* Controlled by JS */
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
}

.study-layout {
  display: flex;
  height: 100%;
  width: 100%;
}

/* Split Column Bible Reader */
.reader-container {
  height: 100%;
  overflow-y: auto;
  flex: 1;
  padding: 2rem;
  background-color: var(--bg-obsidian);
  transition: var(--transition-smooth);
}

/* Chapter Title Header in Reader */
.chapter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1rem;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
}

.reading-range-card {
  align-items: center;
  background: rgba(118, 160, 135, 0.08);
  border: 1px solid rgba(118, 160, 135, 0.24);
  border-radius: 8px;
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  line-height: 1.45;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
}

.reading-range-card strong {
  color: var(--color-text-primary);
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-top: 0.2rem;
}

.reading-stage {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  height: calc(100% - 86px);
  min-height: 0;
}

.story-background-pane,
.scripture-scroll-pane {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-premium);
  min-height: 0;
  overflow-y: auto;
}

.story-background-pane {
  border-left: 4px solid #1f5f5b;
  padding: 1.1rem;
}

.scripture-scroll-pane {
  padding: 1.15rem;
}

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

.story-pane-header span {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

/* Verse Alignment (Single & Parallel Layouts) */
.scripture-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verse-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
}

.verse-row.in-reading-range {
  background: rgba(118, 160, 135, 0.035);
}

.verse-row:hover {
  background: rgba(216, 125, 98, 0.03);
  border-left-color: var(--color-peach);
}

.verse-row.selected {
  background: rgba(212, 163, 91, 0.12);
  border-left-color: var(--color-gold);
}

.verse-cell {
  line-height: 1.8;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  text-align: justify;
}

.verse-num {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-clay);
  vertical-align: super;
  margin-right: 0.5rem;
  user-select: none;
}

/* When side-by-side mode is active */
.parallel-layout .verse-row {
  grid-template-columns: 1fr 1fr;
}

.parallel-layout .primary-cell {
  border-right: 1px solid var(--color-border);
  padding-right: 1.5rem;
}

/* AI Sidebar Panels */
.sidebar-container {
  width: 440px;
  height: 100%;
  border-left: 1px solid var(--color-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  z-index: 10;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: rgba(246, 242, 235, 0.6);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 1rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  position: relative;
}

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

.tab-btn.active {
  color: var(--color-clay);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-clay);
  box-shadow: 0 1px 4px rgba(216, 125, 98, 0.3);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.tab-pane.active {
  display: flex;
}

/* Sub-card Styles (Background context, references) */
.study-card {
  background: var(--bg-sapphire-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(112, 104, 95, 0.02);
}

.joshua-panel {
  background: var(--bg-sapphire-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(112, 104, 95, 0.02);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  line-height: 1.65;
  padding: 1.2rem;
}

.joshua-panel h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.brief-lead {
  color: var(--color-text-muted);
  line-height: 1.65;
}

.brief-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.brief-grid div {
  background: rgba(31, 95, 91, 0.06);
  border: 1px solid rgba(31, 95, 91, 0.13);
  border-radius: 8px;
  padding: 0.8rem;
}

.brief-grid span {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.brief-grid strong {
  color: var(--color-text-primary);
  font-size: 0.95rem;
}

.brief-section {
  border-top: 1px solid var(--color-border);
  padding-top: 0.9rem;
}

.brief-section h4 {
  color: #1f5f5b;
  font-size: 0.98rem;
  margin-bottom: 0.55rem;
}

.generated-context {
  background: rgba(216, 125, 98, 0.055);
  border: 1px solid rgba(216, 125, 98, 0.14);
  border-radius: 8px;
  padding: 0.95rem;
}

.verse-lens-panel {
  border-color: rgba(212, 163, 91, 0.28);
}

.story-teaching-panel {
  border: none;
  box-shadow: none;
  padding: 0;
}

.story-teaching-panel .brief-section p + p {
  margin-top: 0.65rem;
}

.story-basis-panel {
  border-left: 3px solid #1f5f5b;
}

.basis-item {
  background: rgba(31, 95, 91, 0.055);
  border: 1px solid rgba(31, 95, 91, 0.13);
  border-radius: 8px;
  padding: 0.85rem;
}

.basis-item + .basis-item {
  margin-top: 0.75rem;
}

.basis-item strong {
  color: #1f5f5b;
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.joshua-panel ul {
  padding-left: 1.15rem;
}

.joshua-panel li {
  margin-bottom: 0.55rem;
}

.text-anchor {
  background: rgba(212, 163, 91, 0.08);
  border-left: 3px solid var(--color-gold);
  border-radius: 6px;
  line-height: 1.6;
  padding: 0.75rem 0.85rem;
}

.soft-note {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.study-card h4 {
  color: var(--color-clay);
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(216, 125, 98, 0.15);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.study-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-primary);
}

.study-card ul {
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.study-card li {
  margin-bottom: 0.5rem;
}

/* Reference Links */
.ref-item {
  border-left: 2px solid var(--color-clay);
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
}

.ref-citation {
  font-weight: 600;
  color: var(--color-clay);
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.ref-citation:hover {
  color: var(--color-peach);
}

.ref-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  line-height: 1.45;
}

.cross-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cross-link-list .ref-item {
  background: #ffffff;
  border: 1px solid rgba(31, 95, 91, 0.15);
  border-left: 3px solid #1f5f5b;
  border-radius: 8px;
  margin-bottom: 0;
  padding: 0.9rem;
}

/* Markdown formatting inside AI panels */
.markdown-body h4 {
  color: var(--color-clay);
  margin: 1.2rem 0 0.5rem 0;
  font-size: 1.05rem;
}
.markdown-body ul {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}
.markdown-body li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* AI Chat Pane */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  min-height: 200px;
}

.chat-bubble {
  padding: 1rem;
  border-radius: 12px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-bubble.user {
  background: rgba(216, 125, 98, 0.08);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  border: 1px solid rgba(216, 125, 98, 0.2);
}

.chat-bubble.assistant {
  background: rgba(118, 160, 135, 0.08);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(118, 160, 135, 0.2);
}

.chat-bubble.system-alert {
  background: rgba(212, 163, 91, 0.08);
  border: 1px solid rgba(212, 163, 91, 0.22);
  max-width: 100%;
  color: #a3722e;
  text-align: center;
  align-self: center;
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.chat-input-area textarea {
  flex: 1;
  background: var(--bg-sapphire-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: none;
  height: 44px;
  transition: var(--transition-smooth);
}

.chat-input-area textarea:focus {
  border-color: var(--color-clay);
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 125, 98, 0.1);
}

/* Journal / Reflections Modal */
.journal-modal {
  display: none; /* Controlled by JS */
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(46, 42, 37, 0.35);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.journal-container {
  background: var(--bg-obsidian);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(46, 42, 37, 0.15);
}

.journal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-sapphire-dark);
}

.journal-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.journal-sidebar {
  width: 250px;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-sapphire-dark);
}

.journal-item {
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: var(--bg-sapphire-card);
}

.journal-item:hover {
  background: var(--bg-obsidian);
  border-color: var(--color-border);
}

.journal-item.active {
  background: rgba(212, 163, 91, 0.08);
  border-color: var(--color-gold);
}

.journal-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.journal-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
  background: var(--bg-sapphire-card);
}

.journal-title-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 1.4rem;
  font-family: var(--font-sans);
  padding-bottom: 0.5rem;
}

.journal-title-input:focus {
  outline: none;
  border-color: var(--color-clay);
}

.journal-scripture-tag {
  font-size: 0.85rem;
  background: rgba(216, 125, 98, 0.1);
  border: 1px solid rgba(216, 125, 98, 0.2);
  color: var(--color-clay);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  align-self: flex-start;
}

.journal-textarea {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
}

.journal-textarea:focus {
  outline: none;
}

.journal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg-sapphire-dark);
}

/* API Settings Modal */
.settings-modal {
  display: none; /* Controlled by JS */
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(46, 42, 37, 0.35);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
}

.settings-card {
  background: var(--bg-obsidian);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 12px 40px rgba(46, 42, 37, 0.15);
}

.settings-card h3 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-field label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.settings-field input {
  background: var(--bg-sapphire-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  padding: 0.75rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.settings-field input:focus {
  border-color: var(--color-clay);
  outline: none;
  box-shadow: 0 0 0 3px rgba(216, 125, 98, 0.1);
}

.settings-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Loading animations */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  color: var(--color-text-muted);
}

.pulse-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(216, 125, 98, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-clay);
  animation: spin 1s linear infinite;
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Helper styles for scroll locks and view management */
.no-scroll {
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-grid-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .dashboard-left-panel {
    position: relative;
  }
  
  .main-wrapper {
    flex-direction: column;
    overflow-y: auto;
    height: auto;
  }
  
  .sidebar-container {
    width: 100%;
    height: 500px;
    border-left: none;
    border-top: 1px solid var(--color-border);
  }
  
  #study-view {
    flex-direction: column;
  }

  .study-layout {
    flex-direction: column;
    min-height: calc(100vh - 120px);
  }
  
  .reader-container {
    flex: none;
    height: auto;
    min-height: 620px;
  }

  .reading-stage {
    grid-template-columns: 1fr;
    height: auto;
  }

  .story-background-pane,
  .scripture-scroll-pane {
    max-height: none;
  }
}

@media (max-width: 640px) {
  header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .header-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .quick-start-selectors {
    flex-direction: column;
  }

  .quest-panel,
  .quest-actions,
  .brief-grid {
    grid-template-columns: 1fr;
  }

  .quest-buttons {
    flex-direction: column;
  }
  
  .parallel-layout .verse-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .parallel-layout .primary-cell {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
  }
  
  .journal-layout {
    flex-direction: column;
  }
  
  .journal-sidebar {
    width: 100%;
    height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

/* Make Dashboard fit standard 16:9 desktop viewports without scrolling */
@media (min-width: 1025px) and (min-height: 680px) {
  body {
    height: 100vh;
    overflow: hidden;
  }
  .main-wrapper {
    height: 0;
    flex: 1;
  }
  #dashboard-view {
    height: 100%;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 2rem;
  }
  .dashboard-grid-container {
    align-items: center;
    gap: 3rem;
  }
  .dashboard-left-panel {
    gap: 2rem;
  }
  .welcome-section h1 {
    font-size: 2.8rem;
  }
  .welcome-section p {
    font-size: 1.1rem;
  }
  .quick-start-section {
    padding: 1.5rem;
    gap: 1rem;
  }
  .mood-title {
    margin-bottom: 0.85rem;
    font-size: 1.05rem;
  }
  .mood-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .mood-card:last-child {
    grid-column: span 2;
  }
  .mood-card {
    padding: 0.85rem 1.25rem;
    gap: 1.25rem;
  }
  .mood-icon {
    width: 50px;
    height: 50px;
    font-size: 0.86rem;
    border-radius: 8px;
  }
  .mood-card h3 {
    font-size: 1.1rem;
  }
  .mood-card h4 {
    font-size: 0.85rem !important;
    margin-top: 0.1rem !important;
    margin-bottom: 0.25rem !important;
  }
  .mood-card p {
    font-size: 0.85rem;
    line-height: 1.35;
  }
}

/* Liquid Nova redesign */
:root {
  --bg-obsidian: #eef6ff;
  --bg-sapphire-dark: rgba(224, 238, 252, 0.72);
  --bg-sapphire-card: rgba(255, 255, 255, 0.78);
  --color-clay: #1683ff;
  --color-sage: #0e3b5a;
  --color-gold: #32d3ff;
  --color-gold-hover: #69e3ff;
  --color-peach: #83bfff;
  --color-teal: #24a9c9;
  --color-text-primary: #08233b;
  --color-text-muted: #58728a;
  --color-border: rgba(80, 141, 188, 0.18);
  --color-border-focus: rgba(22, 131, 255, 0.34);
  --glass-bg: rgba(245, 250, 255, 0.64);
  --glass-blur: blur(26px) saturate(1.35);
  --shadow-premium: 0 24px 70px rgba(13, 62, 104, 0.13), 0 4px 20px rgba(11, 77, 140, 0.08);
}

body {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(222, 239, 255, 0.96) 38%, rgba(188, 217, 242, 0.9) 100%),
    #eef6ff;
  isolation: isolate;
}

body::before {
  background:
    linear-gradient(125deg, rgba(8, 35, 59, 0.98) 0%, rgba(8, 35, 59, 0.98) 18%, transparent 18.2%),
    linear-gradient(305deg, rgba(8, 35, 59, 0.94) 0%, rgba(8, 35, 59, 0.94) 12%, transparent 12.2%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.24) 46%, transparent 78%);
  content: '';
  inset: 0;
  opacity: 0.95;
  pointer-events: none;
  position: fixed;
  z-index: -2;
}

body::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(8, 35, 59, 0.055) 0 1px, transparent 1px 160px);
  content: '';
  inset: 0;
  opacity: 0.75;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

::-webkit-scrollbar-track {
  background: rgba(225, 240, 252, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(22, 131, 255, 0.35);
}

::-webkit-scrollbar-thumb:hover {
  background: #1683ff;
}

.gradient-text {
  background: linear-gradient(120deg, #083655 0%, #1683ff 48%, #32d3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header {
  background: rgba(246, 251, 255, 0.66);
  border-bottom: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 44px rgba(8, 35, 59, 0.08);
}

.logo-mark {
  background: linear-gradient(150deg, #062a46, #1683ff 66%, #76e8ff);
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(22, 131, 255, 0.28);
}

.btn,
select {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 12px 26px rgba(8, 35, 59, 0.07);
  color: #08233b;
}

.btn {
  border-radius: 18px;
}

select {
  border-radius: 16px;
}

.btn:hover,
select:hover,
select:focus {
  border-color: rgba(22, 131, 255, 0.42);
  box-shadow: 0 16px 34px rgba(22, 131, 255, 0.16);
  color: #075da9;
}

.btn-primary {
  background: linear-gradient(135deg, #0d75e9 0%, #20baff 100%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 20px 44px rgba(22, 131, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1683ff 0%, #5fdcff 100%);
  box-shadow: 0 24px 54px rgba(22, 131, 255, 0.36);
}

#dashboard-view {
  max-width: 1320px;
}

.dashboard-grid-container {
  gap: 2.2rem;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
}

.welcome-section {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.72), rgba(222, 240, 255, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 34px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  padding: 1.4rem;
  position: relative;
}

.welcome-section::after {
  color: rgba(8, 35, 59, 0.055);
  content: 'JOSHUA';
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 1;
  position: absolute;
  right: -0.55rem;
  top: 0.35rem;
  white-space: nowrap;
  z-index: 0;
}

.welcome-section > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.daily-label,
.stat-label {
  color: #1683ff;
  letter-spacing: 0.08em;
}

.welcome-section h1 {
  font-size: clamp(3.2rem, 8vw, 6.2rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}

.welcome-section p {
  color: #425f78;
}

.daily-card,
.quest-actions,
.quick-start-section,
.companion-map,
.stat-card,
.mood-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.74), rgba(231, 244, 255, 0.5));
  backdrop-filter: blur(26px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  box-shadow: var(--shadow-premium);
}

.daily-card {
  border-left: 0;
  overflow: hidden;
  position: relative;
}

.daily-card::before {
  background: linear-gradient(90deg, #1683ff, #32d3ff);
  content: '';
  height: 4px;
  inset: 0 0 auto 0;
  position: absolute;
}

.daily-card h2,
.chapter-title,
.joshua-panel h3 {
  font-family: var(--font-sans);
  font-weight: 800;
}

.level-pill {
  background: rgba(8, 35, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 14px 32px rgba(8, 35, 59, 0.18);
}

.stat-card {
  overflow: hidden;
  position: relative;
}

.stat-card::after {
  background: linear-gradient(135deg, rgba(22, 131, 255, 0.12), rgba(50, 211, 255, 0));
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.stat-card strong {
  color: #08233b;
  font-family: var(--font-sans);
  font-weight: 850;
}

.week-dot {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(22, 131, 255, 0.18);
  border-radius: 999px;
  color: #5b7891;
}

.week-dot.done {
  background: linear-gradient(135deg, #1683ff, #32d3ff);
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 20px rgba(22, 131, 255, 0.28);
}

.companion-map {
  min-height: 280px;
  overflow: hidden;
  position: relative;
}

.companion-map::before {
  color: rgba(8, 35, 59, 0.05);
  content: 'READ WITH CONTEXT';
  font-size: clamp(3.4rem, 7vw, 6.4rem);
  font-weight: 900;
  left: 1rem;
  line-height: 0.86;
  position: absolute;
  top: 0.8rem;
  width: 80%;
}

.companion-map > * {
  position: relative;
  z-index: 1;
}

.map-step {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
}

.map-step.active {
  background: linear-gradient(135deg, rgba(22, 131, 255, 0.12), rgba(255, 255, 255, 0.6));
  border-color: rgba(22, 131, 255, 0.24);
}

.step-index,
.mood-icon {
  background: linear-gradient(145deg, #073b5f, #1683ff 70%, #32d3ff);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 34px rgba(22, 131, 255, 0.22);
}

.mood-card {
  border-radius: 26px;
}

.mood-card:hover {
  box-shadow: 0 24px 58px rgba(22, 131, 255, 0.18);
  transform: translateY(-4px);
}

.mood-card h3 {
  color: #08233b;
  font-weight: 800;
}

.mood-card h4,
.mood-card p,
.map-step p,
.quest-actions p {
  color: #58728a;
}

.mood-card.mood-team,
.mood-card.mood-finance,
.mood-card.mood-business,
.mood-card.mood-leadership,
.mood-card.mood-encouragement {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.78), rgba(220, 239, 255, 0.46));
  border-color: rgba(255, 255, 255, 0.68);
}

.mood-card.mood-team .mood-icon,
.mood-card.mood-finance .mood-icon,
.mood-card.mood-business .mood-icon,
.mood-card.mood-leadership .mood-icon,
.mood-card.mood-encouragement .mood-icon {
  background: linear-gradient(145deg, #073b5f, #1683ff 70%, #32d3ff);
}

.quick-start-section {
  padding: 1.15rem;
}

#study-view,
.reader-container {
  background: transparent;
}

.chapter-header {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  box-shadow: var(--shadow-premium);
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.story-background-pane,
.scripture-scroll-pane,
.sidebar-container,
.study-card,
.joshua-panel,
.settings-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.76), rgba(231, 244, 255, 0.5));
  backdrop-filter: blur(26px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  box-shadow: var(--shadow-premium);
}

.story-background-pane {
  border-left: 1px solid rgba(255, 255, 255, 0.68);
}

.story-pane-header {
  border-bottom-color: rgba(22, 131, 255, 0.14);
}

.scripture-pane {
  gap: 0.72rem;
}

.verse-row {
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-left: 3px solid transparent;
  border-radius: 18px;
}

.verse-row:hover {
  background: rgba(232, 245, 255, 0.72);
  border-left-color: #32d3ff;
}

.verse-row.selected {
  background: rgba(22, 131, 255, 0.12);
  border-left-color: #1683ff;
}

.verse-cell {
  font-family: Georgia, 'Times New Roman', serif;
}

.verse-num {
  color: #1683ff;
}

.sidebar-container {
  border-left: 1px solid rgba(255, 255, 255, 0.58);
  margin: 1rem 1rem 1rem 0;
  overflow: hidden;
}

.sidebar-tabs {
  background: rgba(255, 255, 255, 0.42);
}

.tab-btn.active {
  color: #1683ff;
}

.tab-btn.active::after {
  background: linear-gradient(90deg, #1683ff, #32d3ff);
}

.brief-grid div,
.basis-item,
.text-anchor,
.generated-context,
.cross-link-list .ref-item {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(22, 131, 255, 0.16);
  border-radius: 18px;
}

.brief-section {
  border-top-color: rgba(22, 131, 255, 0.14);
}

.brief-section h4,
.basis-item strong,
.ref-citation {
  color: #0d75e9;
}

.chat-bubble.user,
.chat-bubble.assistant,
.chat-bubble.system-alert {
  border-radius: 20px;
}

.chat-bubble.user {
  background: rgba(22, 131, 255, 0.12);
  border-color: rgba(22, 131, 255, 0.22);
}

.chat-bubble.assistant {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 255, 255, 0.68);
}

.settings-modal {
  background: rgba(8, 35, 59, 0.22);
}

@media (max-width: 1024px) {
  .dashboard-grid-container {
    grid-template-columns: 1fr;
  }
  .sidebar-container {
    margin: 0;
  }
}

/* Comfort pass: softer screen colors and safer layout edges */
:root {
  --bg-obsidian: #f3f7fb;
  --bg-sapphire-dark: rgba(232, 240, 247, 0.76);
  --bg-sapphire-card: rgba(255, 255, 255, 0.82);
  --color-clay: #3b82c4;
  --color-sage: #17364d;
  --color-gold: #76b7d7;
  --color-gold-hover: #9ccbe1;
  --color-peach: #b8d2e6;
  --color-teal: #5e9ab4;
  --color-text-primary: #102a3f;
  --color-text-muted: #617486;
  --color-border: rgba(93, 126, 151, 0.18);
  --color-border-focus: rgba(59, 130, 196, 0.28);
  --shadow-premium: 0 18px 54px rgba(29, 58, 83, 0.11), 0 3px 16px rgba(30, 78, 118, 0.07);
}

body {
  background:
    linear-gradient(145deg, #f8fbfd 0%, #edf4f9 44%, #dbe8f1 100%),
    #f3f7fb;
}

body::before {
  background:
    linear-gradient(125deg, rgba(15, 42, 62, 0.88) 0%, rgba(15, 42, 62, 0.88) 10%, transparent 10.2%),
    linear-gradient(305deg, rgba(15, 42, 62, 0.84) 0%, rgba(15, 42, 62, 0.84) 7%, transparent 7.2%);
  opacity: 0.58;
}

body::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(90deg, rgba(16, 42, 63, 0.028) 0 1px, transparent 1px 180px);
  opacity: 0.55;
}

.main-wrapper {
  padding: 1rem;
}

#dashboard-view {
  padding: 2.2rem clamp(1.25rem, 3vw, 2.25rem);
}

#study-view {
  min-width: 0;
}

.study-layout {
  gap: 1rem;
  min-width: 0;
}

.reader-container {
  min-width: 0;
  padding: 1rem;
}

.reading-stage {
  gap: 1rem;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
}

.story-background-pane,
.scripture-scroll-pane {
  min-width: 0;
  padding: 1rem;
}

.welcome-section,
.daily-card,
.quest-actions,
.quick-start-section,
.companion-map,
.stat-card,
.mood-card,
.chapter-header,
.story-background-pane,
.scripture-scroll-pane,
.sidebar-container,
.study-card,
.joshua-panel,
.settings-card {
  border-radius: 18px;
}

.map-step,
.verse-row,
.brief-grid div,
.basis-item,
.text-anchor,
.generated-context,
.cross-link-list .ref-item,
.chat-bubble.user,
.chat-bubble.assistant,
.chat-bubble.system-alert {
  border-radius: 14px;
}

.btn,
select {
  border-radius: 12px;
}

.logo-mark {
  background: linear-gradient(150deg, #143a58, #4d92c7 70%, #a8d5e8);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(54, 119, 168, 0.2);
}

.gradient-text {
  background: linear-gradient(120deg, #143a58 0%, #3b82c4 56%, #76b7d7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-primary,
.week-dot.done,
.step-index,
.mood-icon,
.mood-card.mood-team .mood-icon,
.mood-card.mood-finance .mood-icon,
.mood-card.mood-business .mood-icon,
.mood-card.mood-leadership .mood-icon,
.mood-card.mood-encouragement .mood-icon {
  background: linear-gradient(145deg, #183c5a, #4f91c4 72%, #9acde2);
  box-shadow: 0 14px 30px rgba(54, 119, 168, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #214d70, #5b9bc9 72%, #b0dcea);
  box-shadow: 0 18px 38px rgba(54, 119, 168, 0.24);
}

.tab-btn.active,
.brief-section h4,
.basis-item strong,
.ref-citation,
.verse-num,
.eyebrow,
.daily-label,
.stat-label {
  color: #3b82c4;
}

.tab-btn.active::after,
.daily-card::before {
  background: linear-gradient(90deg, #4f91c4, #9acde2);
}

.verse-row:hover {
  background: rgba(241, 247, 252, 0.82);
  border-left-color: #8fc5dd;
}

.verse-row.selected {
  background: rgba(79, 145, 196, 0.11);
  border-left-color: #4f91c4;
}

.sidebar-container {
  margin: 0;
}

@media (max-width: 1180px) {
  .reading-stage {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 640px) {
  .main-wrapper {
    padding: 0.7rem;
  }
  #dashboard-view,
  .reader-container {
    padding: 0.75rem;
  }
}

/* Comfort pass 2: reduce white luminance */
:root {
  --bg-obsidian: #eef4f8;
  --bg-sapphire-dark: rgba(222, 232, 240, 0.8);
  --bg-sapphire-card: rgba(244, 248, 251, 0.84);
  --glass-bg: rgba(235, 243, 248, 0.68);
}

body {
  background:
    linear-gradient(145deg, #f2f6f9 0%, #e8f0f6 48%, #d7e5ee 100%),
    #eef4f8;
}

.daily-card,
.quest-actions,
.quick-start-section,
.companion-map,
.stat-card,
.mood-card,
.chapter-header,
.story-background-pane,
.scripture-scroll-pane,
.sidebar-container,
.study-card,
.joshua-panel,
.settings-card {
  background: linear-gradient(150deg, rgba(246, 249, 251, 0.76), rgba(223, 235, 244, 0.54));
  border-color: rgba(244, 249, 252, 0.58);
}

.btn,
select,
.verse-row,
.map-step,
.brief-grid div,
.basis-item,
.text-anchor,
.generated-context,
.cross-link-list .ref-item,
.chat-bubble.assistant {
  background-color: rgba(242, 247, 250, 0.62);
  border-color: rgba(238, 246, 250, 0.56);
}

.welcome-section {
  background: linear-gradient(150deg, rgba(244, 248, 251, 0.72), rgba(221, 234, 244, 0.48));
}

/* Reading layout repair: safer gutters, fewer nested frames */
body::before {
  background:
    linear-gradient(125deg, rgba(15, 42, 62, 0.42) 0%, rgba(15, 42, 62, 0.42) 5.5%, transparent 5.7%),
    linear-gradient(305deg, rgba(15, 42, 62, 0.34) 0%, rgba(15, 42, 62, 0.34) 4.5%, transparent 4.7%);
}

.main-wrapper {
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.study-layout {
  gap: clamp(1rem, 2vw, 1.6rem);
}

.reader-container {
  padding: 0;
}

.chapter-header {
  margin: 0 0 1.25rem 0;
}

.reading-stage {
  gap: clamp(1.35rem, 2.4vw, 2.2rem);
  grid-template-columns: minmax(420px, 0.92fr) minmax(460px, 1.08fr);
  padding: 0;
}

.story-background-pane,
.scripture-scroll-pane {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.story-background-pane {
  border-left: 0;
  padding-left: clamp(0.75rem, 1.6vw, 1.25rem);
}

.story-pane-header {
  background: rgba(239, 246, 250, 0.52);
  border: 1px solid rgba(215, 228, 238, 0.62);
  border-radius: 14px;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
}

.story-teaching-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.story-teaching-panel .brief-grid,
.story-teaching-panel .brief-section,
.story-teaching-panel .generated-context {
  background: rgba(242, 247, 250, 0.62);
  border: 1px solid rgba(215, 228, 238, 0.62);
  border-radius: 14px;
  margin-top: 0.9rem;
  padding: 1rem;
}

.story-teaching-panel .brief-section {
  border-top: 1px solid rgba(215, 228, 238, 0.62);
}

.scripture-scroll-pane {
  padding-right: clamp(0.75rem, 1.4vw, 1.25rem);
}

.sidebar-container {
  margin: 0;
  max-width: 420px;
}

@media (max-width: 1280px) {
  .study-layout {
    flex-direction: column;
  }
  .sidebar-container {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 980px) {
  .reading-stage {
    grid-template-columns: 1fr;
  }
  .story-background-pane,
  .scripture-scroll-pane {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Verse Lens interaction upgrade */
.verse-row {
  display: flex;
  flex-direction: column;
}

.verse-main {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

.parallel-layout .verse-main {
  grid-template-columns: 1fr 1fr;
}

.parallel-layout .verse-row {
  grid-template-columns: 1fr;
}

.inline-verse-lens {
  display: none;
}

.inline-verse-lens.active {
  background: rgba(235, 244, 250, 0.72);
  border: 1px solid rgba(155, 190, 215, 0.45);
  border-radius: 12px;
  display: block;
  margin-top: 0.85rem;
  padding: 0.9rem;
}

.inline-lens-top {
  align-items: center;
  border-bottom: 1px solid rgba(155, 190, 215, 0.36);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
}

.inline-lens-top span,
.inline-lens-grid span {
  color: #3b82c4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline-lens-top strong {
  color: #102a3f;
  font-size: 0.92rem;
}

.inline-lens-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-lens-grid p {
  color: #445f74;
  font-size: 0.92rem;
  line-height: 1.55;
  margin-top: 0.25rem;
}

.inline-lens-empty {
  color: #445f74;
  font-size: 0.92rem;
  line-height: 1.55;
}

.ref-open-btn {
  font-size: 0.78rem;
  margin-top: 0.7rem;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
}

.selection-bar {
  align-items: center;
  background: rgba(235, 244, 250, 0.68);
  border: 1px solid rgba(155, 190, 215, 0.42);
  border-radius: 14px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding: 0.9rem 1rem;
}

.selection-label {
  color: #3b82c4;
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-bar strong {
  color: #102a3f;
  display: block;
  margin-top: 0.15rem;
}

.selection-bar p {
  color: #617486;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.selection-actions {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.selection-feedback {
  color: #245f91;
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 4.5rem;
}

.term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.term-list span {
  background: rgba(59, 130, 196, 0.1);
  border: 1px solid rgba(59, 130, 196, 0.18);
  border-radius: 999px;
  color: #245f91;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
}

.term-empty {
  color: #617486;
  font-size: 0.88rem;
}

.verse-lens-panel {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  position: sticky;
  top: 0;
}

@media (max-width: 1280px) {
  .verse-lens-panel {
    max-height: none;
    position: static;
  }
}

@media (max-width: 640px) {
  .inline-lens-grid {
    grid-template-columns: 1fr;
  }

  .selection-bar,
  .selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-verse-lens.active {
    border-radius: 14px 14px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 40px rgba(29, 58, 83, 0.14);
    left: 0.75rem;
    margin-top: 0;
    max-height: 42vh;
    overflow-y: auto;
    position: fixed;
    right: 0.75rem;
    z-index: 180;
  }
}
