/* ── Buttons ── */
.btn {
  padding: 8px 18px;
  border-radius: 9999px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--anim-base) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:active { transform: scale(var(--press-scale)); }
.btn:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.btn-pri {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  box-shadow: var(--btn-pri-shadow);
}
.btn-pri:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-pri-shadow-hover);
}
.btn-pri:disabled { background: var(--dim); cursor: not-allowed; box-shadow: none; }
.btn-sec { background: var(--glass-bg); color: var(--tx); border: 1px solid var(--glass-border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.btn-sec:hover { border-color: var(--acc); color: var(--wh); }
.btn-grn { background: var(--grn); color: var(--text-on-color); }
.btn-grn:hover { filter: brightness(0.9); }
.btn-rev { background: var(--amb); color: var(--text-on-color); }
.btn-rev:hover { filter: brightness(0.9); }
.btn-red { background: var(--red); color: var(--text-on-accent); }
.btn-red:hover { filter: brightness(0.9); }

.btn-icon {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--anim-base) ease, color var(--anim-base), border-color var(--anim-base);
  margin-bottom: 0;
}
.btn-icon:active { transform: scale(var(--press-scale)); }
.btn-icon:hover { border-color: var(--acc); color: var(--wh); }
.btn-icon.danger { color: var(--red); }
.btn-icon.danger:hover { border-color: var(--red-border); color: var(--red); }
.btn-icon-label {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: var(--acc);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.2px;
  opacity: 0.7;
}

.btn-back {
  background: none;
  border: none;
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  transition: color var(--anim-fast);
}
.btn-back:hover { color: var(--tx); }
.btn-back svg { flex-shrink: 0; }

/* ── Card — Clean Authority ── */
.glass-card, .glass-card-elevated, .glass-card-hero, .liquid-glass {
  position: relative;
  background: var(--card-gradient), var(--sf);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform var(--anim-base) var(--ease-out),
              box-shadow var(--anim-base) var(--ease-out);
}
.glass-card::before, .glass-card-elevated::before, .glass-card-hero::before, .liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-topline), transparent);
  pointer-events: none;
  z-index: 1;
  border-radius: var(--r) var(--r) 0 0;
}

/* ── Premium Card — Gradient + Glow ── */
.premium-card {
  position: relative;
  background: var(--card-gradient), var(--sf);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform var(--anim-base) var(--ease-out),
              box-shadow var(--anim-base) var(--ease-out);
}
.premium-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-topline), transparent);
  pointer-events: none;
  z-index: 1;
  border-radius: var(--r) var(--r) 0 0;
}
.premium-card:hover {
  box-shadow: var(--glow-blue);
  transform: translateY(-1px);
}

/* ── Premium Card Hero — Accent glow variant ── */
.premium-card-hero {
  position: relative;
  background: var(--card-gradient), var(--sf);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--glow-blue);
  overflow: hidden;
}
.premium-card-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}

/* ── Flat Section — Borderless Content ── */
.flat-section {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ── Flat Row — Clean List Item ── */
.flat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--flat-divider);
  transition: background 0.15s ease;
}
.flat-row:last-child { border-bottom: none; }
.flat-row:active { background: var(--flat-row-hover); }

/* ── Flat Row Accent — Left Border ── */
.flat-row-accent {
  border-left: var(--flat-accent-width) solid var(--accent-color, var(--acc));
  padding-left: 12px;
  margin-left: 0;
}

/* ── Flat Card — Outline Only ── */
.flat-card {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.flat-card:hover { border-color: var(--acc); background: var(--flat-row-hover); }
.flat-card:active { transform: scale(var(--press-scale)); }

/* ── Action Button — Compact Pill ── */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--wh);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.action-btn:hover { border-color: var(--acc); color: var(--acc); }
.action-btn:active { transform: scale(var(--press-scale)); }
.action-btn svg { width: 16px; height: 16px; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--cd) 25%, var(--cd2) 50%, var(--cd) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r2);
}

/* ── Stat Pill ── */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  font-weight: 700;
  color: var(--tx);
  white-space: nowrap;
  animation: countUp var(--anim-slow) var(--ease-out) both;
}
.stat-pill svg { width: 12px; height: 12px; flex-shrink: 0; }
.stat-pill .stat-pill-val { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ── Section Label ── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ── Number Display ── */
.number-lg {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  animation: countUp var(--anim-slow) var(--ease-out) both;
}
.number-xl {
  font-size: 40px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  animation: countUp var(--anim-slow) var(--ease-out) both;
}

/* ── Card Hover Utility ── */
.card-hover {
  transition: transform var(--anim-base) var(--ease-out),
              box-shadow var(--anim-base) var(--ease-out),
              border-color var(--anim-base) var(--ease-out);
}
.card-hover:hover {
  transform: var(--hover-lift);
  box-shadow: var(--glow-blue);
  border-color: var(--glass-border);
}


.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* ── Chips ── */
.chip {
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--anim-fast) ease;
}
.chip:hover { border-color: var(--acc); color: var(--wh); }
.chip.on {
  border-color: var(--acc);
  color: var(--wh);
  background: var(--acc-subtle);
}
.chip .b {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 3px;
  background: var(--subtle-bg);
  color: var(--dim);
}
.chip.on .b {
  background: var(--acc-25);
  color: var(--acc);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--anim-base) var(--ease-out);
}
.modal-card {
  padding: 24px;
  min-width: 320px;
  max-width: 90vw;
  background: var(--card-gradient), var(--sf);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-hero);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: scaleIn var(--anim-base) var(--ease-out);
}

/* ── Note Panel ── */
.note-panel {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--r2);
  background: var(--cyn-soft);
  border: 1px solid var(--cyn-border);
}
.note-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyn-soft-2, var(--cyn-soft));
  color: var(--cyn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.note-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--tx);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  background: var(--red);
  color: var(--text-on-accent);
}

/* ── PWA Install Screen ── */
.pwa-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--anim-slow) ease;
}
.pwa-screen.visible { opacity: 1; }
.pwa-screen.hiding { opacity: 0; }
.pwa-screen-content {
  text-align: center;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
}
.pwa-screen-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 24px;
  box-shadow: var(--elev-2);
}
.pwa-screen-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--wh);
  margin-bottom: 8px;
}
.pwa-screen-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: var(--dim);
  margin-bottom: 32px;
}
.pwa-steps {
  text-align: left;
  margin-bottom: 32px;
}
.pwa-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--tx);
  line-height: 1.5;
}
.pwa-step + .pwa-step { border-top: 1px solid var(--bdr); }
.pwa-step strong { color: var(--wh); }
.pwa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--text-on-color);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pwa-screen-install {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 9999px;
  background: var(--acc);
  color: var(--text-on-color);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  margin-bottom: 12px;
}
.pwa-screen-install:hover { background: var(--acc-hover); }
.pwa-screen-install:active { transform: scale(0.98); }
.pwa-screen-skip {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 24px;
  transition: color 0.15s;
}
.pwa-screen-skip:hover { color: var(--tx); }

/* ── Auto-Study Toast ── */
.auto-study-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  opacity: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--r);
  background: var(--sf);
  border: 1px solid var(--bdr);
  border-left: 3px solid var(--acc);
  box-shadow: var(--elev-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  transition: opacity var(--anim-slow) ease, transform var(--anim-slow) ease;
  pointer-events: none;
}
.auto-study-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.auto-study-toast svg { color: var(--acc); flex-shrink: 0; }

/* Questions load error banner */
.questions-load-error {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px 16px;
  margin: 8px 12px;
  --glass-pad: 12px 16px;
  --glass-radius: 20px;
  --glass-surface-border: rgba(255,255,255,0.12);
  --glass-surface-fill:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05)),
    radial-gradient(circle at 18% 0%, rgba(255,255,255,0.18), transparent 42%),
    rgba(17, 24, 37, 0.78);
  --glass-surface-shadow: 0 22px 48px rgba(2, 6, 16, 0.34), inset 0 1px 0 rgba(255,255,255,0.16);
  --glass-surface-blur: 26px;
  font-size: 13px;
  color: var(--tx);
  z-index: 120;
}
.questions-load-error-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.questions-load-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  flex-shrink: 0;
}
.questions-load-error-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.questions-load-error-text strong {
  color: var(--wh);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.questions-load-error-text span {
  color: rgba(224,232,245,0.72);
  font-size: 11px;
  line-height: 1.35;
}
.questions-load-error-action,
.questions-load-error-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 36px;
  padding: 0 16px;
  --glass-pad: 0 16px;
  --glass-radius: 999px;
  --glass-surface-border: rgba(255,255,255,0.16);
  --glass-surface-fill:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06)),
    radial-gradient(circle at 18% 0%, rgba(255,255,255,0.24), transparent 44%),
    rgba(39, 52, 71, 0.64);
  color: rgba(248,250,255,0.96);
  font-weight: 700;
  font-size: 12px;
  --glass-surface-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
.questions-load-error-action {
  cursor: pointer;
  font-family: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.questions-load-error-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(2, 6, 16, 0.24), inset 0 1px 0 rgba(255,255,255,0.18);
}
.questions-load-error-spinner svg {
  animation: ptrSpin 0.8s linear infinite;
}
.questions-load-error.is-retrying .questions-load-error-icon svg {
  animation: ptrSpin 0.8s linear infinite;
}

@media (min-width: 1024px) {
  .questions-load-error {
    position: fixed;
    top: 18px;
    left: 50%;
    right: auto;
    width: auto;
    max-width: calc(100vw - 140px);
    margin: 0;
    padding: 10px 12px 10px 14px;
    border-radius: 999px;
    transform: translateX(-50%);
  }

  body.desktop-workbench.desktop-wide .questions-load-error {
    left: 50%;
  }

  body.desktop-workbench.desktop-compact .questions-load-error {
    left: 50%;
  }
}

@media (max-width: 699px) {
  .questions-load-error {
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .questions-load-error-text span {
    display: none;
  }

  .questions-load-error-action,
  .questions-load-error-spinner {
    min-width: 78px;
    min-height: 34px;
    padding: 0 14px;
  }
}

/* ── Assessment ── */

/* Intro Modal */
.assessment-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.70);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.assessment-intro {
  position: relative;
  background: var(--cd);
  border-radius: var(--r);
  border: 1px solid var(--bdr);
  padding: 32px 24px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.3s ease;
  box-shadow: var(--elev-3);
}
.assess-domain-list {
  margin: 20px 0 16px;
  text-align: left;
}
.assess-domain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--r2);
  background: var(--cd2);
  margin-bottom: 6px;
  font-size: 13px;
}
.assess-domain-name {
  color: var(--tx);
  font-weight: 500;
}
.assess-domain-count {
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
}
.assess-summary {
  font-size: 13px;
  color: var(--dim);
  margin-top: 8px;
}
.assess-skip-link {
  color: var(--dim);
  font-size: 13px;
  text-decoration: none;
}
.assess-skip-link:hover {
  color: var(--tx);
  text-decoration: underline;
}

/* Progress Bar */
.assess-progress-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--bdr);
}
.assess-progress-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.assess-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}
.assess-progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--cd2);
  overflow: hidden;
}
.assess-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--acc);
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(10,132,255,0.2);
}
.assess-progress-pct {
  display: block;
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
  text-align: right;
}

/* "I don't know" button */
.assess-idk-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px auto 0;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--bdr);
  border-radius: 20px;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.assess-idk-btn:hover { border-color: var(--amb); color: var(--amb); }
.assess-idk-btn.active { border-color: var(--amb); color: var(--amb); background: rgba(245, 158, 11, 0.08); }

/* Actions Bar */
.assess-actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--bdr);
  padding: 12px 16px;
}

/* Results Report */
.assess-report {
  padding: 24px 16px 100px;
  text-align: center;
}
.assess-weak-badge {
  display: inline-block;
  background: var(--red);
  color: var(--text-on-accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.assess-focus-callout {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--r2);
  background: var(--cd2);
  border-left: 3px solid var(--amb);
  text-align: left;
  font-size: 13px;
  color: var(--tx);
  line-height: 1.5;
}
.assess-focus-callout strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--amb);
}

/* Dashboard Assessment Card */
.assess-dash-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.assess-dash-ring {
  position: relative;
  flex-shrink: 0;
}
.assess-dash-ring .ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assess-dash-ring .ring-pct {
  font-size: 16px;
  font-weight: 700;
}
.assess-dash-summary {
  flex: 1;
  min-width: 0;
}
.assess-readiness-badge {
  display: inline-block;
  color: var(--text-on-color);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.assess-readiness-msg {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.5;
}
.assess-dash-domains {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.assess-dash-domain {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.assess-dash-domain-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assess-dash-dlabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assess-dash-dpct {
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.assess-dash-advice {
  font-size: 11px;
  color: var(--dim);
  line-height: 1.4;
  padding-left: 2px;
}
.assess-study-order {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--r2);
  background: var(--cd2);
}
.assess-study-order-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 8px;
}
.assess-study-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--tx2);
}
.assess-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--text-on-color);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Domain Report Cards */
.assess-domain-report {
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--r2);
  background: var(--cd2);
  border: 1px solid var(--bdr);
}
.assess-domain-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.assess-domain-report-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.3;
}
.assess-domain-report-score {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.assess-domain-report-pct {
  font-size: 13px;
  font-weight: 700;
}
.assess-tier-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-on-color);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.assess-domain-weight {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--dim);
  margin: 8px 0;
}
.assess-report-section {
  margin-top: 10px;
}
.assess-report-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.assess-report-text {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.55;
}

/* What's Next Section */
.assess-next-steps {
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--r2);
  background: var(--cd2);
  border-left: 3px solid var(--acc);
}
.assess-next-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 6px;
}
.assess-next-text {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.55;
}

.assess-dash-date {
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  margin-top: 8px;
}
.assess-dash-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.assess-dash-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  justify-content: center;
}

/* Guided Study Explanation Panel */
.guided-explain {
  margin-top: 12px;
  border-radius: var(--r2);
  border: 1px solid var(--bdr);
  background: var(--cd2);
  overflow: hidden;
}
.guided-explain-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--amb);
  user-select: none;
}
.guided-explain-header:hover {
  background: var(--sf);
}
.guided-explain-toggle {
  margin-left: auto;
  display: flex;
}
.guided-explain-body {
  padding: 0 14px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tx2);
  border-top: 1px solid var(--bdr);
  padding-top: 12px;
}
.guided-explain-body p { margin: 0 0 8px; }
.guided-explain-body ul, .guided-explain-body ol { margin: 4px 0; padding-left: 20px; }
.guided-explain-body li { margin-bottom: 4px; }

/* Guided Study Progress */
.guided-progress {
  margin-top: 16px;
  padding: 8px 0;
}
.guided-progress-label {
  font-size: 11px;
  color: var(--dim);
  display: block;
  margin-bottom: 4px;
}

/* ── Auto-Study View ── */
/* ── Unified Study Tile ── */
.as-tile { background: var(--card-gradient), var(--sf); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--glow-soft); margin: 0 16px 20px; overflow: hidden; }
.as-tile .glass-card { background: none; border: none; border-radius: 0; box-shadow: none; border-top: 1px solid var(--bdr); }
.as-tile .as-complete { margin: 0; border-radius: 0; border: none; border-bottom: 1px solid var(--bdr); }
.as-tile .as-mission { margin: 0; }
.as-tile .as-domains { margin: 0; }
.as-tile .as-history { margin: 0; }
.as-tile .as-next { margin: 0; }

.as-header { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px 16px; text-align: center; }
.as-header-ring { position: relative; flex-shrink: 0; width: 100px; height: 100px; }
.as-header-info { }
.as-header-title { font-size: 18px; font-weight: 700; color: var(--wh); }
.as-header-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }

.as-complete { padding: 20px; margin: 16px 16px 12px; text-align: center; background: linear-gradient(135deg, var(--grn-soft), var(--cyn-soft)); border: 1px solid var(--grn-border); }
.as-complete-icon { color: var(--grn); margin-bottom: 8px; }
.as-complete-title { font-size: 16px; font-weight: 700; color: var(--grn); margin-bottom: 4px; }
.as-complete-domain { font-size: 13px; color: var(--wh); margin-bottom: 4px; }
.as-complete-score { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.as-complete-msg { font-size: 12px; color: var(--dim); }

/* Phase slide-in (shared by launch, checkpoint, report) */
@keyframes phaseSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Launch screen (session preview) */
.as-launch { padding: 16px; animation: phaseSlideIn 0.35s var(--ease-out); text-align: center; }
.as-launch-badge { display: flex; justify-content: center; margin-bottom: 16px; }
.as-launch-ring { position: relative; width: 160px; height: 160px; }
.as-launch-ring .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.as-launch-session-num { font-size: 14px; font-weight: 800; color: var(--acc); line-height: 1.2; }
.as-launch-session-of { font-size: 12px; color: var(--dim); line-height: 1.2; }
.as-launch-focus { padding: 20px 16px; text-align: center; }
.as-launch-focus-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--acc); margin-bottom: 10px; }
.as-launch-domain { font-size: 18px; font-weight: 800; color: var(--wh); margin-bottom: 4px; }
.as-launch-mastery { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.as-launch-topics { margin-bottom: 12px; }
.as-launch-topic-item { font-size: 12px; color: var(--dim); padding: 2px 0; }
.as-launch-topic-item::before { content: "\2022 "; color: var(--acc); }
.as-launch-stats { font-size: 12px; color: var(--dim); padding-top: 8px; border-top: 1px solid var(--flat-divider); }
.as-launch-footer { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
.as-launch-footer-item { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dim); }

/* Checkpoint (mid-session feedback) */
.as-checkpoint { padding: 16px; animation: phaseSlideIn 0.35s var(--ease-out); }
.as-checkpoint-header { text-align: center; padding: 20px 0 12px; }
.as-checkpoint-icon { color: var(--grn); margin-bottom: 8px; }
.as-checkpoint-title { font-size: 20px; font-weight: 800; color: var(--grn); }
.as-checkpoint-score { text-align: center; padding: 20px 16px; margin-bottom: 12px; }
.as-checkpoint-pct { font-size: 36px; font-weight: 800; line-height: 1.1; }
.as-checkpoint-pct-label { font-size: 13px; color: var(--dim); margin-top: 2px; }
.as-checkpoint-msg { font-size: 14px; font-weight: 600; margin-top: 8px; }
.as-checkpoint-domains { padding: 14px 16px; margin-bottom: 12px; }
.as-checkpoint-domain-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.as-checkpoint-domain-row + .as-checkpoint-domain-row { border-top: 1px solid var(--flat-divider); }
.as-checkpoint-domain-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; min-width: 70px; }
.as-checkpoint-domain-name { font-size: 12px; color: var(--wh); flex: 1; }
.as-checkpoint-domain-score { font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.as-checkpoint-next { padding: 14px 16px; margin-bottom: 4px; }
.as-checkpoint-next-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--acc); margin-bottom: 10px; }
.as-checkpoint-next-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--wh); padding: 6px 0; line-height: 1.4; }
.as-checkpoint-next-icon { color: var(--acc); flex-shrink: 0; margin-top: 1px; }
.as-checkpoint-est { text-align: center; font-size: 11px; color: var(--dim); margin-top: 12px; }

.as-mission { padding: 20px; margin: 12px 16px 12px; text-align: center; }
.as-mission-label { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--acc); margin-bottom: 10px; text-transform: uppercase; }
.as-mission-domain { font-size: 17px; font-weight: 700; color: var(--wh); margin-bottom: 8px; }
.as-mission-reason { font-size: 13px; color: var(--dim); line-height: 1.6; margin-bottom: 16px; }
.as-start-btn { padding: 12px 48px !important; font-size: 15px !important; justify-content: center; gap: 8px; transition: opacity 0.2s, transform 0.2s; }
.as-start-btn:active { transform: scale(0.97); }
.as-start-btn.loading { pointer-events: none; opacity: 0.7; }
.as-start-btn.loading::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: btnSpin 0.6s linear infinite; }
@keyframes btnSpin { to { transform: rotate(360deg); } }
.as-mission-detail { font-size: 11px; color: var(--dim); text-align: center; margin-top: 10px; }

.as-domains { padding: 16px; margin: 0 16px 12px; }
.as-section-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--wh); margin-bottom: 14px; }
.as-domain-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.as-domain-row.as-focus { background: var(--acc-8); margin: 0 -8px 10px; padding: 6px 8px; border-radius: var(--r1); }
.as-domain-label { font-size: 12px; color: var(--dim); width: 28px; flex-shrink: 0; font-weight: 600; }
.as-domain-bar { flex: 1; height: 6px; background: var(--sf); border-radius: 3px; overflow: hidden; }
.as-domain-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.as-domain-pct { font-size: 12px; font-weight: 700; width: 36px; text-align: right; color: var(--wh); }
.as-domain-proficient .as-domain-fill {
  box-shadow: 0 0 8px rgba(180,200,220,0.5), 0 0 16px rgba(180,200,220,0.2);
  animation: domain-glow 2.5s ease-in-out infinite alternate;
}
.as-domain-proficient .as-domain-pct {
  text-shadow: 0 0 8px rgba(180,200,220,0.5);
}
@keyframes domain-glow {
  from { box-shadow: 0 0 6px rgba(180,200,220,0.3), 0 0 12px rgba(180,200,220,0.1); }
  to   { box-shadow: 0 0 12px rgba(180,200,220,0.6), 0 0 24px rgba(180,200,220,0.25); }
}
.as-domain-focus-tag { color: var(--acc); flex-shrink: 0; }
.as-domain-name { font-size: 11px; color: var(--dim); flex: 0 0 auto; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-domain-chevron { color: var(--dim); flex-shrink: 0; transition: transform 0.2s ease; }
.as-domain-expanded .as-domain-chevron { transform: rotate(180deg); }
.as-domain-expanded > .as-domain-row { background: var(--sf); margin: 0 -8px; padding: 6px 8px; border-radius: var(--r1) var(--r1) 0 0; }

/* Domain question expansion */
.as-domain-questions { padding: 0 0 8px; }
.as-dq-summary { display: flex; gap: 12px; padding: 10px 0 8px; border-bottom: 1px solid var(--bdr); margin-bottom: 6px; }
.as-dq-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.as-dq-correct { color: var(--grn); }
.as-dq-wrong { color: var(--red); }
.as-dq-unanswered { color: var(--dim); }

.as-dq-list { max-height: 320px; overflow-y: auto; }
.as-dq-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 4px; border: none; background: none; cursor: pointer;
  text-align: left; font-family: inherit; font-size: 12px;
  color: var(--tx); border-bottom: 1px solid var(--bdr);
  transition: background 0.15s ease; min-height: 40px;
}
.as-dq-item:hover { background: var(--sf); }
.as-dq-item:active { background: var(--acc-8); }
.as-dq-icon { flex-shrink: 0; display: flex; align-items: center; }
.as-dq-correct .as-dq-icon { color: var(--grn); }
.as-dq-wrong .as-dq-icon { color: var(--red); }
.as-dq-unanswered .as-dq-icon { color: var(--dim); }
.as-dq-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.as-dq-type { flex-shrink: 0; font-size: 10px; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; background: var(--sf); border-radius: 3px; }

.as-history { padding: 16px; margin: 0 16px 12px; }
.as-session-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--bdr); }
.as-session-row:last-child { border-bottom: none; }
.as-session-num { font-size: 11px; color: var(--dim); width: 24px; font-weight: 600; }
.as-session-domain { flex: 1; font-size: 12px; color: var(--wh); }
.as-session-score { font-size: 12px; font-weight: 700; width: 36px; text-align: right; }
.as-session-date { font-size: 10px; color: var(--dim); width: 50px; text-align: right; }

.as-next { padding: 16px; margin: 0 16px 20px; }
.as-next-text { font-size: 13px; color: var(--dim); line-height: 1.6; }

/* ── Flashcard Complete Screen ── */
.as-fc-complete { padding: 32px 16px; text-align: center; max-width: 420px; margin: 0 auto; }
.as-fc-complete-icon { color: var(--grn); margin-bottom: 12px; }
.as-fc-complete-title { font-size: 22px; font-weight: 800; color: var(--wh); margin-bottom: 8px; }
.as-fc-complete-msg { font-size: 14px; color: var(--tx2); line-height: 1.6; margin-bottom: 24px; }
.as-fc-complete-stats {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 28px; padding: 16px; background: var(--sf); border-radius: var(--r); border: 1px solid var(--bdr);
}
.as-fc-complete-stat { text-align: center; }
.as-fc-complete-stat-num { font-size: 24px; font-weight: 800; line-height: 1.2; }
.as-fc-complete-stat-label { font-size: 11px; color: var(--dim); font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.as-fc-complete-review { text-align: left; background: var(--sf); border: 1px solid var(--bdr); border-radius: var(--r); padding: 16px; }
.as-fc-complete-review-title { font-size: 14px; font-weight: 700; color: var(--wh); display: flex; align-items: center; gap: 8px; }
.as-fc-complete-review-desc { font-size: 13px; color: var(--tx2); margin-top: 6px; line-height: 1.5; }

/* ── Report Overlay ── */
.report-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: var(--bg); color: var(--wh); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.report-toolbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--bdr);
}
.report-toolbar-actions { display: flex; gap: 8px; }
.report-body { max-width: 820px; margin: 0 auto; padding: 24px 16px 60px; }
.report-body .rpt-header { border-bottom: 3px solid var(--acc); padding-bottom: 20px; margin-bottom: 24px; }
.report-body .rpt-brand { font-size: 24px; font-weight: 800; color: var(--acc); }
.report-body .rpt-subtitle { font-size: 13px; color: var(--dim); margin-top: 2px; }
.report-body .rpt-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--dim); }
.report-body .rpt-overall { background: var(--sf); border: 1px solid var(--bdr); border-radius: 12px; padding: 20px; margin-bottom: 24px; display: flex; gap: 16px; align-items: center; }
.report-body .rpt-score-circle { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; flex-shrink: 0; border: 4px solid; }
.report-body .rpt-score-num { font-size: 26px; font-weight: 800; line-height: 1; }
.report-body .rpt-score-label { font-size: 9px; font-weight: 600; text-transform: uppercase; margin-top: 2px; }
.report-body .rpt-readiness { flex: 1; }
.report-body .rpt-readiness-badge { display: inline-block; padding: 2px 10px; border-radius: 16px; color: var(--text-on-accent); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.report-body .rpt-readiness-text { font-size: 13px; color: var(--tx2); line-height: 1.6; }
.report-body .rpt-section { margin-bottom: 24px; }
.report-body .rpt-section-title { font-size: 18px; font-weight: 700; color: var(--wh); border-bottom: 2px solid var(--bdr); padding-bottom: 6px; margin-bottom: 14px; }
.report-body .rpt-exam-info { font-size: 13px; color: var(--tx2); line-height: 1.7; }
.report-body .rpt-exam-info p { margin-bottom: 8px; }
.report-body .rpt-domain { border: 1px solid var(--bdr); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.report-body .rpt-domain-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.report-body .rpt-domain-name { font-size: 15px; font-weight: 700; color: var(--wh); }
.report-body .rpt-domain-score { display: flex; align-items: center; gap: 8px; }
.report-body .rpt-domain-pct { font-size: 15px; font-weight: 800; }
.report-body .rpt-tier-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; color: var(--text-on-accent); font-size: 10px; font-weight: 700; }
.report-body .rpt-domain-bar { height: 6px; background: var(--sf); border-radius: 3px; margin-bottom: 12px; overflow: hidden; }
.report-body .rpt-domain-bar-fill { height: 100%; border-radius: 3px; }
.report-body .rpt-weight { font-size: 11px; color: var(--dim); margin-bottom: 12px; font-style: italic; }
.report-body .rpt-obj-title { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.report-body .rpt-obj-list { margin: 0 0 12px 18px; font-size: 12px; color: var(--tx2); line-height: 1.7; }
.report-body .rpt-analysis-title { font-size: 12px; font-weight: 700; color: var(--wh); margin: 12px 0 4px; }
.report-body .rpt-analysis-text { font-size: 13px; color: var(--tx2); line-height: 1.6; }
.report-body .rpt-steps { margin: 6px 0 0 18px; font-size: 12px; color: var(--tx2); line-height: 1.7; }
.report-body .rpt-steps li { margin-bottom: 3px; }
.report-body .rpt-plan { background: var(--sf); border: 1px solid var(--bdr); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.report-body .rpt-plan-title { font-size: 14px; font-weight: 700; color: var(--wh); margin-bottom: 10px; }
.report-body .rpt-plan-step { display: flex; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--tx2); line-height: 1.5; }
.report-body .rpt-plan-num { width: 22px; height: 22px; border-radius: 50%; background: var(--acc); color: var(--text-on-accent); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.report-body .rpt-footer { border-top: 2px solid var(--bdr); padding-top: 14px; margin-top: 32px; text-align: center; font-size: 11px; color: var(--dim); }

/* ══════════════════════════════════════════════
   Multi-Phase Auto-Study Styles
   ══════════════════════════════════════════════ */

/* Phase Header */
.as-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--bdr);
}
.as-phase-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--acc);
}
.as-phase-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  background: var(--cd2);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Flashcard Phase */
.as-fc-progress {
  padding: 12px 16px;
}
.as-fc-progress-text {
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 6px;
}

.as-fc-card-container {
  perspective: 1000px;
  margin: 8px 16px 16px;
  cursor: pointer;
  min-height: 220px;
}
.as-fc-card {
  position: relative;
  width: 100%;
  min-height: 220px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
  box-shadow: var(--elev-1);
}
.as-fc-card.as-fc-flipped {
  transform: rotateY(180deg);
  box-shadow: var(--elev-2);
}
.as-fc-front, .as-fc-back {
  position: absolute;
  top: 0; left: 0; right: 0;
  min-height: 220px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--bdr);
}
.as-fc-front {
  background: var(--cd);
}
.as-fc-back {
  background: linear-gradient(135deg, var(--cd), var(--cd2));
  transform: rotateY(180deg);
}
.as-fc-face-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.as-fc-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--tx);
  word-break: break-word;
}
.as-fc-tap-hint {
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  margin-top: 16px;
  opacity: 0.6;
}
.as-fc-wrong-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-soft-2);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-bottom: 10px;
  width: fit-content;
}

.as-fc-status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 16px 8px;
  padding: 6px 12px;
  border-radius: var(--r2);
  font-size: 12px;
  font-weight: 600;
}
.as-fc-gotit {
  background: var(--grn-soft);
  color: var(--grn);
  border: 1px solid var(--grn-border);
  animation: scaleIn var(--anim-base) var(--ease-spring) both;
}
.as-fc-review {
  background: var(--amb-soft);
  color: var(--amb);
  border: 1px solid var(--amb-border);
  animation: scaleIn var(--anim-base) var(--ease-spring) both;
}

/* Flashcard Controls */
.as-fc-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 16px 16px;
}
.as-fc-nav {
  padding: 8px 12px !important;
}
.as-fc-action {
  flex: 1;
  max-width: 140px;
  justify-content: center;
}
.as-fc-flip-prompt {
  font-size: 12px;
  color: var(--dim);
  text-align: center;
  flex: 1;
}

.as-fc-continue {
  padding: 16px;
  text-align: center;
}
.as-fc-continue-note {
  font-size: 11px;
  color: var(--dim);
  margin-top: 8px;
}

/* Complete Phase */
.as-complete-header {
  text-align: center;
  padding: 32px 16px 20px;
}
.as-complete-trophy {
  color: var(--amb);
  margin-bottom: 12px;
}
.as-complete-title-lg {
  font-size: 22px;
  font-weight: 800;
  color: var(--wh);
  margin-bottom: 4px;
}

/* Result Cards */
.as-result-cards {
  display: flex;
  gap: 10px;
  padding: 0 16px 16px;
}
.as-result-card {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
}
.as-result-phase {
  font-size: 10px;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.as-result-score {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.as-result-pct {
  font-size: 12px;
  font-weight: 600;
}

.as-complete-encouragement {
  text-align: center;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.6;
  padding: 0 16px 16px;
}

.as-complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 24px;
}

/* ══════════════════════════════════════════════
   Progress Report Styles (pr- prefix)
   ══════════════════════════════════════════════ */

/* Report Header */
.pr-header {
  text-align: center;
  padding: 32px 16px 20px;
  border-bottom: 3px solid var(--acc);
}
.pr-header-icon { margin-bottom: 8px; }
.pr-header-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--wh);
  margin-bottom: 4px;
}
.pr-header-score {
  font-size: 36px;
  font-weight: 800;
  margin-top: 4px;
}

/* Phase Results Row */
.pr-phases {
  display: flex;
  gap: 8px;
  padding: 16px 16px 8px;
}
.pr-phase-card {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
}

/* Report Body Sections */
.pr-section {
  margin: 12px 16px;
  padding: 16px;
}
.pr-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--acc);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pr-section-text {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.65;
}
.pr-section-text strong { color: var(--wh); }

/* Trend Display */
.pr-trend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pr-trend-delta {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}
.pr-trend-delta-up {
  background: var(--grn-soft-2);
  color: var(--grn);
}
.pr-trend-delta-down {
  background: var(--red-soft-2);
  color: var(--red);
}

/* Tier Upgrade */
.pr-tier-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
}
.pr-tier-from, .pr-tier-to {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-color);
}
@keyframes tierPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* Milestones Banner */
.pr-milestone-banner {
  margin: 12px 16px;
  padding: 16px;
  border: 1px solid var(--acc);
  background: linear-gradient(135deg, rgba(10,132,255,0.08), rgba(10,132,255,0.02));
}
.pr-milestone-new {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.pr-milestone-new.pr-milestone-revealed {
  opacity: 1;
  transform: translateY(0);
}
.pr-milestone-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--acc-15);
  color: var(--acc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Milestone Grid (study path) */
.pr-milestone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.pr-milestone-badge {
  text-align: center;
  padding: 10px 4px;
  border-radius: var(--r2);
  opacity: 1;
  transition: opacity 0.3s;
}
.pr-milestone-badge .pr-milestone-icon-circle {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  background: var(--cd2);
  color: var(--dim);
  position: relative;
}
.pr-milestone-badge .pr-milestone-icon-circle svg {
  opacity: 0.35;
}
.pr-milestone-badge .pr-milestone-lock {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--cd2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bdr);
}
.pr-milestone-badge .pr-milestone-lock svg {
  opacity: 1;
  width: 8px;
  height: 8px;
}
.pr-milestone-badge .pr-milestone-desc {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  margin-top: 2px;
  line-height: 1.3;
}
.pr-milestone-badge.pr-milestone-earned .pr-milestone-icon-circle svg {
  opacity: 1;
}
.pr-milestone-badge.pr-milestone-earned .pr-milestone-lock {
  display: none;
}
.pr-milestone-badge.pr-milestone-earned .pr-milestone-desc {
  color: var(--grn);
}
.pr-milestone-badge.pr-milestone-earned {
  opacity: 1;
}
.pr-milestone-badge.pr-milestone-earned .pr-milestone-icon-circle {
  background: var(--acc-15);
  color: var(--acc);
  border: 1.5px solid var(--acc);
  animation: milestone-glow 4s ease-in-out infinite;
}
@keyframes milestone-glow {
  0%   { box-shadow: 0 0 4px rgba(180,200,220,0.1), 0 0 8px rgba(180,200,220,0.05); opacity: 0.7; }
  50%  { box-shadow: 0 0 18px rgba(180,200,220,0.6), 0 0 36px rgba(180,200,220,0.25); opacity: 1; }
  100% { box-shadow: 0 0 4px rgba(180,200,220,0.1), 0 0 8px rgba(180,200,220,0.05); opacity: 0.7; }
}

/* Streak Section */
.pr-streak {
  margin: 12px 16px;
  padding: 16px;
}
.pr-streak-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--amb);
}
.pr-streak-tier {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-on-color);
}
.pr-streak-recovery {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--amb);
  background: var(--amb-soft);
  border-radius: 0 var(--r2) var(--r2) 0;
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.5;
}
.pr-streak-recovery strong { color: var(--amb); }
.pr-recovery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cd2);
  border: 1.5px solid var(--dim);
}
.pr-recovery-dot.pr-recovery-done {
  background: var(--amb);
  border-color: var(--amb);
}

/* Domain movement */
.pr-domains { padding: 16px; margin: 0 16px 12px; }
.pr-domain-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.pr-domain-label { font-size: 12px; font-weight: 700; color: var(--dim); min-width: 24px; }
.pr-domain-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.pr-domain-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease-out; }
.pr-domain-pct { font-size: 12px; font-weight: 700; min-width: 32px; text-align: right; }
.pr-domain-delta { font-size: 11px; font-weight: 700; min-width: 28px; text-align: right; }
.pr-domain-note { font-size: 11px; color: var(--dim); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--flat-divider); }

/* Stats section */
.pr-stats { padding: 16px; margin: 0 16px 12px; }
.pr-stats-grid { display: flex; gap: 16px; margin-top: 8px; }
.pr-stat-item { flex: 1; text-align: center; }
.pr-stat-value { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.pr-stat-label { display: block; font-size: 11px; color: var(--dim); margin-top: 2px; }

/* The Hook */
.pr-hook {
  margin: 12px 16px 24px;
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--acc);
  background: linear-gradient(135deg, rgba(10,132,255,0.06), rgba(10,132,255,0.02));
}
.pr-hook-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--acc);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pr-hook-domain {
  font-size: 17px;
  font-weight: 700;
  color: var(--wh);
  margin-bottom: 6px;
}
.pr-hook-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Reinforcement Intro */
.as-reinforce-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  min-height: 60vh;
}
.as-reinforce-intro-icon { color: var(--acc); margin-bottom: 16px; }
.as-reinforce-intro-title { font-size: 22px; font-weight: 800; color: var(--wh); margin-bottom: 12px; }
.as-reinforce-intro-text { font-size: 15px; color: var(--tx); line-height: 1.6; max-width: 340px; }
.as-reinforce-intro-note { font-size: 13px; color: var(--dim); margin-top: 16px; max-width: 320px; line-height: 1.5; }

/* Concepts section */
.pr-concepts { padding: 16px; margin: 0 16px 12px; }
.pr-concepts-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.pr-concept-item { text-align: center; }
.pr-concept-value { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.pr-concept-label { display: block; font-size: 10px; color: var(--dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Key Takeaways */
.pr-takeaways { padding: 16px; margin: 0 16px 12px; }
.pr-takeaway-item { font-size: 13px; color: var(--tx); line-height: 1.5; padding: 4px 0; }

/* Recovery Dialog */
.as-recovery-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  min-height: 60vh;
}
.as-recovery-icon { color: var(--acc); margin-bottom: 16px; }
.as-recovery-title { font-size: 22px; font-weight: 800; color: var(--wh); margin-bottom: 8px; }
.as-recovery-text { font-size: 14px; color: var(--dim); margin-bottom: 24px; }
.as-recovery-actions { width: 100%; max-width: 320px; }

/* Flashcard micro-feedback overlay */
.fc-micro-feedback .micro-feedback-content { text-align: center; }

/* ── Onboarding ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.onboarding-overlay.visible { opacity: 1; }
.onboarding-card {
  max-width: 380px;
  width: 90%;
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.onboarding-icon { margin-bottom: 16px; color: var(--acc); }
.onboarding-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--wh);
  margin-bottom: 8px;
}
.onboarding-subtitle {
  font-size: 14px;
  color: var(--dim);
  margin-bottom: 24px;
  line-height: 1.5;
}
.onboarding-date {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--bdr2);
  background: var(--cd);
  color: var(--wh);
  font-size: 16px;
  margin-bottom: 8px;
  text-align: center;
  box-sizing: border-box;
}
.onboarding-date:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 2px rgba(10,132,255,0.2);
}
.onboarding-error {
  color: var(--red);
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 12px;
}
.onboarding-next {
  width: 100%;
  padding: 14px;
  border-radius: var(--r);
  background: var(--acc);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.onboarding-next:active { opacity: 0.8; }

/* ── Onboarding: Results Review ── */
.ob-results-overlay { overflow-y: auto; }
.ob-results-card {
  max-width: 420px;
  padding: 32px 20px 40px;
}
.ob-score-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.ob-score-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.ob-score-label {
  font-size: 11px;
  color: var(--dim);
  margin-top: 4px;
}
.ob-readiness {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-color);
  margin-bottom: 8px;
}
.ob-readiness-text {
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.6;
  margin-bottom: 20px;
}
.ob-domains-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--acc);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.ob-domains-list { width: 100%; margin-bottom: 16px; }
.ob-domain-row {
  margin-bottom: 10px;
  text-align: left;
}
.ob-domain-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.ob-domain-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
}
.ob-domain-pct {
  font-size: 12px;
  font-weight: 700;
}
.ob-domain-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--cd2);
  overflow: hidden;
  margin-bottom: 2px;
}
.ob-domain-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.ob-domain-tier {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ob-encourage {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r2);
  background: var(--amb-soft);
  border: 1px solid var(--amb-border);
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.5;
  text-align: left;
  margin-bottom: 8px;
  width: 100%;
}
.ob-encourage svg { color: var(--amb); flex-shrink: 0; margin-top: 1px; }
.ob-encourage strong { color: var(--amb); }
.ob-encourage-strong {
  background: var(--grn-soft);
  border-color: var(--grn-border);
}
.ob-encourage-strong svg { color: var(--grn); }
.ob-encourage-strong strong { color: var(--grn); }

/* ── Onboarding: Tutorial Slideshow ── */
.ob-tutorial-card {
  max-width: 380px;
  padding: 48px 24px 40px;
}
.ob-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cd2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.ob-dot-active {
  background: var(--acc);
  width: 24px;
  border-radius: 4px;
}
.ob-gold-btn {
  background: linear-gradient(135deg, var(--acc), var(--acc));
  color: #FFFFFF;
  font-size: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(10,132,255,0.3), inset 0 1px 0 rgba(255,255,255,0.18);
}
.ob-gold-btn:active {
  opacity: 0.9;
  transform: scale(0.98);
}


/* ═══════════════════════════════════════════
   HOME VIEW — Clean Authority
   ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   HOME VIEW — Clean Authority (Apple-inspired)
   Typography: font-display for headlines, font-mono for labels
   Cards: rounded-2xl, generous padding, subtle shadow
   Buttons: rounded-full
   ═══════════════════════════════════════════ */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
}
.home-header-left {}
.home-brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -0.03em;
}
.home-greeting {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dim);
  margin-top: 2px;
}
.home-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--amb);
}
.home-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sf);
  border: 1px solid var(--bdr);
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.home-avatar:hover { border-color: var(--bdr2); }

/* Hero Stat Card — Apple card surface */
.home-hero {
  margin: 12px 20px 0;
  padding: 24px;
  background: var(--sf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s var(--ease-out) both;
}
.home-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.home-hero-left {}
.home-hero-label {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.home-hero-score {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.home-hero-meta {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dim);
  margin-top: 4px;
}
.home-hero-right {
  text-align: right;
}
.home-hero-days {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.home-hero-days-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
}
.home-hero-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-on-accent);
  margin-top: 8px;
}
.home-hero-bar { margin-top: 20px; }
.home-hero-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--cd2);
  position: relative;
  overflow: hidden;
}
.home-hero-bar-marker {
  position: absolute;
  left: 70%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--tx);
  opacity: 0.15;
  z-index: 1;
}
.home-hero-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s var(--ease-out);
}
.home-hero-bar-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
  margin-top: 6px;
}

/* Continue Studying CTA — rounded-full pill */
.home-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 40px);
  margin: 20px 20px 0;
  padding: 16px 24px;
  border-radius: 9999px;
  background: var(--acc);
  color: var(--text-on-accent);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  animation: fadeUp 0.6s var(--ease-out) 0.1s both;
}
.home-cta:active { transform: scale(0.97); }
.home-cta:hover { background: var(--acc-hover); }

/* Sections — Apple-style generous spacing */
.home-section {
  margin: 28px 20px 0;
  animation: fadeUp 0.6s var(--ease-out) 0.15s both;
}
.home-section-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--tx);
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

/* Plan List — clean tappable rows */
.home-plan-list {}
.home-plan-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--flat-divider);
  cursor: pointer;
  transition: background 0.15s;
}
.home-plan-row:last-child { border-bottom: none; }
.home-plan-row:active { background: var(--flat-row-hover); }
.home-plan-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-plan-body { flex: 1; min-width: 0; }
.home-plan-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}
.home-plan-chevron {
  color: var(--dim);
  opacity: 0.4;
  flex-shrink: 0;
}

/* Domain Bars — wider with progress fill */
.home-domain-row {
  margin-bottom: 16px;
}
.home-domain-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.home-domain-label {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--tx);
}
.home-domain-pct {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--dim);
}
.home-domain-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--cd2);
  overflow: hidden;
}
.home-domain-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--acc);
  transition: width 0.8s var(--ease-out);
}

/* Last Session */
.home-last-session {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--dim);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════
   INSIGHTS VIEW — Clean Authority
   ═══════════════════════════════════════════ */
/* ── Insights Unified Tile ── */
.insights-tile {
  background: var(--card-gradient), var(--sf);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--glow-soft);
  margin: 0 20px 20px;
  overflow: hidden;
}
.insights-tile .insights-section {
  margin: 0;
  padding: 20px;
}
.insights-tile .insights-section:first-child {
  border-top: none;
}
.insights-tile .insights-assessment-card {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.insights-tile .dash-weak-areas {
  background: none;
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--flat-divider);
  padding: 20px;
  margin: 0;
}
.insights-tile #ai-weekly-insight {
  border-bottom: 1px solid var(--flat-divider);
}
.insights-tile #ai-weekly-insight:empty {
  border-bottom: none;
}

.insights-header {
  padding: 20px 20px 8px;
}
.insights-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -0.02em;
}
.insights-section {
  margin: 0 20px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--flat-divider);
  animation: fadeUp 0.6s var(--ease-out) both;
}
.insights-section:first-of-type {
  border-top: none;
}
.insights-section-title {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.insights-assessment-card {
  padding: 20px;
  background: var(--sf);
  border-radius: var(--r);
  border: 1px solid var(--bdr);
  box-shadow: var(--elev-1);
}
.insights-assess-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Domain rows in Insights */
.insights-domain-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--flat-divider);
}
.insights-domain-row:last-child { border-bottom: none; }
.insights-domain-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.insights-domain-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}
.insights-domain-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
}

/* Session rows */
.insights-session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--flat-divider);
}
.insights-session-row:last-child { border-bottom: none; }
.insights-session-day {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}
.insights-session-meta {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
}

/* Cert pills */
.insights-cert-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.insights-cert-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  font-family: "SF Mono", "JetBrains Mono", monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}
.insights-cert-pill.active {
  background: var(--acc);
  color: var(--text-on-accent);
  border-color: var(--acc);
}
.insights-cert-pill:hover { border-color: var(--bdr2); }

/* Expand button */
.insights-expand-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: var(--sf);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  color: var(--tx);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s ease;
}
.insights-expand-btn:hover { background: var(--cd2); }
.insights-expand-btn svg:last-child { margin-left: auto; color: var(--dim); }

/* ═══════════════════════════════════════════
   STUDY TAB HEADER — Clean Authority
   ═══════════════════════════════════════════ */
.study-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}
.study-tab-header .insights-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Session Browser (Session Engine) ── */
.se-domain-divider {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--bdr);
  margin-bottom: 4px;
}
.se-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  border-radius: var(--r2);
  cursor: pointer;
  transition: background 0.2s ease;
}
.se-session-row:hover { background: var(--flat-row-hover); }
.se-session-row.se-done { opacity: 0.55; }
.se-session-row.se-next { background: var(--acc-subtle); border: 1px solid rgba(10,132,255,0.2); }
.se-session-num {
  min-width: 28px;
  text-align: center;
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--dim);
}
.se-session-row.se-done .se-session-num { color: var(--grn); }
.se-session-row.se-next .se-session-num { color: var(--acc); }
.se-session-name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.se-phase-badge {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.se-phase-1 { background: rgba(175,82,222,0.12); color: var(--pur); }
.se-phase-2 { background: rgba(255,159,10,0.12); color: var(--amb); }
.se-phase-3 { background: rgba(90,200,250,0.12); color: var(--cyn); }
.se-next-badge {
  font-family: "SF Mono", "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--acc);
  color: var(--text-on-color);
  flex-shrink: 0;
}

/* ── Subscription Status Badge ── */
.sub-badge {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
  animation: fadeIn var(--anim-slow) var(--ease-out) both;
}

/* Orbiting dot */
.sub-badge-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  offset-path: path('M-28,0 A28,13 0 1,1 28,0 A28,13 0 1,1 -28,0 Z');
  offset-rotate: 0deg;
  animation: sub-orbit 3s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes sub-orbit {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* Freemium — bronze */
.sub-badge--free {
  background: rgba(180,120,60,0.12);
  border: 1px solid rgba(205,127,50,0.35);
  color: var(--bronze);
}
.sub-badge--free .sub-badge-dot {
  background: var(--bronze);
  box-shadow: 0 0 6px rgba(205,127,50,0.6);
}

/* Premium — accent with glow */
.sub-badge--premium {
  background: var(--acc-12);
  border: 1px solid var(--bdr2);
  color: var(--acc);
}
.sub-badge--premium .sub-badge-dot {
  background: var(--acc);
  box-shadow: 0 0 8px rgba(10,132,255,0.7);
}

/* ── Terms & Conditions Modal ── */
.terms-summary {
  width: 100%;
  text-align: left;
  background: var(--cd2);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.terms-summary-item {
  font-size: 13px;
  color: var(--tx2);
  padding: 5px 0;
  line-height: 1.4;
}
.terms-summary-item::before {
  content: "\2022 ";
  color: var(--acc);
  font-weight: 700;
}
.terms-full-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--acc);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity 0.15s;
}
.terms-full-link:hover { opacity: 0.8; }
.terms-full-link svg { flex-shrink: 0; }

/* ── Zoom Controls Panel ── */
.zoom-panel {
  position: fixed;
  top: 72px;
  left: 16px;
  z-index: 9999;
  background: var(--sf);
  border: 1px solid var(--bdr2);
  border-radius: var(--r2);
  box-shadow: var(--elev-3);
  padding: 10px;
  transition: padding 0.2s ease, opacity 0.2s ease;
}
.zoom-panel.collapsed .zoom-controls { display: none; }
.zoom-panel.expanded .zoom-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.zoom-panel.expanded { padding: 12px; }

.zoom-toggle-btn {
  background: var(--acc-subtle);
  border: 1px solid var(--acc);
  border-radius: 50%;
  cursor: grab;
  color: var(--acc);
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.zoom-toggle-btn:hover { background: var(--acc); color: var(--text-on-accent); }
.zoom-toggle-btn:active { transform: scale(0.92); }

.zoom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zoom-label {
  font-size: 11px;
  color: var(--dim);
  min-width: 56px;
  font-weight: 600;
}
.zoom-value {
  font-size: 11px;
  color: var(--tx);
  min-width: 32px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.zoom-panel input[type="range"] {
  width: 100px;
  accent-color: var(--acc);
}
.zoom-reset {
  font-size: 11px;
  color: var(--acc);
  background: none;
  border: 1px solid var(--bdr);
  border-radius: var(--r1);
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.zoom-reset:hover { background: var(--acc-subtle); }
.zoom-reset:disabled { opacity: 0.4; pointer-events: none; }

.zoom-actions {
  display: flex;
  gap: 6px;
}
.zoom-lock {
  font-size: 11px;
  color: var(--dim);
  background: none;
  border: 1px solid var(--bdr);
  border-radius: var(--r1);
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.zoom-lock:hover { background: var(--subtle-bg); color: var(--tx); }

/* Locked state */
.zoom-locked .zoom-lock {
  color: var(--amb);
  border-color: var(--amb);
  background: rgba(255,159,10,0.08);
}
.zoom-locked input[type="range"] { opacity: 0.35; pointer-events: none; }
.zoom-locked .zoom-label,
.zoom-locked .zoom-value { opacity: 0.5; }

/* ── Toast Module ── */
.toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: 9999px; font-size: 13px; font-weight: 600;
  color: var(--text-on-accent); opacity: 0; transform: translateY(12px);
  transition: opacity var(--anim-slow), transform var(--anim-slow); pointer-events: auto;
  max-width: 90vw; text-align: center;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-info    { background: var(--acc); }
.toast-success { background: var(--grn); color: var(--text-on-color); }
.toast-error   { background: var(--red); }
.toast-warning { background: var(--amb); color: var(--text-on-color); }
.toast-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--anim-base);
}
.toast-overlay-show { opacity: 1; }
.toast-modal {
  background: var(--sf); border: 1px solid var(--bdr); border-radius: var(--r);
  padding: 24px; max-width: 320px; width: 90%;
}
.toast-modal-msg { font-size: 14px; color: var(--wh); margin-bottom: 16px; line-height: 1.5; }
.toast-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Consent Banner ── */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--sf);
  border-top: 1px solid var(--bdr);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out);
}
.consent-banner.hidden {
  transform: translateY(100%);
  pointer-events: none;
}
.consent-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.consent-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.consent-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--acc-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--acc);
}
.consent-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--wh);
}
.consent-text {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.consent-text a {
  color: var(--acc);
  text-decoration: none;
  font-weight: 600;
}
.consent-actions {
  display: flex;
  gap: 10px;
}
.consent-accept {
  flex: 1;
  padding: 12px 24px;
  border-radius: 9999px;
  border: none;
  background: var(--acc);
  color: var(--text-on-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.consent-accept:hover { background: var(--acc-hover); }
.consent-accept:active { transform: scale(0.97); }
.consent-decline {
  padding: 12px 20px;
  border-radius: 9999px;
  border: 1px solid var(--bdr);
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.consent-decline:hover { color: var(--wh); border-color: var(--bdr2); }

/* Shared Glass System — Desktop Core */
.glass-panel,
.glass-panel-hero,
.glass-search,
.glass-list,
.glass-row,
.glass-pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--glass-pad, 0);
  border-radius: var(--glass-radius, var(--r));
  border: 1px solid var(--glass-surface-border, var(--glass-border));
  background:
    radial-gradient(240px circle at var(--glass-live-x, 50%) var(--glass-live-y, 50%), rgba(255,255,255,var(--glass-live-opacity, 0)), transparent 42%),
    var(--glass-surface-fill, var(--glass-panel-fill)),
    var(--glass-surface-base, transparent);
  box-shadow: var(--glass-surface-shadow, var(--glass-neutral-shadow));
  backdrop-filter: blur(var(--glass-surface-blur, 18px)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-surface-blur, 18px)) saturate(140%);
  transition:
    transform var(--anim-base) var(--ease-out),
    border-color var(--anim-base) var(--ease-out),
    box-shadow var(--anim-base) var(--ease-out),
    background var(--anim-base) var(--ease-out);
}

.glass-panel,
.glass-list {
  --glass-radius: 28px;
  --glass-surface-fill: var(--glass-panel-fill);
}

.glass-panel-hero {
  --glass-radius: 30px;
  --glass-surface-fill: var(--glass-panel-hero-fill);
  --glass-surface-shadow: var(--glass-hero-shadow);
}

.glass-search {
  --glass-radius: 999px;
  --glass-surface-fill: var(--glass-search-fill);
  --glass-surface-blur: 22px;
}

.glass-row {
  --glass-radius: 22px;
  --glass-surface-fill: var(--glass-row-fill);
}

.glass-pill {
  --glass-radius: 999px;
  --glass-surface-fill: var(--glass-pill-fill);
  --glass-surface-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.glass-active {
  --glass-surface-border: rgba(255,255,255,0.18);
  --glass-live-opacity: 0.12;
  box-shadow:
    var(--glass-surface-shadow, var(--glass-neutral-shadow)),
    inset 0 1px 0 rgba(255,255,255,0.14);
}

.glass-interactive {
  --glass-live-opacity: 0;
  cursor: pointer;
}

.glass-interactive:hover,
.glass-interactive:focus-visible,
.glass-interactive.is-glass-live {
  --glass-live-opacity: 0.16;
  --glass-surface-border: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

.glass-interactive:focus-visible {
  outline: none;
  box-shadow:
    var(--glass-surface-shadow, var(--glass-neutral-shadow)),
    0 0 0 1px rgba(255,255,255,0.08),
    0 0 0 3px rgba(180,200,220,0.16);
}

.glass-sheen {
  position: relative;
}

.glass-sheen::after {
  content: "";
  position: absolute;
  inset: -30% auto auto -10%;
  width: 52%;
  height: 180%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05) 26%, transparent 70%);
  transform: rotate(18deg);
  opacity: 0.36;
  pointer-events: none;
  animation: glassSheen 6.2s ease-in-out infinite;
}

@keyframes glassSheen {
  0%, 100% {
    transform: translateX(0) rotate(18deg);
    opacity: 0.26;
  }
  50% {
    transform: translateX(22px) rotate(18deg);
    opacity: 0.42;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glass-panel,
  .glass-panel-hero,
  .glass-search,
  .glass-list,
  .glass-row,
  .glass-pill {
    transition: none;
  }

  .glass-interactive:hover,
  .glass-interactive:focus-visible,
  .glass-interactive.is-glass-live {
    transform: none;
  }

  .glass-sheen::after {
    animation: none;
    opacity: 0.18;
  }
}
