/* ─────────────────────────────────────────────
   econOS – Design System v1.0
   Font: Inter  |  Max-width: 1200px
───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS ── */
:root {
  /* Backgrounds */
  --bg:          #F8FAFC;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F1F5F9;
  --bg-hover:    #F8FAFC;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-inverse:   #FFFFFF;

  /* Borders */
  --border:       #E2E8F0;
  --border-focus: #2563EB;

  /* Stage colours */
  --learn:        #22C55E;
  --learn-light:  #DCFCE7;
  --learn-dark:   #16A34A;
  --link:         #F59E0B;
  --link-light:   #FEF3C7;
  --link-dark:    #D97706;
  --land:         #2563EB;
  --land-light:   #DBEAFE;
  --land-dark:    #1D4ED8;

  /* Supporting */
  --navy:         #0F172A;
  --slate:        #64748B;
  --charcoal:     #334155;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm:  0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:  0 4px 6px rgba(15,23,42,0.05), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg:  0 10px 15px rgba(15,23,42,0.06), 0 4px 6px rgba(15,23,42,0.04);
  --shadow-xl:  0 20px 25px rgba(15,23,42,0.07), 0 10px 10px rgba(15,23,42,0.04);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Spacing */
  --sidebar-w: 240px;
  --header-h:  64px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 300ms ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── TYPOGRAPHY ── */
.t-h1  { font-size: 2.5rem;  font-weight: 700; line-height: 1.2; }
.t-h2  { font-size: 2rem;    font-weight: 700; line-height: 1.25; }
.t-h3  { font-size: 1.5rem;  font-weight: 600; line-height: 1.3; }
.t-h4  { font-size: 1.25rem; font-weight: 600; line-height: 1.35; }
.t-h5  { font-size: 1.125rem;font-weight: 600; line-height: 1.4; }
.t-h6  { font-size: 1rem;    font-weight: 600; line-height: 1.4; }
.t-lg  { font-size: 1.125rem; }
.t-sm  { font-size: 0.875rem; }
.t-xs  { font-size: 0.75rem; }
.t-muted   { color: var(--text-secondary); }
.t-faint   { color: var(--text-muted); }
.t-learn   { color: var(--learn-dark); }
.t-link    { color: var(--link-dark); }
.t-land    { color: var(--land); }

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
}
.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.logo-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}
.logo-dots span {
  display: block;
  border-radius: 50%;
}
.logo-dots .d1 { width:8px; height:8px; background: var(--learn); margin-top:6px; }
.logo-dots .d2 { width:10px; height:10px; background: var(--link); margin-top:2px; }
.logo-dots .d3 { width:12px; height:12px; background: var(--land); margin-top:-2px; }
.logo-wordmark { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-wordmark .econ { color: var(--navy); }
.logo-wordmark .os   { color: var(--land); }
.logo-tagline { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; letter-spacing: 0.01em; }
.logo-tagline .t-learn { color: var(--learn-dark); font-weight: 600; }
.logo-tagline .t-link  { color: var(--link-dark);  font-weight: 600; }
.logo-tagline .t-land  { color: var(--land);       font-weight: 600; }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-section-label {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.25rem;
  margin: 1px 0.5rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.nav-item.active { background: var(--land-light); color: var(--land); font-weight: 600; }
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--land);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.nav-badge.new { background: var(--learn); }
.nav-badge.count { background: var(--link); color: var(--navy); }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-subtle); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--land);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* Upgrade card in sidebar */
.sidebar-upgrade {
  margin: 0 0.75rem 0.75rem;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B44;
  border-radius: var(--r-md);
  padding: 0.875rem;
}
.sidebar-upgrade .crown { font-size: 1.25rem; margin-bottom: 0.375rem; }
.sidebar-upgrade h6 { font-size: 0.8rem; font-weight: 700; color: var(--navy); }
.sidebar-upgrade p { font-size: 0.7rem; color: var(--charcoal); margin: 0.2rem 0 0.625rem; }

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.main-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.main-header h1 { font-size: 1.25rem; font-weight: 700; }
.main-header .header-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }
.main-header .header-title { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.page-body { padding: 2rem; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad    { padding: 1.5rem; }
.card-pad-sm { padding: 1rem; }
.card-pad-lg { padding: 2rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  border: none;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn-sm  { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.75rem 1.5rem;   font-size: 1rem; border-radius: var(--r-md); }
.btn-xl  { padding: 0.875rem 2rem;    font-size: 1rem; border-radius: var(--r-md); font-weight: 700; }

.btn-primary  { background: var(--land); color: white; }
.btn-primary:hover  { background: var(--land-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-learn    { background: var(--learn); color: white; }
.btn-learn:hover { background: var(--learn-dark); transform: translateY(-1px); }
.btn-link-stage { background: var(--link); color: var(--navy); }
.btn-link-stage:hover { background: var(--link-dark); color: white; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-subtle); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-danger  { background: #EF4444; color: white; }
.btn-danger:hover  { background: #DC2626; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-icon:hover { background: var(--bg-subtle); color: var(--text-primary); }

/* ── STAGE PILLS ── */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-learn { background: var(--learn-light); color: var(--learn-dark); }
.pill-link  { background: var(--link-light);  color: var(--link-dark); }
.pill-land  { background: var(--land-light);  color: var(--land-dark); }
.pill-mixed { background: #F3E8FF; color: #7C3AED; }

/* ── PROGRESS ── */
.progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s ease;
}
.progress-bar.thick { height: 8px; }
.fill-learn { background: var(--learn); }
.fill-link  { background: var(--link); }
.fill-land  { background: var(--land); }
.fill-multi {
  background: linear-gradient(90deg, var(--learn) 0%, var(--link) 50%, var(--land) 100%);
}

/* Donut chart (CSS-only) */
.donut-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.donut-label { position: absolute; text-align: center; }

/* ── STREAK ── */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: var(--r-full);
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}
.streak-badge .flame { font-size: 1rem; }

/* ── STATUS INDICATORS ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green  { background: var(--learn); }
.status-dot.amber  { background: var(--link); }
.status-dot.blue   { background: var(--land); }
.status-dot.red    { background: #EF4444; }
.status-dot.grey   { background: var(--border); }

/* ── TOPIC STATUS ICONS ── */
.topic-status {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topic-status.complete  { background: var(--learn); color: white; }
.topic-status.progress  { background: var(--land-light); color: var(--land); border: 2px solid var(--land); }
.topic-status.needswork { background: var(--link-light); color: var(--link-dark); border: 2px solid var(--link); }
.topic-status.locked    { background: var(--bg-subtle); color: var(--text-muted); border: 2px solid var(--border); }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.375rem; letter-spacing: 0.01em; }
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.form-input:focus { border-color: var(--land); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.875rem center; padding-right: 2.5rem; }

/* ── TABS ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--land); border-bottom-color: var(--land); font-weight: 600; }

/* ── GRID UTILITIES ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }

/* ── FLEX UTILITIES ── */
.flex       { display: flex; }
.flex-col   { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* ── SPACING UTILITIES ── */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── NOTIFICATION BELL ── */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}
.notif-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid white;
  font-size: 0.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state h4 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 0.375rem; }
.empty-state p { font-size: 0.875rem; }

/* ── TOOLTIP ── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
[data-tip]:hover::after { opacity: 1; }

/* ── STAGE INDICATORS (BREADCRUMB) ── */
.stage-trail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stage-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stage-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
}
.stage-circle.active-learn { background: var(--learn); border-color: var(--learn); color: white; }
.stage-circle.active-link  { background: var(--link);  border-color: var(--link);  color: var(--navy); }
.stage-circle.active-land  { background: var(--land);  border-color: var(--land);  color: white; }
.stage-circle.done { background: var(--bg-subtle); border-color: var(--border); color: var(--text-muted); }
.stage-trail-line { width: 32px; height: 2px; background: var(--border); border-radius: 1px; }
.stage-trail-line.done-learn { background: var(--learn); }
.stage-trail-line.done-link  { background: var(--link); }
.stage-node-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
.stage-node-label.active-learn { color: var(--learn-dark); }
.stage-node-label.active-link  { color: var(--link-dark); }
.stage-node-label.active-land  { color: var(--land); }

/* ── METRIC CARD ── */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.metric-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.metric-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; margin: 0.375rem 0 0.25rem; }
.metric-sub   { font-size: 0.75rem; color: var(--text-secondary); }
.metric-trend { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 2px; }
.metric-trend.up   { color: var(--learn-dark); }
.metric-trend.down { color: #EF4444; }

/* ── SPARKLINE PLACEHOLDER ── */
.sparkline {
  height: 32px;
  background: linear-gradient(180deg, rgba(34,197,94,0.08) 0%, transparent 100%);
  border-radius: 4px;
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
}
.sparkline::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 2px;
  background: var(--learn);
  border-radius: 1px;
}

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.875rem 0.875rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ── CHECKBOX CUSTOM ── */
.check-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0;
  cursor: pointer;
  font-size: 0.875rem;
}
.check-box {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.check-item.checked .check-box { background: var(--land); border-color: var(--land); }
.check-item.checked .check-box::after { content: '✓'; color: white; font-size: 0.65rem; font-weight: 800; }
.check-item.checked-amber .check-box { background: var(--link); border-color: var(--link); }
.check-item.checked-amber .check-box::after { content: '✓'; color: var(--navy); font-size: 0.65rem; font-weight: 800; }

/* ── ANSWER CARDS (Spot the Flaw) ── */
.answer-card {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
}
.answer-card:hover { border-color: var(--land); box-shadow: var(--shadow-md); }
.answer-card.selected-best { border-color: var(--learn); background: var(--learn-light); }
.answer-card.selected-bad  { border-color: #EF4444; background: #FEF2F2; }
.answer-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.answer-label { font-size: 0.8rem; font-weight: 700; }
.answer-quality {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-full);
}
.quality-low  { background: #FEE2E2; color: #DC2626; }
.quality-mid  { background: var(--link-light); color: var(--link-dark); }
.quality-high { background: var(--learn-light); color: var(--learn-dark); }
.answer-radio {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}
.answer-card.selected-best .answer-radio { border-color: var(--learn); background: var(--learn); }
.answer-card.selected-best .answer-radio::after { content: ''; width: 8px; height: 8px; background: white; border-radius: 50%; }

/* ── CHAIN BUILDER ── */
.chain-slot {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 0.875rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all var(--t-fast);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chain-slot.active { border-color: var(--land); background: var(--land-light); color: var(--land); }
.chain-slot.filled { border-style: solid; border-color: var(--learn); background: var(--learn-light); }
.chain-slot.imposter { border-color: #EF4444; background: #FEF2F2; }

.chain-piece {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.8rem;
  cursor: grab;
  transition: all var(--t-fast);
  box-shadow: var(--shadow-xs);
}
.chain-piece:hover { box-shadow: var(--shadow-md); border-color: var(--land); transform: translateY(-1px); }
.chain-piece.dragging { opacity: 0.5; cursor: grabbing; }

/* ── LOADING SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; display: flex; flex-direction: column; gap: 0.625rem; }
.toast {
  background: var(--navy);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  animation: toast-in 0.2s ease;
  max-width: 320px;
}
.toast.success { background: var(--learn-dark); }
.toast.warning { background: var(--link-dark); color: var(--navy); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
