:root {
  color-scheme: dark;
  --bg: #050913;
  --bg-2: #081224;
  --surface: rgba(18, 31, 52, 0.82);
  --surface-2: rgba(31, 49, 76, 0.86);
  --surface-3: #0b1424;
  --line: rgba(111, 151, 205, 0.24);
  --line-strong: rgba(139, 184, 246, 0.38);
  --ink: #f8fbff;
  --muted: #95a7c5;
  --gold: #e1b84f;
  --gold-2: #ffc238;
  --blue: #38bdf8;
  --purple: #9b35e8;
  --green: #24c773;
  --red: #ef4444;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --orange: #fb923c;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(19, 30, 57, 0.82), rgba(5, 9, 19, 0.96) 38%),
    repeating-linear-gradient(90deg, rgba(34, 211, 238, 0.035) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, rgba(139, 92, 246, 0.028) 0 1px, transparent 1px 88px),
    var(--bg);
  color: var(--ink);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.32) 0 1px, transparent 1px),
    radial-gradient(circle at 33% 74%, rgba(34, 211, 238, 0.28) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 88% 62%, rgba(139, 92, 246, 0.24) 0 1px, transparent 1px);
  background-size: 180px 180px, 240px 240px, 210px 210px, 280px 280px;
  content: "";
  opacity: 0.55;
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  display: block;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: auto;
  max-width: 100%;
  padding: 12px 18px;
  border-right: 0;
  border-bottom: 1px solid #243044;
  background: rgba(5, 9, 19, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(217, 173, 79, 0.6);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-2), #22d3ee);
  color: #101622;
  font-weight: 900;
}

.brand-title {
  display: block;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-stack {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.6) rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
}

.nav-stack::-webkit-scrollbar {
  height: 5px;
}

.nav-stack::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-stack::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.6);
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.1);
  color: var(--ink);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: #172233;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.profile-nav {
  position: relative;
  flex: 0 0 auto;
}

.profile-pill {
  display: grid;
  grid-template-columns: 38px minmax(118px, 1fr) 16px;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-pill:hover,
.profile-nav.open .profile-pill {
  border-color: rgba(217, 173, 79, 0.45);
  background: #172233;
}

.profile-pill-avatar,
.profile-menu-avatar {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #101622;
  font-weight: 950;
}

.profile-pill-avatar {
  width: 36px;
  height: 36px;
}

.profile-pill-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.profile-pill-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.profile-pill-meter {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #3b4759;
}

.profile-pill-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-2);
}

.profile-caret {
  color: var(--muted);
  font-weight: 900;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: 282px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1b2636;
  box-shadow: var(--shadow);
}

.profile-menu-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-menu-avatar {
  width: 44px;
  height: 44px;
}

.profile-menu-head strong,
.profile-menu-head span {
  display: block;
}

.profile-menu-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.profile-menu-item {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid rgba(52, 66, 85, 0.6);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 900;
}

.profile-menu-item:hover,
.profile-menu-item.active {
  background: #334052;
  color: var(--ink);
}

.profile-template-switch {
  display: grid;
  gap: 9px;
  padding: 12px 14px 14px;
  border-bottom: 1px solid rgba(52, 66, 85, 0.6);
}

.profile-template-switch > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.template-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-choice {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #263244;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.template-choice:hover,
.template-choice.active {
  border-color: var(--gold);
  background: rgba(217, 173, 79, 0.16);
  color: var(--ink);
}

.main-panel {
  min-width: 0;
  max-width: 100%;
  padding: 28px;
}

.topbar,
.content {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

.page-kicker {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  max-width: 100%;
}

.grid {
  display: grid;
  gap: 14px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tracker-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-main {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  align-items: start;
  margin-top: 16px;
}

.dashboard-stack {
  display: grid;
  gap: 14px;
}

.dashboard-section {
  padding: 0;
  overflow: hidden;
}

.dashboard-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 16px 18px;
  border-bottom: 1px solid transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  list-style: none;
}

.dashboard-section summary::-webkit-details-marker {
  display: none;
}

.dashboard-section[open] summary {
  border-bottom-color: var(--line);
}

.dashboard-section summary::after {
  color: var(--cyan);
  content: "+";
  font-size: 18px;
}

.dashboard-section[open] summary::after {
  content: "-";
}

.dashboard-section summary > * {
  min-width: 0;
}

.dashboard-section .book-list,
.dashboard-section .weak-list,
.dashboard-section .review-list,
.dashboard-section .source-list {
  padding: 14px 18px 18px;
}

.tracker-bottom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  margin-top: 16px;
}

.practice-layout,
.browse-layout {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel,
.stat-card,
.question-card,
.table-wrap,
.empty-state,
.quick-card,
.memory-card,
.memory-progress-card,
.memory-reference,
.memory-finish {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 18px;
}

.stat-card {
  min-height: 112px;
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 17px;
}

.panel-title small {
  color: var(--muted);
}

.form-grid,
.book-list,
.weak-list,
.review-list,
.source-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #344154;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.button:focus,
.nav-button:focus,
.profile-pill:focus,
.profile-menu-item:focus,
.choice:focus,
.jeopardy-tile:focus,
.match-slot:focus,
.test-sequence-slot:focus,
.bible-verse:focus,
.bible-ref-chip:focus,
.verse-ref:focus,
.quick-card:focus,
.select-card:focus,
.word-chip:focus,
.blank-slot:focus,
.phrase-pill:focus {
  outline: 3px solid rgba(78, 140, 255, 0.26);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #334052;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  border-color: #637188;
  background: #3b495e;
}

.button.gold {
  border-color: var(--gold);
  background: var(--gold);
  color: #101622;
}

.button.gold:hover {
  border-color: var(--gold-2);
  background: var(--gold-2);
}

.button.blue {
  border-color: #315fae;
  background: #17376d;
  color: #dce9ff;
}

.button.danger {
  border-color: #b72e37;
  background: #dc2626;
  color: #fff7f7;
}

.button.small {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #2b3849;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.badge.green {
  border-color: rgba(36, 199, 115, 0.45);
  background: rgba(36, 199, 115, 0.11);
  color: #67e8a4;
}

.badge.blue {
  border-color: rgba(78, 140, 255, 0.45);
  background: rgba(78, 140, 255, 0.14);
  color: #8bb6ff;
}

.badge.amber {
  border-color: rgba(217, 173, 79, 0.5);
  background: rgba(217, 173, 79, 0.12);
  color: #f2cb75;
}

.badge.red {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #ff9b9b;
}

.question-card {
  min-height: 560px;
  padding: 24px;
}

.question-topline,
.meta-row,
.split-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.question-topline,
.split-row {
  justify-content: space-between;
}

.question-topline {
  margin-bottom: 18px;
}

.question-reference {
  margin: 0 0 10px;
  color: #8bb6ff;
  font-size: 13px;
  font-weight: 900;
}

.question-text {
  max-width: 900px;
  margin: 0 0 20px;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: 0;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.choice {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
  color: var(--ink);
  text-align: left;
}

.choice:hover,
.choice.selected {
  border-color: var(--blue);
  background: #203b66;
}

.choice.correct {
  border-color: var(--green);
  background: #0f4931;
}

.choice.missed {
  border-color: #c8860a;
  background: #3b2500;
}

.choice.wrong {
  border-color: var(--red);
  background: #55202a;
}

.choice-label {
  display: grid;
  width: 52px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #273445;
  color: var(--muted);
  font-weight: 900;
}

.choice-text {
  overflow-wrap: anywhere;
}

.answer-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
}

.answer-box.correct {
  border-color: var(--green);
  background: #0f4931;
}

.answer-box.wrong {
  border-color: var(--red);
  background: #55202a;
}

.answer-title {
  margin: 0 0 6px;
  font-weight: 900;
}

.answer-text,
.answer-box p {
  margin: 0;
  color: #d5deeb;
  line-height: 1.5;
}

.verse-ref {
  display: inline;
  border-bottom: 1px dotted rgba(56, 189, 248, 0.7);
  color: #9ed8ff;
  font-weight: 900;
  text-decoration: none;
  cursor: help;
}

.verse-ref:hover {
  color: #d9efff;
}

.verse-tooltip {
  position: fixed;
  z-index: 80;
  display: none;
  width: min(420px, calc(100vw - 28px));
  padding: 12px 13px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 8px;
  background: #081224;
  color: var(--ink);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.48);
  pointer-events: none;
}

.verse-tooltip.visible {
  display: block;
}

.verse-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
}

.verse-tooltip p {
  margin: 0;
  color: #d5deeb;
  font-size: 13px;
  line-height: 1.45;
}

.tooltip-verse-number {
  color: var(--cyan);
  font-weight: 950;
}

.bible-page {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.bible-tools {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 14px;
}

.bible-tool-actions,
.bible-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bible-source-note {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bible-focus-note {
  padding: 9px 10px;
  border: 1px solid rgba(225, 184, 79, 0.34);
  border-radius: 8px;
  background: rgba(225, 184, 79, 0.1);
  color: #ffe3a3;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.bible-ref-tray {
  display: grid;
  gap: 9px;
}

.bible-ref-chip {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  color: #a9dcff;
  font-size: 12px;
  font-weight: 900;
}

.bible-ref-chip:hover {
  border-color: rgba(56, 189, 248, 0.72);
  background: rgba(56, 189, 248, 0.18);
}

.bible-ref-chip.active {
  border-color: rgba(225, 184, 79, 0.72);
  background: rgba(225, 184, 79, 0.18);
  color: #ffe3a3;
  box-shadow: 0 0 0 1px rgba(225, 184, 79, 0.2);
}

.bible-ref-chip.missing {
  border-color: rgba(149, 167, 197, 0.24);
  background: rgba(149, 167, 197, 0.08);
  color: var(--muted);
}

.bible-reader-panel {
  min-height: 620px;
}

.bible-reader-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bible-reader-head h2,
.bible-reader-head p {
  margin: 0;
}

.bible-reader-head h2 {
  font-size: 24px;
}

.bible-reader-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.bible-reader {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.bible-reader.focused {
  gap: 10px;
}

.bible-verse {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.bible-verse:hover,
.bible-verse.selected {
  border-color: rgba(56, 189, 248, 0.44);
  background: rgba(56, 189, 248, 0.09);
}

.bible-verse.highlighted {
  border-color: rgba(255, 202, 88, 0.95);
  background: linear-gradient(90deg, rgba(225, 184, 79, 0.28), rgba(225, 184, 79, 0.12));
  box-shadow: inset 4px 0 0 #ffc94d, 0 0 0 1px rgba(255, 202, 88, 0.18);
}

.bible-verse.highlighted .bible-verse-number {
  background: #ffc94d;
  color: #211507;
}

.bible-reader.focused .bible-verse.selected,
.bible-reader.focused .bible-verse.highlighted {
  border-color: rgba(255, 202, 88, 0.98);
  background: linear-gradient(90deg, rgba(225, 184, 79, 0.26), rgba(56, 189, 248, 0.1));
}

.bible-verse-number {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #243044;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 950;
}

.bible-verse-text {
  color: #e4ecf8;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.bible-verse mark {
  border-radius: 4px;
  background: rgba(255, 194, 56, 0.35);
  color: #fff8d6;
}

.matching-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.matching-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.matching-list li,
.source-row,
.weak-row,
.review-row,
.book-row,
.activity-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
}

.matching-list li {
  padding: 10px;
  overflow-wrap: anywhere;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #3b4759;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.progress-fill.purple {
  background: var(--purple);
}

.progress-fill.red-fill {
  background: var(--red);
}

.book-row,
.weak-row,
.review-row,
.source-row,
.activity-row {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-title {
  font-weight: 900;
}

.row-note {
  color: var(--muted);
  font-size: 13px;
}

.profile-page {
  display: grid;
  gap: 22px;
  width: min(1400px, 100%);
  margin: 0 auto;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.36fr);
  gap: 26px;
  padding: 30px;
  border-color: rgba(56, 189, 248, 0.28);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(18, 31, 52, 0.88), rgba(10, 18, 33, 0.92));
}

.profile-hero-main {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.profile-avatar-large {
  display: grid;
  width: 124px;
  height: 124px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffc238, #22d3ee);
  color: #101622;
  font-size: 42px;
  font-weight: 950;
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.18);
}

.profile-identity {
  min-width: 0;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-identity h2 {
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
}

.profile-identity p,
.profile-next-card p,
.profile-rank-row p,
.profile-insight-card p {
  color: var(--muted);
}

.profile-level-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  font-weight: 900;
}

.profile-level-row span {
  color: var(--cyan);
}

.profile-level-track {
  margin-top: 10px;
}

.gold-fill {
  background: linear-gradient(90deg, var(--gold-2), var(--cyan));
}

.profile-next-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 14, 28, 0.72);
}

.profile-next-card h3,
.profile-rank-row h3 {
  margin: 0;
  font-size: 24px;
}

.profile-next-card p,
.profile-rank-row p {
  margin: 0;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.profile-stat.gold .stat-value {
  color: var(--gold-2);
}

.profile-stat.green .stat-value,
.profile-insight-row strong,
.profile-insight-card .positive {
  color: #25e59a;
}

.profile-stat.blue .stat-value {
  color: var(--cyan);
}

.profile-stat.orange .stat-value,
.profile-chapter-card.needs-work strong,
.profile-insight-card .negative {
  color: #ff9a2f;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
  gap: 22px;
  align-items: start;
}

.profile-main-stack,
.profile-side-stack {
  display: grid;
  gap: 22px;
}

.profile-mastery-panel {
  padding: 26px;
}

.profile-mastery-panel .panel-title h2,
.profile-activity-panel .panel-title h2 {
  margin-top: 12px;
  font-size: 30px;
}

.profile-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.profile-chapter-card {
  display: grid;
  gap: 9px;
  min-height: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 14, 28, 0.72);
  text-align: center;
}

.profile-chapter-card span,
.profile-chapter-card small {
  color: #7fa2d2;
}

.profile-chapter-card strong {
  color: var(--cyan);
  font-size: 22px;
}

.profile-chapter-card.great strong {
  color: #25e59a;
}

.profile-chapter-card.quiet strong {
  color: var(--muted);
}

.profile-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.profile-insight-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 14, 28, 0.72);
}

.profile-insight-card > strong {
  font-size: 34px;
}

.profile-insight-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.profile-rank-card,
.profile-side-stack .panel {
  background:
    linear-gradient(180deg, rgba(18, 31, 52, 0.86), rgba(9, 16, 30, 0.92));
}

.profile-rank-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.profile-rank-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #22d3ee);
  color: #101622;
  font-size: 22px;
  font-weight: 950;
}

.profile-streak-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.profile-streak-row span {
  display: grid;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #263244;
  color: #7fa2d2;
  font-size: 12px;
  font-weight: 900;
}

.profile-streak-row span.active {
  border-color: var(--gold);
  background: rgba(217, 173, 79, 0.16);
  color: var(--gold-2);
}

.profile-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-badge-list span {
  padding: 7px 9px;
  border: 1px solid rgba(217, 173, 79, 0.45);
  border-radius: 999px;
  background: rgba(217, 173, 79, 0.12);
  color: #ffd66d;
  font-size: 12px;
  font-weight: 900;
}

.profile-action-stack {
  display: grid;
  gap: 12px;
}

.profile-action-stack .button {
  width: 100%;
}

.profile-activity-panel {
  padding: 26px;
}

.profile-game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 14, 28, 0.78);
}

.profile-game-row div {
  display: grid;
  gap: 5px;
}

.profile-game-row span {
  color: #9bc2f4;
  font-size: 13px;
}

.profile-game-row > strong {
  color: #25e59a;
  white-space: nowrap;
}

.quick-page,
.jeopardy-page,
.real-test-page,
.recall-page,
.memory-page,
.drill-page {
  display: grid;
  gap: 26px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.jeopardy-page,
.real-test-page,
.drill-page {
  width: min(1120px, 100%);
}

.jeopardy-toolbar,
.real-test-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
}

.recall-hero,
.recall-controls {
  display: grid;
  gap: 16px;
  align-items: center;
}

.recall-hero {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recall-hero h2,
.recall-hero p {
  margin: 0;
}

.recall-hero h2 {
  margin-top: 8px;
  font-size: 26px;
}

.recall-hero p {
  margin-top: 5px;
  color: var(--muted);
}

.recall-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.recall-controls {
  grid-template-columns: repeat(2, minmax(160px, 1fr)) repeat(3, minmax(110px, 0.6fr));
}

.recall-control-summary {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.recall-control-summary strong {
  font-size: 22px;
}

.recall-control-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.recall-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}

.recall-main-stack,
.recall-side-stack,
.recall-category-stack,
.recall-check-list,
.recall-prompt-list,
.recall-history-list,
.recall-missed-list {
  display: grid;
  gap: 12px;
}

.recall-textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(7, 13, 28, 0.9);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
}

.recall-textarea:focus,
.recall-prompt-row input:focus,
.recall-status input:focus + span {
  outline: 3px solid rgba(78, 140, 255, 0.26);
  outline-offset: 2px;
}

.recall-category {
  display: grid;
  gap: 8px;
}

.recall-category h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.recall-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.recall-check-row.status-remembered {
  border-color: rgba(36, 199, 115, 0.55);
  background: rgba(36, 199, 115, 0.09);
}

.recall-check-row.status-partial {
  border-color: rgba(225, 184, 79, 0.62);
  background: rgba(225, 184, 79, 0.1);
}

.recall-check-row.status-missed {
  border-color: rgba(239, 68, 68, 0.56);
  background: rgba(239, 68, 68, 0.1);
}

.recall-check-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recall-check-copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.recall-ref {
  color: #f87171;
  font-size: 12px;
  font-weight: 900;
}

.recall-check-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.recall-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.recall-status input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.recall-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.recall-status.remembered.selected span {
  border-color: rgba(36, 199, 115, 0.68);
  background: rgba(36, 199, 115, 0.16);
  color: #7dffbc;
}

.recall-status.partial.selected span {
  border-color: rgba(225, 184, 79, 0.72);
  background: rgba(225, 184, 79, 0.18);
  color: #ffe08a;
}

.recall-status.missed.selected span {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.17);
  color: #ffb3b3;
}

.recall-prompt-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.recall-prompt-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--cyan);
  font-weight: 900;
}

.recall-prompt-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recall-prompt-copy strong {
  line-height: 1.35;
}

.recall-prompt-copy small {
  color: #f87171;
  font-weight: 900;
}

.recall-prompt-row input {
  grid-column: 2;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #344154;
  color: var(--ink);
}

.recall-history-row,
.recall-missed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.recall-history-row div {
  display: grid;
  gap: 2px;
}

.recall-history-row span,
.recall-history-row small,
.recall-missed-row span {
  color: var(--muted);
  font-size: 12px;
}

.recall-missed-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recall-missed-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.recall-missed-row strong {
  flex: 0 0 auto;
  color: var(--red);
}

.recall-final-week-panel {
  border-color: rgba(225, 184, 79, 0.4);
}

.recall-target-groups {
  display: grid;
  gap: 12px;
}

.recall-target-group {
  display: grid;
  gap: 7px;
}

.recall-target-group h3,
.recall-final-missed > strong {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.recall-target-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.recall-target-chip {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-align: left;
}

.recall-target-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recall-target-chip strong {
  color: var(--ink);
  font-size: 16px;
}

.recall-target-chip.active {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(56, 189, 248, 0.14);
}

.recall-target-chip.strong {
  border-color: rgba(36, 199, 115, 0.56);
}

.recall-target-chip.medium {
  border-color: rgba(225, 184, 79, 0.6);
}

.recall-target-chip.weak {
  border-color: rgba(239, 68, 68, 0.58);
}

.recall-final-missed {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.recall-dashboard-block {
  display: grid;
  gap: 14px;
  padding: 14px 18px 18px;
}

.recall-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recall-dashboard-metrics > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.recall-dashboard-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.recall-dashboard-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.recall-heatmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.recall-heat-cell {
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  text-align: left;
}

.recall-heat-cell span {
  color: var(--muted);
  font-size: 12px;
}

.recall-heat-cell strong {
  font-size: 18px;
}

.recall-heat-cell.strong {
  border-color: rgba(36, 199, 115, 0.6);
  background: rgba(36, 199, 115, 0.13);
}

.recall-heat-cell.medium {
  border-color: rgba(225, 184, 79, 0.62);
  background: rgba(225, 184, 79, 0.12);
}

.recall-heat-cell.weak {
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(239, 68, 68, 0.11);
}

/* ── Nationals Confidence Bar ──────────────────────────────── */
.ncb-wrap {
  margin: 0 0 4px;
  padding: 14px 20px 10px;
  background: linear-gradient(135deg, rgba(30,50,120,0.55) 0%, rgba(20,35,90,0.65) 100%);
  border: 1px solid rgba(100,140,255,0.25);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ncb-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ncb-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ncb-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffd166;
  letter-spacing: 0.3px;
}

.ncb-pool {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}

.ncb-overall-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.ncb-overall-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ncb-overall-pct {
  font-size: 1.9rem;
  font-weight: 900;
  color: #51cf66;
  line-height: 1;
}

.ncb-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ncb-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
}

.ncb-stat-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
}

.ncb-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4dabf7, #74c0fc);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.ncb-stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ncb-stat-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: #74c0fc;
}

.ncb-disclaimer {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  font-style: italic;
}

.focus-set-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr) minmax(180px, 0.65fr);
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
}

.focus-set-panel h2,
.focus-set-panel p {
  margin: 0;
}

.focus-set-panel h2 {
  margin-top: 8px;
}

.focus-set-panel p {
  margin-top: 5px;
  color: var(--muted);
}

.focus-set-mini-grid,
.focus-set-traps {
  display: grid;
  gap: 6px;
}

.focus-set-mini-grid span,
.focus-set-traps span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

/* ── Intelligence panel ──────────────────────────────────────────────────── */

.focus-set-intel-panel {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.focus-intel-header {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: start;
}

.focus-intel-title {
  margin: 6px 0 4px;
  font-size: 1.1rem;
}

.focus-intel-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.focus-intel-tiers {
  margin: 6px 0 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.focus-intel-tiers strong {
  color: var(--muted);
  margin-right: 4px;
}

.tier-a-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(246, 173, 85, 0.15);
  border: 1px solid rgba(246, 173, 85, 0.35);
  color: #f6ad55;
  font-size: 11px;
  font-weight: 600;
}

.focus-intel-trap-col {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.focus-intel-trap-label {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.intel-trap-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.intel-trap-count {
  font-weight: 600;
  color: var(--ink);
}

.intel-chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.intel-chapter-row {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intel-chapter-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.intel-chapter-name {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  color: var(--ink);
}

.intel-tier-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.intel-chapter-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  min-width: 32px;
  text-align: right;
}

.intel-prob-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}

.intel-prob-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.intel-chapter-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.intel-trap-hint {
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.focus-question-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  margin-left: 2px;
}

.focus-label-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.12);
  border: 1px solid rgba(99, 179, 237, 0.28);
  color: #90cdf4;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.focus-set-mini-grid strong {
  color: var(--ink);
}

.jeopardy-toolbar h2,
.jeopardy-toolbar p,
.real-test-toolbar h2,
.real-test-toolbar p {
  margin: 0;
}

.jeopardy-toolbar p,
.real-test-toolbar p {
  margin-top: 5px;
  color: var(--muted);
}

.jeopardy-score {
  display: grid;
  min-width: 132px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 173, 79, 0.45);
  border-radius: 8px;
  background: rgba(217, 173, 79, 0.12);
  text-align: center;
}

.jeopardy-score span {
  color: #f2cb75;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.jeopardy-score strong {
  margin-top: 4px;
  font-size: 30px;
}

.jeopardy-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #080d17;
  box-shadow: var(--shadow);
}

.jeopardy-column {
  display: grid;
  grid-template-rows: 78px repeat(5, 92px);
  gap: 8px;
  min-width: 0;
}

.jeopardy-category,
.jeopardy-tile {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid #244f99;
  border-radius: 8px;
  background: #123a7a;
  color: var(--ink);
  text-align: center;
}

.jeopardy-category {
  padding: 10px;
  background: #102d5f;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.jeopardy-tile {
  width: 100%;
  min-height: 92px;
  padding: 8px;
  color: #ffd66d;
  font-size: 30px;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.26);
}

.jeopardy-tile:hover:not(:disabled),
.jeopardy-tile.active {
  border-color: var(--gold);
  background: #174a9a;
}

.jeopardy-tile.completed {
  border-color: #23344d;
  background: #172233;
  color: #778399;
  text-shadow: none;
}

.jeopardy-tile.empty {
  color: var(--muted);
  font-size: 13px;
  text-shadow: none;
}

.jeopardy-question {
  min-height: auto;
}

.jeopardy-complete {
  min-height: 180px;
}

.real-test-sheet,
.test-question-list {
  display: grid;
  gap: 16px;
}

.test-section {
  padding: 22px;
}

.test-question {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
}

.test-question p {
  margin: 0;
  line-height: 1.5;
}

.test-question-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.choice-grid.compact {
  margin: 4px 0;
}

.test-matching {
  margin: 0;
}

.test-match-board,
.test-match-slots,
.test-sequence-slots {
  display: grid;
  gap: 10px;
}

.test-match-board {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: start;
}

.match-slot,
.test-sequence-slot {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px dashed #65a3ff;
  border-radius: 8px;
  background: #1d2a3d;
  color: var(--ink);
  text-align: left;
}

.match-slot {
  grid-template-columns: 38px minmax(0, 1fr) minmax(160px, 0.9fr);
}

.test-sequence-slot {
  grid-template-columns: 42px minmax(0, 1fr);
}

.match-slot.filled,
.test-sequence-slot.filled {
  border-style: solid;
  border-color: #2563eb;
  background: #20324f;
}

.match-slot.correct {
  border-color: var(--green);
  background: #0f4931;
}

.match-slot.wrong {
  border-color: var(--red);
  background: #55202a;
}

.match-left-label {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(78, 140, 255, 0.22);
  color: #a9c7ff;
  font-weight: 900;
}

.match-left-text,
.match-selected {
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-selected {
  color: #f2cb75;
  font-weight: 900;
}

.real-test-page.paper-mode {
  width: min(1180px, 100%);
}

.paper-test-sheet {
  display: block;
  width: min(8.5in, 100%);
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.45in;
  border: 1px solid #c7c2b8;
  border-radius: 2px;
  background: #fffef9;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.28;
}

.paper-test-header {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.85fr;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid #111;
}

.paper-test-header h1,
.paper-test-header p,
.paper-test-header span,
.paper-section-heading h2,
.paper-section-heading p {
  margin: 0;
}

.paper-test-brand h1 {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.paper-test-brand p {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
}

.paper-test-meta,
.paper-test-student {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}

.paper-test-section {
  padding: 0;
  margin: 0 0 14px;
}

.paper-section-heading {
  padding: 4px 0;
  margin-bottom: 6px;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
}

.paper-section-heading h2 {
  color: #111;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0;
}

.paper-section-heading p {
  margin-top: 2px;
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.paper-test-sheet .test-question-list {
  display: grid;
  gap: 5px;
}

.paper-test-sheet .test-question {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #111;
  break-inside: avoid;
}

.paper-test-sheet .test-question p,
.paper-test-sheet .answer-box p {
  color: #111;
}

.paper-question-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 118px;
  align-items: start;
  gap: 8px;
}

.paper-question-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: start;
  gap: 10px;
}

.paper-question-copy,
.paper-question-text {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px;
}

.paper-question-text {
  margin: 0 0 3px;
}

.paper-question-number {
  color: #111;
  font-weight: 950;
}

.paper-reference {
  color: #9d251d;
  font-size: 10.5px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}

.paper-test-sheet .verse-ref {
  border-bottom: 1px dotted #777;
  color: inherit;
}

.paper-answer-controls,
.paper-tf-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.paper-tf-button {
  display: grid;
  width: 30px;
  height: 24px;
  place-items: center;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font: inherit;
  font-weight: 950;
}

.paper-tf-button:hover,
.paper-tf-button.selected {
  background: #111;
  color: #fff;
}

.paper-tf-button.correct,
.paper-choice.correct .paper-choice-bubble,
.paper-match-row.correct,
.paper-verse-row.correct {
  border-color: #08723a;
  background: #e8f7ee;
  color: #063f21;
}

.paper-tf-button.missed,
.paper-choice.missed .paper-choice-bubble {
  border-color: #9c6500;
  background: #fff4d8;
  color: #4a3200;
}

.paper-tf-button.wrong,
.paper-choice.wrong .paper-choice-bubble,
.paper-match-row.wrong,
.paper-verse-row.wrong {
  border-color: #9c1d1d;
  background: #fdecec;
  color: #611111;
}

.paper-choice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 3px 0 0 28px;
}

.paper-choice {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  min-height: 25px;
  padding: 1px 3px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #111;
}

.paper-choice:hover,
.paper-choice.selected {
  background: #f1f1f1;
}

.paper-choice-bubble {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 950;
}

.paper-choice.selected .paper-choice-bubble {
  background: #111;
  color: #fff;
}

.paper-choice-text {
  color: #111;
  overflow-wrap: anywhere;
}

.paper-match-board {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.85fr);
  gap: 14px;
  margin-top: 4px;
}

.paper-match-left,
.paper-verse-slots {
  gap: 3px;
}

.paper-test-sheet .match-slot,
.paper-test-sheet .test-sequence-slot {
  min-height: 28px;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
}

.paper-test-sheet .match-slot:hover,
.paper-test-sheet .test-sequence-slot:hover {
  background: #f3f3f3;
}

.paper-test-sheet .match-slot.filled,
.paper-test-sheet .test-sequence-slot.filled {
  border: 0;
  background: transparent;
}

.paper-test-sheet .paper-match-row.correct,
.paper-test-sheet .paper-verse-row.correct {
  background: #e8f7ee;
  color: #063f21;
}

.paper-test-sheet .paper-match-row.wrong,
.paper-test-sheet .paper-verse-row.wrong {
  background: #fdecec;
  color: #611111;
}

.paper-match-row,
.paper-verse-row {
  grid-template-columns: 24px 34px minmax(0, 1fr);
}

.paper-match-index,
.paper-verse-row .phrase-order {
  display: block;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-weight: 950;
}

.paper-answer-blank {
  display: grid;
  min-width: 30px;
  min-height: 20px;
  place-items: center;
  border-bottom: 1px solid #111;
  color: #111;
  font-weight: 950;
}

.paper-test-sheet .match-left-text,
.paper-test-sheet .match-selected,
.paper-test-sheet .phrase-text {
  min-width: 0;
  color: #111;
  overflow-wrap: anywhere;
}

.paper-match-options,
.paper-verse-bank {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
}

.paper-bank-title {
  color: #111;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.paper-bank {
  display: grid;
  gap: 3px;
}

.paper-bank .word-chip {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 1px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.paper-bank .word-chip:hover {
  background: #f3f3f3;
}

.paper-bank .word-chip.used {
  opacity: 0.48;
  text-decoration: line-through;
}

.paper-bank-label {
  font-weight: 950;
}

.paper-test-sheet .answer-box {
  margin: 8px 0 0 28px;
  padding: 8px 10px;
  border-color: #b7b7b7;
  border-radius: 2px;
  background: #f8f8f8;
  color: #111;
}

.paper-test-sheet .answer-box.correct {
  border-color: #08723a;
  background: #eef9f2;
}

.paper-test-sheet .answer-box.wrong {
  border-color: #9c1d1d;
  background: #fff0f0;
}

.answer-correct-text span,
.matching-feedback-correct {
  color: #08723a;
  font-weight: 950;
}

.answer-selected-text {
  opacity: 0.78;
  font-size: 0.85em;
}

.answer-selected-text span,
.matching-feedback-selected {
  font-weight: 850;
}

.matching-feedback {
  display: grid;
  gap: 3px;
}

.matching-feedback-summary,
.matching-feedback-key {
  font-size: 0.9em;
}

.test-option-bank {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131d2c;
}

.match-option {
  white-space: normal;
  overflow-wrap: anywhere;
}

.match-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.match-answer-row select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #344154;
  color: var(--ink);
}

.verse-answer-grid {
  display: grid;
  gap: 10px;
}

.quick-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.quick-card {
  position: relative;
  display: grid;
  gap: 20px;
  min-height: 220px;
  padding: 24px;
  color: var(--ink);
  text-align: left;
}

.quick-card strong {
  align-self: end;
  font-size: 20px;
}

.quick-card span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.quick-card:hover {
  border-color: var(--gold);
  background: #243044;
}

.quick-card-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: rgba(78, 140, 255, 0.16);
  color: #7eabff;
  font-weight: 900;
}

.quick-card-time {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 5px 8px;
  border: 1px solid rgba(36, 199, 115, 0.4);
  border-radius: 999px;
  color: #67e8a4;
  font-size: 12px;
  font-weight: 900;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

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

.quick-custom {
  padding: 26px;
}

.quick-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.quick-actions {
  margin-top: 18px;
}

.quick-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.quick-totals span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-totals strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.memory-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.memory-hero h2 {
  margin: 0;
  font-size: 40px;
  letter-spacing: 0;
}

.memory-hero p {
  margin: 0;
  color: var(--muted);
}

.memory-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--purple);
  font-weight: 900;
}

.memory-setup {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.memory-setup h2 {
  margin: 0;
}

.age-grid,
.mode-grid {
  display: grid;
  gap: 12px;
}

.age-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.select-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #2b3647;
  color: var(--ink);
  text-align: left;
}

.select-card span {
  color: var(--muted);
}

.select-card:hover,
.select-card.active {
  border-color: #c084fc;
  background: #4b2d78;
}

.memory-start {
  width: 100%;
  min-height: 64px;
  font-size: 18px;
}

.memory-progress-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.memory-reference {
  padding: 24px;
  border-color: rgba(155, 53, 232, 0.6);
  background: var(--purple);
  text-align: center;
}

.memory-reference h2,
.memory-reference p {
  margin: 0;
}

.memory-reference h2 {
  font-size: 28px;
}

.memory-reference p {
  margin-top: 8px;
  color: #f0ddff;
}

.memory-card {
  padding: 28px;
}

.verse-line {
  font-size: 23px;
  line-height: 2.25;
}

.blank-slot,
.word-chip,
.phrase-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 126px;
  margin: 4px;
  padding: 8px 16px;
  border: 1px dashed #65a3ff;
  border-radius: 8px;
  background: #253650;
  color: var(--ink);
  font-weight: 900;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(247, 248, 251, 0.18);
  border-radius: 8px;
  background: rgba(16, 22, 34, 0.22);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.icon-button:hover:not(:disabled) {
  border-color: rgba(217, 173, 79, 0.75);
  background: rgba(217, 173, 79, 0.18);
}

.blank-slot.filled,
.phrase-pill {
  border-style: solid;
  border-color: #2563eb;
  background: #2563eb;
}

.blank-slot.correct,
.phrase-pill.correct {
  border-color: var(--green);
  background: #16a34a;
}

.blank-slot.wrong,
.phrase-pill.wrong {
  border-color: var(--red);
  background: #dc2626;
}

.word-bank-card {
  display: grid;
  gap: 14px;
}

.word-bank-card h3 {
  margin: 0;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.word-chip {
  min-width: auto;
  border: 1px solid rgba(217, 173, 79, 0.75);
  background: var(--gold);
  color: #101622;
}

.word-chip.used {
  opacity: 0.45;
}

.phrase-chip {
  max-width: 100%;
  white-space: normal;
}

.phrase-slots {
  display: grid;
  gap: 10px;
  min-height: 84px;
}

.phrase-slot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px dashed #65a3ff;
  border-radius: 8px;
  background: #182235;
}

.phrase-slot.filled {
  border-style: solid;
  border-color: #2563eb;
  background: #20324f;
}

.phrase-slot.correct {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.3);
}

.phrase-slot.wrong {
  border-color: var(--red);
  background: rgba(220, 38, 38, 0.3);
}

.phrase-order {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: rgba(78, 140, 255, 0.22);
  color: #a9c7ff;
  font-weight: 900;
}

.phrase-text {
  min-width: 0;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.4;
}

.phrase-placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.phrase-controls {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.memory-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.memory-stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  text-align: center;
}

.memory-stat strong,
.memory-stat span {
  display: block;
}

.memory-stat strong {
  font-size: 34px;
}

.memory-stat.green {
  border-color: rgba(36, 199, 115, 0.55);
  color: #4ade80;
}

.memory-stat.red {
  border-color: rgba(239, 68, 68, 0.55);
  color: #ff8080;
}

.memory-stat.blue {
  border-color: rgba(78, 140, 255, 0.55);
  color: #70a5ff;
}

.memory-finish {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 52px;
  border-color: rgba(155, 53, 232, 0.75);
  background: var(--purple);
  text-align: center;
}

.memory-finish h2,
.memory-finish p {
  margin: 0;
}

.memory-finish h2 {
  font-size: 38px;
}

.tracker-page {
  display: grid;
  gap: 16px;
}

.verse-game-page {
  display: grid;
  gap: 16px;
}

.drill-question {
  min-height: auto;
}

.drill-match-board {
  margin-top: 10px;
}

.drill-bottom-actions {
  padding: 14px;
}

.tracker-summary-panel {
  margin-top: 16px;
}

.tracker-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.session-complete-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.session-complete-stats > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
}

.session-complete-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.session-complete-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.compact-meter {
  display: grid;
  min-width: 180px;
  gap: 7px;
}

.compact-meter span {
  font-weight: 900;
}

.final-score {
  text-align: center;
}

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

.table-title {
  padding: 16px 16px 0;
}

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

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #172233;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: 14px;
}

.truncate-cell {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 16px;
  color: var(--muted);
}

.question-footer {
  margin-top: 18px;
}

.center-actions {
  justify-content: center;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.debug-dock {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 50;
  width: min(680px, calc(100vw - 36px));
  pointer-events: none;
}

.debug-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 168px;
  margin-left: auto;
  padding: 10px 12px;
  border: 1px solid rgba(78, 140, 255, 0.65);
  border-radius: 8px;
  background: #172233;
  color: var(--ink);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.debug-tab strong {
  color: var(--gold);
}

.debug-panel {
  display: none;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #101928;
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.debug-dock.open .debug-panel {
  display: grid;
  gap: 12px;
}

.debug-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.debug-header h2,
.debug-header p {
  margin: 0;
}

.debug-header h2 {
  font-size: 16px;
}

.debug-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.debug-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.debug-list {
  display: grid;
  max-height: 260px;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.debug-event {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172233;
}

@media (max-width: 1050px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid #243044;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav-stack {
    display: flex;
    grid-template-columns: none;
  }

  .nav-button {
    justify-content: flex-start;
  }

  .profile-nav {
    justify-self: stretch;
  }

  .profile-pill {
    width: 100%;
  }

  .dashboard-grid,
  .dashboard-main,
  .profile-hero,
  .profile-layout,
  .profile-insight-grid,
  .tracker-grid,
  .tracker-bottom-grid,
  .tracker-kpis,
  .session-complete-stats,
  .practice-layout,
  .browse-layout,
  .bible-page,
  .recall-hero,
  .recall-controls,
  .recall-layout,
  .matching-grid {
    grid-template-columns: 1fr;
  }

  .bible-tools {
    position: relative;
    top: auto;
  }

  .quick-form,
  .quick-presets,
  .profile-stat-grid,
  .jeopardy-toolbar,
  .real-test-toolbar,
  .recall-dashboard-metrics,
  .memory-actions {
    grid-template-columns: 1fr;
  }

  .recall-hero-actions {
    justify-content: stretch;
  }

  .recall-hero-actions .button,
  .recall-hero-actions .badge {
    width: 100%;
  }

  .recall-check-row {
    grid-template-columns: 1fr;
  }

  .recall-check-options {
    justify-content: flex-start;
  }

  .recall-heatmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jeopardy-board {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  .main-panel {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .topbar-actions .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .profile-menu {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 28px));
  }

  .nav-stack {
    display: flex;
    grid-template-columns: none;
  }

  .nav-button {
    justify-content: flex-start;
    font-size: 14px;
  }

  .debug-dock {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .debug-header {
    display: grid;
  }

  .dashboard-grid,
  .profile-stat-grid,
  .profile-hero-main,
  .tracker-grid,
  .tracker-kpis,
  .session-complete-stats,
  .age-grid,
  .mode-grid,
  .memory-stats,
  .recall-heatmap,
  .recall-target-grid,
  .quick-totals {
    grid-template-columns: 1fr;
  }

  .page-title,
  .profile-identity h2,
  .memory-hero h2 {
    font-size: 24px;
  }

  .profile-hero,
  .profile-mastery-panel,
  .profile-activity-panel {
    padding: 16px;
  }

  .profile-avatar-large {
    width: 82px;
    height: 82px;
    font-size: 30px;
  }

  .question-card,
  .memory-card,
  .bible-reader-panel {
    min-height: auto;
    padding: 16px;
  }

  .bible-reader-head {
    display: grid;
  }

  .bible-verse {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
  }

  .question-text {
    font-size: 22px;
  }

  .verse-line {
    font-size: 20px;
    line-height: 2;
  }

  .blank-slot {
    min-width: 112px;
  }

  .phrase-slot {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .phrase-controls {
    grid-column: 2;
    justify-content: flex-start;
  }

  .button,
  .quick-actions .button,
  .memory-actions .button {
    width: 100%;
  }

  .recall-textarea {
    min-height: 260px;
  }

  .jeopardy-column {
    grid-template-rows: 70px repeat(5, 78px);
  }

  .jeopardy-tile {
    min-height: 78px;
    font-size: 24px;
  }

  .test-match-board {
    grid-template-columns: 1fr;
  }

  .match-slot {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .match-selected {
    grid-column: 2;
  }

  .match-answer-row {
    grid-template-columns: 1fr;
  }

  .paper-test-sheet {
    width: 100%;
    padding: 18px;
    font-size: 11.5px;
  }

  .focus-set-panel {
    grid-template-columns: 1fr;
  }

  .paper-test-header,
  .paper-question-line,
  .paper-question-main,
  .paper-match-board {
    grid-template-columns: 1fr;
  }

  .paper-reference {
    text-align: left;
  }

  .paper-choice-list {
    margin-left: 0;
  }

  .paper-test-sheet .match-slot,
  .paper-test-sheet .test-sequence-slot {
    grid-template-columns: 24px 34px minmax(0, 1fr);
  }
}

@media print {
  @page {
    size: letter;
    margin: 0.45in;
  }

  body {
    background: #fff;
    color: #111;
  }

  .sidebar,
  .topbar,
  .real-test-toolbar,
  .focus-set-panel,
  .ncb-wrap,
  .button,
  .topbar-actions {
    display: none !important;
  }

  .app-shell,
  .main-panel,
  .content,
  .real-test-page {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .panel,
  .test-question,
  .answer-box {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
    color: #111;
    break-inside: avoid;
  }

  .badge,
  .row-note,
  .answer-text,
  .answer-box p {
    color: #111;
  }

  .paper-test-sheet {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: #111;
    font-size: 10pt;
  }

  .paper-test-header {
    grid-template-columns: 1.05fr 0.95fr 0.85fr;
    gap: 10px;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .paper-test-brand h1 {
    font-size: 16pt;
  }

  .paper-test-section {
    margin-bottom: 10px;
  }

  .paper-section-heading {
    margin-bottom: 5px;
  }

  .paper-section-heading h2 {
    font-size: 12pt;
  }

  .paper-section-heading p,
  .paper-test-meta,
  .paper-test-student,
  .paper-reference,
  .paper-bank-title {
    font-size: 8.5pt;
  }

  .paper-test-sheet .test-question {
    background: #fff;
    color: #111;
    page-break-inside: avoid;
  }

  .paper-question-line {
    grid-template-columns: 72px minmax(0, 1fr) 108px;
  }

  .paper-question-main {
    grid-template-columns: minmax(0, 1fr) 108px;
  }

  .paper-choice,
  .paper-tf-button,
  .paper-test-sheet .match-slot,
  .paper-test-sheet .test-sequence-slot,
  .paper-bank .word-chip {
    background: #fff !important;
    color: #111 !important;
  }

  .paper-choice:hover,
  .paper-choice.selected,
  .paper-test-sheet .match-slot:hover,
  .paper-test-sheet .test-sequence-slot:hover,
  .paper-bank .word-chip:hover {
    background: #fff !important;
  }

  .paper-choice-bubble,
  .paper-tf-button,
  .paper-answer-blank,
  .paper-match-options,
  .paper-verse-bank {
    border-color: #111 !important;
  }

  .paper-bank .word-chip.used {
    opacity: 1;
    text-decoration: none;
  }
}

@media (max-width: 460px) {
  .nav-stack {
    grid-template-columns: none;
  }

  .choice {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .choice-label {
    width: 46px;
  }

  .blank-slot,
  .word-chip,
  .phrase-pill {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .phrase-slot {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .phrase-order {
    width: 100%;
  }

  .phrase-controls {
    grid-column: auto;
  }

  .phrase-controls .icon-button {
    flex: 1;
  }
}

@media screen {
  body[data-template="template2"] {
    --bg: #05030d;
    --bg-2: #09051c;
    --surface: rgba(10, 14, 32, 0.82);
    --surface-2: rgba(20, 28, 58, 0.86);
    --surface-3: #070a18;
    --line: rgba(80, 220, 255, 0.24);
    --line-strong: rgba(205, 92, 255, 0.42);
    --ink: #fbfdff;
    --muted: #92a9d6;
    --gold: #ff4fd8;
    --gold-2: #23f3ff;
    --blue: #45a3ff;
    --purple: #b24cff;
    --green: #26ffc1;
    --red: #ff4d68;
    --cyan: #23f3ff;
    --violet: #9b5cff;
    --orange: #ff9d29;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
    isolation: isolate;
    background:
      linear-gradient(135deg, rgba(5, 3, 13, 0.98) 0%, rgba(8, 9, 30, 0.96) 42%, rgba(28, 4, 46, 0.94) 100%),
      repeating-linear-gradient(90deg, rgba(35, 243, 255, 0.065) 0 1px, transparent 1px 72px),
      repeating-linear-gradient(0deg, rgba(178, 76, 255, 0.045) 0 1px, transparent 1px 72px),
      var(--bg);
  }

  body[data-template="template2"]::before {
    background-image:
      linear-gradient(90deg, transparent 0 48%, rgba(35, 243, 255, 0.16) 49%, transparent 51%),
      linear-gradient(0deg, transparent 0 48%, rgba(178, 76, 255, 0.12) 49%, transparent 51%),
      radial-gradient(circle at 18% 10%, rgba(35, 243, 255, 0.34) 0 1px, transparent 1px),
      radial-gradient(circle at 72% 30%, rgba(255, 79, 216, 0.3) 0 1px, transparent 1px),
      radial-gradient(circle at 86% 76%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px);
    background-size: 160px 160px, 160px 160px, 180px 180px, 230px 230px, 260px 260px;
    opacity: 0.58;
  }

  body[data-template="template2"]::after {
    position: fixed;
    inset: -28vh -18vw auto auto;
    z-index: -1;
    width: min(820px, 86vw);
    aspect-ratio: 1;
    border: 3px solid rgba(35, 243, 255, 0.2);
    border-radius: 50%;
    background:
      conic-gradient(from 30deg, transparent 0 12%, rgba(35, 243, 255, 0.42) 13% 17%, transparent 18% 32%, rgba(255, 79, 216, 0.42) 33% 37%, transparent 38% 100%);
    box-shadow:
      inset 0 0 0 32px rgba(178, 76, 255, 0.04),
      inset 0 0 0 78px rgba(35, 243, 255, 0.035),
      0 0 90px rgba(35, 243, 255, 0.16);
    content: "";
    opacity: 0.72;
    pointer-events: none;
  }

  body[data-template="template2"] .sidebar {
    border-bottom-color: rgba(35, 243, 255, 0.28);
    background:
      linear-gradient(90deg, rgba(3, 6, 18, 0.96), rgba(13, 9, 36, 0.94)),
      linear-gradient(180deg, rgba(35, 243, 255, 0.08), transparent);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 60px rgba(0, 0, 0, 0.34);
  }

  body[data-template="template2"] .brand-mark,
  body[data-template="template2"] .profile-pill-avatar,
  body[data-template="template2"] .profile-menu-avatar,
  body[data-template="template2"] .profile-avatar-large,
  body[data-template="template2"] .profile-rank-icon {
    border-color: rgba(35, 243, 255, 0.55);
    background:
      linear-gradient(135deg, #23f3ff 0%, #8a5cff 46%, #ff4fd8 100%);
    color: #020715;
    box-shadow: 0 0 24px rgba(35, 243, 255, 0.34), 0 0 42px rgba(255, 79, 216, 0.16);
  }

  body[data-template="template2"] .brand-title,
  body[data-template="template2"] .page-title,
  body[data-template="template2"] .profile-identity h2,
  body[data-template="template2"] .memory-hero h2 {
    color: #ffffff;
    text-shadow: 0 0 18px rgba(35, 243, 255, 0.26), 0 0 34px rgba(178, 76, 255, 0.18);
  }

  body[data-template="template2"] .brand-title::after {
    color: var(--cyan);
    content: " // T2";
    font-size: 11px;
    font-weight: 900;
  }

  body[data-template="template2"] .brand-subtitle,
  body[data-template="template2"] .page-kicker,
  body[data-template="template2"] .row-note,
  body[data-template="template2"] .stat-note {
    color: #a8bcf1;
  }

  body[data-template="template2"] .nav-stack {
    scrollbar-color: rgba(255, 79, 216, 0.68) transparent;
  }

  body[data-template="template2"] .nav-icon {
    border: 1px solid rgba(35, 243, 255, 0.18);
    background:
      linear-gradient(180deg, rgba(35, 243, 255, 0.12), rgba(178, 76, 255, 0.12)),
      #101833;
    color: var(--cyan);
    box-shadow: inset 0 0 18px rgba(35, 243, 255, 0.08);
  }

  body[data-template="template2"] .nav-button {
    color: #aeb9d7;
  }

  body[data-template="template2"] .nav-button:hover,
  body[data-template="template2"] .nav-button.active {
    border-color: rgba(35, 243, 255, 0.58);
    background:
      linear-gradient(90deg, rgba(35, 243, 255, 0.16), rgba(255, 79, 216, 0.1));
    color: #ffffff;
    box-shadow: inset 0 0 22px rgba(35, 243, 255, 0.07), 0 0 22px rgba(35, 243, 255, 0.08);
  }

  body[data-template="template2"] .profile-pill:hover,
  body[data-template="template2"] .profile-nav.open .profile-pill {
    border-color: rgba(255, 79, 216, 0.48);
    background: rgba(15, 18, 42, 0.94);
    box-shadow: 0 0 28px rgba(255, 79, 216, 0.12);
  }

  body[data-template="template2"] .profile-pill-meter,
  body[data-template="template2"] .profile-level-track,
  body[data-template="template2"] .progress-track {
    background: rgba(99, 119, 164, 0.32);
  }

  body[data-template="template2"] .profile-pill-meter span,
  body[data-template="template2"] .gold-fill {
    background: linear-gradient(90deg, #23f3ff, #ff4fd8);
    box-shadow: 0 0 14px rgba(35, 243, 255, 0.58);
  }

  body[data-template="template2"] .profile-menu,
  body[data-template="template2"] .debug-panel {
    border-color: rgba(35, 243, 255, 0.3);
    background:
      linear-gradient(180deg, rgba(18, 17, 45, 0.98), rgba(8, 10, 24, 0.98));
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.68), 0 0 38px rgba(35, 243, 255, 0.12);
  }

  body[data-template="template2"] .profile-menu-item:hover,
  body[data-template="template2"] .profile-menu-item.active,
  body[data-template="template2"] .template-choice.active,
  body[data-template="template2"] .template-choice:hover {
    border-color: rgba(35, 243, 255, 0.5);
    background: linear-gradient(90deg, rgba(35, 243, 255, 0.16), rgba(255, 79, 216, 0.12));
    color: #ffffff;
  }

  body[data-template="template2"] .panel,
  body[data-template="template2"] .stat-card,
  body[data-template="template2"] .question-card,
  body[data-template="template2"] .table-wrap,
  body[data-template="template2"] .empty-state,
  body[data-template="template2"] .quick-card,
  body[data-template="template2"] .memory-card,
  body[data-template="template2"] .memory-progress-card,
  body[data-template="template2"] .memory-reference,
  body[data-template="template2"] .memory-finish,
  body[data-template="template2"] .profile-hero,
  body[data-template="template2"] .profile-chapter-card,
  body[data-template="template2"] .profile-insight-card,
  body[data-template="template2"] .profile-game-row,
  body[data-template="template2"] .profile-next-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(35, 243, 255, 0.24);
    background:
      linear-gradient(180deg, rgba(18, 24, 52, 0.86), rgba(8, 12, 28, 0.9)),
      repeating-linear-gradient(135deg, rgba(35, 243, 255, 0.045) 0 1px, transparent 1px 18px);
    box-shadow:
      0 28px 90px rgba(0, 0, 0, 0.48),
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 0 28px rgba(35, 243, 255, 0.08);
  }

  body[data-template="template2"] .profile-hero::before,
  body[data-template="template2"] .panel::before,
  body[data-template="template2"] .quick-card::before,
  body[data-template="template2"] .memory-card::before,
  body[data-template="template2"] .question-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(35, 243, 255, 0.9), rgba(255, 79, 216, 0.8), transparent);
    content: "";
    opacity: 0.8;
    pointer-events: none;
  }

  body[data-template="template2"] .profile-hero {
    background:
      linear-gradient(110deg, rgba(35, 243, 255, 0.13), transparent 30%),
      linear-gradient(250deg, rgba(255, 79, 216, 0.16), transparent 38%),
      linear-gradient(180deg, rgba(13, 18, 42, 0.9), rgba(8, 10, 24, 0.94));
  }

  body[data-template="template2"] .profile-hero::after {
    position: absolute;
    inset: auto -80px -190px auto;
    width: 460px;
    aspect-ratio: 1;
    border: 1px solid rgba(35, 243, 255, 0.22);
    border-radius: 50%;
    background:
      conic-gradient(from 90deg, transparent 0 18%, rgba(35, 243, 255, 0.26) 20% 24%, transparent 26% 62%, rgba(255, 79, 216, 0.22) 64% 68%, transparent 70% 100%);
    content: "";
    opacity: 0.7;
    pointer-events: none;
  }

  body[data-template="template2"] .profile-hero-main,
  body[data-template="template2"] .profile-next-card > *,
  body[data-template="template2"] .panel > *,
  body[data-template="template2"] .question-card > *,
  body[data-template="template2"] .quick-card > *,
  body[data-template="template2"] .memory-card > * {
    position: relative;
    z-index: 1;
  }

  body[data-template="template2"] .stat-label,
  body[data-template="template2"] .field span,
  body[data-template="template2"] .badge,
  body[data-template="template2"] .panel-title small {
    color: #9bb7f6;
  }

  body[data-template="template2"] .stat-value,
  body[data-template="template2"] .profile-stat.blue .stat-value,
  body[data-template="template2"] .profile-chapter-card strong {
    color: #23f3ff;
    text-shadow: 0 0 16px rgba(35, 243, 255, 0.22);
  }

  body[data-template="template2"] .profile-stat.gold .stat-value {
    color: #ffde59;
  }

  body[data-template="template2"] .profile-stat.green .stat-value,
  body[data-template="template2"] .profile-insight-row strong,
  body[data-template="template2"] .profile-insight-card .positive,
  body[data-template="template2"] .profile-game-row > strong {
    color: #26ffc1;
  }

  body[data-template="template2"] .profile-stat.orange .stat-value,
  body[data-template="template2"] .profile-chapter-card.needs-work strong,
  body[data-template="template2"] .profile-insight-card .negative {
    color: #ff9d29;
  }

  body[data-template="template2"] .profile-chapter-card {
    background:
      linear-gradient(180deg, rgba(8, 12, 30, 0.88), rgba(7, 9, 22, 0.94));
  }

  body[data-template="template2"] .button,
  body[data-template="template2"] .choice,
  body[data-template="template2"] .bible-verse,
  body[data-template="template2"] .bible-ref-chip,
  body[data-template="template2"] .select-card,
  body[data-template="template2"] .word-chip,
  body[data-template="template2"] .phrase-pill,
  body[data-template="template2"] .blank-slot,
  body[data-template="template2"] .match-slot,
  body[data-template="template2"] .test-sequence-slot,
  body[data-template="template2"] .field input,
  body[data-template="template2"] .field select {
    border-color: rgba(80, 220, 255, 0.26);
    background: rgba(16, 25, 54, 0.86);
    color: #f9fbff;
  }

  body[data-template="template2"] .button:hover,
  body[data-template="template2"] .choice:hover,
  body[data-template="template2"] .bible-verse:hover,
  body[data-template="template2"] .bible-ref-chip:hover,
  body[data-template="template2"] .select-card:hover,
  body[data-template="template2"] .word-chip:hover,
  body[data-template="template2"] .phrase-pill:hover {
    border-color: rgba(35, 243, 255, 0.66);
    background: rgba(25, 38, 78, 0.9);
    box-shadow: 0 0 20px rgba(35, 243, 255, 0.1);
  }

  body[data-template="template2"] .choice.selected {
    border-color: rgba(35, 243, 255, 0.9);
    background: rgba(35, 243, 255, 0.18);
    box-shadow: 0 0 18px rgba(35, 243, 255, 0.18), inset 0 0 0 1px rgba(35, 243, 255, 0.3);
  }

  body[data-template="template2"] .choice.selected .choice-label {
    background: rgba(35, 243, 255, 0.28);
    color: #23f3ff;
  }

  body[data-template="template2"] .bible-verse.selected {
    border-color: rgba(35, 243, 255, 0.72);
    background: rgba(35, 243, 255, 0.14);
  }

  body[data-template="template2"] .bible-verse.highlighted,
  body[data-template="template2"] .bible-reader.focused .bible-verse.selected,
  body[data-template="template2"] .bible-reader.focused .bible-verse.highlighted {
    border-color: rgba(255, 217, 92, 0.96);
    background: linear-gradient(90deg, rgba(255, 217, 92, 0.26), rgba(35, 243, 255, 0.1));
    box-shadow: inset 4px 0 0 #ffd95c, 0 0 22px rgba(255, 217, 92, 0.16);
  }

  body[data-template="template2"] .bible-verse.highlighted .bible-verse-number {
    background: #ffd95c;
    color: #09101f;
  }

  body[data-template="template2"] .bible-ref-chip.active {
    border-color: rgba(255, 217, 92, 0.8);
    background: rgba(255, 217, 92, 0.18);
    color: #fff2b8;
    box-shadow: 0 0 20px rgba(255, 217, 92, 0.12);
  }

  body[data-template="template2"] .button.gold,
  body[data-template="template2"] .quick-card.primary {
    border-color: rgba(255, 79, 216, 0.72);
    background: linear-gradient(90deg, #ff4fd8, #9b5cff);
    color: #ffffff;
    box-shadow: 0 0 26px rgba(255, 79, 216, 0.2);
  }

  body[data-template="template2"] .button.gold:hover {
    border-color: rgba(35, 243, 255, 0.78);
    background: linear-gradient(90deg, #23f3ff, #9b5cff);
    color: #020715;
  }

  body[data-template="template2"] .button.blue {
    border-color: rgba(35, 243, 255, 0.42);
    background: linear-gradient(90deg, rgba(12, 70, 160, 0.9), rgba(66, 34, 142, 0.9));
    color: #eef7ff;
  }

  body[data-template="template2"] .button.danger {
    border-color: rgba(255, 77, 104, 0.72);
    background: linear-gradient(90deg, #ff315f, #b622ff);
  }

  body[data-template="template2"] .dashboard-section summary::after {
    color: #ff4fd8;
  }

  body[data-template="template2"] .progress-fill,
  body[data-template="template2"] .progress-fill.purple {
    background: linear-gradient(90deg, #23f3ff, #ff4fd8);
  }

  body[data-template="template2"] .progress-fill.red-fill {
    background: linear-gradient(90deg, #ff4d68, #ff9d29);
  }

  body[data-template="template2"] .jeopardy-category,
  body[data-template="template2"] .jeopardy-tile {
    border-color: rgba(35, 243, 255, 0.28);
    background: linear-gradient(180deg, rgba(17, 28, 67, 0.92), rgba(10, 13, 32, 0.94));
  }

  body[data-template="template2"] .jeopardy-category {
    color: #ffffff;
    text-shadow: 0 0 14px rgba(35, 243, 255, 0.22);
  }

  body[data-template="template2"] .jeopardy-tile {
    color: #23f3ff;
    text-shadow: 0 0 18px rgba(35, 243, 255, 0.28);
  }

  body[data-template="template2"] .jeopardy-tile:hover:not(:disabled),
  body[data-template="template2"] .jeopardy-tile.active {
    border-color: rgba(255, 79, 216, 0.72);
    background: linear-gradient(180deg, rgba(255, 79, 216, 0.22), rgba(25, 24, 68, 0.94));
    color: #ffffff;
  }

  body[data-template="template2"] .memory-hero {
    background:
      linear-gradient(120deg, rgba(35, 243, 255, 0.16), transparent 32%),
      linear-gradient(260deg, rgba(255, 79, 216, 0.24), transparent 42%),
      #0a1027;
  }

  body[data-template="template2"] .phrase-slot.filled,
  body[data-template="template2"] .test-sequence-slot.filled,
  body[data-template="template2"] .match-slot.filled,
  body[data-template="template2"] .blank-slot.filled {
    border-color: rgba(35, 243, 255, 0.7);
    background: linear-gradient(90deg, rgba(35, 243, 255, 0.18), rgba(255, 79, 216, 0.12));
    color: #ffffff;
  }

  body[data-template="template2"] .answer-box,
  body[data-template="template2"] .feedback,
  body[data-template="template2"] .debug-event {
    border-color: rgba(80, 220, 255, 0.22);
    background: rgba(8, 13, 32, 0.82);
  }

  body[data-template="template2"] .debug-dock > button {
    border-color: rgba(35, 243, 255, 0.5);
    background: linear-gradient(90deg, rgba(9, 18, 42, 0.96), rgba(37, 18, 68, 0.96));
    color: #ffffff;
    box-shadow: 0 0 22px rgba(35, 243, 255, 0.14);
  }
}

@media screen {
  body[data-template="template3"] {
    --bg: #030806;
    --bg-2: #06110f;
    --surface: rgba(8, 20, 18, 0.88);
    --surface-2: rgba(16, 34, 30, 0.9);
    --surface-3: #07110f;
    --line: rgba(116, 255, 211, 0.18);
    --line-strong: rgba(219, 255, 120, 0.38);
    --ink: #f6fff9;
    --muted: #9bb9ae;
    --gold: #e7ff6b;
    --gold-2: #ffb84d;
    --blue: #38f2d0;
    --purple: #7dffb8;
    --green: #79ff6b;
    --red: #ff5f6f;
    --cyan: #38f2d0;
    --violet: #80ffea;
    --orange: #ffb84d;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
    background:
      linear-gradient(115deg, rgba(2, 8, 7, 0.98), rgba(4, 20, 19, 0.98) 48%, rgba(18, 24, 8, 0.96)),
      repeating-linear-gradient(120deg, rgba(231, 255, 107, 0.045) 0 1px, transparent 1px 42px),
      repeating-linear-gradient(0deg, rgba(56, 242, 208, 0.045) 0 1px, transparent 1px 76px),
      var(--bg);
  }

  body[data-template="template3"]::before {
    background-image:
      linear-gradient(90deg, transparent 0 49%, rgba(56, 242, 208, 0.15) 50%, transparent 51%),
      linear-gradient(0deg, transparent 0 49%, rgba(231, 255, 107, 0.08) 50%, transparent 51%),
      repeating-linear-gradient(135deg, transparent 0 36px, rgba(255, 184, 77, 0.07) 37px 38px, transparent 39px 80px);
    background-size: 132px 132px, 132px 132px, 100% 100%;
    opacity: 0.58;
  }

  body[data-template="template3"]::after {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(90deg, rgba(56, 242, 208, 0.1), transparent 18%, transparent 82%, rgba(231, 255, 107, 0.08)),
      linear-gradient(180deg, rgba(231, 255, 107, 0.08), transparent 20%, transparent 78%, rgba(56, 242, 208, 0.07));
    content: "";
    pointer-events: none;
  }

  body[data-template="template3"] .app-template3 {
    display: grid;
    min-height: 100vh;
    gap: 16px;
    padding: 16px;
  }

  .t3-header {
    position: sticky;
    top: 16px;
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid rgba(116, 255, 211, 0.22);
    border-radius: 8px;
    background:
      linear-gradient(90deg, rgba(5, 18, 17, 0.96), rgba(10, 18, 10, 0.94)),
      repeating-linear-gradient(90deg, rgba(116, 255, 211, 0.06) 0 1px, transparent 1px 36px);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
  }

  .t3-brand {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 54px;
    padding: 6px;
    border: 1px solid rgba(231, 255, 107, 0.28);
    border-radius: 8px;
    background: rgba(2, 10, 9, 0.68);
    color: var(--ink);
    text-align: left;
  }

  .t3-brand:hover {
    border-color: rgba(231, 255, 107, 0.72);
    background: rgba(17, 33, 20, 0.88);
  }

  .t3-brand-mark {
    display: grid;
    width: 46px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #e7ff6b, #38f2d0 58%, #ffb84d);
    color: #07110f;
    font-weight: 950;
  }

  .t3-brand strong,
  .t3-brand small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .t3-brand strong {
    font-size: 15px;
    font-weight: 950;
  }

  .t3-brand small,
  .t3-eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .t3-header-center {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding-left: 4px;
  }

  .t3-header-center strong {
    overflow: hidden;
    color: #faffd7;
    font-size: 18px;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-template="template3"] .profile-nav {
    justify-self: end;
  }

  body[data-template="template3"] .profile-pill {
    border-color: rgba(116, 255, 211, 0.22);
    background: rgba(3, 12, 11, 0.66);
  }

  body[data-template="template3"] .profile-pill:hover,
  body[data-template="template3"] .profile-nav.open .profile-pill {
    border-color: rgba(231, 255, 107, 0.64);
    background: rgba(19, 31, 16, 0.95);
  }

  body[data-template="template3"] .profile-pill-avatar,
  body[data-template="template3"] .profile-menu-avatar,
  body[data-template="template3"] .profile-avatar-large,
  body[data-template="template3"] .profile-rank-icon {
    background: linear-gradient(135deg, #e7ff6b, #38f2d0);
    color: #06110f;
  }

  body[data-template="template3"] .profile-menu {
    border-color: rgba(116, 255, 211, 0.28);
    background: linear-gradient(180deg, rgba(7, 20, 18, 0.98), rgba(4, 12, 11, 0.98));
  }

  body[data-template="template3"] .template-choice.active,
  body[data-template="template3"] .template-choice:hover,
  body[data-template="template3"] .profile-menu-item:hover,
  body[data-template="template3"] .profile-menu-item.active {
    border-color: rgba(231, 255, 107, 0.58);
    background: linear-gradient(90deg, rgba(231, 255, 107, 0.15), rgba(56, 242, 208, 0.12));
    color: #f8ffe4;
  }

  .t3-workspace {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 292px;
    align-items: start;
    gap: 16px;
  }

  .t3-nav,
  .t3-sidecar {
    position: sticky;
    top: 94px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(231, 255, 107, 0.52) transparent;
  }

  .t3-nav {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(116, 255, 211, 0.2);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(6, 18, 16, 0.92), rgba(4, 9, 8, 0.92)),
      repeating-linear-gradient(0deg, rgba(231, 255, 107, 0.04) 0 1px, transparent 1px 28px);
  }

  .t3-nav-button {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-height: 70px;
    padding: 8px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(3, 12, 11, 0.72);
    color: #a6c8ba;
    text-align: center;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
  }

  .t3-nav-button:hover,
  .t3-nav-button.active {
    border-color: rgba(231, 255, 107, 0.72);
    background: linear-gradient(180deg, rgba(231, 255, 107, 0.16), rgba(56, 242, 208, 0.1));
    color: #f8ffe4;
    box-shadow: inset 0 0 0 1px rgba(231, 255, 107, 0.12), 0 0 24px rgba(56, 242, 208, 0.12);
  }

  .t3-nav-icon {
    display: grid;
    width: 34px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(116, 255, 211, 0.24);
    border-radius: 8px;
    background: #071715;
    color: #38f2d0;
    font-size: 12px;
    font-weight: 950;
  }

  .t3-nav-button.active .t3-nav-icon {
    border-color: rgba(231, 255, 107, 0.76);
    background: #e7ff6b;
    color: #06110f;
  }

  .t3-stage {
    min-width: 0;
  }

  .t3-command-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(116, 255, 211, 0.22);
    border-left: 5px solid #e7ff6b;
    border-radius: 8px;
    background:
      linear-gradient(115deg, rgba(9, 25, 23, 0.94), rgba(7, 13, 10, 0.92)),
      repeating-linear-gradient(90deg, rgba(56, 242, 208, 0.045) 0 1px, transparent 1px 44px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  }

  .t3-command-bar h1,
  .t3-command-bar p {
    margin: 0;
  }

  .t3-command-bar h1 {
    margin-top: 4px;
    color: #f8ffe4;
    font-size: clamp(26px, 4vw, 44px);
    line-height: 1;
  }

  .t3-command-bar p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
  }

  .t3-command-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(78px, 1fr));
    gap: 8px;
    min-width: min(360px, 100%);
  }

  .t3-command-metrics span,
  .t3-mini-grid span {
    display: grid;
    gap: 2px;
    min-height: 52px;
    padding: 8px;
    border: 1px solid rgba(116, 255, 211, 0.2);
    border-radius: 8px;
    background: rgba(3, 12, 11, 0.7);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .t3-command-metrics strong,
  .t3-mini-grid strong {
    color: #e7ff6b;
    font-size: 18px;
  }

  .t3-content {
    width: 100%;
    margin: 0;
  }

  .t3-sidecar {
    display: grid;
    gap: 12px;
  }

  .t3-side-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(116, 255, 211, 0.2);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(6, 18, 16, 0.92), rgba(3, 10, 9, 0.92)),
      repeating-linear-gradient(135deg, rgba(231, 255, 107, 0.04) 0 1px, transparent 1px 22px);
  }

  .t3-status-ring {
    display: grid;
    min-height: 118px;
    place-items: center;
    padding: 14px;
    border: 1px solid rgba(231, 255, 107, 0.34);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(231, 255, 107, 0.14), rgba(56, 242, 208, 0.08)),
      #07110f;
    text-align: center;
  }

  .t3-status-ring strong {
    color: #f6ffb5;
    font-size: 38px;
    line-height: 1;
  }

  .t3-status-ring span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .t3-mini-grid,
  .t3-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .t3-action-grid .button,
  .t3-side-panel > .button {
    width: 100%;
  }

  body[data-template="template3"] .panel,
  body[data-template="template3"] .stat-card,
  body[data-template="template3"] .question-card,
  body[data-template="template3"] .table-wrap,
  body[data-template="template3"] .empty-state,
  body[data-template="template3"] .quick-card,
  body[data-template="template3"] .memory-card,
  body[data-template="template3"] .memory-progress-card,
  body[data-template="template3"] .memory-reference,
  body[data-template="template3"] .memory-finish,
  body[data-template="template3"] .profile-hero,
  body[data-template="template3"] .profile-chapter-card,
  body[data-template="template3"] .profile-insight-card,
  body[data-template="template3"] .profile-game-row,
  body[data-template="template3"] .profile-next-card {
    border-color: rgba(116, 255, 211, 0.18);
    background:
      linear-gradient(180deg, rgba(8, 22, 20, 0.9), rgba(4, 12, 11, 0.92)),
      repeating-linear-gradient(90deg, rgba(116, 255, 211, 0.035) 0 1px, transparent 1px 28px);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  body[data-template="template3"] .button,
  body[data-template="template3"] .choice,
  body[data-template="template3"] .bible-verse,
  body[data-template="template3"] .bible-ref-chip,
  body[data-template="template3"] .select-card,
  body[data-template="template3"] .word-chip,
  body[data-template="template3"] .phrase-pill,
  body[data-template="template3"] .blank-slot,
  body[data-template="template3"] .match-slot,
  body[data-template="template3"] .test-sequence-slot,
  body[data-template="template3"] .field input,
  body[data-template="template3"] .field select {
    border-color: rgba(116, 255, 211, 0.24);
    background: rgba(3, 12, 11, 0.78);
    color: #f6fff9;
  }

  body[data-template="template3"] .button {
    justify-content: center;
    border-left-color: rgba(231, 255, 107, 0.52);
    text-transform: none;
  }

  body[data-template="template3"] .button:hover,
  body[data-template="template3"] .choice:hover,
  body[data-template="template3"] .select-card:hover,
  body[data-template="template3"] .word-chip:hover,
  body[data-template="template3"] .phrase-pill:hover,
  body[data-template="template3"] .bible-ref-chip:hover,
  body[data-template="template3"] .bible-verse:hover {
    border-color: rgba(231, 255, 107, 0.72);
    background: rgba(20, 34, 19, 0.92);
    box-shadow: 0 0 22px rgba(56, 242, 208, 0.12);
  }

  body[data-template="template3"] .button.gold,
  body[data-template="template3"] .quick-card.primary {
    border-color: rgba(231, 255, 107, 0.78);
    background: linear-gradient(90deg, #e7ff6b, #38f2d0);
    color: #04100e;
  }

  body[data-template="template3"] .button.blue {
    border-color: rgba(56, 242, 208, 0.7);
    background: linear-gradient(90deg, rgba(8, 96, 83, 0.96), rgba(36, 79, 23, 0.96));
    color: #effff9;
  }

  body[data-template="template3"] .button.danger {
    border-color: rgba(255, 95, 111, 0.72);
    background: linear-gradient(90deg, rgba(148, 32, 48, 0.96), rgba(255, 184, 77, 0.38));
  }

  body[data-template="template3"] .page-title,
  body[data-template="template3"] .brand-title {
    color: #f8ffe4;
  }

  body[data-template="template3"] .stat-label,
  body[data-template="template3"] .field span,
  body[data-template="template3"] .badge,
  body[data-template="template3"] .panel-title small,
  body[data-template="template3"] .row-note,
  body[data-template="template3"] .stat-note {
    color: #a9c9bd;
  }

  body[data-template="template3"] .stat-value,
  body[data-template="template3"] .profile-stat.blue .stat-value,
  body[data-template="template3"] .profile-chapter-card strong,
  body[data-template="template3"] .jeopardy-tile {
    color: #e7ff6b;
  }

  body[data-template="template3"] .profile-stat.green .stat-value,
  body[data-template="template3"] .profile-insight-row strong,
  body[data-template="template3"] .profile-game-row > strong {
    color: #79ff6b;
  }

  body[data-template="template3"] .profile-stat.gold .stat-value,
  body[data-template="template3"] .profile-stat.orange .stat-value,
  body[data-template="template3"] .profile-chapter-card.needs-work strong {
    color: #ffb84d;
  }

  body[data-template="template3"] .progress-fill,
  body[data-template="template3"] .progress-fill.purple,
  body[data-template="template3"] .gold-fill {
    background: linear-gradient(90deg, #e7ff6b, #38f2d0);
  }

  body[data-template="template3"] .progress-fill.red-fill {
    background: linear-gradient(90deg, #ff5f6f, #ffb84d);
  }

  body[data-template="template3"] .jeopardy-category,
  body[data-template="template3"] .jeopardy-tile {
    border-color: rgba(116, 255, 211, 0.24);
    background: linear-gradient(180deg, rgba(11, 28, 25, 0.94), rgba(4, 11, 10, 0.94));
  }

  body[data-template="template3"] .bible-verse.selected {
    border-color: rgba(56, 242, 208, 0.72);
    background: rgba(56, 242, 208, 0.12);
  }

  body[data-template="template3"] .bible-verse.highlighted,
  body[data-template="template3"] .bible-reader.focused .bible-verse.selected,
  body[data-template="template3"] .bible-reader.focused .bible-verse.highlighted {
    border-color: rgba(231, 255, 107, 0.96);
    background: linear-gradient(90deg, rgba(231, 255, 107, 0.24), rgba(56, 242, 208, 0.1));
    box-shadow: inset 4px 0 0 #e7ff6b, 0 0 22px rgba(231, 255, 107, 0.12);
  }

  body[data-template="template3"] .bible-verse.highlighted .bible-verse-number {
    background: #e7ff6b;
    color: #06110f;
  }

  body[data-template="template3"] .debug-tab {
    border-color: rgba(231, 255, 107, 0.54);
    background: linear-gradient(90deg, rgba(4, 12, 11, 0.96), rgba(15, 24, 9, 0.96));
  }

  body[data-template="template3"] .debug-panel,
  body[data-template="template3"] .debug-event {
    border-color: rgba(116, 255, 211, 0.22);
    background: rgba(5, 15, 14, 0.96);
  }

  @media (max-width: 1240px) {
    body[data-template="template3"] .t3-workspace {
      grid-template-columns: 104px minmax(0, 1fr);
    }

    body[data-template="template3"] .t3-sidecar {
      position: static;
      grid-column: 1 / -1;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      max-height: none;
      overflow: visible;
    }
  }

  @media (max-width: 860px) {
    body[data-template="template3"] .app-template3 {
      padding: 10px;
    }

    body[data-template="template3"] .t3-header {
      position: relative;
      top: auto;
      grid-template-columns: 1fr;
    }

    body[data-template="template3"] .profile-nav {
      justify-self: stretch;
    }

    body[data-template="template3"] .t3-workspace {
      display: grid;
      grid-template-columns: 1fr;
    }

    body[data-template="template3"] .t3-nav {
      position: sticky;
      top: 0;
      z-index: 30;
      display: flex;
      max-height: none;
      overflow-x: auto;
      overflow-y: hidden;
    }

    body[data-template="template3"] .t3-nav-button {
      flex: 0 0 92px;
    }

    body[data-template="template3"] .t3-command-bar {
      grid-template-columns: 1fr;
    }

    body[data-template="template3"] .t3-command-metrics,
    body[data-template="template3"] .t3-sidecar {
      grid-template-columns: 1fr;
    }

    body[data-template="template3"] .t3-action-grid,
    body[data-template="template3"] .t3-mini-grid {
      grid-template-columns: 1fr;
    }
  }
}

/* ─── Jeopardy 2.0 ──────────────────────────────────────────────────────────── */

.j2-setup-page {
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.j2-setup-card {
  width: min(480px, 100%);
  display: grid;
  gap: 28px;
  padding: 36px;
}

.j2-setup-hero {
  text-align: center;
}

.j2-hero-title-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.j2-setup-hero h2 {
  margin: 0;
  font-size: 32px;
  background: linear-gradient(135deg, #ffd166, #ff9f00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.j2-header-byline {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.65;
  margin-left: 8px;
  vertical-align: middle;
  -webkit-text-fill-color: initial;
  background: none;
}

.j2-byline {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.7;
  align-self: center;
}

.j2-setup-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.j2-setup-section {
  display: grid;
  gap: 12px;
}

.j2-count-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.j2-name-grid {
  display: grid;
  gap: 10px;
}

.j2-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.j2-name-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

.j2-name-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(217, 173, 79, 0.25);
}

.j2-start-btn {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Team color dots */
.j2-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.j2-dot-1 { background: #ffd166; }
.j2-dot-2 { background: #23f3ff; }
.j2-dot-3 { background: #ff6b6b; }
.j2-dot-4 { background: #51cf66; }
.j2-dot-5 { background: #cc5de8; }
.j2-dot-6 { background: #ff922b; }
.j2-dot-7 { background: #f06595; }
.j2-dot-8 { background: #74c0fc; }


/* Game page */
.j2-game-page {
  display: grid;
  gap: 14px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding-bottom: 95px;
}

.j2-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.j2-fs-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.j2-fs-btn:hover {
  border-color: var(--gold);
  background: rgba(217, 173, 79, 0.1);
}

/* Fullscreen mode */
.j2-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #02040e;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 0;
  overflow: hidden;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.j2-fullscreen .j2-board-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.j2-fullscreen .j2-board-wrap .j2-board {
  flex: 1;
  min-height: 0;
}

.j2-fullscreen .j2-board-wrap .j2-column {
  display: flex;
  flex-direction: column;
  grid-template-rows: none;
}

.j2-fullscreen .j2-board-wrap .j2-cat-header {
  flex-shrink: 0;
}

.j2-fullscreen .j2-board-wrap .j2-tile {
  flex: 1;
  min-height: 50px;
  height: auto;
}

/* Pull team bar into flex flow so it sits right under the board */
.j2-fullscreen .j2-team-bar {
  position: static;
  flex-shrink: 0;
  border-top: 2px solid #000;
}

.j2-fullscreen .j2-game-header {
  flex-shrink: 0;
}

/* Team bar — fixed at the bottom of the viewport, JeopardyLabs style */
.j2-team-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 210;
  background: #1a1a3e;
  border-top: 2px solid #000;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.7);
}

.j2-team-bar-teams {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.j2-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px 5px;
  background: #fff;
  border: 2px solid #444;
  min-width: 80px;
  max-width: 120px;
  text-align: center;
}

.j2-team-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}

.j2-team-card-score {
  font-size: 24px;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
  min-width: 40px;
}

.j2-team-card-btns {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.j2-pts-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  padding: 0 2px;
  line-height: 1;
  transition: transform 0.08s;
}

.j2-pts-btn:hover {
  transform: scale(1.2);
}

.j2-pts-btn:active {
  transform: scale(0.85);
}

.j2-pts-plus {
  color: #1a9e40;
}

.j2-pts-minus {
  color: #d9232b;
}

/* Board */
.j2-board-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.j2-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #02040e;
  border: 1px solid #16244a;
  min-width: 620px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.j2-column {
  display: grid;
  grid-template-rows: 72px repeat(5, 84px);
  gap: 6px;
}

.j2-cat-header {
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  background: #1a3b80;
  border: 1px solid #2d5ecc;
  color: #ffd166;
  font-size: 39px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
  letter-spacing: 0.3px;
}

.j2-tile {
  width: 100%;
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #1b3f8a;
  background: #0f1f66;
  color: #ffd166;
  font-size: 28px;
  font-weight: 950;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  line-height: 1;
}

.j2-tile:hover:not(:disabled) {
  background: #1c3db8;
  border-color: #4d7cff;
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(30, 70, 200, 0.4);
}

.j2-tile:active:not(:disabled) {
  transform: scale(0.97);
}

.j2-tile.active {
  border-color: var(--gold);
  background: #2245cc;
}

.j2-tile.completed {
  background: #0b1325;
  border-color: #1a2840;
  color: #2e4a70;
  text-shadow: none;
  cursor: pointer;
  font-size: 22px;
  opacity: 0.55;
}

.j2-tile.completed:hover {
  opacity: 0.8;
  border-color: #2e4a70;
}

.j2-tile.empty {
  background: #060b15;
  border-color: #0e1928;
  color: #1e2d42;
  font-size: 18px;
  cursor: default;
}

.j2-check { color: #51cf66; }
.j2-x { color: #ff6b6b; }

/* Modal overlay — full-screen JeopardyLabs style */
.j2-overlay {
  position: fixed;
  inset: 0 0 78px 0;
  z-index: 200;
  background: #1e2d8a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.j2-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.j2-topbar-btn {
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.95);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition: background 0.12s;
}

.j2-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.j2-topbar-btn kbd {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 16px;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.j2-topbar-cat {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  flex: 1;
}

.j2-topbar-spacer {
  flex: 0 0 180px;
}

.j2-modal-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 4%;
  overflow: hidden;
  text-align: center;
}

.j2-screen-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
}

.j2-screen-q {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.8rem);
  color: #fff;
  font-weight: 400;
  line-height: 1.3;
  -webkit-text-fill-color: #fff;
}

/* Verse refs inside question text stay inline (no absolute positioning on screen-q) */
.j2-screen-q .verse-ref {
  font-size: 0.45em;
  font-weight: 500;
  vertical-align: middle;
  border-bottom-color: rgba(56, 189, 248, 0.4);
  color: #7fc4f0;
  position: static;
}

/* Corner block — English + Romanian refs stacked at bottom-right of overlay */
.j2-corner-refs {
  position: absolute;
  bottom: 20px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
}

.j2-corner-ref-en {
  font-size: clamp(0.85rem, 1.6vw, 1.2rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255, 255, 255, 0.45);
}

.j2-corner-ref-ro {
  font-size: clamp(0.75rem, 1.3vw, 1.05rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(138, 184, 240, 0.45);
}

.j2-screen-divider {
  width: 100%;
  max-width: 860px;
  border: none;
  border-top: 2px dotted rgba(255, 255, 255, 0.35);
  margin: 28px 0;
}

.j2-screen-a {
  margin: 0;
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
  color: #a8cfff;
  font-weight: 500;
  line-height: 1.4;
}

/* Romanian question — 90% of English size */
.j2-screen-q-ro {
  margin: 6px 0 0;
  font-size: clamp(1.3rem, 2.7vw, 2.5rem);
  color: #8ab8f0;
  font-weight: 400;
  font-style: italic;
  line-height: 1.3;
  opacity: 0.85;
}

/* Choices list in full-screen modal */
.j2-screen-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  max-width: 960px;
  text-align: left;
}

.j2-screen-choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.2s, border-color 0.2s;
}

.j2-screen-choice-label {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.j2-screen-choice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.j2-screen-choice-en {
  font-size: clamp(1.3rem, 2.6vw, 2.4rem);
  color: #fff;
  font-weight: 500;
  line-height: 1.3;
}

.j2-screen-choice-ro {
  font-size: clamp(1rem, 2vw, 1.85rem);
  color: #8ab8f0;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.85;
}

/* Correct answer highlight after reveal */
.j2-screen-choice.j2-choice-correct {
  background: rgba(81, 207, 102, 0.2);
  border-color: rgba(81, 207, 102, 0.6);
}

.j2-screen-choice.j2-choice-correct .j2-screen-choice-label {
  background: rgba(81, 207, 102, 0.4);
  color: #6ee887;
}

.j2-screen-choice.j2-choice-correct .j2-screen-choice-en {
  color: #6ee887;
  font-weight: 700;
}

.j2-screen-choice.j2-choice-correct .j2-screen-choice-ro {
  color: #a5f0b8;
  opacity: 1;
}

/* Non-interactive choice display in modal */
.j2-choices-display {
  display: grid;
  gap: 8px;
}

.j2-choice-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s;
}

.j2-choice-row .choice-label {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.j2-choice-row.j2-choice-correct {
  background: rgba(81, 207, 102, 0.18);
  border-color: rgba(81, 207, 102, 0.55);
  color: #6ee887;
  font-weight: 700;
}

.j2-choice-row.j2-choice-correct .choice-label {
  background: rgba(81, 207, 102, 0.35);
  color: #51cf66;
}

/* Complete banner */
.j2-complete {
  padding: 30px;
  text-align: center;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.j2-complete h2 {
  margin: 0;
  font-size: 28px;
}

.j2-complete p {
  margin: 0;
  color: var(--muted);
}

.j2-final-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.j2-final-team {
  display: grid;
  gap: 4px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
  font-size: 16px;
  min-width: 100px;
}

/* Responsive phone */
@media (max-width: 600px) {
  .j2-modal {
    padding: 18px;
    gap: 16px;
    border-radius: 14px;
  }

  .j2-modal-q {
    font-size: 17px;
  }

  .j2-tile {
    font-size: 20px;
    min-height: 68px;
  }

  .j2-cat-header {
    font-size: 20px;
  }

  .j2-team-card-score {
    font-size: 18px;
  }

  .j2-pts-label {
    display: none;
  }
}

body[data-template] .paper-test-sheet {
  border-color: #c7c2b8;
  background: #fffef9;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  color: #111;
}

body[data-template] .paper-test-sheet .test-question,
body[data-template] .paper-test-sheet .paper-choice,
body[data-template] .paper-test-sheet .match-slot,
body[data-template] .paper-test-sheet .test-sequence-slot,
body[data-template] .paper-test-sheet .word-chip {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #111;
}

body[data-template] .paper-test-sheet .paper-choice:hover,
body[data-template] .paper-test-sheet .paper-choice.selected,
body[data-template] .paper-test-sheet .match-slot:hover,
body[data-template] .paper-test-sheet .test-sequence-slot:hover,
body[data-template] .paper-test-sheet .word-chip:hover {
  background: #f3f3f3;
  box-shadow: none;
  color: #111;
}

body[data-template] .paper-test-sheet .paper-choice-bubble,
body[data-template] .paper-test-sheet .paper-tf-button,
body[data-template] .paper-test-sheet .paper-answer-blank,
body[data-template] .paper-test-sheet .paper-match-options,
body[data-template] .paper-test-sheet .paper-verse-bank {
  border-color: #111;
  background: #fff;
  box-shadow: none;
  color: #111;
}

body[data-template] .paper-test-sheet .paper-choice.selected .paper-choice-bubble,
body[data-template] .paper-test-sheet .paper-tf-button.selected {
  background: #111;
  color: #fff;
}

body[data-template] .paper-test-sheet .paper-choice.correct .paper-choice-bubble,
body[data-template] .paper-test-sheet .paper-tf-button.correct {
  border-color: #08723a;
  background: #e8f7ee;
  color: #063f21;
}

body[data-template] .paper-test-sheet .paper-choice.missed .paper-choice-bubble,
body[data-template] .paper-test-sheet .paper-tf-button.missed {
  border-color: #9c6500;
  background: #fff4d8;
  color: #4a3200;
}

body[data-template] .paper-test-sheet .paper-choice.wrong .paper-choice-bubble,
body[data-template] .paper-test-sheet .paper-tf-button.wrong {
  border-color: #9c1d1d;
  background: #fdecec;
  color: #611111;
}

body[data-template] .paper-test-sheet .match-slot.filled,
body[data-template] .paper-test-sheet .test-sequence-slot.filled {
  background: transparent;
  color: #111;
}

body[data-template] .paper-test-sheet .paper-match-row.correct,
body[data-template] .paper-test-sheet .paper-verse-row.correct {
  background: #e8f7ee;
  color: #063f21;
}

body[data-template] .paper-test-sheet .paper-match-row.wrong,
body[data-template] .paper-test-sheet .paper-verse-row.wrong {
  background: #fdecec;
  color: #611111;
}

body[data-template] .paper-test-sheet .paper-reference {
  color: #9d251d;
}

body[data-template] .paper-test-sheet .answer-box {
  border-color: #b7b7b7;
  background: #f8f8f8;
  color: #111;
}

body[data-template] .paper-test-sheet .answer-box.correct {
  border-color: #08723a;
  background: #eef9f2;
}

body[data-template] .paper-test-sheet .answer-box.wrong {
  border-color: #9c1d1d;
  background: #fff0f0;
}

@media print {
  body[data-template] .paper-test-sheet {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  body[data-template] .paper-test-sheet .paper-choice,
  body[data-template] .paper-test-sheet .paper-tf-button,
  body[data-template] .paper-test-sheet .match-slot,
  body[data-template] .paper-test-sheet .test-sequence-slot,
  body[data-template] .paper-test-sheet .word-chip {
    background: #fff !important;
    box-shadow: none !important;
    color: #111 !important;
  }
}
