@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --cq-bg: #1e2939;
  --cq-surface: #24344f;
  --cq-card: #283b59;
  --cq-border: #2a4870;
  --cq-accent: #3b82f6;
  --cq-accent-light: #60a5fa;
  --cq-gold: #c9a227;
  --cq-green: #22c55e;
  --cq-red: #ef4444;
  --cq-text: #e8eef7;
  --cq-muted: #94aed0;
  --cq-radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cq-bg);
  color: var(--cq-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cq-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  background: var(--cq-bg);
}

.cq-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1e2939ee;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cq-border);
  padding: 12px 20px 0;
}

.cq-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.cq-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cq-case-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cq-muted);
  font-size: 12px;
}

.cq-case-select {
  appearance: none;
  background: var(--cq-card);
  color: var(--cq-text);
  border: 1px solid var(--cq-border);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font-size: 11px;
  font-family: inherit;
  max-width: 180px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238ba3c7' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.cq-case-select:focus {
  outline: 2px solid var(--cq-accent);
  outline-offset: 1px;
}

.cq-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cq-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}
.cq-back:hover { color: var(--cq-accent-light); }

.cq-title-block h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cq-text);
  line-height: 1.3;
}
.cq-title-block p {
  font-size: 11px;
  color: var(--cq-muted);
  margin-top: 2px;
}

.cq-hud { display: flex; gap: 8px; }
.cq-hud-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cq-hud-pill i { font-size: 10px; color: var(--cq-gold); }

.cq-progress-wrap { padding-bottom: 12px; }
.cq-progress-bar {
  height: 6px;
  background: var(--cq-surface);
  border-radius: 3px;
  overflow: hidden;
}
.cq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cq-accent), #1d4ed8);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.cq-stage-label {
  font-size: 11px;
  color: var(--cq-muted);
  margin-top: 6px;
  font-weight: 500;
}

.cq-steps {
  display: flex;
  gap: 4px;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cq-steps::-webkit-scrollbar { display: none; }

.cq-step {
  flex: 1;
  min-width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--cq-surface);
  cursor: pointer;
  transition: background 0.3s;
  position: relative;
}
.cq-step.active { background: var(--cq-accent); }
.cq-step.done { background: var(--cq-green); }
.cq-step::after {
  content: attr(data-num);
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--cq-muted);
  font-weight: 600;
}
.cq-step.active::after { color: var(--cq-accent-light); }

.cq-main {
  flex: 1;
  padding: 20px;
  padding-bottom: 100px;
}

.cq-stage { display: none; animation: cqFadeIn 0.35s ease; }
.cq-stage.active { display: block; }

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

.cq-stage-header { margin-bottom: 16px; }
.cq-stage-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cq-accent-light);
  margin-bottom: 4px;
}
.cq-stage-header h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.cq-stage-banner,
.cq-courtroom-banner {
  margin-bottom: 16px;
  border-radius: var(--cq-radius);
  overflow: hidden;
  border: 1px solid var(--cq-border);
}
.cq-courtroom-svg,
.cq-stage-banner-svg { width: 100%; display: block; }

.cq-intro-headline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cq-gold);
  margin-bottom: 12px;
  line-height: 1.4;
}
.cq-intro-story {
  font-size: 14px;
  color: var(--cq-muted);
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--cq-surface);
  border-radius: var(--cq-radius);
  border-left: 3px solid var(--cq-accent);
}

.cq-char-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (min-width: 600px) {
  .cq-char-grid { grid-template-columns: repeat(3, 1fr); }
}

.cq-char-card {
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  overflow: hidden;
  animation: cqFadeIn 0.4s ease both;
}
.cq-char-portrait {
  background: var(--cq-surface);
  display: flex;
  justify-content: center;
  padding: 12px 12px 0;
}
.cq-char-portrait svg { width: 100px; height: auto; }
.cq-char-body { padding: 12px 14px 16px; }
.cq-char-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cq-accent-light);
}
.cq-char-body h3 { font-size: 14px; font-weight: 700; margin: 4px 0 2px; }
.cq-char-tag { font-size: 11px; color: var(--cq-gold); font-weight: 600; margin-bottom: 6px; }
.cq-char-bio { font-size: 12px; color: var(--cq-muted); line-height: 1.5; }

.cq-timeline-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--cq-border) transparent;
  margin: 0 -20px;
  padding: 0 20px 12px;
}
.cq-timeline-track {
  display: flex;
  gap: 0;
  min-width: max-content;
  position: relative;
  padding: 20px 0;
}
.cq-timeline-track::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--cq-border);
}
.cq-timeline-node {
  width: 160px;
  flex-shrink: 0;
  padding: 0 10px;
  cursor: pointer;
  transition: transform 0.2s;
}
.cq-timeline-node:hover { transform: translateY(-4px); }
.cq-timeline-icon { margin-bottom: 8px; position: relative; z-index: 1; }
.cq-timeline-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--cq-accent-light);
  letter-spacing: 0.5px;
}
.cq-timeline-title { font-size: 13px; font-weight: 700; margin: 4px 0; }
.cq-timeline-text {
  font-size: 11px;
  color: var(--cq-muted);
  line-height: 1.45;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.cq-timeline-node.expanded .cq-timeline-text { max-height: 120px; }

.cq-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 500px) {
  .cq-evidence-grid { grid-template-columns: repeat(3, 1fr); }
}

.cq-evidence-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: inherit;
}
.cq-evidence-card:hover {
  border-color: var(--cq-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px #00000033;
}
.cq-evidence-card.viewed { border-color: var(--cq-green); }
.cq-evidence-card.viewed::after {
  content: '✓ Examined';
  font-size: 9px;
  font-weight: 700;
  color: var(--cq-green);
  margin-top: 6px;
}
.cq-evidence-icon { font-size: 28px; margin-bottom: 8px; }
.cq-evidence-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.cq-evidence-summary { font-size: 10px; color: var(--cq-muted); line-height: 1.4; }

.cq-hint {
  font-size: 12px;
  color: var(--cq-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.cq-quiz-progress {
  font-size: 11px;
  font-weight: 600;
  color: var(--cq-accent-light);
  margin-bottom: 8px;
}
.cq-quiz-question {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
}
.cq-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.cq-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--cq-border);
  color: var(--cq-muted);
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
  flex-shrink: 0;
}

.cq-quiz-opt {
  padding: 14px 16px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--cq-text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}
.cq-quiz-opt:hover:not(:disabled) { border-color: var(--cq-accent); background: var(--cq-card); }
.cq-quiz-opt.correct { border-color: var(--cq-green); background: #22c55e18; }
.cq-quiz-opt.wrong { border-color: var(--cq-red); background: #ef444418; }
.cq-quiz-opt:disabled { cursor: default; }

.cq-quiz-explanation {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--cq-radius);
  font-size: 13px;
  line-height: 1.6;
  display: none;
}
.cq-quiz-explanation.show { display: block; }
.cq-quiz-explanation.correct { background: #22c55e15; border: 1px solid #22c55e44; }
.cq-quiz-explanation.wrong { background: #ef444415; border: 1px solid #ef444444; }

.cq-quiz-done {
  text-align: center;
  padding: 32px 20px;
  background: var(--cq-surface);
  border-radius: var(--cq-radius);
  border: 1px solid var(--cq-border);
}
.cq-quiz-done i { font-size: 40px; color: var(--cq-green); margin-bottom: 12px; }
.cq-quiz-done h3 { font-size: 1.2rem; margin-bottom: 8px; }
.cq-quiz-score { color: var(--cq-gold); font-weight: 700; margin-top: 8px; }

.cq-args-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 12px;
}
@media (min-width: 600px) {
  .cq-args-grid { grid-template-columns: 1fr 1fr; }
}

.cq-args-side {
  background: var(--cq-surface);
  border-radius: var(--cq-radius);
  padding: 16px;
  border: 1px solid var(--cq-border);
}
.cq-args-side.defence { border-top: 3px solid #3b82f6; }
.cq-args-side.prosecution { border-top: 3px solid var(--cq-red); }
.cq-args-side h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.cq-args-side.defence h4 { color: #60a5fa; }
.cq-args-side.prosecution h4 { color: #f87171; }

.cq-arg-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--cq-text);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}
.cq-arg-choice:hover:not(:disabled) { border-color: var(--cq-accent); }
.cq-arg-choice.picked.correct { border-color: var(--cq-green); background: #22c55e12; }
.cq-arg-choice.picked.wrong { border-color: var(--cq-red); background: #ef444412; }
.cq-arg-choice:disabled { cursor: default; }
.cq-arg-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--cq-border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 8px;
  opacity: 0;
}
.cq-arg-choice.picked .cq-arg-check { opacity: 1; background: var(--cq-green); border-color: var(--cq-green); color: white; }
.cq-arg-choice.picked.wrong .cq-arg-check { background: var(--cq-red); border-color: var(--cq-red); }

.cq-verdict-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.cq-verdict-opt {
  padding: 14px 16px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: all 0.2s;
}
.cq-verdict-opt strong { display: block; font-size: 14px; margin-bottom: 4px; }
.cq-verdict-opt span { font-size: 12px; color: var(--cq-muted); }
.cq-verdict-opt:hover { border-color: var(--cq-accent); }
.cq-verdict-opt.selected { border-color: var(--cq-accent); background: #3b82f615; box-shadow: 0 0 0 1px var(--cq-accent); }

.cq-reasoning-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cq-reasoning-count { font-size: 11px; font-weight: 600; color: var(--cq-muted); letter-spacing: 0.02em; }
.cq-reasoning-count.ok { color: var(--cq-green); }
.cq-reasoning.valid {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}
.cq-verdict-validation {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
}
.cq-verdict-validation.all-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}
.cq-val-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cq-muted);
  transition: color 0.2s;
}
.cq-val-item i { width: 14px; text-align: center; flex-shrink: 0; }
.cq-val-item.ok { color: var(--cq-green); font-weight: 600; }
.cq-reasoning {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--cq-text);
  resize: vertical;
  line-height: 1.6;
  outline: none;
}
.cq-reasoning:focus { border-color: var(--cq-accent); }

.cq-verdict-result {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: var(--cq-surface);
  border-radius: var(--cq-radius);
  border: 1px solid var(--cq-border);
}
.cq-verdict-result.show { display: block; }
.cq-verdict-result h3 { font-size: 1rem; margin-bottom: 12px; }
.cq-verdict-eval {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}
.cq-verdict-eval.good { background: #22c55e18; color: var(--cq-green); }
.cq-verdict-eval.partial { background: #fbbf2418; color: var(--cq-gold); }

.cq-verdict-choice {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--cq-muted);
}
.cq-reasoning-summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--cq-card);
  border-radius: 10px;
  border: 1px solid var(--cq-border);
  font-size: 13px;
  line-height: 1.55;
  color: var(--cq-text);
}

.cq-score-breakdown { margin-top: 12px; }
.cq-score-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--cq-border);
}
.cq-score-line.total { font-weight: 700; color: var(--cq-gold); border-bottom: none; margin-top: 4px; }

.cq-judgment-verdict {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #283b59, #24344f);
  border-radius: var(--cq-radius);
  border: 1px solid var(--cq-gold);
  margin-bottom: 20px;
}
.cq-judgment-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cq-gold);
  margin-bottom: 8px;
}
.cq-judgment-verdict h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.cq-learn-block {
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 18px;
  margin-bottom: 14px;
}
.cq-learn-block h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--cq-accent-light);
}
.cq-learn-block ul {
  padding-left: 18px;
  font-size: 13px;
  color: var(--cq-muted);
  line-height: 1.7;
}
.cq-learn-block li { margin-bottom: 6px; }

.cq-ipc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 500px) { .cq-ipc-grid { grid-template-columns: 1fr 1fr; } }

.cq-ipc-card {
  padding: 12px;
  background: var(--cq-card);
  border-radius: 10px;
  border: 1px solid var(--cq-border);
}
.cq-ipc-card strong { display: block; font-size: 12px; color: var(--cq-gold); margin-bottom: 4px; }
.cq-ipc-card p { font-size: 12px; color: var(--cq-muted); line-height: 1.5; }

.cq-final-score {
  text-align: center;
  padding: 28px;
  background: linear-gradient(135deg, #2a487022, #283b59);
  border-radius: var(--cq-radius);
  border: 1px solid var(--cq-border);
  margin-top: 20px;
}
.cq-final-score h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.cq-final-headline {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--cq-text);
}
.cq-final-headline strong { color: var(--cq-gold); }
.cq-final-subline {
  font-size: 0.875rem;
  color: var(--cq-muted);
  margin-bottom: 18px;
}
.cq-final-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-bottom: 20px;
}
.cq-running-score {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--cq-border);
  font-size: 0.9rem;
  color: var(--cq-muted);
}
.cq-running-score strong { color: var(--cq-gold); }
.cq-final-numbers span {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--cq-gold);
}
.cq-final-numbers label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cq-muted);
}

.cq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--cq-radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.cq-btn-primary {
  background: var(--cq-accent);
  color: white;
  width: 100%;
}
.cq-btn-primary:hover:not(:disabled) { background: #2563eb; }
.cq-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.cq-btn-share {
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  color: var(--cq-text);
  padding: 10px 20px;
  border-radius: var(--cq-radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cq-btn-share:hover { border-color: var(--cq-accent); }

.cq-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #1e2939ee;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--cq-border);
  max-width: 900px;
  margin: 0 auto;
}
.cq-btn-nav {
  flex: 1;
  padding: 12px;
  border-radius: var(--cq-radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--cq-border);
  background: var(--cq-surface);
  color: var(--cq-text);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cq-btn-nav:hover:not(:disabled) { border-color: var(--cq-accent); }
.cq-btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.cq-btn-nav.next {
  background: var(--cq-accent);
  border-color: var(--cq-accent);
  color: white;
  flex: 1.5;
}
.cq-btn-nav.next:hover:not(:disabled) { background: #2563eb; }

.cq-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #00000088;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cq-modal.open { opacity: 1; pointer-events: auto; }
.cq-modal-panel {
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.cq-modal.open .cq-modal-panel { transform: translateY(0); }
.cq-modal-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.cq-modal-body {
  font-size: 14px;
  color: var(--cq-muted);
  line-height: 1.7;
}
.cq-modal-close {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  color: var(--cq-text);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cq-feedback {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 300;
  padding: 12px 20px;
  border-radius: var(--cq-radius);
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  max-width: 90%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  box-shadow: 0 8px 30px #00000055;
}
.cq-feedback.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cq-feedback.xp { border-color: var(--cq-gold); }
.cq-feedback.wrong { border-color: var(--cq-red); }
.cq-feedback-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.cq-feedback-body { font-size: 12px; color: var(--cq-muted); }
.cq-feedback.xp .cq-feedback-title { color: var(--cq-gold); }

.cq-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--cq-muted);
}
.cq-error i { font-size: 48px; color: var(--cq-red); margin-bottom: 16px; }
.cq-error h2 { color: var(--cq-text); margin-bottom: 8px; }

/* Lexithra brand mark */
.lx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.lx-brand:hover { opacity: 0.88; }
.lx-brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #232731;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.28), 0 4px 10px rgb(0 0 0 / 0.35);
  border: 1px solid rgba(59, 130, 246, 0.22);
}
.lx-brand-emblem img {
  width: 100%;
  height: 145%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.lx-brand-compact .lx-brand-name { display: none; }
.lx-brand-compact .lx-brand-emblem {
  width: 34px;
  height: 34px;
}
.cq-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lx-brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--cq-text);
}

.cq-hub-footer a[href="/"] {
  color: var(--cq-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Hub page */
.cq-hub { min-height: 100vh; background: var(--cq-bg); }

.cq-hub-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #1e2939ee;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cq-border);
}

.cq-hub-hero {
  text-align: center;
  padding: 90px 24px 32px;
}
.cq-hub-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--cq-accent-light);
  margin-bottom: 12px;
}
.cq-hub-hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--cq-text);
  margin-bottom: 8px;
}
.cq-hub-hero p {
  color: var(--cq-muted);
  max-width: 520px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

/* CaseQuest home — five main feature sections always visible */
.cq-trifurcated {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 900px) {
  .cq-trifurcated {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .cq-hub-content {
    max-width: 960px;
  }
  #section-gamified-law {
    grid-column: 1 / -1;
  }
}

.cq-main-section {
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  border-left: 5px solid var(--section-color, var(--cq-accent));
  padding: 22px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cq-main-section:hover {
  border-color: var(--section-color, var(--cq-accent));
  box-shadow: 0 8px 28px #00000033;
}

.cq-main-section-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.cq-main-section-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  background: var(--section-color, var(--cq-accent));
}
.cq-main-section-head h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}
.cq-main-section-head p {
  font-size: 13px;
  color: var(--cq-muted);
  line-height: 1.6;
  margin: 0;
}

.cq-main-section-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--section-color, var(--cq-accent)), color-mix(in srgb, var(--section-color, var(--cq-accent)) 75%, #000));
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.2s;
}
.cq-main-section-cta:hover { filter: brightness(1.1); }

.cq-main-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--section-color, var(--cq-accent));
  background: color-mix(in srgb, var(--section-color, var(--cq-accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--section-color, var(--cq-accent)) 35%, transparent);
}
.cq-main-section-featured {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--section-color, var(--cq-accent)) 6%, var(--cq-card)),
    var(--cq-card)
  );
  box-shadow: 0 4px 24px color-mix(in srgb, var(--section-color, var(--cq-accent)) 12%, transparent);
}
.cq-main-section-featured:hover {
  box-shadow: 0 10px 32px color-mix(in srgb, var(--section-color, var(--cq-accent)) 22%, transparent);
}

.cq-course-subheadings-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cq-muted);
  margin-bottom: 10px;
}
.cq-course-subheadings {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cq-course-subheadings li a {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  text-decoration: none;
  color: var(--cq-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  transition: border-color 0.2s, background 0.2s;
}
.cq-course-subheadings li a:hover {
  border-color: var(--section-color, var(--cq-accent));
  background: color-mix(in srgb, var(--section-color, var(--cq-accent)) 8%, var(--cq-surface));
}
.cq-course-subheadings li.is-live a {
  border-color: color-mix(in srgb, var(--section-color, var(--cq-accent)) 35%, var(--cq-border));
}
.cq-course-subheadings li a > i:first-child {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  width: 16px;
  text-align: center;
  color: var(--section-color, var(--cq-accent-light));
  font-size: 12px;
}
.cq-course-subheadings li a span:first-of-type {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.cq-course-detail {
  grid-column: 2;
  grid-row: 2;
  font-size: 10px;
  font-weight: 500;
  color: var(--cq-muted);
  line-height: 1.45;
  display: none;
}
.cq-course-soon {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fb923c;
  margin-left: 0;
}
.cq-course-arrow {
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: center;
  font-size: 10px;
  color: var(--cq-muted);
  margin-left: 0;
}
.cq-main-section-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--section-color, var(--cq-accent-light));
  text-decoration: none;
}
.cq-main-section-link:hover { text-decoration: underline; }

.cq-subpage-section .cq-course-subheadings li a {
  border-color: color-mix(in srgb, var(--section-color, var(--cq-accent)) 20%, var(--cq-border));
}
.cq-subpage-section .cq-course-subheadings li a:hover,
.cq-subpage-section .cq-course-subheadings li.is-live a {
  border-color: color-mix(in srgb, var(--section-color, var(--cq-accent)) 40%, var(--cq-border));
}
.cq-subpage-section .cq-course-subheadings li a > i:first-child {
  color: var(--section-color, var(--cq-accent-light));
}

@media (min-width: 540px) {
  .cq-course-detail { display: block; }
}

@media (max-width: 539px) {
  .cq-course-subheadings li a:has(.cq-course-detail) {
    row-gap: 0;
  }
  .cq-course-subheadings li a span:first-of-type {
    padding-right: 4px;
  }
}

/* Legacy tabbed home (subpages) */
.cq-hub-tabbed { padding-top: 8px; }

.cq-section-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .cq-section-tabs { grid-template-columns: repeat(3, 1fr); }
}

.cq-section-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--cq-radius);
  border: 2px solid var(--cq-border);
  background: var(--cq-card);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cq-section-tab:hover {
  border-color: color-mix(in srgb, var(--tab-color, var(--cq-accent)) 50%, var(--cq-border));
  transform: translateY(-1px);
}
.cq-section-tab.is-active {
  border-color: var(--tab-color, var(--cq-accent));
  background: color-mix(in srgb, var(--tab-color, var(--cq-accent)) 12%, var(--cq-card));
  box-shadow: 0 6px 24px #00000033;
}
.cq-section-tab-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--tab-color, var(--cq-accent-light));
  background: color-mix(in srgb, var(--tab-color, var(--cq-accent)) 18%, var(--cq-surface));
}
.cq-section-tab.is-active .cq-section-tab-icon {
  color: white;
  background: var(--tab-color, var(--cq-accent));
}
.cq-section-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cq-section-tab-text strong {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.cq-section-tab-text small {
  font-size: 11px;
  color: var(--cq-muted);
  font-weight: 500;
}
.cq-section-tab.is-active .cq-section-tab-text small {
  color: color-mix(in srgb, var(--tab-color, var(--cq-accent)) 70%, var(--cq-muted));
}

.cq-section-panels { min-height: 200px; }
.cq-section-panel { animation: cqPanelIn 0.25s ease; }
@keyframes cqPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cq-panel-intro {
  font-size: 14px;
  color: var(--cq-muted);
  line-height: 1.65;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: 12px;
}
.cq-hub-tabbed .cq-area-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 540px) {
  .cq-hub-tabbed .cq-area-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .cq-hub-tabbed .cq-area-grid { grid-template-columns: repeat(3, 1fr); }
}

.cq-hub-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.cq-hub-hero-compact { padding-top: 80px; padding-bottom: 24px; }
.cq-hub-hero-sub {
  padding-top: 80px;
  padding-bottom: 28px;
  text-align: center;
}
.cq-hub-hero-sub .cq-breadcrumb { justify-content: center; margin-bottom: 16px; }
.cq-hub-hero-sub h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }

.cq-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cq-muted);
  flex-wrap: wrap;
}
.cq-breadcrumb a { color: var(--cq-accent-light); text-decoration: none; }
.cq-breadcrumb a:hover { text-decoration: underline; }
.cq-breadcrumb i { font-size: 9px; opacity: 0.6; }

.cq-sub-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.cq-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--cq-muted);
}
.cq-stat-pill i { color: var(--cq-accent-light); font-size: 10px; }

/* Category hub cards */
.cq-category-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cq-cat-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  border-left: 4px solid var(--cat-color, var(--cq-accent));
  overflow: hidden;
  transition: all 0.25s;
}
.cq-cat-card:hover,
article.cq-cat-card:focus-within {
  border-color: var(--cat-color, var(--cq-accent));
  transform: translateY(-3px);
  box-shadow: 0 10px 32px #00000044;
}
article.cq-cat-card { position: relative; }
.cq-cat-card-icon {
  flex-shrink: 0;
  width: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--cat-color, var(--cq-accent-light));
  background: color-mix(in srgb, var(--cat-color, var(--cq-accent)) 10%, var(--cq-surface));
}
.cq-cat-card-body { flex: 1; padding: 20px 18px; min-width: 0; }
.cq-cat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.cq-cat-card-body h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
}
.cq-cat-card-body h2 a {
  color: inherit;
  text-decoration: none;
}
.cq-cat-card-body h2 a:hover { color: var(--cat-color, var(--cq-accent-light)); }
.cq-cat-tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cat-color, var(--cq-accent-light));
  margin-bottom: 8px !important;
}
.cq-cat-subareas-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cq-muted);
  margin: 12px 0 8px;
}
.cq-cat-subareas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cq-cat-subareas li a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--cq-text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.cq-cat-subareas li a:hover {
  border-color: var(--cat-color, var(--cq-accent));
  background: color-mix(in srgb, var(--cat-color, var(--cq-accent)) 8%, var(--cq-surface));
}
.cq-cat-subareas li a i {
  width: 14px;
  text-align: center;
  color: var(--cat-color, var(--cq-accent-light));
  font-size: 11px;
}
.cq-cat-subareas li.is-live a {
  border-color: color-mix(in srgb, var(--cat-color, var(--cq-accent)) 30%, var(--cq-border));
}
.cq-sub-detail {
  font-size: 10px;
  font-weight: 500;
  color: var(--cq-muted);
  margin-left: auto;
}
.cq-sub-soon {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fb923c;
  margin-left: auto;
}
.cq-cat-card-body p {
  font-size: 13px;
  color: var(--cq-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.cq-cat-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--cq-muted);
}
.cq-cat-card-meta i { margin-right: 4px; color: var(--cat-color, var(--cq-accent-light)); }
.cq-cat-card-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  background: #f9731622;
  color: #fb923c;
  border: 1px solid #f9731644;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cq-cat-card-arrow {
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: var(--cq-muted);
  font-size: 14px;
  transition: color 0.2s;
}
.cq-cat-card:hover .cq-cat-card-arrow { color: var(--cat-color, var(--cq-accent-light)); }

.cq-cat-card-main .cq-cat-card-body h2 { font-size: 1.2rem; }

.cq-cat-card-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.cq-area-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--cq-border);
  background: var(--cq-surface);
  color: var(--cq-muted);
}
.cq-area-chip.available {
  border-color: color-mix(in srgb, var(--cq-accent) 35%, var(--cq-border));
  color: var(--cq-text);
}
.cq-area-chip.soon { opacity: 0.65; }

/* Law area sub-cards */
.cq-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cq-area-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  border-left: 4px solid var(--area-color, var(--cq-accent));
  overflow: hidden;
  transition: all 0.25s;
}
a.cq-area-card:hover {
  border-color: var(--area-color, var(--cq-accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px #00000033;
}
.cq-area-card-disabled {
  opacity: 0.72;
  cursor: default;
}
.cq-area-card-icon {
  flex-shrink: 0;
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--area-color, var(--cq-accent-light));
  background: color-mix(in srgb, var(--area-color, var(--cq-accent)) 10%, var(--cq-surface));
}
.cq-area-card-body { flex: 1; padding: 16px 14px; min-width: 0; }
.cq-area-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.cq-area-card-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.cq-area-card-body p {
  font-size: 12px;
  color: var(--cq-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}
.cq-area-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10px;
  color: var(--cq-muted);
}
.cq-area-card-meta i { margin-right: 3px; color: var(--area-color, var(--cq-accent-light)); }
.cq-area-card-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f9731622;
  color: #fb923c;
  border: 1px solid #f9731644;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cq-area-soon-label { color: #fb923c; }
.cq-area-card-arrow {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--cq-muted);
  font-size: 13px;
  transition: color 0.2s;
}
a.cq-area-card:hover .cq-area-card-arrow { color: var(--area-color, var(--cq-accent-light)); }

.cq-area-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cq-accent-light);
  text-decoration: none;
}
.cq-area-back-link:hover { text-decoration: underline; }
.cq-area-drill-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cq-area-drill-title i { color: var(--cq-accent-light); }

.pm-law-area-grid { margin-bottom: 8px; }

/* Interactive tools hub */
.cq-tools-module {
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 22px;
  margin-bottom: 20px;
}
.cq-tools-module-header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.cq-tools-module-header > div:last-child {
  min-width: 0;
  flex: 1;
}
.cq-tools-module-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
}
.cq-tools-module-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cq-accent-light);
  line-height: 1.45;
  margin-bottom: 6px;
}
.cq-tools-module-header h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 8px;
}
.cq-tools-module-header p {
  font-size: 13px;
  color: var(--cq-muted);
  line-height: 1.6;
  margin: 0;
}
.cq-tools-promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cq-tools-promo-single {
  grid-template-columns: 1fr;
  max-width: 360px;
}
.cq-tools-promo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.cq-tools-promo:hover {
  border-color: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #00000033;
}
.cq-tools-promo i { font-size: 1.5rem; color: #22c55e; margin-bottom: 10px; }
.cq-tools-promo h3 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 6px;
}
.cq-tools-promo p {
  font-size: 11px;
  color: var(--cq-muted);
  line-height: 1.45;
  margin: 0;
}
.cq-tools-launch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.2s;
}
.cq-tools-launch:hover { filter: brightness(1.08); }

.cq-coming-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--cq-surface);
  border: 1px dashed var(--cq-border);
  border-radius: var(--cq-radius);
  color: var(--cq-muted);
}
.cq-coming-card i { font-size: 1.75rem; color: var(--cq-accent-light); margin-bottom: 12px; }
.cq-coming-card h3 { font-family: 'Source Serif 4', Georgia, serif; color: var(--cq-text); margin-bottom: 8px; }
.cq-coming-card p { font-size: 13px; line-height: 1.6; }

/* Video summaries */
.cq-coming-banner {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, #7c2d1222, var(--cq-card));
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  margin-bottom: 28px;
}
.cq-coming-banner-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}
.cq-coming-banner h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.cq-coming-banner p {
  font-size: 14px;
  color: var(--cq-muted);
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 20px;
}
.cq-coming-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.cq-btn-primary, .cq-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.cq-btn-primary {
  background: linear-gradient(135deg, var(--cq-accent), #1d4ed8);
  color: white;
}
.cq-btn-primary:hover { filter: brightness(1.1); }
.cq-btn-ghost {
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  color: var(--cq-muted);
}
.cq-btn-ghost:hover { border-color: var(--cq-accent); color: var(--cq-text); }

.cq-videos-preview-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cq-accent-light);
  margin-bottom: 14px;
}
.cq-videos-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cq-video-preview-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  opacity: 0.85;
}
.cq-video-preview-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 52px;
  border-radius: 8px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cq-muted);
  font-size: 14px;
}
.cq-video-preview-body { flex: 1; min-width: 0; }
.cq-video-preview-cat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cq-accent-light);
}
.cq-video-preview-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0;
}
.cq-video-preview-body p { font-size: 12px; color: var(--cq-muted); line-height: 1.5; }
.cq-video-preview-soon {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fb923c;
  text-transform: uppercase;
}

.cq-course-cases {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--cq-border);
}
.cq-course-cases-title {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.cq-course-cases-title i { color: var(--course-color, #22c55e); }
.cq-course-cases-count {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--course-color, #22c55e) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--course-color, #22c55e) 35%, transparent);
  color: color-mix(in srgb, var(--course-color, #22c55e) 80%, white);
}
.cq-course-cases-note {
  font-size: 12px;
  color: var(--cq-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}
.cq-course-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.cq-course-case-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--course-color, #a855f7) 28%, var(--cq-border));
  background: color-mix(in srgb, var(--course-color, #a855f7) 6%, var(--cq-surface));
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}
.cq-course-case-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--course-color, #a855f7) 55%, var(--cq-border));
}
.cq-course-case-badge {
  align-self: flex-start;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--course-color, #a855f7) 14%, transparent);
  color: color-mix(in srgb, var(--course-color, #a855f7) 75%, white);
}
.cq-course-case-card strong {
  font-size: 13px;
  line-height: 1.35;
}
.cq-course-case-card p {
  font-size: 11px;
  color: var(--cq-muted);
  line-height: 1.45;
}

@media (max-width: 600px) {
  .cq-cat-card-icon { width: 56px; font-size: 1.25rem; }
  .cq-cat-card-arrow { display: none; }
  .cq-area-grid { grid-template-columns: 1fr; }
  .cq-area-card-icon { width: 52px; font-size: 1.15rem; }
  .cq-area-card-arrow { display: none; }
  .cq-tools-module-header { flex-direction: column; }
  .cq-tools-promo-grid { grid-template-columns: 1fr; }
  .cq-course-cases-grid { grid-template-columns: 1fr; }
}

.cq-category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cq-category-tabs::-webkit-scrollbar { display: none; }

.cq-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--cq-border);
  background: var(--cq-surface);
  color: var(--cq-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.cq-tab:hover { border-color: var(--cq-accent); color: var(--cq-text); }
.cq-tab.active {
  background: var(--cq-accent);
  border-color: var(--cq-accent);
  color: white;
}
.cq-tab i { font-size: 11px; }

.cq-case-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cq-case-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cq-card);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  overflow: hidden;
  transition: all 0.25s;
}
.cq-case-card:hover {
  border-color: color-mix(in srgb, var(--cq-accent) 65%, var(--cq-border));
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(96, 165, 250, 0.12);
}
.cq-case-card.locked {
  opacity: 0.72;
  cursor: not-allowed;
  pointer-events: none;
}
.cq-case-card.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--cq-border);
}
.cq-case-lock-notice {
  margin-top: 10px;
  font-size: 12px;
  color: var(--cq-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cq-case-lock-notice i { color: #f59e0b; }
.cq-tag.locked {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.cq-case-card-banner {
  padding: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #3b82f6) 20%, #1e2939), #1e2939);
  border-bottom: 1px solid var(--cq-border);
  position: relative;
}
.cq-case-portraits {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: flex-end;
}
.cq-mini-portrait svg { width: 64px; height: auto; border-radius: 8px; }
.cq-case-cat {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: #1e2939aa;
  border: 1px solid var(--cq-border);
  color: var(--cq-muted);
}
.cq-case-cat i { margin-right: 4px; }

.cq-case-card-body { padding: 18px; }
.cq-case-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.cq-case-card-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.cq-case-card-body p {
  font-size: 13px;
  color: var(--cq-muted);
  line-height: 1.5;
}
.cq-case-meta {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--cq-muted);
}
.cq-case-meta i { margin-right: 4px; color: var(--cq-accent-light); }

.cq-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
}
.cq-tag.new { color: var(--cq-accent-light); }
.cq-tag.progress { color: var(--cq-gold); border-color: #c9a22744; }
.cq-tag.done { color: var(--cq-green); border-color: #22c55e44; }

.cq-empty {
  text-align: center;
  padding: 40px;
  color: var(--cq-muted);
  font-size: 14px;
}

.cq-hub-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--cq-muted);
}
.cq-hub-footer a { color: var(--cq-accent-light); text-decoration: none; }
.cq-hub-footer a:hover { text-decoration: underline; }

/* Provisions Mastery (Family Law) */
.cq-provisions-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cq-border);
}
.cq-provisions-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c084fc;
  margin-bottom: 14px;
}
.cq-provisions-heading i { font-size: 13px; }
.cq-provisions-link {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cq-accent-light);
  text-decoration: none;
}
.cq-provisions-link:hover { text-decoration: underline; }
.cq-provisions-link i { font-size: 9px; margin-left: 4px; }

#cq-provisions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cq-provisions-card {
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #581c8718, var(--cq-card));
  border: 1px solid #7c3aed44;
  border-radius: var(--cq-radius);
  padding: 18px;
  transition: all 0.25s;
}
.cq-provisions-card:hover {
  border-color: #a855f7;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px #00000044;
}
.cq-provisions-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}
.cq-provisions-card-body { flex: 1; min-width: 0; }
.cq-provisions-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.cq-provisions-card-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}
.cq-provisions-card-body p {
  font-size: 12px;
  color: var(--cq-muted);
  line-height: 1.5;
}

/* Case RAG assistant (Tier 0 offline) */
.lx-rag-root {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: min(380px, calc(100vw - 24px));
}

.lx-rag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid var(--cq-border);
  border-radius: 999px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lx-rag-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.45);
}

.lx-rag-panel {
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--cq-surface);
  border: 1px solid var(--cq-border);
  border-radius: var(--cq-radius);
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.lx-rag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lx-rag-header h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lx-rag-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--cq-border);
  border-radius: 8px;
  background: var(--cq-card);
  color: var(--cq-muted);
  cursor: pointer;
}

.lx-rag-hint {
  font-size: 12px;
  color: var(--cq-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.lx-rag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lx-rag-chip {
  border: 1px solid var(--cq-border);
  background: var(--cq-card);
  color: var(--cq-muted);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.lx-rag-chip:hover {
  color: var(--cq-text);
  border-color: var(--cq-accent);
}

.lx-rag-label {
  display: block;
  font-size: 11px;
  color: var(--cq-muted);
  margin-bottom: 6px;
}

.lx-rag-input-row {
  display: flex;
  gap: 8px;
}

.lx-rag-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--cq-border);
  border-radius: 10px;
  background: var(--cq-card);
  color: var(--cq-text);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}

.lx-rag-input:focus {
  outline: none;
  border-color: var(--cq-accent);
}

.lx-rag-submit {
  width: 42px;
  border: none;
  border-radius: 10px;
  background: var(--cq-accent);
  color: #fff;
  cursor: pointer;
}

.lx-rag-status {
  margin-top: 10px;
  font-size: 11px;
  color: var(--cq-muted);
}

.lx-rag-answer {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cq-text);
}

.lx-rag-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lx-rag-source {
  font-size: 10px;
  color: var(--cq-accent-light);
  border: 1px solid var(--cq-border);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 640px) {
  .lx-rag-root {
    right: 10px;
    bottom: 76px;
  }

  .lx-rag-toggle span {
    display: none;
  }

  .lx-rag-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}