:root {
  --sand-50: #f8f5ec;
  --sand-100: #efe7d6;
  --sand-200: #deceac;
  --oak-700: #5f3f23;
  --oak-900: #2d1f13;
  --cedar-700: #2f5d50;
  --cedar-900: #16352d;
  --clay-700: #8a4a2f;
  --ink-900: #1f1f1f;
  --white: #ffffff;
  --shadow: 0 12px 28px rgba(45, 31, 19, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: radial-gradient(circle at 15% 15%, #fffdf7 0%, #f6f1e4 44%, #eee3ca 100%);
  position: relative;
  overflow-x: hidden;
  transition: color 300ms ease;
}

.bg-glow {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  z-index: -1;
}

.bg-glow-one {
  background: #6fae93;
  top: -10rem;
  right: -8rem;
  animation: glowDriftOne 22s ease-in-out infinite alternate;
}

.bg-glow-two {
  background: #ca8f5f;
  bottom: -12rem;
  left: -10rem;
  animation: glowDriftTwo 28s ease-in-out infinite alternate;
}

@keyframes glowDriftOne {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-2.5rem, 1.5rem) scale(1.1); }
}

@keyframes glowDriftTwo {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2rem, -2rem) scale(1.08); }
}

.hero,
.top-nav,
main,
footer {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.hero {
  padding: 3.2rem 0 1.5rem;
}

.hero-bottom {
  padding: 0.45rem 0 1.3rem;
}

.eyebrow {
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cedar-700);
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Cinzel", "Georgia", serif;
  margin-top: 0;
}

h1 {
  margin: 0.5rem 0 0.8rem;
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 18ch;
  color: var(--oak-900);
}

.hero-copy {
  max-width: 65ch;
  line-height: 1.45;
  margin: 0 0 1.5rem;
}

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

.hero-metrics article {
  border: 1px solid rgba(95, 63, 35, 0.25);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

.metric-icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--cedar-700);
  margin-bottom: 0.35rem;
  opacity: 0.8;
}

.hero-metrics span {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cedar-900);
}

.hero-metrics p {
  margin: 0.25rem 0 0;
  font-weight: 600;
}

.top-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  gap: 0;
  padding: 0.5rem 0 0;
  border-bottom: 2px solid rgba(95, 63, 35, 0.15);
  margin-bottom: 1rem;
}

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

.top-nav::before,
.top-nav::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1rem;
  pointer-events: none;
  z-index: 2;
}

.top-nav::before {
  left: 0;
  background: linear-gradient(90deg, rgba(246, 241, 228, 0.95), rgba(246, 241, 228, 0));
}

.top-nav::after {
  right: 0;
  background: linear-gradient(270deg, rgba(246, 241, 228, 0.95), rgba(246, 241, 228, 0));
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--oak-700);
  padding: 0.55rem 1.05rem 0.75rem;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  transition: color 180ms ease;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #184d3f, #32705f);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}

.nav-btn:hover {
  color: var(--cedar-700);
  transform: none;
  box-shadow: none;
  filter: none;
}

.nav-btn.active {
  color: var(--cedar-700);
  background: transparent;
  border-color: transparent;
}

.nav-btn.active::after {
  transform: scaleX(1);
}

main {
  padding-bottom: 2rem;
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

@keyframes childSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-animating > * {
  opacity: 0;
  animation: childSlideIn 300ms ease forwards;
}
.panel-animating > *:nth-child(1) { animation-delay:   0ms; }
.panel-animating > *:nth-child(2) { animation-delay:  55ms; }
.panel-animating > *:nth-child(3) { animation-delay: 110ms; }
.panel-animating > *:nth-child(4) { animation-delay: 165ms; }
.panel-animating > *:nth-child(5) { animation-delay: 220ms; }
.panel-animating > *:nth-child(6) { animation-delay: 275ms; }
.panel-animating > *:nth-child(7) { animation-delay: 330ms; }

.section-head {
  margin-bottom: 1.2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(95, 63, 35, 0.11);
}

.section-head h2 {
  position: relative;
  padding-bottom: 0.55rem;
}

.section-head h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.2rem;
  height: 2px;
  background: linear-gradient(90deg, var(--cedar-700), transparent);
  border-radius: 999px;
}

.section-head p {
  margin-top: -0.25rem;
  line-height: 1.5;
}

.doc-boost {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  margin: 0.2rem 0 1rem;
}

.doc-boost article {
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.88);
  padding: 0.72rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.doc-boost article:nth-child(1) { border-left: 3px solid var(--cedar-700); }
.doc-boost article:nth-child(2) { border-left: 3px solid var(--clay-700); }
.doc-boost article:nth-child(3) { border-left: 3px solid var(--oak-700); }

.doc-boost article:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 31, 19, 0.11);
}

.doc-boost h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.doc-boost p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.42;
}

.framework-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.framework-cards article {
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.88);
  padding: 0.72rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.framework-cards article:nth-child(3n+1) { border-top: 3px solid var(--cedar-700); }
.framework-cards article:nth-child(3n+2) { border-top: 3px solid var(--clay-700); }
.framework-cards article:nth-child(3n+3) { border-top: 3px solid var(--oak-700); }

.framework-cards article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 31, 19, 0.12);
}

.framework-cards h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.framework-cards p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.42;
}

.framework-grid {
  display: grid;
  gap: 0.75rem;
}

.framework-block {
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.88);
  padding: 0.8rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.framework-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 31, 19, 0.12);
}

.framework-block h3 {
  margin: 0 0 0.55rem;
  font-size: 0.98rem;
}

.framework-block ul {
  margin: 0;
  padding-left: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

.framework-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.framework-table th,
.framework-table td {
  border: 1px solid rgba(95, 63, 35, 0.25);
  padding: 0.42rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.framework-table th {
  background: #f2e6cf;
}

.progress-wrap {
  margin-bottom: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.progress-header label {
  font-weight: 700;
}

#progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cedar-700);
}

progress {
  width: 100%;
  height: 1.2rem;
}

progress::-webkit-progress-bar {
  background: #eadfca;
  border-radius: 999px;
}

@keyframes progressShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #2f5d50 0%, #5a8a6f 40%, #8ec9ae 50%, #5a8a6f 60%, #2f5d50 100%);
  background-size: 200% 100%;
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  progress::-webkit-progress-value {
    animation: progressShimmer 3s linear infinite;
  }
}

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

.session-card {
  border: 1px solid rgba(95, 63, 35, 0.24);
  border-left: 4px solid transparent;
  border-radius: 14px;
  padding: 0.95rem;
  background: rgba(253, 249, 241, 0.9);
  transition: background 250ms ease, border-color 250ms ease;
}

.session-card.completed {
  background: rgba(47, 93, 80, 0.07);
  border-color: rgba(95, 63, 35, 0.24);
  border-left-color: #2f5d50;
}

.session-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.pill {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  background: #f0e3cd;
  color: var(--oak-900);
}

.session-card ul {
  padding-left: 1.1rem;
  margin: 0.5rem 0;
}

.session-card li {
  margin: 0.25rem 0;
}

.session-done {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  margin-top: 0.55rem;
  cursor: pointer;
}

.session-done input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--cedar-700);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 150ms, border-color 150ms;
}

.session-done input[type="checkbox"]:checked {
  background: var(--cedar-700);
  border-color: var(--cedar-700);
}

.session-done input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.session-done input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(47, 93, 80, 0.28);
  outline-offset: 2px;
}

.chapter-controls {
  display: grid;
  grid-template-columns: 1fr minmax(145px, 220px);
  gap: 0.7rem;
}

.chapter-controls select {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(95, 63, 35, 0.35);
  font: inherit;
  background: #fffdfa;
}

.chapter-count {
  margin: 0.75rem 0 0.6rem;
  font-weight: 700;
  color: var(--cedar-700);
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.chapter-card {
  background: #fefbf3;
  border: 1px solid rgba(95, 63, 35, 0.24);
  border-radius: 12px;
  padding: 0.85rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 31, 19, 0.11);
}

.chapter-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #1f4c40;
  background: #e3efe8;
}

.chapter-card h3 {
  margin: 0.42rem 0 0.45rem;
  font-size: 1.04rem;
}

.chapter-key {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.94rem;
  color: #523f2e;
}

.chapter-card details {
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-radius: 10px;
  background: #fffdf8;
  padding: 0.5rem 0.55rem;
  margin-top: 0.5rem;
}

.chapter-card summary {
  cursor: pointer;
  font-weight: 700;
}

.chapter-card details ul {
  margin: 0.52rem 0 0;
  padding-left: 1rem;
}

.chapter-depth {
  margin-top: 0.6rem;
}

.chapter-depth summary {
  margin-bottom: 0.35rem;
}

.chapter-depth-grid {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.chapter-depth-card {
  border: 1px solid rgba(95, 63, 35, 0.18);
  border-radius: 10px;
  background: #fff9ee;
  padding: 0.58rem;
}

.chapter-depth-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.chapter-depth-card ul,
.chapter-depth-card ol {
  margin: 0;
  padding-left: 1rem;
}

.chapter-depth-card li {
  margin: 0.22rem 0;
  font-size: 0.88rem;
}

.historical-sidebar-list {
  display: grid;
  gap: 0.5rem;
}

.historical-sidebar {
  margin: 0;
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-left: 4px solid #8a4a2f;
  border-radius: 9px;
  background: #fffdf8;
  padding: 0.52rem 0.58rem;
}

.historical-sidebar p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.chapter-depth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.chapter-depth-table th,
.chapter-depth-table td {
  border: 1px solid rgba(95, 63, 35, 0.2);
  padding: 0.32rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.chapter-depth-table th {
  background: #f3e9d4;
}

.chapter-depth-note {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #4e3c2b;
}

.chapter-practice {
  margin: 0.7rem 0 0;
}

.chapter-supp {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.chapter-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-weight: 700;
  color: #1f4c40;
}

.chapter-empty {
  border: 1px dashed rgba(95, 63, 35, 0.45);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.62);
}

.explorer-controls {
  display: grid;
  gap: 0.7rem;
}

#search-input,
#chapter-search,
#scenario-search,
textarea {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(95, 63, 35, 0.35);
  font: inherit;
  background: #fffdfa;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
}

#search-input:focus,
#chapter-search:focus,
#scenario-search:focus,
textarea:focus {
  border-color: var(--cedar-700);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.18);
}

.theme-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-chip {
  border: 1px solid rgba(47, 93, 80, 0.5);
  border-radius: 999px;
  background: #e7f2ed;
  color: #214339;
  padding: 0.3rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.active {
  background: #245244;
  color: var(--white);
}

.explorer-results {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.result-card {
  background: #fefbf3;
  border: 1px solid rgba(95, 63, 35, 0.24);
  border-radius: 12px;
  padding: 0.85rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 31, 19, 0.11);
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.result-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.result-ref {
  font-weight: 700;
  color: var(--clay-700);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}

.tool-card {
  background: #fefbf3;
  border: 1px solid rgba(95, 63, 35, 0.24);
  border-radius: 12px;
  padding: 0.9rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 31, 19, 0.12);
}

.tool-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.tool-card p {
  margin: 0 0 0.65rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.pill-btn {
  border: 1px solid rgba(47, 93, 80, 0.45);
  background: #edf5f1;
  color: #1f4c40;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.pill-btn.active {
  background: #245244;
  color: var(--white);
  border-color: #245244;
}

.xref-detail,
.hebrew-detail,
.translation-compare,
.topic-heatmap,
.theme-verse-graph,
.theme-graph-detail,
.word-study-detail,
.scenario-results,
.misuse-grid {
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-radius: 10px;
  background: #fffdf8;
  padding: 0.7rem;
}

.xref-title {
  margin: 0 0 0.3rem;
  font-size: 1.02rem;
}

.xref-note {
  margin: 0 0 0.6rem;
}

.xref-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.xref-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.xref-list {
  margin: 0;
  padding-left: 1rem;
}

.xref-list li {
  margin: 0.2rem 0;
}

.xref-link {
  display: inline-block;
  margin-top: 0.55rem;
  font-weight: 700;
  color: #214d8a;
}

.tool-select {
  width: 100%;
  margin-top: 0.3rem;
  margin-bottom: 0.7rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(95, 63, 35, 0.35);
  font: inherit;
  background: #fffdfa;
}

.translation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.translation-table th,
.translation-table td {
  border: 1px solid rgba(95, 63, 35, 0.24);
  padding: 0.45rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.translation-table th {
  background: #f2e6cf;
}

.translation-ref {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #245244;
}

.hebrew-detail h4 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.hebrew-meta {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}

.hebrew-examples {
  margin: 0;
  padding-left: 1rem;
}

.hebrew-examples li {
  margin: 0.2rem 0;
}

.heatmap-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(31, minmax(1.9rem, 1fr));
  gap: 0.24rem;
  min-width: 48rem;
}

.heat-cell {
  border-radius: 8px;
  padding: 0.22rem 0.18rem;
  text-align: center;
  border: 1px solid rgba(95, 63, 35, 0.18);
}

.heat-cell strong {
  display: block;
  font-size: 0.73rem;
  line-height: 1;
}

.heat-cell span {
  display: block;
  font-size: 0.74rem;
  line-height: 1.2;
}

.heat-cell.heat-high { color: #ffffff; }
.heat-cell.heat-low  { color: #1f2b26; }
[data-theme="dark"] .heat-cell.heat-high { color: #ffffff; }
[data-theme="dark"] .heat-cell.heat-low  { color: #b8e0cc; }

.heatmap-summary {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.theme-verse-graph {
  overflow-x: auto;
}

.theme-graph-svg {
  display: block;
  width: 100%;
  min-width: 34rem;
  height: auto;
}

.graph-edge {
  stroke: rgba(47, 93, 80, 0.45);
  stroke-width: 2;
}

.graph-node text {
  fill: #1f2b26;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

.graph-node circle {
  stroke: rgba(47, 93, 80, 0.35);
  stroke-width: 2;
  fill: #eaf4ef;
}

.graph-node.theme-node circle {
  fill: #245244;
  stroke: #1f4c40;
}

.graph-node.theme-node text {
  fill: #ffffff;
  font-size: 0.6rem;
}

.verse-node {
  cursor: pointer;
  outline: none;
}

.verse-node.active circle {
  fill: #2f5d50;
  stroke: #1f4c40;
}

.verse-node.active text {
  fill: #ffffff;
}

.verse-node:focus-visible circle {
  stroke: #214d8a;
  stroke-width: 3;
}

.theme-graph-detail {
  margin-top: 0.7rem;
}

.theme-graph-meta {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.theme-graph-detail p {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
}

.word-study-summary {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
}

.word-study-list {
  display: grid;
  gap: 0.55rem;
}

.word-study-card {
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-radius: 10px;
  background: #fff9ee;
  padding: 0.58rem;
}

.word-study-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.word-study-card h4 span {
  font-size: 0.8rem;
  color: #5f4a35;
  font-weight: 600;
}

.word-study-card p {
  margin: 0.2rem 0;
  font-size: 0.87rem;
}

.scenario-results {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.scenario-card {
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-radius: 10px;
  background: #fff9ee;
  padding: 0.62rem;
}

.scenario-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.97rem;
}

.scenario-meta {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.scenario-meta a {
  color: #214d8a;
  font-weight: 700;
}

.scenario-card p {
  margin: 0;
  font-size: 0.91rem;
}

.misuse-grid {
  display: grid;
  gap: 0.55rem;
}

.misuse-card {
  border: 1px solid rgba(95, 63, 35, 0.2);
  border-radius: 10px;
  background: #fff9ee;
  padding: 0.62rem;
}

.misuse-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.misuse-card p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.journal-card {
  background: #fdf8eb;
  border: 1px solid rgba(95, 63, 35, 0.23);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.2rem;
}

.prompt-label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cedar-700);
  font-weight: 700;
}

.journal-prompt {
  margin: 0.4rem 0 0.8rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.journal-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0.55rem 0;
}

.journal-status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #315e4f;
}

.journal-status.warning {
  color: #9a3e21;
}

button {
  background: linear-gradient(135deg, #1f594a, #346f5f);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 0.58rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn {
  background: transparent;
  color: var(--cedar-900);
  border: 1px solid rgba(47, 93, 80, 0.5);
}

.ghost-btn:hover {
  background: rgba(47, 93, 80, 0.1);
  filter: none;
}

[data-theme="dark"] .ghost-btn {
  color: #8ecfb0;
  border-color: rgba(142, 207, 176, 0.35);
}

[data-theme="dark"] .ghost-btn:hover {
  background: rgba(142, 207, 176, 0.08);
}

.journal-entries {
  display: grid;
  gap: 0.65rem;
}

.journal-entry {
  background: #fffdf8;
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 10px;
  padding: 0.75rem;
}

.entry-head {
  font-size: 0.86rem;
  color: #554636;
  font-weight: 700;
}

.quiz-shell {
  background: #fefcf4;
  border: 1px solid rgba(95, 63, 35, 0.22);
  border-radius: 14px;
  padding: 1rem;
}

.quiz-options {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.quiz-choice {
  text-align: left;
  background: #f2e6cf;
  color: #332418;
}

.quiz-choice.selected {
  background: #2f5d50;
  color: var(--white);
}

.quiz-choice.correct {
  background: #2d6a4f;
  color: var(--white);
}

.quiz-choice.incorrect {
  background: #8b2526;
  color: var(--white);
}

.source-primary {
  background: #fff9ec;
  border: 1px solid rgba(95, 63, 35, 0.25);
  border-radius: 12px;
  padding: 0.8rem;
}

.sources-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
  padding-left: 1rem;
}

.sources-list a {
  color: #214d8a;
}

footer {
  padding: 1rem 0 2rem;
  color: #513e2c;
  text-align: center;
  font-weight: 700;
  border-top: 1px solid rgba(95, 63, 35, 0.2);
  margin-top: 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 450ms ease, transform 450ms ease;
}

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

/* ── Theme toggle button ─────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(95, 63, 35, 0.3);
  color: var(--oak-900);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(45, 31, 19, 0.15);
  transition: background 200ms, box-shadow 200ms, transform 180ms;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(45, 31, 19, 0.22);
  filter: none;
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ── Dark theme ──────────────────────────────────────── */
[data-theme="dark"] body {
  background: radial-gradient(circle at 15% 15%, #201a12 0%, #18130d 44%, #110d08 100%);
  color: #e8dcc8;
}

[data-theme="dark"] .bg-glow-one { background: #2a6e55; opacity: 0.18; }
[data-theme="dark"] .bg-glow-two { background: #8a5530; opacity: 0.15; }

[data-theme="dark"] .eyebrow { color: #6fae93; }
[data-theme="dark"] h1 { color: #f0e4cc; }
[data-theme="dark"] h2, [data-theme="dark"] h3 { color: #f0e4cc; }
[data-theme="dark"] .hero-copy { color: #c8b898; }

[data-theme="dark"] .hero-metrics article {
  background: rgba(40, 30, 18, 0.88);
  border-color: rgba(200, 160, 80, 0.2);
}
[data-theme="dark"] .hero-metrics span { color: #8ecfb0; }
[data-theme="dark"] .hero-metrics p { color: #c8b898; }
[data-theme="dark"] .metric-icon { color: #6fae93; }

[data-theme="dark"] .top-nav {
  border-bottom-color: rgba(200, 160, 80, 0.15);
}
[data-theme="dark"] .top-nav::before {
  background: linear-gradient(90deg, rgba(22, 18, 12, 0.95), rgba(22, 18, 12, 0));
}
[data-theme="dark"] .top-nav::after {
  background: linear-gradient(270deg, rgba(22, 18, 12, 0.95), rgba(22, 18, 12, 0));
}
[data-theme="dark"] .nav-btn {
  background: transparent;
  color: #a8947a;
  border-color: transparent;
}
[data-theme="dark"] .nav-btn:hover {
  color: #c8b898;
  box-shadow: none;
}
[data-theme="dark"] .nav-btn.active {
  background: transparent;
  color: #8ecfb0;
  border-color: transparent;
}
[data-theme="dark"] .nav-btn.active::after {
  background: linear-gradient(90deg, #4a9070, #6fae93);
}
[data-theme="dark"] .section-head {
  border-bottom-color: rgba(200, 160, 80, 0.1);
}

[data-theme="dark"] .panel {
  background: rgba(30, 22, 12, 0.92);
  border-color: rgba(200, 160, 80, 0.14);
}
[data-theme="dark"] .doc-boost article {
  background: rgba(42, 32, 16, 0.88);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .doc-boost article:nth-child(1) { border-left-color: var(--cedar-700); }
[data-theme="dark"] .doc-boost article:nth-child(2) { border-left-color: var(--clay-700); }
[data-theme="dark"] .doc-boost article:nth-child(3) { border-left-color: var(--oak-700); }
[data-theme="dark"] .framework-cards article,
[data-theme="dark"] .framework-block {
  background: rgba(42, 32, 16, 0.88);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .framework-cards article:nth-child(3n+1) { border-top-color: var(--cedar-700); }
[data-theme="dark"] .framework-cards article:nth-child(3n+2) { border-top-color: var(--clay-700); }
[data-theme="dark"] .framework-cards article:nth-child(3n+3) { border-top-color: var(--oak-700); }
[data-theme="dark"] .framework-table th,
[data-theme="dark"] .framework-table td {
  border-color: rgba(200, 160, 80, 0.2);
}
[data-theme="dark"] .framework-table th {
  background: rgba(80, 58, 24, 0.7);
}

[data-theme="dark"] .progress-header label { color: #e8dcc8; }
[data-theme="dark"] #progress-label { color: #6fae93; }
[data-theme="dark"] progress::-webkit-progress-bar { background: #2a2018; }

[data-theme="dark"] .session-card {
  background: rgba(36, 27, 14, 0.94);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .session-card.completed {
  background: rgba(28, 55, 42, 0.35);
  border-left-color: #4a9070;
}
[data-theme="dark"] .pill {
  background: rgba(80, 58, 24, 0.65);
  color: #d4a870;
}
[data-theme="dark"] .session-done input[type="checkbox"] {
  border-color: #6fae93;
  background: rgba(40, 30, 18, 1);
}
[data-theme="dark"] .session-done input[type="checkbox"]:checked {
  background: #4a8870;
  border-color: #4a8870;
}
[data-theme="dark"] .session-done input[type="checkbox"]:focus-visible {
  outline-color: rgba(111, 174, 147, 0.32);
}

[data-theme="dark"] .chapter-controls select {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.22);
  color: #e8dcc8;
}
[data-theme="dark"] .chapter-count { color: #8ecfb0; }
[data-theme="dark"] .chapter-card {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .chapter-tag {
  background: rgba(30, 55, 42, 0.55);
  color: #a8d4be;
}
[data-theme="dark"] .chapter-key {
  color: #bba98d;
}
[data-theme="dark"] .chapter-card details {
  background: rgba(45, 33, 17, 0.85);
  border-color: rgba(200, 160, 80, 0.2);
}
[data-theme="dark"] .chapter-depth-card {
  background: rgba(39, 29, 15, 0.92);
  border-color: rgba(200, 160, 80, 0.18);
}
[data-theme="dark"] .historical-sidebar {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.18);
  border-left-color: #b06c45;
}
[data-theme="dark"] .historical-sidebar p {
  color: #e2d3bd;
}
[data-theme="dark"] .chapter-depth-table th,
[data-theme="dark"] .chapter-depth-table td {
  border-color: rgba(200, 160, 80, 0.2);
}
[data-theme="dark"] .chapter-depth-table th {
  background: rgba(82, 60, 28, 0.72);
}
[data-theme="dark"] .chapter-depth-note {
  color: #c5b499;
}
[data-theme="dark"] .chapter-link { color: #8ecfb0; }
[data-theme="dark"] .chapter-empty {
  background: rgba(30, 22, 12, 0.7);
  border-color: rgba(200, 160, 80, 0.35);
}

[data-theme="dark"] #search-input,
[data-theme="dark"] #chapter-search,
[data-theme="dark"] #scenario-search,
[data-theme="dark"] textarea {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.22);
  color: #e8dcc8;
}
[data-theme="dark"] #search-input::placeholder,
[data-theme="dark"] #chapter-search::placeholder,
[data-theme="dark"] #scenario-search::placeholder,
[data-theme="dark"] textarea::placeholder { color: rgba(200, 180, 140, 0.70); }
[data-theme="dark"] #search-input:focus,
[data-theme="dark"] #chapter-search:focus,
[data-theme="dark"] #scenario-search:focus,
[data-theme="dark"] textarea:focus {
  border-color: #6fae93;
  box-shadow: 0 0 0 3px rgba(111, 174, 147, 0.18);
}

[data-theme="dark"] .filter-chip {
  background: rgba(30, 55, 42, 0.5);
  border-color: rgba(111, 174, 147, 0.35);
  color: #a8d4be;
}
[data-theme="dark"] .filter-chip.active {
  background: #245244;
  color: #e8f5ee;
}

[data-theme="dark"] .result-card {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .result-ref { color: #d4936a; }

[data-theme="dark"] .tool-card,
[data-theme="dark"] .xref-detail,
[data-theme="dark"] .hebrew-detail,
[data-theme="dark"] .translation-compare,
[data-theme="dark"] .topic-heatmap,
[data-theme="dark"] .theme-verse-graph,
[data-theme="dark"] .theme-graph-detail,
[data-theme="dark"] .word-study-detail,
[data-theme="dark"] .scenario-results,
[data-theme="dark"] .misuse-grid,
[data-theme="dark"] .scenario-card,
[data-theme="dark"] .misuse-card {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .graph-edge {
  stroke: rgba(111, 174, 147, 0.48);
}
[data-theme="dark"] .graph-node text {
  fill: #d9cdb7;
}
[data-theme="dark"] .graph-node circle {
  fill: rgba(37, 62, 47, 0.72);
  stroke: rgba(111, 174, 147, 0.44);
}
[data-theme="dark"] .graph-node.theme-node circle {
  fill: #315f4f;
  stroke: #6fae93;
}
[data-theme="dark"] .graph-node.theme-node text {
  fill: #eff8f3;
}
[data-theme="dark"] .verse-node.active circle {
  fill: #4a9070;
  stroke: #8ecfb0;
}
[data-theme="dark"] .verse-node.active text {
  fill: #ffffff;
}
[data-theme="dark"] .verse-node:focus-visible circle {
  stroke: #7ab4d8;
}
[data-theme="dark"] .word-study-card {
  background: rgba(39, 29, 15, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .word-study-card h4 span {
  color: #bfae90;
}

[data-theme="dark"] .pill-btn {
  background: rgba(30, 55, 42, 0.5);
  border-color: rgba(111, 174, 147, 0.35);
  color: #a8d4be;
}

[data-theme="dark"] .pill-btn.active {
  background: #245244;
  color: #e8f5ee;
}

[data-theme="dark"] .tool-select {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.22);
  color: #e8dcc8;
}

[data-theme="dark"] .translation-table th,
[data-theme="dark"] .translation-table td {
  border-color: rgba(200, 160, 80, 0.2);
}

[data-theme="dark"] .translation-table th {
  background: rgba(80, 58, 24, 0.7);
}

[data-theme="dark"] .translation-ref {
  color: #8ecfb0;
}

[data-theme="dark"] .xref-link {
  color: #7ab4d8;
}

[data-theme="dark"] .scenario-meta a {
  color: #7ab4d8;
}

[data-theme="dark"] .journal-card {
  background: rgba(42, 32, 16, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .prompt-label { color: #6fae93; }
[data-theme="dark"] .journal-prompt { color: #e8dcc8; }
[data-theme="dark"] .journal-entry {
  background: rgba(36, 27, 14, 0.88);
  border-color: rgba(200, 160, 80, 0.14);
}
[data-theme="dark"] .entry-head { color: #a8947a; }
[data-theme="dark"] .journal-status { color: #8ecfb0; }
[data-theme="dark"] .journal-status.warning { color: #e59b78; }

[data-theme="dark"] .quiz-shell {
  background: rgba(36, 27, 14, 0.92);
  border-color: rgba(200, 160, 80, 0.16);
}
[data-theme="dark"] .quiz-choice {
  background: rgba(58, 44, 22, 0.88);
  color: #e8dcc8;
}

[data-theme="dark"] .source-primary {
  background: rgba(46, 35, 18, 0.88);
  border-color: rgba(200, 160, 80, 0.2);
}
[data-theme="dark"] .sources-list a { color: #7ab4d8; }
[data-theme="dark"] .panel a:not([class]) { color: #7ab4d8; } /* unstyled links inside panels */

[data-theme="dark"] footer {
  color: #a8947a;
  border-top-color: rgba(200, 160, 80, 0.14);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(42, 32, 18, 0.92);
  border-color: rgba(200, 160, 80, 0.3);
  color: #e8dcc8;
}
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-reduced-motion: reduce) {
  .bg-glow-one,
  .bg-glow-two,
  progress::-webkit-progress-value,
  .panel-animating > * {
    animation: none !important;
  }

  .reveal,
  .nav-btn,
  .nav-btn::after,
  .doc-boost article,
  .framework-cards article,
  .framework-block,
  .chapter-card,
  .result-card,
  .tool-card {
    transition: none !important;
  }
}

@media (max-width: 800px) {
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .chapter-controls {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .xref-columns {
    grid-template-columns: 1fr;
  }

  .theme-graph-svg {
    min-width: 27rem;
  }

  .panel {
    padding: 1rem;
  }

  .top-nav {
    padding-right: 3.5rem; /* prevent fixed toggle from overlapping last tab */
  }

  .nav-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem 0.65rem;
  }
}
