/* Learn Sanskrit. Canonical reading base lives in /book-base.css (home/book-base.css). */
@import url("/book-base.css");

body {
  padding: 1.25rem 1rem 3.5rem;
}
.site-home {
  position: sticky;
  top: 0;
  z-index: 2;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.35rem 0 0.45rem;
  background: #fdf6e9;
  font-size: 0.95rem;
}

/* Live Word Search */
.word-search {
  margin: 0.8rem 0 1.4rem;
}
.word-search input {
  width: 100%;
  max-width: 32rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(44, 34, 26, 0.22);
  border-radius: 999px;
  background: #fffdfa;
  color: #2c221a;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.word-search input:focus {
  border-color: #b5451d;
  box-shadow: 0 0 0 3px rgba(181, 69, 29, 0.12);
}

/* Chant strips & memory boxes */
.chant-strip {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1.05rem;
  border: 1.5px solid rgba(181, 69, 29, 0.32);
  border-radius: 0.55rem;
  background: #fffaf1;
}
.chant-strip .chant-kicker {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a3414;
  margin-bottom: 0.3rem;
}
.chant-strip p {
  margin: 0 0 0.45rem;
}
.chant-strip p:last-child {
  margin-bottom: 0;
}

/* Interactive Case Drill & Quiz Cards */
.drill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
}
.drill-chip {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(44, 34, 26, 0.2);
  background: #ffffff;
  color: #2c221a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.drill-chip:hover {
  background: #f3e6d0;
  border-color: rgba(181, 69, 29, 0.4);
}
.drill-chip[aria-pressed="true"] {
  background: #b5451d;
  color: #fffdfa;
  border-color: #b5451d;
}
.drill-card {
  margin: 0.8rem 0 1.4rem;
  padding: 1.2rem 1.25rem;
  border: 1.5px solid rgba(44, 34, 26, 0.2);
  border-radius: 0.65rem;
  background: #fffdfa;
  box-shadow: 0 2px 8px rgba(44, 34, 26, 0.05);
}
.drill-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: #7b6452;
  margin-bottom: 0.55rem;
}
.drill-prompt {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.35rem;
}
.drill-cue {
  font-size: 1.02rem;
  color: #5c4938;
  margin: 0 0 0.9rem;
}
.drill-answer {
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background: #f6ebd8;
  border-left: 3.5px solid #b5451d;
}
.drill-answer[hidden] {
  display: none;
}
.drill-answer-word {
  font-size: 1.45rem;
  font-weight: 700;
  color: #8a3414;
  margin: 0 0 0.25rem;
}
.drill-answer-sent {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}
.drill-answer-hook {
  font-size: 0.96rem;
  margin: 0;
}
.drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.drill-btn {
  font: inherit;
  font-size: 0.94rem;
  font-weight: 650;
  padding: 0.42rem 0.95rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(44, 34, 26, 0.24);
  background: #f3e6d0;
  color: #2c221a;
  cursor: pointer;
}
.drill-btn:hover {
  background: #ead5b5;
}
.drill-btn.primary {
  background: #b5451d;
  color: #fffdfa;
  border-color: #b5451d;
}
.drill-btn.primary:hover {
  background: #8a3414;
}
.drill-btn.good {
  background: #236337;
  color: #ffffff;
  border-color: #236337;
}
.drill-help {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(44, 34, 26, 0.2);
  font-size: 0.85rem;
  line-height: 1.45;
  color: #6b5847;
}
.drill-help strong {
  color: #8b2500;
}
.stem-explainer-box {
  background: #fffdfa;
  border: 1.5px solid #d4c8b8;
  border-left: 4px solid #8b2500;
  border-radius: 6px;
  padding: 1.15rem 1.35rem;
  margin: 1.4rem 0 2rem;
}
.stem-explainer-box h3 {
  margin: 0 0 0.55rem;
  color: #8b2500;
  font-size: 1.15rem;
}
.stem-explainer-box p {
  margin: 0 0 0.6rem;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #374151;
}
.stem-explainer-box ul {
  margin: 0 0 0.6rem;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #374151;
}

.quiz-list {
  display: grid;
  gap: 0.95rem;
  margin: 0.9rem 0 1.5rem;
}
.quiz-card {
  padding: 0.95rem 1.1rem;
  border: 1px solid rgba(44, 34, 26, 0.18);
  border-radius: 0.55rem;
  background: #fffdfa;
}
.quiz-q {
  font-weight: 650;
  margin: 0 0 0.6rem;
}
.quiz-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.quiz-opt {
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(44, 34, 26, 0.22);
  background: #ffffff;
  color: #2c221a;
  cursor: pointer;
}
.quiz-opt:hover {
  background: #f3e6d0;
}
.quiz-opt.correct {
  background: #dff3e4;
  border-color: #236337;
  color: #164424;
}
.quiz-opt.wrong {
  background: #fbe4de;
  border-color: #b5451d;
  color: #7d260b;
}
.quiz-explain {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(44, 34, 26, 0.18);
}
.quiz-explain[hidden] {
  display: none;
}

/* Dark mode theme adaptations */
html[data-theme="dark"] .site-home {
  background: #1c1612;
}
html[data-theme="dark"] .word-search input {
  background: #241c16;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.22);
}
html[data-theme="dark"] .chant-strip {
  background: #241c16;
  border-color: rgba(224, 112, 67, 0.4);
}
html[data-theme="dark"] .chant-strip .chant-kicker {
  color: #f6b28f;
}
html[data-theme="dark"] .drill-chip {
  background: #261e18;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.2);
}
html[data-theme="dark"] .drill-chip[aria-pressed="true"] {
  background: #e07043;
  color: #1c1612;
  border-color: #e07043;
}
html[data-theme="dark"] .drill-card,
html[data-theme="dark"] .quiz-card {
  background: #221c17;
  border-color: rgba(243, 230, 212, 0.16);
}
html[data-theme="dark"] .drill-cue,
html[data-theme="dark"] .drill-meta {
  color: #c9b7a4;
}
html[data-theme="dark"] .drill-answer {
  background: #2c221b;
  border-left-color: #e07043;
}
html[data-theme="dark"] .drill-answer-word {
  color: #f6b28f;
}
html[data-theme="dark"] .drill-btn,
html[data-theme="dark"] .quiz-opt {
  background: #2e241d;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.22);
}
html[data-theme="dark"] .drill-btn.primary {
  background: #e07043;
  color: #1c1612;
  border-color: #e07043;
}
html[data-theme="dark"] .quiz-opt.correct {
  background: #1b3d26;
  border-color: #46a766;
  color: #d6f5df;
}
html[data-theme="dark"] .quiz-opt.wrong {
  background: #442019;
  border-color: #e07043;
  color: #fbd6cc;
}
html[data-theme="dark"] .drill-help {
  border-top-color: rgba(243, 230, 212, 0.16);
  color: #bfaea0;
}
html[data-theme="dark"] .drill-help strong {
  color: #f6b28f;
}
html[data-theme="dark"] .stem-explainer-box {
  background: #241e1a;
  border-color: rgba(232, 220, 207, 0.16);
  border-left-color: #e07043;
}
html[data-theme="dark"] .stem-explainer-box h3 {
  color: #f0a070;
}
html[data-theme="dark"] .stem-explainer-box p,
html[data-theme="dark"] .stem-explainer-box ul {
  color: #ded1c4;
}


/* ============================================================
   Acoustic Memory Beats & Table Grouping Styles
   ============================================================ */
tr.beat-banner-1 td,
tr.beat-banner-2 td,
tr.beat-banner-3 td,
tr.beat-banner-4 td,
tr.beat-banner-clone td {
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Beat 1 / Group 1: The Dramatic / Inanimate Pair */
tr.beat-banner-1 td {
  background: #fbf2ec !important;
  border-top: 3px solid #8b2500 !important;
  border-bottom: 1.5px solid #d4a389 !important;
  color: #8b2500 !important;
}
tr.beat-1 td:first-child {
  border-left: 5px solid #8b2500 !important;
}
tr.beat-1 {
  background: #fffdfb;
}

/* Beat 2 / Group 2: The Connection Pair / -या- Spine */
tr.beat-banner-2 td {
  background: #fbf5eb !important;
  border-top: 3px solid #b85d19 !important;
  border-bottom: 1.5px solid #deb887 !important;
  color: #9c4a0c !important;
}
tr.beat-2 td:first-child {
  border-left: 5px solid #b85d19 !important;
}
tr.beat-2 {
  background: #fffdf8;
}

/* Beat 3 / Group 3 / Masculine Clone: Spatial Trio / Clone Spine */
tr.beat-banner-3 td,
tr.beat-banner-clone td {
  background: #f2f8f4 !important;
  border-top: 3px solid #2d6a4f !important;
  border-bottom: 1.5px solid #a3c9b8 !important;
  color: #1b4d3e !important;
}
tr.beat-3 td:first-child,
tr.beat-clone td:first-child {
  border-left: 5px solid #2d6a4f !important;
}
tr.beat-3,
tr.beat-clone {
  background: #fafdfb;
}

/* Beat 4 / Group 4: The Direct Call */
tr.beat-banner-4 td {
  background: #f6f3f0 !important;
  border-top: 3px solid #5c4636 !important;
  border-bottom: 1.5px solid #c4b5a5 !important;
  color: #4a382a !important;
}
tr.beat-4 td:first-child {
  border-left: 5px solid #5c4636 !important;
}
tr.beat-4 {
  background: #faf8f5;
}

/* Dark Mode Overrides */
html[data-theme="dark"] tr.beat-banner-1 td {
  background: #382017 !important;
  border-top-color: #e07043 !important;
  border-bottom-color: #633320 !important;
  color: #f6b28f !important;
}
html[data-theme="dark"] tr.beat-1 td:first-child {
  border-left-color: #e07043 !important;
}
html[data-theme="dark"] tr.beat-1 {
  background: #251d18;
}

html[data-theme="dark"] tr.beat-banner-2 td {
  background: #36291a !important;
  border-top-color: #f3a847 !important;
  border-bottom-color: #6a4c28 !important;
  color: #fed89a !important;
}
html[data-theme="dark"] tr.beat-2 td:first-child {
  border-left-color: #f3a847 !important;
}
html[data-theme="dark"] tr.beat-2 {
  background: #272018;
}

html[data-theme="dark"] tr.beat-banner-3 td,
html[data-theme="dark"] tr.beat-banner-clone td {
  background: #182e22 !important;
  border-top-color: #46a766 !important;
  border-bottom-color: #275239 !important;
  color: #a3e8ba !important;
}
html[data-theme="dark"] tr.beat-3 td:first-child,
html[data-theme="dark"] tr.beat-clone td:first-child {
  border-left-color: #46a766 !important;
}
html[data-theme="dark"] tr.beat-3,
html[data-theme="dark"] tr.beat-clone {
  background: #19241e;
}

html[data-theme="dark"] tr.beat-banner-4 td {
  background: #2b2520 !important;
  border-top-color: #aa9582 !important;
  border-bottom-color: #4e433b !important;
  color: #e3d8cc !important;
}
html[data-theme="dark"] tr.beat-4 td:first-child {
  border-left-color: #aa9582 !important;
}
html[data-theme="dark"] tr.beat-4 {
  background: #201c18;
}

/* Audio Playback Buttons */
.audio-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #24292f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.45rem;
  vertical-align: middle;
  transition: all 0.15s ease;
}
.audio-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  transform: scale(1.03);
}
.audio-btn:active {
  transform: scale(0.97);
}
html[data-theme="dark"] .audio-btn {
  background: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}
html[data-theme="dark"] .audio-btn:hover {
  background: #30363d;
}

/* Disclaimer & Notice Boxes */
.audio-disclaimer,
.script-disclaimer {
  background: #fdfaf5;
  border: 1px solid #e6dacf;
  border-left: 4px solid #b85d19;
  border-radius: 6px;
  padding: 0.85rem 1.15rem;
  margin: 1.1rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #4a3b32;
}
.audio-disclaimer strong,
.script-disclaimer strong {
  color: #8b2500;
}
.audio-disclaimer .disclaimer-title,
.script-disclaimer .disclaimer-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: #8b2500;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}
html[data-theme="dark"] .audio-disclaimer,
html[data-theme="dark"] .script-disclaimer {
  background: #1e1b18;
  border-color: #3d352e;
  border-left-color: #d97706;
  color: #d6cbbf;
}
html[data-theme="dark"] .audio-disclaimer strong,
html[data-theme="dark"] .audio-disclaimer .disclaimer-title,
html[data-theme="dark"] .script-disclaimer strong,
html[data-theme="dark"] .script-disclaimer .disclaimer-title {
  color: #f3a847;
}

/* ENHANCE_SANSKRIT_CSS_START */
.nepali-bridge-strip {
  margin: 2.25rem 0 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  background: #f4f7f5;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2f6b5a;
}
.nepali-bridge-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2f6b5a;
  margin-bottom: 0.3rem;
}
.nepali-bridge-strip h3 {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
  color: #1e293b;
}
.nepali-bridge-strip p {
  margin: 0 0 0.65rem;
  font-size: 0.94rem;
}
.nepali-bridge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.nepali-bridge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: #2f6b5a;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.nepali-bridge-btn:hover {
  background: #245446;
  color: #ffffff;
}
.word-search-box {
  margin: 1.15rem 0 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}
.word-search-box label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: #1e293b;
}
.word-search-box input[type="search"] {
  width: 100%;
  max-width: 540px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
  border: 1.5px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
}
.lab-chip-bar,
.lakara-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.9rem 0 1rem;
}
.lab-chip-btn {
  padding: 0.35rem 0.78rem;
  border-radius: 9999px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lab-chip-btn:hover {
  border-color: #8b2500;
  color: #8b2500;
}
.lab-chip-btn.active {
  background: #8b2500;
  border-color: #8b2500;
  color: #ffffff;
}
.lab-trace-card {
  border: 1px solid #e2e8f0;
  border-left: 4px solid #8b2500;
  border-radius: 8px;
  background: #fffdfa;
  padding: 1rem 1.2rem;
  margin-top: 0.75rem;
}
.scansion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0;
}
.syl-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.3rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.95rem;
}
.syl-pill.syl-guru {
  background: #fef3c7;
  border-color: #d97706;
}
.syl-pill.syl-laghu {
  background: #eff6ff;
  border-color: #60a5fa;
}
.syl-mark {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8b2500;
}
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  margin: 1rem 0 1.25rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.reader-scansion-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #0369a1;
  font-size: 0.9rem;
}
html[data-theme="dark"] .nepali-bridge-strip {
  background: #17211d;
  border-color: #2c4138;
  border-left-color: #4ea88e;
}
html[data-theme="dark"] .nepali-bridge-kicker {
  color: #6ee7b7;
}
html[data-theme="dark"] .nepali-bridge-strip h3 {
  color: #f1f5f9;
}
html[data-theme="dark"] .word-search-box,
html[data-theme="dark"] .lab-trace-card,
html[data-theme="dark"] .reader-scansion-panel {
  background: #1c1917;
  border-color: #3f3a36;
  color: #e7e5e4;
}
html[data-theme="dark"] .word-search-box label {
  color: #e7e5e4;
}
html[data-theme="dark"] .word-search-box input[type="search"] {
  background: #292524;
  border-color: #57534e;
  color: #fafaf9;
}
html[data-theme="dark"] .lab-chip-btn {
  background: #292524;
  border-color: #57534e;
  color: #e7e5e4;
}
html[data-theme="dark"] .lab-chip-btn.active {
  background: #b45309;
  border-color: #b45309;
  color: #ffffff;
}
html[data-theme="dark"] .syl-pill {
  background: #292524;
  border-color: #57534e;
  color: #f5f5f4;
}
html[data-theme="dark"] .syl-pill.syl-guru {
  background: #451a03;
  border-color: #d97706;
}
html[data-theme="dark"] .syl-pill.syl-laghu {
  background: #172554;
  border-color: #3b82f6;
}
html[data-theme="dark"] .syl-mark {
  color: #fbbf24;
}
html[data-theme="dark"] .reader-toolbar {
  background: #292012;
  border-color: #78350f;
}

/* ENHANCE_PEDAGOGY_CSS_START */
/* 1. Graded Storybook & Word X-Ray Styles */
.xray-dashboard {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.xray-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2e8f0;
}
.xray-role-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.role-actor .chip-dot { background: #0284c7; }
.role-actor { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

.role-target .chip-dot { background: #16a34a; }
.role-target { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }

.role-action .chip-dot { background: #d97706; }
.role-action { background: #fef3c7; color: #b45309; border-color: #fde68a; }

.role-tool .chip-dot { background: #9333ea; }
.role-tool { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }

.role-place .chip-dot { background: #0891b2; }
.role-place { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }

.role-state .chip-dot { background: #e11d48; }
.role-state { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }

.xray-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.xray-btn {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.xray-btn:hover {
  background: #f1f5f9;
  border-color: #64748b;
}
.xray-btn.active {
  background: #2f6b5a;
  border-color: #2f6b5a;
  color: #ffffff;
}

/* Inspector Card */
.xray-inspector-panel {
  margin-top: 0.9rem;
  padding: 0.85rem 1.1rem;
  background: #ffffff;
  border: 1.5px solid #2f6b5a;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.inspector-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #64748b;
  font-size: 0.9rem;
}
.inspector-prompt-icon {
  font-size: 1.4rem;
}
.inspector-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #f1f5f9;
}
.inspector-word-box {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.inspector-deva {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}
.inspector-iast {
  font-size: 0.95rem;
  color: #475569;
  font-style: italic;
}
.inspector-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.xray-audio-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.xray-audio-btn:hover {
  background: #e2e8f0;
}
.inspector-role-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}
.inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}
.inspector-cell {
  background: #f8fafc;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.inspector-cell.full-width {
  grid-column: 1 / -1;
}
.ins-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}
.ins-val {
  font-size: 0.93rem;
  font-weight: 600;
  color: #1e293b;
}

/* Story Cards */
.xray-story-card {
  margin: 2rem 0;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.story-header {
  padding: 1.15rem 1.4rem;
  background: #fdfdfd;
  border-bottom: 1px solid #e2e8f0;
}
.story-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b2500;
  margin-bottom: 0.35rem;
}
.story-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  color: #1e293b;
}
.story-desc {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}
.story-body {
  padding: 1.25rem 1.4rem;
}
.xray-sentence-row {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px dashed #e2e8f0;
}
.xray-sentence-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sentence-num-badge {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.sentence-content {
  flex: 1;
}
.sentence-words-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  align-items: flex-end;
  margin-bottom: 0.45rem;
}

/* The Clickable X-Ray Word */
.xray-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.45rem 0.2rem;
  border-radius: 6px;
  font-size: 1.18rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.25;
}
.xray-word:hover,
.xray-word:focus-visible {
  border-color: #2f6b5a;
  box-shadow: 0 0 0 2px rgba(47, 107, 90, 0.2);
  outline: none;
}
.xray-word.xray-active {
  border-color: #0f172a !important;
  box-shadow: 0 0 0 2px #0f172a !important;
}

/* Role Color Highlighting (when active) */
.show-role-colors .xray-word.role-actor { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.show-role-colors .xray-word.role-target { background: #dcfce7; border-color: #86efac; color: #15803d; }
.show-role-colors .xray-word.role-action { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
.show-role-colors .xray-word.role-tool { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.show-role-colors .xray-word.role-place { background: #cffafe; border-color: #67e8f9; color: #0e7490; }
.show-role-colors .xray-word.role-state { background: #ffe4e6; border-color: #fda4af; color: #be123c; }

/* Interlinear gloss */
.xray-interlinear-gloss {
  display: none;
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.15rem;
  white-space: nowrap;
}
.show-interlinear .xray-interlinear-gloss {
  display: block;
}

.sentence-translation-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: #334155;
  background: #f8fafc;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}
.sent-speak-btn {
  background: transparent;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.sent-speak-btn:hover {
  background: #e2e8f0;
}
.story-moral-strip {
  padding: 0.85rem 1.4rem;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}
.moral-tag {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2f6b5a;
}
.moral-sa {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
}
.moral-sub {
  font-size: 0.88rem;
  color: #475569;
  font-style: italic;
}

/* 2. Comic Strip Dialogue Panels */
.comic-strip-container {
  margin: 1.75rem 0 2.25rem;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
}
.comic-strip-header {
  background: #0f172a;
  color: #ffffff;
  padding: 0.8rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.comic-scene-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}
.comic-location-tag {
  font-size: 0.82rem;
  color: #94a3b8;
}
.comic-strip-flow {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: #f8fafc;
}
.comic-turn {
  display: flex;
  gap: 0.9rem;
  max-width: 85%;
}
.comic-turn.left {
  align-self: flex-start;
}
.comic-turn.right {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.comic-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 4rem;
  flex-shrink: 0;
}
.avatar-circle {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #2f6b5a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 2px solid #ffffff;
}
.comic-turn.right .avatar-circle {
  background: #8b2500;
}
.avatar-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-align: center;
  margin-top: 0.3rem;
  line-height: 1.2;
}
.comic-speech-bubble {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  position: relative;
}
.comic-turn.left .comic-speech-bubble {
  border-top-left-radius: 2px;
}
.comic-turn.right .comic-speech-bubble {
  border-top-right-radius: 2px;
}
.bubble-deva-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 1.18rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}
.bubble-audio-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
}
.bubble-audio-btn:hover {
  background: #e2e8f0;
}
.bubble-iast {
  font-size: 0.88rem;
  color: #64748b;
  font-style: italic;
  margin-bottom: 0.35rem;
}
.bubble-trans-row {
  font-size: 0.92rem;
  color: #334155;
  margin-bottom: 0.45rem;
  line-height: 1.4;
}
.bubble-grammar-tag {
  font-size: 0.76rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  display: inline-block;
}
.gram-tag-badge {
  font-weight: 800;
  color: #2f6b5a;
}

/* Dark Mode Adaptations */
html[data-theme="dark"] .xray-dashboard { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .xray-inspector-panel { background: #1e293b; border-color: #38bdf8; }
html[data-theme="dark"] .inspector-deva { color: #f8fafc; }
html[data-theme="dark"] .inspector-iast { color: #94a3b8; }
html[data-theme="dark"] .inspector-cell { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .ins-val { color: #f1f5f9; }
html[data-theme="dark"] .xray-story-card { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .story-header { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .story-title { color: #f8fafc; }
html[data-theme="dark"] .xray-word { background: #0f172a; border-color: #334155; color: #f8fafc; }
html[data-theme="dark"] .sentence-translation-bar { background: #0f172a; color: #cbd5e1; }
html[data-theme="dark"] .story-moral-strip { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .moral-sa { color: #f8fafc; }
html[data-theme="dark"] .comic-strip-container { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .comic-strip-flow { background: #0f172a; }
html[data-theme="dark"] .comic-speech-bubble { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .bubble-deva-line { color: #f8fafc; }
html[data-theme="dark"] .bubble-trans-row { color: #cbd5e1; }
html[data-theme="dark"] .bubble-grammar-tag { background: #0f172a; color: #94a3b8; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] .deva { color: #e8dac6; }
html[data-theme="dark"] .story-desc,
html[data-theme="dark"] .ins-label,
html[data-theme="dark"] .bubble-iast { color: #cbd5e1; }
html[data-theme="dark"] .xray-btn {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
html[data-theme="dark"] .xray-btn:hover { background: #334155; }
html[data-theme="dark"] .toc-label { color: #f0a070; }
html[data-theme="dark"] table.stages-table,
html[data-theme="dark"] [style*="background: #fffdfa"],
html[data-theme="dark"] [style*="background:#fffdfa"],
html[data-theme="dark"] [style*="background: #fdfbf7"],
html[data-theme="dark"] [style*="background:#fdfbf7"],
html[data-theme="dark"] [style*="background: #fffaf3"],
html[data-theme="dark"] [style*="background:#fffaf3"],
html[data-theme="dark"] [style*="background: #faf8f5"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background: #fff;"],
html[data-theme="dark"] [style*="background:#fff"] {
  background: #241d17 !important;
  border-color: rgba(243, 230, 212, 0.2) !important;
  color: #f3e6d4 !important;
}
html[data-theme="dark"] [style*="background: #fbf5eb"],
html[data-theme="dark"] [style*="background:#fbf5eb"],
html[data-theme="dark"] [style*="background: #f7f3ec"],
html[data-theme="dark"] [style*="background:#f7f3ec"],
html[data-theme="dark"] [style*="background: #f5efe6"],
html[data-theme="dark"] [style*="background: #f3e6d0"],
html[data-theme="dark"] [style*="background: #f9f5ee"] {
  background: #2c231b !important;
  border-color: rgba(243, 230, 212, 0.22) !important;
  color: #f6ead4 !important;
}
html[data-theme="dark"] [style*="color: #8b2500"],
html[data-theme="dark"] [style*="color:#8b2500"],
html[data-theme="dark"] [style*="color: #8a3414"],
html[data-theme="dark"] [style*="color:#8a3414"],
html[data-theme="dark"] [style*="color: #7c2d12"],
html[data-theme="dark"] [style*="color: #b5451d"] {
  color: #f0a070 !important;
}
html[data-theme="dark"] [style*="color: #2c221a"],
html[data-theme="dark"] [style*="color: #4a3c2e"],
html[data-theme="dark"] [style*="color: #5a4638"],
html[data-theme="dark"] [style*="color: #6b5644"],
html[data-theme="dark"] [style*="color: #4a382a"],
html[data-theme="dark"] [style*="color:#4a382a"],
html[data-theme="dark"] [style*="color: #5c4636"],
html[data-theme="dark"] [style*="color:#5c4636"],
html[data-theme="dark"] [style*="color: #4b5563"],
html[data-theme="dark"] [style*="color:#4b5563"],
html[data-theme="dark"] [style*="color: #555"] {
  color: #e4d4c0 !important;
}
html[data-theme="dark"] .phase-tag { color: #f6b667 !important; }
html[data-theme="dark"] [style*="color: #0369a1"],
html[data-theme="dark"] [style*="color:#0369a1"] { color: #7dd3fc !important; }
html[data-theme="dark"] [style*="color: #9c4a0c"],
html[data-theme="dark"] [style*="color:#9c4a0c"],
html[data-theme="dark"] [style*="color: #92400e"],
html[data-theme="dark"] [style*="color:#92400e"],
html[data-theme="dark"] [style*="color: #b45309"],
html[data-theme="dark"] [style*="color:#b45309"],
html[data-theme="dark"] [style*="color: #b85d19"],
html[data-theme="dark"] [style*="color:#b85d19"] { color: #f6b667 !important; }
html[data-theme="dark"] [style*="color: #1b4d3e"],
html[data-theme="dark"] [style*="color:#1b4d3e"],
html[data-theme="dark"] [style*="color: #166534"],
html[data-theme="dark"] [style*="color:#166534"],
html[data-theme="dark"] [style*="color: #2f6b5a"],
html[data-theme="dark"] [style*="color:#2f6b5a"],
html[data-theme="dark"] [style*="color: #2d6a4f"],
html[data-theme="dark"] [style*="color:#2d6a4f"] { color: #7cd9b0 !important; }
html[data-theme="dark"] a[style*="color: #fff"],
html[data-theme="dark"] a[style*="color:#fff"],
html[data-theme="dark"] a[style*="color: white"],
html[data-theme="dark"] a[style*="background: #2f6b5a"],
html[data-theme="dark"] a[style*="background:#2f6b5a"] { color: #ffffff !important; }
html[data-theme="dark"] tr.beat-banner-1 td,
html[data-theme="dark"] tr.beat-banner-2 td,
html[data-theme="dark"] tr.beat-banner-3 td,
html[data-theme="dark"] tr.beat-banner-clone td,
html[data-theme="dark"] tr.beat-banner-4 td {
  background: #2c231b !important;
  color: #f6ead4 !important;
}
html[data-theme="dark"] tr.beat-1,
html[data-theme="dark"] tr.beat-2,
html[data-theme="dark"] tr.beat-3,
html[data-theme="dark"] tr.beat-clone,
html[data-theme="dark"] tr.beat-4 {
  background: #221b15 !important;
}

/* Print Optimizations */
@media print {
  .xray-dashboard,
  .xray-controls-bar,
  .sent-speak-btn,
  .bubble-audio-btn { display: none !important; }
  .xray-story-card { page-break-inside: avoid; border: 1px solid #999; margin: 1.5rem 0; box-shadow: none; }
  .xray-interlinear-gloss { display: block !important; }
  .comic-strip-container { page-break-inside: avoid; border: 1px solid #999; }
}
/* ENHANCE_PEDAGOGY_CSS_END */

/* ENHANCE_SANSKRIT_CSS_END */
