/* ==========================================================================
   Predict — Scan. Solve. See.
   ========================================================================== */

.predict-page {
  --predict-accent: var(--color-primary, #c47a1a);
  --predict-student: #e67e22;
  --predict-reality: #4A90D9;
  --predict-correct: #3d8c5c;
  --predict-wrong: #c45a3c;
}

/* Phase entrance animation */
@keyframes predict-phase-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes predict-breathe {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.04); }
}

@keyframes predict-assumption-enter {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Auto mode toggle — recede into header, don't compete with content */
.predict-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-body, sans-serif);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--color-divider, #ddd);
  background: transparent;
  color: var(--color-text-faint, #aaa);
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0.7;
}
.predict-mode-toggle:hover { opacity: 1; }
.predict-mode-toggle svg { width: 12px; height: 12px; }
.predict-mode-toggle.active {
  background: color-mix(in srgb, var(--predict-accent) 15%, transparent);
  color: var(--predict-accent, #c47a1a);
  border-color: color-mix(in srgb, var(--predict-accent) 30%, transparent);
  opacity: 1;
}

/* Model selector — whisper-quiet, developer tool */
.predict-model-select {
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  font-weight: 400;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-faint, #aaa);
  cursor: pointer;
  outline: none;
  max-width: 160px;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.predict-model-select:hover,
.predict-model-select:focus {
  opacity: 1;
  border-color: var(--color-divider);
}

/* Main layout */
.predict-main {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ---- Left panel ---- */
.predict-instruct {
  flex: 0 0 40%;
  max-width: 40%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--color-divider);
  background: var(--color-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--color-divider) transparent;
}

.predict-instruct::-webkit-scrollbar { width: 4px; }
.predict-instruct::-webkit-scrollbar-track { background: transparent; }
.predict-instruct::-webkit-scrollbar-thumb {
  background: var(--color-divider);
  border-radius: 2px;
}

/* ---- Right panel ---- */
.predict-viz {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-offset);
}

.predict-viz-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (max-width: 768px) {
  .predict-page .app-main { flex-direction: column; }
  .predict-main { flex-direction: column; }
  .predict-instruct {
    flex: none; max-width: 100%; max-height: 45vh;
    border-right: none; border-bottom: 1px solid var(--color-divider);
  }
  .predict-welcome-inner {
    padding: var(--space-6, 1.5rem) var(--space-4, 1rem);
  }
  .predict-welcome-title {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }
  .predict-scan-card-row {
    flex-wrap: wrap;
  }
  .predict-qr-section {
    display: none; /* On phone, you ARE the phone — no need for QR */
  }
  .predict-solve-prompt {
    padding: var(--space-5, 1.5rem) 0;
  }
}

/* ---- Welcome ---- */
.predict-welcome {
  animation: predict-phase-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-welcome-inner {
  padding: var(--space-12, 3rem) var(--space-6, 1.5rem) var(--space-6, 2rem);
  max-width: 30rem;
  margin: 0 auto;
  text-align: center;
}

.predict-welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3, 0.75rem);
  color: var(--color-text);
}

.predict-welcome-subtitle {
  font-size: var(--text-sm, 0.92rem);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 auto var(--space-8, 2rem);
  max-width: 24rem;
}

.predict-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 0.4rem);
  margin-bottom: var(--space-5, 1.5rem);
}

.predict-example-btn {
  padding: var(--space-2, 0.4rem) var(--space-3, 0.85rem);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md, 8px);
  background: var(--color-bg);
  font-size: var(--text-xs, 0.82rem);
  font-weight: 500;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.predict-example-btn:hover {
  border-color: var(--predict-accent);
  background: color-mix(in srgb, var(--predict-accent) 6%, transparent);
}

/* ---- Problem form ---- */
.predict-problem-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.6rem);
  align-items: flex-start;
}

.predict-problem-form .predict-problem-textarea {
  align-self: stretch;
}

.predict-problem-textarea,
.predict-text-area {
  width: 100%;
  padding: var(--space-3, 0.7rem) var(--space-3, 0.85rem);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.9rem);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  line-height: 1.5;
  resize: vertical;
  background: var(--color-bg);
  color: var(--color-text);
  box-sizing: border-box;
}

.predict-problem-textarea:focus,
.predict-text-area:focus {
  outline: none;
  border-color: var(--predict-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--predict-accent) 20%, transparent);
}

/* ---- Active panel ---- */
.predict-active {
  padding: var(--space-5, 1.5rem) var(--space-5, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
  flex: 1;
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-problem-card {
  padding: var(--space-4, 1rem) var(--space-4, 1.25rem);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--color-divider);
  border-left: 3px solid var(--predict-accent);
  transition: border-color 0.2s;
}

.predict-problem-card:hover {
  border-color: var(--color-divider);
  border-left-color: var(--predict-accent);
}

.predict-problem-card .predict-problem-text {
  font-size: var(--text-sm, 0.9rem);
  line-height: 1.6;
  color: var(--color-text);
  margin: var(--space-2, 0.5rem) 0 0;
}

/* ---- Section titles ---- */
.predict-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg, 1.2rem);
  font-weight: 400;
  margin: 0 0 var(--space-1, 0.35rem);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.predict-problem-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.predict-problem-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--predict-accent) 12%, transparent);
  color: var(--predict-accent);
}

.predict-hint {
  font-size: var(--text-xs, 0.82rem);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4, 1rem);
  line-height: 1.5;
}

.predict-input-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.predict-scratch-hint {
  display: flex;
  align-items: center;
  gap: var(--space-1, 0.35rem);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3, 0.75rem);
}

/* ---- Buttons ---- */
.predict-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 0.4rem);
  padding: var(--space-2, 0.55rem) var(--space-4, 1.2rem);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.88rem);
  font-weight: 600;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, transform 0.12s, box-shadow 0.2s;
}

.predict-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.predict-btn:disabled { opacity: 0.45; cursor: default; }

.predict-btn--primary {
  background: var(--predict-accent);
  color: #fff;
  align-self: flex-start;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--predict-accent) 25%, transparent);
}

.predict-btn--primary:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--predict-accent) 35%, transparent);
}

.predict-btn--secondary {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border: 1px solid var(--color-divider);
}

.predict-btn--secondary:hover:not(:disabled) {
  background: var(--color-surface-offset-2);
}

.predict-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.predict-btn--ghost:hover:not(:disabled) {
  background: var(--color-surface-offset);
}

/* ---- Loading / analyzing — build anticipation ---- */
.predict-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-8, 2rem) var(--space-5, 1.5rem);
}

.predict-analyzing {
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  padding: var(--space-10, 2.5rem) 0;
}

.predict-loading-spinner { width: 44px; height: 44px; }

.predict-loading-text {
  font-family: var(--font-display);
  font-size: var(--text-base, 1rem);
  font-weight: 400;
  color: var(--color-text);
  text-align: center;
  letter-spacing: -0.01em;
}

.predict-loading-subtext {
  font-size: var(--text-xs, 0.8rem);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 20rem;
  line-height: 1.5;
}

.predict-viz-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, 0.75rem);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(2px);
  animation: predict-phase-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-viz-loading-text {
  font-family: var(--font-display);
  font-size: var(--text-base, 1rem);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* ---- Teaching / compare ---- */
.predict-teaching-text {
  font-size: var(--text-sm, 0.88rem);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3, 0.75rem);
  line-height: 1.5;
}

.predict-dialogue-actions {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
}

/* ==== Scan cards ==== */

.predict-scan-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-4, 1rem);
}

.predict-scan-card {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-bg);
  text-align: left;
  transition: border-color 0.2s;
}

.predict-scan-card:hover {
  border-color: color-mix(in srgb, var(--predict-accent) 30%, var(--color-divider));
}

.predict-scan-card-row {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
}

.predict-scan-card--muted {
  background: var(--color-surface-offset);
}

.predict-scan-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--predict-accent) 10%, transparent);
  color: var(--predict-accent);
  flex-shrink: 0;
}

.predict-scan-icon i, .predict-scan-icon svg { width: 20px; height: 20px; }

.predict-scan-card-body {
  flex: 1;
  min-width: 0;
}

.predict-scan-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-base, 1rem);
  margin: 0 0 var(--space-1, 0.2rem);
  color: var(--color-text);
}

.predict-scan-card p {
  font-size: var(--text-xs, 0.82rem);
  color: var(--color-text-muted);
  margin: 0;
}

.predict-file-input {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.predict-btn--large {
  padding: var(--space-3, 0.85rem) var(--space-6, 1.75rem);
  font-size: var(--text-base, 1rem);
  border-radius: var(--radius-lg, 10px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--predict-accent) 30%, transparent),
    0 4px 20px color-mix(in srgb, var(--predict-accent) 18%, transparent);
  transition: background 0.15s, opacity 0.15s, box-shadow 0.25s, transform 0.15s;
}

.predict-btn--large:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--predict-accent) 40%, transparent),
    0 6px 28px color-mix(in srgb, var(--predict-accent) 25%, transparent);
}

/* QR code — useful utility, not the hero */
.predict-qr-section {
  margin-bottom: var(--space-5, 1.5rem);
  text-align: center;
  padding: var(--space-4, 1rem) var(--space-4, 1.25rem);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg, 12px);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.predict-qr-section:hover {
  border-color: color-mix(in srgb, var(--predict-accent) 25%, var(--color-divider));
}

.predict-qr-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2, 0.5rem);
  letter-spacing: 0.01em;
}

.predict-qr-code {
  display: inline-block;
  padding: var(--space-2, 0.5rem);
  background: #fff;
  border-radius: var(--radius-md, 8px);
}

.predict-qr-code svg {
  display: block;
  transform: scale(1);
  transform-origin: center;
}

.predict-qr-url {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-faint, var(--color-text-muted));
  margin-top: var(--space-2, 0.5rem);
  word-break: break-all;
  opacity: 0.7;
}

.predict-qr-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1, 0.25rem);
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
  opacity: 0.65;
}

/* Type toggle (collapsible) — quiet tertiary action */
.predict-type-toggle {
  margin-bottom: var(--space-3, 0.75rem);
  text-align: center;
}

.predict-type-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 0.35rem);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  color: var(--color-text-faint, var(--color-text-muted));
  cursor: pointer;
  padding: var(--space-2, 0.4rem) 0;
  transition: color 0.15s;
  list-style: none;
}

.predict-type-summary::-webkit-details-marker { display: none; }

.predict-type-summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-surface-offset);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: background 0.15s, transform 0.2s;
}

.predict-type-toggle[open] .predict-type-summary::before {
  transform: rotate(45deg);
}

.predict-type-summary:hover {
  color: var(--color-text);
}

.predict-type-toggle .predict-problem-form {
  padding-top: var(--space-3, 0.75rem);
  text-align: left;
}

/* Solve prompt — the student's moment */
.predict-solve-prompt {
  text-align: center;
  padding: var(--space-8, 2rem) 0 var(--space-5, 1.5rem);
  animation: predict-phase-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-solve-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto var(--space-4, 1rem);
  border-radius: 50%;
  background: color-mix(in srgb, var(--predict-accent) 8%, transparent);
  color: var(--predict-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--predict-accent) 12%, transparent);
}

.predict-solve-icon i { width: 28px; height: 28px; }

.predict-solve-prompt h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2, 0.5rem);
  color: var(--color-text);
}

.predict-solve-prompt p {
  color: var(--color-text-muted);
  font-size: var(--text-sm, 0.88rem);
  margin: 0 0 var(--space-4, 1rem);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.predict-upload-area {
  margin: var(--space-4, 1rem) 0;
}

.predict-upload-hint {
  font-size: var(--text-xs, 0.78rem);
  color: var(--color-text-muted);
  margin-top: var(--space-2, 0.4rem);
}

/* Photo thumbnails */
.predict-photos {
  animation: predict-phase-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-photos-grid {
  display: flex;
  gap: var(--space-2, 0.5rem);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-3, 0.75rem);
}

.predict-photo-thumb {
  width: 76px; height: 76px;
  object-fit: cover;
  border-radius: var(--radius-md, 8px);
  border: 2px solid var(--color-divider);
  transition: border-color 0.15s, transform 0.15s;
}

.predict-photo-thumb:hover {
  border-color: var(--predict-accent);
  transform: scale(1.04);
}

.predict-photos-actions {
  display: flex;
  gap: var(--space-2, 0.5rem);
  justify-content: center;
}

/* Assumptions list — the reveal. Each assumption enters with weight. */
.predict-results {
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-assumption {
  padding: var(--space-3, 0.85rem) var(--space-4, 1rem);
  margin-bottom: var(--space-2, 0.5rem);
  border-radius: var(--radius-lg, 10px);
  border-left: 4px solid;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  cursor: default;
  animation: predict-assumption-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-assumption:nth-child(1) { animation-delay: 0.05s; }
.predict-assumption:nth-child(2) { animation-delay: 0.12s; }
.predict-assumption:nth-child(3) { animation-delay: 0.19s; }
.predict-assumption:nth-child(4) { animation-delay: 0.26s; }
.predict-assumption:nth-child(5) { animation-delay: 0.33s; }
.predict-assumption:nth-child(6) { animation-delay: 0.40s; }

.predict-assumption:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.predict-assumption--correct {
  border-left-color: var(--predict-correct, #3d8c5c);
  background: color-mix(in srgb, var(--predict-correct) 5%, transparent);
}

.predict-assumption--wrong {
  border-left-color: var(--predict-wrong, #c45a3c);
  background: color-mix(in srgb, var(--predict-wrong) 6%, transparent);
}

.predict-assumption-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2, 0.5rem);
}

.predict-assumption-icon {
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

.predict-assumption--correct .predict-assumption-icon { color: var(--predict-correct, #3d8c5c); }
.predict-assumption--wrong .predict-assumption-icon { color: var(--predict-wrong, #c45a3c); }

.predict-assumption-text {
  font-size: var(--text-sm, 0.9rem);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.predict-assumption-detail {
  font-size: var(--text-xs, 0.82rem);
  color: var(--color-text-muted);
  margin-top: var(--space-1, 0.3rem);
  padding-left: 1.5rem;
  line-height: 1.5;
}

.predict-assumption-sim-btn {
  margin-top: var(--space-2, 0.5rem);
  margin-left: 1.5rem;
}

.predict-assumption-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-4, 1rem);
}

.predict-equations {
  padding: var(--space-3, 0.75rem);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md, 8px);
  margin-top: var(--space-3, 0.75rem);
}

.predict-equations h4 {
  font-size: var(--text-xs, 0.82rem);
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2, 0.4rem);
}

.predict-equations pre {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.82rem);
  margin: 0;
  white-space: pre-wrap;
}

.predict-summary {
  padding: var(--space-3, 0.75rem);
  border-radius: var(--radius-md, 8px);
  margin-top: var(--space-3, 0.75rem);
  font-size: var(--text-sm, 0.88rem);
}

.predict-summary--correct { background: color-mix(in srgb, var(--predict-correct) 7%, transparent); }
.predict-summary--wrong { background: color-mix(in srgb, var(--predict-wrong) 7%, transparent); }

.predict-results-actions {
  display: flex;
  gap: var(--space-2, 0.5rem);
  margin-top: var(--space-4, 1rem);
}

/* ==== Depth bar ==== */

.predict-depth-bar {
  display: flex;
  gap: 2px;
  padding: 0 0 var(--space-3, 0.75rem);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-3, 0.75rem);
}

.predict-depth-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.predict-depth-step.is-active {
  background: color-mix(in srgb, var(--predict-accent) 12%, transparent);
  color: var(--predict-accent);
  font-weight: 700;
}

.predict-depth-step.is-done {
  color: var(--color-text-muted);
}

.predict-depth-step.is-done .predict-depth-num {
  background: var(--predict-accent);
  color: #fff;
}

.predict-depth-step.is-wrong {
  color: #e74c3c;
}

.predict-depth-step.is-wrong .predict-depth-num {
  background: #e74c3c;
  color: #fff;
}

.predict-depth-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.predict-depth-step.is-active .predict-depth-num {
  background: var(--predict-accent);
  color: #fff;
}

.predict-depth-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== Review phase ==== */

.predict-review { animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }

.predict-review-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }

.predict-review-card {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border-left: 4px solid var(--predict-accent);
  background: var(--color-surface-offset, #fafafa);
  position: relative;
}

.predict-review-card textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  resize: vertical;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.35rem 0.5rem;
  transition: border-color 0.2s, background 0.2s;
}

.predict-review-card textarea:focus {
  border-color: var(--predict-accent);
  background: var(--color-surface, #fff);
  outline: none;
}

.predict-review-text { min-height: 2.4em; margin-bottom: 0.3rem; }
.predict-review-impl { min-height: 1.6em; font-size: 0.85rem; opacity: 0.7; }

.predict-review-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: none;
  font-size: 1.1rem;
  opacity: 0.35;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}
.predict-review-remove:hover { opacity: 0.8; background: rgba(0,0,0,0.06); }

.predict-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.predict-btn--large {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ==== Clarify phase ==== */

.predict-clarify {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-clarify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.predict-clarify-actions { padding-top: 0.5rem; }

/* ==== Compare phase banner ==== */

.predict-compare-banner {
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.predict-compare-banner--wrong {
  background: color-mix(in srgb, var(--predict-wrong, #e74c3c) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--predict-wrong, #e74c3c) 20%, transparent);
}

/* ==== Chat ==== */

.predict-chat {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: var(--space-2, 0.5rem);
}

.predict-msg {
  display: flex;
}

.predict-msg--student { justify-content: flex-end; }
.predict-msg--tutor { justify-content: flex-start; }
.predict-msg--system { justify-content: center; }

.predict-bubble {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: var(--text-sm, 0.88rem);
  line-height: 1.5;
}

.predict-bubble--student {
  background: var(--predict-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.predict-bubble--tutor {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.predict-bubble--system {
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-style: italic;
  max-width: 100%;
  text-align: center;
}

.predict-bubble--tutor p { margin: 0 0 0.4em; }
.predict-bubble--tutor p:last-child { margin-bottom: 0; }
.predict-bubble--tutor strong { color: var(--predict-accent); }

/* Typing indicator */
.predict-typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.predict-typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-muted); opacity: 0.4;
  animation: predict-dot-pulse 1.2s ease-in-out infinite;
}
.predict-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.predict-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes predict-dot-pulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* Chat input */
.predict-chat-input-area {
  flex-shrink: 0;
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--color-divider);
}

.predict-chat-form {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.predict-chat-textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.88rem);
  font-family: var(--font-body, 'Satoshi', sans-serif);
  line-height: 1.4;
  resize: none;
  background: var(--color-bg);
  color: var(--color-text);
  max-height: 120px;
}

.predict-chat-textarea:focus {
  outline: none;
  border-color: var(--predict-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--predict-accent) 20%, transparent);
}

.predict-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--predict-accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.predict-chat-send:hover { opacity: 0.85; }
.predict-chat-send:disabled { opacity: 0.4; cursor: default; }
.predict-chat-send i, .predict-chat-send svg { width: 16px; height: 16px; }

/* ==== Right panel: viz header ==== */

.predict-viz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-bg);
}

.predict-viz-tabs { display: flex; gap: 2px; }

.predict-viz-tab {
  padding: 5px 12px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.predict-viz-tab:hover:not(:disabled) {
  color: var(--color-text);
}

.predict-viz-tab.active {
  background: transparent;
  color: var(--predict-accent);
}

.predict-viz-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--predict-accent);
  border-radius: 1px;
}

.predict-viz-tab:disabled { opacity: 0.3; cursor: default; }

.predict-phase-chip {
  font-size: 0.625rem;
  font-weight: 600;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--color-surface-offset);
  color: var(--color-text-faint, var(--color-text-muted));
}

/* ==== Canvas — the stage ==== */

.predict-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface-offset);
  background-image:
    radial-gradient(
      ellipse at 50% 60%,
      color-mix(in srgb, var(--predict-accent) 4%, transparent) 0%,
      transparent 60%
    );
}

#predict-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.predict-scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.predict-scratch-canvas.drawing-active {
  pointer-events: auto;
  cursor: crosshair;
}

/* ==== Scratch toolbar ==== */

.predict-scratch-toolbar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.predict-scratch-btn {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.predict-scratch-btn:hover { background: var(--color-surface-offset); }

.predict-scratch-btn.is-active,
.predict-scratch-btn--toggle.is-active {
  background: var(--predict-accent);
  color: #fff;
  border-color: var(--predict-accent);
}

.predict-scratch-btn--ghost { color: var(--color-text-muted); }
.predict-scratch-btn--ghost:hover { color: var(--color-text); }

.predict-scratch-width {
  font-size: 0.72rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  padding: 3px 5px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-bg);
  color: var(--color-text);
}

.predict-scratch-colors {
  display: flex;
  gap: 3px;
  align-items: center;
}

.predict-scratch-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}

.predict-scratch-color:hover { transform: scale(1.15); }
.predict-scratch-color.is-active { border-color: var(--color-text); }

.predict-scratch-color[data-color="#1a1a1e"] { background: #1a1a1e; }
.predict-scratch-color[data-color="#c47a1a"] { background: #c47a1a; }
.predict-scratch-color[data-color="#e74c3c"] { background: #e74c3c; }
.predict-scratch-color[data-color="#4A90D9"] { background: #4A90D9; }
.predict-scratch-color[data-color="#27ae60"] { background: #27ae60; }

/* ==== Playback controls ==== */

.predict-controls {
  padding: var(--space-2, 0.4rem) var(--space-4, 1rem);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
  animation: predict-phase-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.4rem);
}

.predict-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm, 5px);
  background: var(--color-bg);
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.12s, border-color 0.12s;
}

.predict-ctrl-btn:hover {
  background: var(--color-surface-offset);
  border-color: color-mix(in srgb, var(--predict-accent) 30%, var(--color-divider));
}
.predict-ctrl-btn:disabled { opacity: 0.3; cursor: default; }
.predict-ctrl-btn svg, .predict-ctrl-btn i { width: 14px; height: 14px; }

.predict-scrubber-wrap { flex: 1; padding: 0 var(--space-1, 0.25rem); }

.predict-scrubber {
  width: 100%;
  height: 3px;
  accent-color: var(--predict-accent);
}

.predict-speed-select {
  font-size: 0.6875rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  padding: 2px 4px;
  border: 1px solid var(--color-divider);
  border-radius: 3px;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* ==== Legend ==== */

.predict-legend {
  display: flex;
  gap: var(--space-5, 1.25rem);
  justify-content: center;
  padding: var(--space-2, 0.4rem) var(--space-3, 0.75rem);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
  letter-spacing: 0.01em;
}

.predict-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.predict-legend-item::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.predict-legend-student::before { background: var(--predict-student); }
.predict-legend-reality::before { background: var(--predict-reality); }

/* ==== Empty state — presence, not placeholder ==== */

.predict-viz-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3, 0.75rem);
  z-index: 1;
  pointer-events: none;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-8, 2rem);
}

.predict-viz-empty-icon {
  margin-bottom: var(--space-2, 0.5rem);
  color: var(--color-text-muted);
  animation: predict-breathe 4s ease-in-out infinite;
}

.predict-viz-empty-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  color: var(--color-text-muted);
  margin: 0;
  opacity: 0.5;
  letter-spacing: -0.01em;
}

.predict-viz-empty-hint {
  font-size: var(--text-xs, 0.8rem);
  color: var(--color-text-muted);
  margin: 0;
  opacity: 0.35;
}

/* ==== Debug overlay (Ctrl+D) ==== */

.debug-overlay {
  position: fixed;
  bottom: 0;
  right: 0;
  width: min(50vw, 600px);
  max-height: 50vh;
  z-index: 200;
  background: #1a1a1e;
  color: #c8c8c8;
  border-top-left-radius: var(--radius-lg, 12px);
  border: 1px solid #333;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
}

.debug-header {
  display: flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  padding: 6px 12px;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.debug-title {
  font-weight: 700;
  color: #e0a040;
}

.debug-timing {
  flex: 1;
  color: #888;
  font-size: 0.7rem;
}

.debug-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
}

.debug-close-btn:hover { color: #fff; }

.debug-body {
  flex: 1;
  overflow: auto;
  padding: 8px 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.debug-copy-btn {
  padding: 4px 12px;
  border: none;
  background: #333;
  color: #aaa;
  font-size: 0.7rem;
  cursor: pointer;
  align-self: flex-end;
  margin: 4px 8px;
  border-radius: var(--radius-sm, 4px);
}

.debug-copy-btn:hover { background: #444; color: #fff; }

/* ==== Hide feynman.js's own controls that leak through ==== */

.predict-page .viz-controls,
.predict-page .viz-status,
.predict-page .viz-header:not(.predict-viz-header),
.predict-page .test-phase-chip:not(.predict-phase-chip),
.predict-page .feynman-skills-card,
.predict-page .feynman-debug-card {
  display: none !important;
}

/* Make sure feynman.js canvas sizing works within our layout */
.predict-page #preview-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ==== Received photo inbox ==== */

.predict-photo-inbox {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: var(--space-4, 1rem);
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.predict-inbox-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg, 10px);
  animation: predict-inbox-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 0.3s;
}

.predict-inbox-card.done {
  border-color: color-mix(in srgb, var(--predict-correct) 35%, var(--color-divider));
}

@keyframes predict-inbox-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.predict-inbox-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-divider);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.predict-inbox-thumb:hover {
  border-color: var(--predict-accent);
  transform: scale(1.05);
}

.predict-inbox-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.predict-inbox-label {
  font-size: var(--text-sm, 0.88rem);
  font-weight: 500;
  color: var(--color-text);
}

.predict-inbox-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-divider);
  border-top-color: var(--predict-accent);
  border-radius: 50%;
  animation: predict-inbox-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes predict-inbox-spin {
  to { transform: rotate(360deg); }
}

.predict-inbox-start {
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
  animation: predict-inbox-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==== Photo lightbox ==== */

.predict-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
}

.predict-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.predict-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #8a857e;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  transition: color 0.15s;
}

.predict-lightbox-close:hover {
  color: #e8e4de;
}

/* ==== Pipeline Log Panel ==== */
.plog-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 55vh; z-index: 9999;
  background: #1a1a1e; color: #ccc;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  border-top: 2px solid #333;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.plog-panel.open { transform: translateY(0); }
.plog-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; background: #111; border-bottom: 1px solid #333;
  flex-shrink: 0;
}
.plog-header-left { display: flex; align-items: center; gap: 10px; }
.plog-header-right { display: flex; align-items: center; gap: 6px; }
.plog-title { font-weight: 700; color: #e8e4de; font-size: 13px; }
.plog-badge {
  background: #2a2a2e; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; color: #88c0d0;
}
.plog-total { font-size: 11px; color: #666; }
.plog-btn {
  background: #2a2a2e; border: 1px solid #444; color: #aaa;
  padding: 3px 10px; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 11px;
}
.plog-btn:hover { background: #333; color: #eee; }
.plog-close { font-size: 16px; line-height: 1; padding: 2px 8px; }
.plog-body { overflow-y: auto; flex: 1; padding: 8px 14px 14px; }
.plog-empty { color: #555; font-style: italic; padding: 20px 0; text-align: center; }

/* Run separators */
.plog-sep {
  color: #88c0d0; font-weight: 600; font-size: 12px;
  padding: 10px 0 4px; border-top: 1px solid #2a2a2e;
  margin-top: 8px;
}
.plog-sep:first-child { border-top: none; margin-top: 0; }

/* Stage rows */
.plog-stage { margin-bottom: 2px; }
.plog-stage-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; cursor: pointer; border-radius: 4px;
  user-select: none;
}
.plog-stage-hdr:hover { background: #24242a; }
.plog-stage-chevron { color: #555; font-size: 10px; transition: transform 0.15s; }
.plog-stage.expanded .plog-stage-chevron { transform: rotate(90deg); }
.plog-stage-name { color: #e8e4de; font-weight: 600; }
.plog-stage-time { color: #666; margin-left: auto; }
.plog-stage-status { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.plog-stage-status.ok { color: #a3be8c; background: #1a2a1a; }
.plog-stage-status.error { color: #bf616a; background: #2a1a1a; }

/* Expandable body */
.plog-stage-body {
  display: none; padding: 6px 8px 10px 22px;
  border-left: 2px solid #2a2a2e; margin-left: 12px;
}
.plog-stage.expanded .plog-stage-body { display: block; }

/* Sections inside a stage */
.plog-section { margin-bottom: 8px; }
.plog-section-label {
  color: #88c0d0; font-size: 11px; font-weight: 600;
  margin-bottom: 3px; cursor: pointer; user-select: none;
}
.plog-section-label::before { content: "\25B8 "; color: #555; }
.plog-section.sec-open .plog-section-label::before { content: "\25BE "; }
.plog-code {
  display: none; background: #111; padding: 8px 10px;
  border-radius: 4px; overflow-x: auto; white-space: pre-wrap;
  word-break: break-all; max-height: 400px; overflow-y: auto;
  line-height: 1.5;
}
.plog-section.sec-open .plog-code { display: block; }
.plog-code.error-box { border-left: 3px solid #bf616a; }

/* Syntax colors */
.plog-code .jk { color: #88c0d0; }
.plog-code .js { color: #a3be8c; }
.plog-code .jn { color: #d08770; }
.plog-code .jb { color: #b48ead; }
.plog-code .jnull { color: #555; }

/* ==== Interrogation phase ==== */

.predict-interrogate {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-interrogate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.predict-interrogate-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.predict-interrogate-progress {
  font-size: var(--text-xs, 0.8rem);
  color: var(--color-text-muted);
  font-weight: 500;
}

.predict-mental-model {
  padding: var(--space-3, 0.75rem);
  border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, var(--predict-accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--predict-accent) 20%, transparent);
  margin-top: 0.5rem;
  font-size: var(--text-sm, 0.88rem);
  line-height: 1.6;
}

.predict-mental-model p { margin: 0 0 0.3em; }
.predict-mental-model strong { color: var(--predict-accent); }
.predict-mental-model ul { margin: 0.2em 0 0.5em 1.2em; padding: 0; }
.predict-mental-model li { margin-bottom: 0.15em; }

.predict-interrogate-actions {
  padding-top: 0.75rem;
  text-align: center;
}

/* ==== Explore phase (post-simulation) ==== */

.predict-explore {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: predict-phase-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.predict-explore-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.predict-explore-context {
  font-size: var(--text-xs, 0.8rem);
  color: var(--color-text-muted);
  line-height: 1.45;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm, 6px);
  background: var(--color-surface-offset);
  margin-bottom: 0.5rem;
}
.predict-explore-context:empty { display: none; }

.predict-explore-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0.5rem 0;
}
.predict-explore-suggestions:empty { display: none; }

.predict-suggestion-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body, 'Satoshi', sans-serif);
  border: 1px solid var(--color-divider);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.predict-suggestion-chip:hover {
  border-color: var(--predict-accent);
  background: color-mix(in srgb, var(--predict-accent) 8%, transparent);
}

.predict-explore-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  margin-top: auto;
}

/* Small button variant */
.predict-btn--sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

/* ==== Utility ==== */
.hidden { display: none !important; }
