/* ============================================
   Case File — landing + investigation game
   Uses variables.css tokens. Layout + mechanics
   adapted from hackers-eyes archive.
   ============================================ */

/* ── Shared container ── */
.case-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: calc(var(--navbar-height) + var(--space-12)) var(--space-6) var(--space-20);
}

/* ============================================
   LANDING PAGE
   ============================================ */

.case-hero {
  text-align: center;
  margin-bottom: var(--space-12);
}

.case-hero-eyebrow {
  display: inline-block;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: var(--space-4);
}

.case-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.case-hero-subtitle {
  max-width: 680px;
  margin: 0 auto;
  font-size: var(--text-body-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ── Current case dossier ── */
.dossier {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: var(--space-12);
  position: relative;
}

.dossier::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-vivid);
}

.dossier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-6) var(--space-2);
}

.case-number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--accent-primary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-light);
}
.difficulty-easy { background: var(--success); }
.difficulty-medium { background: var(--warning); }
.difficulty-hard { background: var(--danger); }

.dossier-body {
  padding: var(--space-5) var(--space-6) var(--space-6);
}

.dossier-cover {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
}

.dossier-cover-img {
  flex-shrink: 0;
  width: 220px;
  height: auto;
  max-height: 220px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--border-default);
}

.dossier-cover-text { flex: 1; min-width: 0; }

.dossier-title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.client-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-small);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.client-info-item strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.alert-callout {
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  font-size: var(--text-small);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.alert-callout-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--danger);
  margin-bottom: var(--space-2);
}

.dossier-intro {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.dossier-cta {
  text-align: center;
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}

.btn-investigate {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-light);
  background: var(--gradient-vivid);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-primary);
}

.btn-investigate:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-lg);
  color: var(--text-light);
}

/* ── How it works ── */
.how-section {
  margin-bottom: var(--space-12);
}

.how-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-8);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.how-step {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
}

.how-step-num {
  width: 36px; height: 36px;
  background: var(--accent-primary);
  color: var(--text-light);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}

.how-step h4 {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.how-step p {
  font-size: var(--text-small);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
  .how-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .how-steps { grid-template-columns: 1fr; }
}

/* ── Archive grid ── */
.archive-section { margin-bottom: var(--space-12); }

.archive-section-header {
  margin-bottom: var(--space-6);
}

.archive-section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.archive-section-header p {
  color: var(--text-tertiary);
  font-size: var(--text-body);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.archive-card {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.archive-card:hover:not(.locked) {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.archive-card.locked {
  opacity: 0.65;
  cursor: default;
}

.archive-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.archive-case-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--accent-primary);
  letter-spacing: 0.08em;
}

.archive-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin: 0;
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.archive-card-cta {
  margin-top: auto;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.archive-card.locked .archive-card-cta { color: var(--text-tertiary); }

/* ── Loss-leader CTA block ── */
.casefile-cta-block {
  background: linear-gradient(135deg, var(--indigo-950), var(--violet-700));
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  color: var(--text-light);
  text-align: center;
  margin-top: var(--space-12);
}

.casefile-cta-block h2 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  color: var(--text-light);
}

.casefile-cta-block p {
  max-width: 640px;
  margin: 0 auto var(--space-6);
  font-size: var(--text-body-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-light-secondary);
}

.casefile-cta-block p strong {
  color: var(--text-light);
  font-weight: var(--weight-bold);
}

.casefile-cta-block .btn-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--indigo-950);
  background: var(--text-light);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.casefile-cta-block .btn-cta:hover {
  transform: translateY(-2px);
}

.casefile-cta-block .product-links {
  margin-top: var(--space-5);
  font-size: var(--text-small);
  color: var(--text-light-muted);
}

.casefile-cta-block .product-links a {
  color: var(--text-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   INVESTIGATION PAGE
   ============================================ */

.investigate-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(var(--navbar-height) + var(--space-6)) var(--space-6) var(--space-16);
}

/* ── Difficulty selector ── */
.diff-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
}

.diff-bar-label {
  font-size: var(--text-small);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
  margin-right: var(--space-2);
}

.diff-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  background: var(--bg-pure);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .diff-bar {
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    gap: var(--space-1);
  }
  .diff-bar-label {
    flex-basis: 100%;
    text-align: center;
    margin-right: 0;
    margin-bottom: var(--space-1);
  }
  .diff-btn {
    padding: var(--space-2) var(--space-3);
    flex: 1 1 auto;
  }
}

.diff-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.diff-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-light);
}

/* Difficulty-based visibility */
body.diff-hard .evidence-type-badge,
body.diff-hard .teaches-callout,
body.diff-hard .evidence-analysis { display: none !important; }

body.diff-intermediate .teaches-callout,
body.diff-intermediate .evidence-analysis { display: none !important; }

/* ── Top bar ── */
.case-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.topbar-left h1 {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.case-id-badge {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  background: var(--violet-100);
  color: var(--violet-700);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.case-client {
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.case-client strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.case-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-small);
  color: var(--text-secondary);
}

.case-stat .stat-value {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.btn-file-report {
  padding: var(--space-2-5) var(--space-5);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-light);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-file-report:hover {
  background: var(--accent-primary-dark);
}

/* ── Two-column layout ── */
.case-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 1024px) {
  .case-layout { grid-template-columns: 1fr; }
}

/* ── Area grid ── */
.area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
  .area-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .area-grid { grid-template-columns: 1fr; }
}

.area-card {
  background: var(--bg-pure);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  position: relative;
}

.area-card:hover:not(.examined) {
  border-color: var(--accent-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.area-card.exploring {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12), var(--shadow-md);
}

.area-card.examined {
  opacity: 0.55;
  cursor: default;
}

.area-img {
  width: 100%;
  height: 90px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.area-name {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.area-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

.area-check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--success);
  color: var(--text-light);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--weight-bold);
}

.area-card.examined .area-check { display: flex; }

/* ── Expanded area detail ── */
.area-detail {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-5);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.area-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-light);
}

.area-detail-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.close-area {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-body-lg);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.close-area:hover {
  color: var(--text-primary);
  background: var(--bg-cloud);
}

/* ── Item rows ── */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.item-row:last-child { border-bottom: none; }

.item-row-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.item-status {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: transparent;
  font-weight: var(--weight-bold);
}

.item-row.examined .item-status {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-light);
}

.item-name {
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.examine-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.examine-btn:hover {
  background: var(--accent-primary);
  color: var(--text-light);
}

.item-row.examined .examine-btn { display: none; }

/* ── Evidence reveal ── */
.evidence-reveal {
  padding: var(--space-5);
  border-top: 1px solid var(--border-light);
  background: var(--bg-soft);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.evidence-type-badge {
  display: inline-flex;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-3);
}

.evidence-type-badge.critical { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.evidence-type-badge.supporting { background: var(--violet-100); color: var(--violet-700); }
.evidence-type-badge.dead_end { background: var(--bg-mist); color: var(--text-tertiary); }
.evidence-type-badge.red_herring { background: rgba(217, 119, 6, 0.12); color: var(--warning); }

.evidence-raw {
  background: var(--indigo-950);
  color: #cbd5e1;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  margin-bottom: var(--space-3);
}

.evidence-analysis {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.teaches-callout {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--violet-50);
  border-left: 3px solid var(--violet-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-small);
  color: var(--violet-900);
  line-height: var(--leading-relaxed);
}

.teaches-callout strong {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  font-size: var(--text-xs);
  color: var(--violet-700);
  display: block;
  margin-bottom: var(--space-1);
}

/* ── Right column: evidence board + notebook ── */
.right-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-4));
}

@media (max-width: 1024px) {
  .right-column { position: static; }
}

.panel {
  background: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-soft);
}

.panel-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.evidence-count {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  background: var(--violet-100);
  color: var(--violet-700);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.evidence-body {
  padding: var(--space-3);
  max-height: 420px;
  overflow-y: auto;
}

.evidence-empty {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-tertiary);
  font-size: var(--text-small);
}

.evidence-pin {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.evidence-pin:last-child { border-bottom: none; }

.evidence-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 6px;
}

.evidence-pin-dot.critical { background: var(--danger); }
.evidence-pin-dot.supporting { background: var(--violet-500); }

.evidence-pin-text {
  font-size: var(--text-small);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}

.evidence-pin-text strong {
  display: block;
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}

.evidence-pin-text em {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.notebook-body {
  padding: var(--space-3);
}

.notebook-body textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--text-primary);
  resize: vertical;
  background: var(--bg-pure);
}

.notebook-body textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ── Report overlay ── */
.report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: var(--z-modal);
  overflow-y: auto;
}

.report-overlay.active {
  display: flex;
}

.report-panel {
  background: var(--bg-pure);
  border-radius: var(--radius-2xl);
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-3xl);
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-light);
}

.report-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.close-report {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.close-report:hover {
  color: var(--text-primary);
  background: var(--bg-cloud);
}

.report-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.report-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ── Report questions ── */
.report-question {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-light);
}

.report-question:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.q-number {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
}

.q-text {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
}

.q-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-body);
}

.q-option:hover:not([style*="pointer-events"]) {
  border-color: var(--accent-primary);
  background: var(--violet-50);
}

.q-option.selected {
  border-color: var(--accent-primary);
  background: var(--violet-50);
}

.q-option.correct {
  border-color: var(--success);
  background: rgba(5, 150, 105, 0.05);
}

.q-option.incorrect {
  border-color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

.q-radio {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-medium);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
}

.q-option.selected .q-radio,
.q-option.correct .q-radio {
  border-color: currentColor;
}

.q-option.selected .q-radio::after,
.q-option.correct .q-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.q-option.correct { color: var(--success); }
.q-option.incorrect { color: var(--danger); }

.q-explanation {
  display: none;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-small);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.q-explanation.visible { display: block; }

/* ── Results ── */
.results-section { display: none; }
.results-section.active { display: flex; flex-direction: column; overflow: hidden; }

.results-content {
  padding: var(--space-6);
  overflow-y: auto;
}

.results-grade {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--gradient-soft);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
}

.grade-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  background: var(--gradient-vivid);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grade-subtitle {
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.results-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.results-card {
  text-align: center;
  padding: var(--space-5);
  background: var(--bg-soft);
  border-radius: var(--radius-xl);
}

.rc-value {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.rc-label {
  font-size: var(--text-small);
  color: var(--text-tertiary);
  font-weight: var(--weight-medium);
}

.evidence-check-list h4,
.solution-narrative h4,
.key-lessons h4 {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
}

.evidence-check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.evidence-check-item:last-child { border-bottom: none; }

.check-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  flex-shrink: 0;
  color: var(--text-light);
}

.check-icon.found { background: var(--success); }
.check-icon.missed { background: var(--danger); }

.check-text {
  font-size: var(--text-small);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
}

.check-text strong { display: block; margin-bottom: 2px; }

.consequence {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-style: italic;
}

.solution-narrative,
.key-lessons {
  padding: var(--space-5);
  background: var(--bg-soft);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
}

.solution-narrative p {
  font-size: var(--text-body);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.key-lessons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.key-lessons li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-small);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.key-lessons li::before {
  content: '✓';
  color: var(--success);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
  margin-top: 1px;
}

.results-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-light);
}

.btn-secondary {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  background: var(--bg-soft);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-cloud);
}

/* ── Responsive tweaks ── */
@media (max-width: 640px) {
  .case-topbar { flex-direction: column; align-items: stretch; }
  .dossier-cover { flex-direction: column; align-items: center; text-align: center; }
  .dossier-cover-img { width: 180px; }
  .results-breakdown { grid-template-columns: 1fr; }
}
