/* Portal app styles. Extends /styles.css and /train/train.css. */
@import url("/train/train.css");

/* App shell layout */
.portal-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Top bar */
.portal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-panel);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.portal-topbar .brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.portal-topbar .brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
}
.portal-topbar .who {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.portal-topbar .who .name { color: var(--ink); font-weight: 500; }
.portal-topbar .who a { color: var(--ink-muted); }
.portal-topbar .who a:hover { color: var(--accent); text-decoration: none; }

/* Day badge in topbar */
.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.day-badge .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
}

/* Body grid: sidebar + main */
.portal-body {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .portal-body {
    grid-template-columns: 280px 1fr;
    gap: 0;
  }
}

/* Sidebar */
.portal-sidebar {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-panel);
  padding: 16px 20px;
}
@media (min-width: 900px) {
  .portal-sidebar {
    border-bottom: none;
    border-right: 1px solid var(--rule);
    padding: 28px 20px;
    min-height: calc(100vh - 64px);
  }
}

.sidebar-heading {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
  padding: 0 6px;
}

/* Mobile accordion toggle */
.sidebar-accordion-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 12px;
}
.sidebar-accordion-toggle .chev { transition: transform 0.15s ease; }
.sidebar-accordion-toggle.open .chev { transform: rotate(180deg); }
@media (min-width: 900px) {
  .sidebar-accordion-toggle { display: none; }
}

.day-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
}
@media (max-width: 899px) {
  .day-list.collapsed { display: none; }
}

.day-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.day-item:hover:not(:disabled):not(.locked) {
  background: var(--bg-sunken);
  color: var(--ink);
}
.day-item .status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-sunken);
  color: var(--ink-muted);
}
.day-item .label {
  flex: 1;
  font-weight: 500;
}
.day-item .meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.day-item.passed .status {
  background: var(--ok-soft);
  color: var(--ok);
}
.day-item.passed .label { color: var(--ink); }

.day-item.current {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}
.day-item.current .status {
  background: var(--accent);
  color: #fff;
}
.day-item.current .label { color: var(--ink); font-weight: 600; }

.day-item.locked {
  cursor: not-allowed;
  color: var(--ink-muted);
  opacity: 0.7;
}
.day-item.locked .status {
  background: transparent;
  color: var(--ink-muted);
  border: 1px dashed var(--rule-strong);
}

/* Main panel */
.portal-main {
  padding: 20px 20px 80px;
}
@media (min-width: 900px) {
  .portal-main { padding: 28px 36px 96px; }
}

.portal-main-head {
  margin-bottom: 24px;
}
.portal-main-head .kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.portal-main-head h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}
.portal-main-head h1 em { font-style: italic; color: var(--accent); }

/* Tab pill bar */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 999px;
  font-family: 'Inter Tight', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-pill:hover { color: var(--ink); }
.tab-pill.active {
  background: var(--bg-panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  font-weight: 600;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Lesson content */
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.lesson-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.lesson-chip strong { color: var(--ink); margin-right: 6px; }

.lesson-theme {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.subtopic {
  margin-bottom: 28px;
}
.subtopic-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}
.subtopic-body {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
}
.subtopic-body p { margin-bottom: 12px; }
.subtopic-body p:last-child { margin-bottom: 0; }
.subtopic-body strong { color: var(--ink); font-weight: 600; }
.subtopic-body em { font-style: italic; }
.subtopic-body ul, .subtopic-body ol {
  margin: 8px 0 12px 22px;
}
.subtopic-body li { margin-bottom: 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  max-width: 90vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Inline note */
.inline-note {
  padding: 14px 16px;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}
.inline-note.info {
  background: var(--bg-sunken);
  border-color: var(--rule-strong);
  color: var(--ink-soft);
}

/* Schedule + time-off modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: var(--bg-panel, #fff);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.schedule-pill { letter-spacing: 0.02em; }
.schedule-pill-approved { background: #E4EDE2; color: #3A6B47; }
.schedule-pill-requested { background: #F4ECD4; color: #9A7B1F; }
.schedule-pill-denied { background: #F4E0DA; color: #9A3A2A; }
.schedule-pill-cancelled { background: #F0EDE5; color: #8A8578; }

/* Last submitted line */
.last-submitted {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

/* Progress tab */
.progress-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
@media (min-width: 640px) {
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .progress-grid { grid-template-columns: repeat(3, 1fr); }
}
.progress-stat {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px;
}
.progress-stat .label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.progress-stat .value {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
}
.progress-stat .value em { font-style: italic; color: var(--accent); }
.progress-stat .sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.day-history {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px;
}
.day-history h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 12px;
}
.day-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.day-history-row:last-child { border-bottom: none; }
.day-history-row .day-label { font-weight: 500; }
.day-history-row .score-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* Login shell shared */
.portal-login-shell {
  max-width: 440px;
  margin: 80px auto;
  padding: 32px 24px;
}
.portal-login-card {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 36px 32px;
}
.portal-login-card h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.portal-login-card h1 em { font-style: italic; color: var(--accent); }
.portal-login-card .sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 24px;
}
.portal-login-card .field { margin-bottom: 16px; }
.portal-login-card .btn-primary { width: 100%; }
.portal-login-card .login-extra {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.portal-login-card .login-extra a { color: var(--ink-soft); }

/* ---------- Resources tab ---------- */
.resources-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
@media (min-width: 900px) {
  .resources-layout {
    grid-template-columns: 220px 1fr;
  }
}

.resources-sidebar {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-panel);
  padding: 14px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.resources-sidebar input[type="search"] {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  box-sizing: border-box;
}
.resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resource-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
}
.resource-item:hover { background: var(--accent-soft); color: var(--ink); }
.resource-item.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}
.resource-item-title { display: block; }

.resources-main { min-width: 0; }
.resources-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
.resources-body-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
@media (min-width: 1100px) {
  .resources-body-wrap {
    grid-template-columns: 1fr 200px;
  }
}
.resources-body {
  min-width: 0;
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.resources-body h1, .resources-body h2, .resources-body h3, .resources-body h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
}
.resources-body h1 { font-size: 26px; }
.resources-body h2 { font-size: 21px; padding-top: 8px; border-top: 1px solid var(--rule); margin-top: 1.6em; }
.resources-body h3 { font-size: 17px; }
.resources-body h4 { font-size: 15px; }
.resources-body p { margin: 0 0 1em; }
.resources-body ul, .resources-body ol { margin: 0 0 1em 1.2em; padding: 0; }
.resources-body li { margin-bottom: 0.35em; }
.resources-body strong { color: var(--ink); font-weight: 600; }
.resources-body em { color: var(--ink); }
.resources-body a { color: var(--accent); text-decoration: underline; }
.resources-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 4px;
}
.resources-body pre {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
}
.resources-body pre code { background: transparent; padding: 0; }
.resources-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 1em;
  padding: 4px 14px;
  color: var(--ink-soft);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
}
.resources-body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}
.resources-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1em;
  font-size: 14px;
}
.resources-body th, .resources-body td {
  border: 1px solid var(--rule);
  padding: 6px 10px;
  text-align: left;
}
.resources-body th { background: var(--bg-panel); font-weight: 600; }

.resources-toc {
  border-left: 1px solid var(--rule);
  padding-left: 14px;
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.resources-toc-heading {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.resources-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.resources-toc-list a {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  display: block;
  padding: 2px 0;
}
.resources-toc-list a:hover { color: var(--accent); }

/* Day-1 lesson cross-link to a Resources doc */
.lesson-resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
}
.lesson-resource-link:hover { text-decoration: underline; }
.practice-lesson-link { margin-left: 14px; }

/* ---------- Practice tab ---------- */
.practice-view { display: block; }
.practice-view.hidden { display: none !important; }

.practice-intro { margin-bottom: 22px; }
.practice-h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--ink);
}
.practice-h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink);
}
.practice-sub {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

.practice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .practice-grid { grid-template-columns: repeat(3, 1fr); }
}

.practice-card {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.practice-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.practice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.practice-card-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}
.practice-card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
}
.practice-card-principle {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}
/* Wave 4.1 — every persona card has a 2-3 sentence brief at the top.
   Heavier weight, full readability, takes up the room. */
.practice-card-brief {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
  flex: 1;
}
/* Smaller italic principle footer under the brief. Only renders when the
   card has BOTH a brief and a separate playbook_principle — otherwise the
   brief slot uses principle text directly and this footer is omitted. */
.practice-card-principle-footer {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
  font-style: italic;
  margin: 0;
}

/* ============================================================
   Wave 5 — compact list view, status glyphs, family sections,
   filter chips, Today's Quests rail.
   ============================================================ */

/* Today's Quests rail — 3 algorithmic picks. */
.practice-quests-rail {
  margin: 0 0 18px 0;
  padding: 0;
}
.practice-quests-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.practice-quests-rail-kicker { font-weight: 600; color: var(--ink); }
.practice-quests-rail-progress { font-weight: 500; }
.practice-quests-rail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.practice-quest-card {
  text-align: left;
  background: #fff;
  border: 1px solid var(--rule, #E5E0D5);
  border-left: 3px solid var(--ink-muted);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.practice-quest-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.practice-quest-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
}
.practice-quest-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}
.practice-quest-fam {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* Filter bar — status chips + family chips. */
.practice-filter-bar {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  background: var(--bg-sunken, #F4F1E8);
  border: 1px solid var(--rule, #E5E0D5);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.practice-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.practice-filter-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  min-width: 60px;
}
.practice-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.practice-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--rule, #CFC8B5);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s, background 0.1s;
  font-family: inherit;
}
.practice-chip:hover { border-color: var(--accent, #B8472D); color: var(--accent, #B8472D); }
.practice-chip-active {
  background: var(--accent, #B8472D);
  border-color: var(--accent, #B8472D);
  color: #fff;
  font-weight: 600;
}
.practice-chip-count {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  opacity: 0.75;
  margin-left: 2px;
}
.practice-chip-active .practice-chip-count { opacity: 1; }

/* Family sections — compact header + body. */
.practice-list-host {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.practice-fam {
  background: #fff;
  border: 1px solid var(--rule, #E5E0D5);
  border-left: 3px solid var(--ink-muted);
  border-radius: 8px;
  overflow: hidden;
}
.practice-fam-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: #FAF8F4;
  border: 0;
  border-bottom: 1px solid var(--rule, #E8E2D2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.practice-fam-head:hover { background: #F4F1E8; }
.practice-fam-head-passed { background: #F0F5F0; }
.practice-fam-head-passed:hover { background: #E8F0E8; }
.practice-fam-icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.practice-fam-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.practice-fam-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.practice-fam-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--ink-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.practice-fam-head-passed .practice-fam-count { color: #3A6B47; }
.practice-fam-chev { font-size: 12px; color: var(--ink-muted); transition: transform 0.15s; }
.practice-fam-chev-collapsed { transform: rotate(-90deg); }

/* Sparkline — one dot per persona, monochrome shape only. */
.practice-fam-spark { display: inline-flex; gap: 3px; }
.practice-fam-spark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.practice-fam-spark-passed     { background: var(--ink, #2a2a2a); }
.practice-fam-spark-borderline { background: linear-gradient(to right, var(--ink, #2a2a2a) 50%, transparent 50%); border: 1px solid var(--ink, #2a2a2a); }
.practice-fam-spark-retry      { background: transparent; border: 1px solid var(--ink, #2a2a2a); position: relative; }
.practice-fam-spark-retry::before {
  content: "×";
  position: absolute; inset: 0;
  font-size: 9px; line-height: 5px; color: var(--ink, #2a2a2a);
  display: flex; align-items: center; justify-content: center;
}
.practice-fam-spark-new        { background: transparent; border: 1px solid var(--ink-muted, #8A8578); opacity: 0.5; }

/* Family body — list of persona rows, no extra padding. */
.practice-fam-body { display: flex; flex-direction: column; }

/* Persona row — replaces the old card. ~56px tall, full-width clickable. */
.practice-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule, #F0EBDF);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}
.practice-row:last-child { border-bottom: 0; }
.practice-row:hover { background: var(--bg-sunken, #F4F1E8); }
.practice-row:hover .practice-row-cta { transform: translateX(4px); color: var(--accent, #B8472D); }

.practice-row-avatar {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  font-weight: 500;
}

.practice-row-status { font-size: 16px; line-height: 1; flex-shrink: 0; width: 16px; text-align: center; }
.practice-row-status-passed { color: #2a2a2a; font-weight: 700; }
.practice-row-status-border { color: #9A7B1F; }
.practice-row-status-retry  { color: #9A3A2A; }
.practice-row-status-new    { color: #C9C2AE; }

.practice-row-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}

.practice-row-body { flex: 1; min-width: 0; overflow: hidden; }
.practice-row-title-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.practice-row-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, #2a2a2a);
  overflow: hidden;
  text-overflow: ellipsis;
}
.practice-row-rich-tag { color: #9A7B1F; font-size: 11px; flex-shrink: 0; }
.practice-row-hook {
  font-size: 12.5px;
  color: var(--ink-muted, #6A6558);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.practice-row-cta {
  font-size: 18px;
  color: var(--ink-muted, #C9C2AE);
  flex-shrink: 0;
  margin-left: 4px;
  transition: transform 0.12s, color 0.12s;
}

/* Wave 6 — async-grading toasts on the practice list view. */
.practice-pending-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FBF4DC;
  border: 1px solid #E0C97A;
  border-left: 3px solid #B8472D;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #6A5615;
}
.practice-pending-toast.hidden { display: none; }
.practice-pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #B8472D;
  flex-shrink: 0;
  animation: practice-pulse 1.2s ease-in-out infinite;
}
@keyframes practice-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.practice-pending-msg { flex: 1; }
.practice-pending-dismiss {
  background: transparent;
  border: 0;
  color: #6A5615;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.practice-grade-ready-toast {
  display: block;
  background: #E4EDE2;
  border: 1px solid #A8C4A0;
  border-left: 3px solid #3A6B47;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #3A6B47;
  font-weight: 600;
  cursor: pointer;
  animation: practice-toast-slide 0.25s ease-out;
}
@keyframes practice-toast-slide {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobile — slightly tighter padding, hook still shows but truncates harder. */
@media (max-width: 600px) {
  .practice-row { padding: 9px 12px; gap: 10px; }
  .practice-row-avatar { width: 32px; height: 32px; font-size: 14px; }
  .practice-row-id { font-size: 10px; min-width: 28px; }
  .practice-row-title { font-size: 14px; }
  .practice-row-hook { font-size: 11.5px; }
  .practice-fam-head { padding: 10px 12px; }
  .practice-quests-rail-cards { grid-template-columns: 1fr; }
}
.practice-card-start {
  align-self: flex-start;
  margin-top: 4px;
}

.practice-recent {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
}
.practice-recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.practice-recent-row:last-child { border-bottom: none; }
.practice-recent-left { min-width: 0; flex: 1; }
.practice-recent-title {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.practice-recent-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.practice-recent-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.practice-recent-review {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.practice-recent-review:hover { text-decoration: underline; }

.practice-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.practice-score-good { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.practice-score-mid { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.practice-score-low { background: #F4E0DA; color: #9A3A2A; border-color: #C46955; }
.practice-score-unknown { background: var(--bg-sunken); color: var(--ink-muted); border-color: var(--rule-strong); }

/* Active chat */
.practice-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  margin-bottom: 14px;
}
.practice-chat-head-left { min-width: 0; flex: 1; }
.practice-chat-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
}
.practice-chat-principle {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}
.practice-chat-head-right {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.practice-help-btn,
.practice-end-btn {
  padding: 8px 16px;
  font-size: 13px;
}

.practice-help-panel {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.practice-help-panel.hidden { display: none !important; }
.practice-help-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.practice-help-panel-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.practice-help-dismiss {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.practice-help-dismiss:hover { color: var(--ink); }
.practice-help-text {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.practice-transcript {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
  height: 60vh;
  min-height: 360px;
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.practice-transcript-readonly {
  height: auto;
  max-height: 360px;
}

.practice-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  position: relative;
}
.practice-bubble-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.practice-bubble-content {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.practice-bubble-fan {
  align-self: flex-start;
  background: var(--bg-sunken);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 4px;
}
.practice-bubble-trainee {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-bottom-right-radius: 4px;
}
.practice-bubble-trainee .practice-bubble-meta { color: rgba(255,255,255,0.7); }

/* Wave-3 content drop card — distinct visual from a regular trainee text bubble. */
.practice-drop-card {
  background: rgba(255,255,255,0.14);
  border: 1px dashed rgba(255,255,255,0.45);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 2px;
}
.practice-drop-card-freebie {
  border-style: solid;
  border-color: rgba(255,255,255,0.5);
}

.practice-typing {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 6px 6px;
  animation: practice-pulse 1.2s ease-in-out infinite;
}
.practice-typing.hidden { display: none !important; }

@keyframes practice-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.practice-cost-row {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 0 6px 4px;
}

.practice-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.practice-input-row textarea {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--bg-panel);
  color: var(--ink);
  resize: vertical;
  min-height: 56px;
  box-sizing: border-box;
}
.practice-input-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.practice-input-row .btn {
  flex-shrink: 0;
  align-self: stretch;
}

/* Grade view */
.practice-grade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.practice-grade-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.practice-grade-score-wrap { text-align: right; }
.practice-grade-score-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.practice-grade-score {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1;
  display: inline-block;
  padding: 6px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.practice-grade-feedback {
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.practice-grade-section { margin-bottom: 24px; }

.practice-dim-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.practice-dim-row:last-child { border-bottom: none; }
.practice-dim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.practice-dim-name {
  font-weight: 500;
  color: var(--ink);
  font-size: 14px;
}
.practice-dim-score {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.practice-dim-bar {
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.practice-dim-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.practice-dim-comment {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.practice-rewrite {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.practice-rewrite[open] { border-color: var(--accent); }
.practice-rewrite-sum {
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  list-style: none;
}
.practice-rewrite-sum::-webkit-details-marker { display: none; }
.practice-rewrite-sum::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: var(--ink-muted);
  transition: transform 0.15s ease;
}
.practice-rewrite[open] .practice-rewrite-sum::before { transform: rotate(90deg); }
.practice-rewrite-original,
.practice-rewrite-suggested {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.practice-rewrite-original { color: var(--ink-muted); }
.practice-rewrite-suggested { color: var(--accent); }
.practice-rewrite-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.practice-rewrite-original .practice-rewrite-label { color: var(--ink-muted); }
.practice-rewrite-suggested .practice-rewrite-label { color: var(--accent); }
.practice-rewrite-reason {
  margin-top: 8px;
  font-size: 12.5px;
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ---------- Lesson tab: tighter header summary ---------- */
.lesson-summary-line {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.lesson-summary-seg { color: var(--ink-soft); }
.lesson-summary-sep { color: var(--rule-strong); }
.lesson-summary-builds {
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.lesson-summary-builds strong {
  color: var(--ink-soft);
  font-weight: 600;
  margin-right: 4px;
}
.lesson-cta-hint {
  font-size: 13.5px;
  color: var(--ink-muted);
  text-align: center;
  margin: 24px auto 12px;
  max-width: 560px;
  line-height: 1.5;
}

/* ---------- Lesson tab: section grouping + collapsible subtopics ---------- */
.lesson-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.lesson-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-muted);
  font: inherit;
  text-transform: uppercase;
}
.lesson-toggle-btn:hover { color: var(--accent); }
.lesson-toggle-sep { color: var(--rule-strong); }

.lesson-section-header {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  letter-spacing: -0.005em;
}
.lesson-section-header:first-of-type { margin-top: 0; }

/* Subtopic block: head is the click target, body wrap collapses */
.subtopic {
  margin-bottom: 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-panel);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.subtopic:hover { border-color: var(--rule-strong); }
.subtopic--expanded {
  border-color: var(--rule-strong);
  background: var(--bg-panel);
}
.subtopic-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
}
.subtopic-head:hover { background: var(--bg-sunken); }
.subtopic--expanded .subtopic-head {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-sunken);
}
.subtopic-id-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 500;
  margin: 0;
}
.subtopic--expanded .subtopic-id-pill {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.subtopic-title {
  flex: 1 1 auto;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}
.subtopic-chev {
  flex: 0 0 auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-muted);
  transition: transform 0.15s ease;
}
.subtopic--expanded .subtopic-chev { transform: rotate(180deg); color: var(--accent); }

.subtopic-body-wrap {
  padding: 14px 16px 16px 16px;
}
/* Indent the body to align with the title (past the id pill) */
.subtopic--expanded .subtopic-body-wrap {
  padding-left: 18px;
}
.subtopic-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}

/* ---------- Test tab: per-question review on failure ---------- */
.test-review-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.test-review-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.test-review-sub {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.test-review-question {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.test-review-q-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.test-review-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.test-review-q-label {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.test-review-q-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 12px;
}
.test-review-wrong,
.test-review-correct {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 6px;
}
.test-review-wrong { color: var(--ink-soft); }
.test-review-correct { color: var(--ink); }
.test-review-wrong .test-review-mark {
  color: var(--warn);
  font-weight: 700;
  flex: 0 0 auto;
  width: 14px;
}
.test-review-correct .test-review-mark {
  color: var(--ok);
  font-weight: 700;
  flex: 0 0 auto;
  width: 14px;
}
.test-review-row-label {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  min-width: 84px;
}
.test-review-row-value { flex: 1 1 auto; }
.test-review-row-value strong { color: var(--ink); margin-right: 2px; }
.test-review-explanation {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
}
.test-review-explanation-label {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}


/* ============================================================
   Vault (tier-tagging drill)
   ============================================================ */
.vault-view { display: block; }
.vault-view.hidden { display: none; }

.vault-intro {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.vault-h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 6px;
}
.vault-sub {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 680px;
}
.vault-mode-row { margin-top: 14px; }
.vault-quiz-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

/* Filter chips */
.vault-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.vault-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vault-chip {
  border: 1px solid var(--rule-strong);
  background: var(--bg-panel);
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.vault-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.vault-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-panel);
}

/* Grid */
.vault-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 32px;
}
@media (min-width: 640px) {
  .vault-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .vault-grid { grid-template-columns: repeat(3, 1fr); }
}

.vault-card {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  font-family: inherit;
  color: inherit;
}
.vault-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.vault-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  display: block;
  overflow: hidden;
}
.vault-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.vault-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vault-card-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.vault-card-desc {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Format badge sits on the thumbnail */
.vault-format-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(26, 26, 26, 0.78);
  color: #FAF8F4;
  padding: 4px 9px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Tier pills (also used in modal/results). One pill style per tier with
   color matching the SVG thumbnail palette. */
.vault-tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid transparent;
}
.vault-thumb-wrap .vault-tier-pill {
  position: absolute;
  top: 8px;
  left: 8px;
}
.vault-tier-pill-1 { background: #E8EEF2; color: #1A1A1A; border-color: #C8D5DE; }
.vault-tier-pill-2 { background: #FBE3E8; color: #6B1F33; border-color: #F0AEBF; }
.vault-tier-pill-3 { background: #F0C7DA; color: #6B1140; border-color: #A8336E; }
.vault-tier-pill-4 { background: #FFD9C2; color: #7A2A10; border-color: #E66B3F; }
.vault-tier-pill-5 { background: #F9C9CC; color: #6E0F16; border-color: #C2202B; }
.vault-tier-pill-6 {
  background: #2C0510;
  color: #F4D27A;
  border-color: #B8862A;
}

/* Modal */
.vault-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.vault-modal.hidden { display: none; }
.vault-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.55);
}
.vault-modal-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
}
.vault-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-panel);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  z-index: 2;
}
.vault-modal-close:hover { color: var(--accent); border-color: var(--accent); }
.vault-modal-thumb-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-sunken);
}
.vault-modal-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vault-modal-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vault-modal-tier { align-self: flex-start; }
.vault-modal-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  margin: 0;
}
.vault-modal-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.vault-modal-long {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}
.vault-modal-price {
  margin-top: 4px;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-transform: uppercase;
}

/* Quiz */
.vault-quiz-stage {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.vault-quiz-question {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vault-quiz-question-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.vault-quiz-step {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.vault-quiz-format-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.vault-quiz-thumb {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1px solid var(--rule);
  align-self: center;
  display: block;
}
.vault-quiz-long {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}
.vault-quiz-tier-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 6px;
}
@media (max-width: 640px) {
  .vault-quiz-tier-row { grid-template-columns: repeat(3, 1fr); }
}
.vault-quiz-tier-btn {
  border: 1px solid var(--rule-strong);
  background: var(--bg-panel);
  color: var(--ink);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 14px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.vault-quiz-tier-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.vault-quiz-tier-btn.is-picked {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.vault-quiz-tier-btn-1.is-picked { background: #5C7587; border-color: #5C7587; box-shadow: 0 0 0 3px #E8EEF2; }
.vault-quiz-tier-btn-2.is-picked { background: #C25A75; border-color: #C25A75; box-shadow: 0 0 0 3px #FBE3E8; }
.vault-quiz-tier-btn-3.is-picked { background: #A8336E; border-color: #A8336E; box-shadow: 0 0 0 3px #F0C7DA; }
.vault-quiz-tier-btn-4.is-picked { background: #E66B3F; border-color: #E66B3F; box-shadow: 0 0 0 3px #FFD9C2; }
.vault-quiz-tier-btn-5.is-picked { background: #C2202B; border-color: #C2202B; box-shadow: 0 0 0 3px #F9C9CC; }
.vault-quiz-tier-btn-6.is-picked { background: #2C0510; border-color: #B8862A; color: #F4D27A; box-shadow: 0 0 0 3px #B8862A; }

.vault-quiz-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.vault-quiz-progress {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

/* Results */
.vault-results-score {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--accent);
  margin: 6px 0 4px;
}
.vault-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vault-results-row {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-strong);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vault-quiz-feedback-correct {
  border-left-color: #2F8050;
  background: #F0F7F2;
}
.vault-quiz-feedback-wrong {
  border-left-color: var(--accent);
  background: #FCF1ED;
}
.vault-results-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.vault-results-step {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.vault-results-verdict {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.vault-quiz-feedback-correct .vault-results-verdict { color: #2F8050; }
.vault-quiz-feedback-wrong .vault-results-verdict { color: var(--accent); }
.vault-results-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.vault-results-tiers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vault-results-twist {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-sunken);
  border-radius: 8px;
  padding: 10px 14px;
}

/* Day 3 lesson cross-link */
.lesson-vault-cta {
  margin-top: 24px;
  padding: 20px 22px;
  background: var(--accent-soft);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-vault-cta-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
}
.lesson-vault-cta-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- Daily checklist widget (Lesson tab) ---- */
.checklist-widget {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
.checklist-widget.hidden { display: none; }
.checklist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.checklist-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
}
.checklist-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.checklist-progress {
  height: 4px;
  width: 100%;
  background: var(--bg-sunken, #f5f3ec);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.checklist-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.18s ease;
}
.checklist-progress-fill--green { background: #3A6B47; }
.checklist-progress-fill--yellow { background: #C2913A; }
.checklist-progress-fill--red { background: #B8472D; }

.checklist-section {
  margin-top: 10px;
}
.checklist-section + .checklist-section { margin-top: 16px; }
.checklist-section-head {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checklist-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checklist-item:hover { background: var(--bg-sunken, #faf8f4); }
.checklist-item.is-done {
  color: var(--ink-muted);
}
.checklist-item.is-done .checklist-item-title {
  text-decoration: line-through;
  text-decoration-color: var(--rule-strong);
}
.checklist-checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 5px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1;
  color: transparent;
}
.checklist-checkbox.is-done {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.checklist-checkbox.is-locked {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  cursor: default;
}
.checklist-checkbox[disabled] { cursor: not-allowed; }
.checklist-item-title {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
}
.checklist-item.is-done .checklist-item-title { color: var(--ink-muted); }
.checklist-item-meta {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.checklist-item-link {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.checklist-item-link:hover { text-decoration: underline; }
.checklist-toggle {
  background: transparent;
  border: none;
  padding: 8px 0 0;
  margin-top: 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.checklist-toggle:hover { color: var(--ink); }
.checklist-toggle .chev { font-family: inherit; font-size: 12px; }

/* ---- Topbar checklist pill + dropdown ---- */
.checklist-pill {
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.checklist-pill.hidden { display: none; }
.checklist-pill--green {
  background: #E4EDE2;
  color: #3A6B47;
  border-color: #B7D1B6;
}
.checklist-pill--green .dot { background: #3A6B47; }
.checklist-pill--yellow {
  background: #F4ECD4;
  color: #9A7B1F;
  border-color: #DDC78B;
}
.checklist-pill--yellow .dot { background: #C2913A; }
.checklist-pill--red {
  background: #F4E0DA;
  color: #9A3A2A;
  border-color: #E0B5A8;
}
.checklist-pill--red .dot { background: #B8472D; }
.checklist-pill--muted {
  background: var(--bg-sunken, #f4f1ea);
  color: var(--ink-muted);
  border-color: var(--rule);
}
.checklist-pill--muted .dot { background: var(--ink-muted); }

.topbar-checklist {
  position: absolute;
  top: 100%;
  right: 24px;
  margin-top: 8px;
  width: min(420px, calc(100vw - 32px));
  background: var(--bg-panel);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
  padding: 16px 18px;
  z-index: 50;
}
.topbar-checklist.hidden { display: none; }
.topbar-checklist .checklist-section + .checklist-section { margin-top: 12px; }

.lesson-vault-cta-btn { align-self: flex-start; margin-top: 4px; }

/* ---------- Practice — rich-profile badge & brief view ---------- */
.practice-card-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.practice-card-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg-panel);
  color: var(--ink-soft);
}
.practice-card-pill-rich {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,0,0,0.02);
}

.practice-brief {
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px 24px 28px;
  max-width: 880px;
  margin: 0 auto;
}
.practice-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.practice-brief-back { padding: 6px 12px; font-size: 13px; }
.practice-brief-title-wrap { margin-bottom: 22px; }
.practice-brief-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.practice-brief-principle {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
  margin: 6px 0 0;
}
.practice-brief-section { margin-top: 22px; }
.practice-brief-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 18px;
}
@media (min-width: 640px) {
  .practice-brief-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 880px) {
  .practice-brief-grid { grid-template-columns: repeat(3, 1fr); }
}
.practice-brief-row {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: rgba(0,0,0,0.015);
}
.practice-brief-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.practice-brief-value {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}
.practice-brief-list {
  list-style: disc;
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.practice-brief-list li { margin-bottom: 4px; }
.practice-brief-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 720px) {
  .practice-brief-two-col { grid-template-columns: 1fr 1fr; }
}
.practice-brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.practice-brief-tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg-panel);
  color: var(--ink-soft);
}
.practice-brief-tag-warn {
  border-color: #d8a8a8;
  color: #8a3a3a;
  background: #fbf3f3;
}
.practice-brief-callout {
  background: #fff8e6;
  border: 1px solid #e8d28a;
  border-radius: 10px;
  padding: 14px 18px;
}
.practice-brief-callout .practice-h3 { color: #6a4f00; margin-bottom: 8px; }
.practice-brief-prior-notes {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4a3700;
  white-space: pre-wrap;
}
.practice-brief-session-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .practice-brief-session-grid { grid-template-columns: repeat(3, 1fr); }
}
.practice-brief-session-grid > div {
  background: rgba(0,0,0,0.015);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
}
.practice-brief-quote {
  font-style: italic;
  color: var(--ink);
}
.practice-brief-empty { color: var(--ink-muted); font-size: 13px; }
.practice-brief-actions { margin-top: 26px; }

/* Word-count indicators on Explain + Playbook scenario textareas */
.q-wc { transition: color 120ms ease-in-out; }
.q-wc.wc-below-min { color: #b34d4d; font-weight: 500; }
.q-wc.wc-over-max { color: #b34d4d; font-weight: 500; }
