:root {
  --bg: #0f1115;
  --panel: #161a21;
  --panel-2: #1d222b;
  --border: #2a303c;
  --text: #e6e9ef;
  --muted: #8a93a6;
  --accent: #4f8cff;
  --green: #38c172;
  --red: #e3564a;
  --amber: #d9a441;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.brand:hover {
  background-color: var(--panel-2);
}
.brand:hover .brand-wordmark::after {
  content: " · Home";
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
.brand-accent { color: var(--accent); }
.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #1a0f0c, #2b1310);
  border: 1px solid rgba(255, 107, 61, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px -4px rgba(227, 40, 58, 0.55);
}
.brand-mark svg { width: 18px; height: 18px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.tier-badge {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: default;
}
.tier-badge.paid { color: #0f1115; background: linear-gradient(90deg,#f6d365,#fda085); border: none; font-weight: 600; }
.tier-badge button {
  margin-left: 8px;
  font-size: 11px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
}

.reset-progress-btn {
  font-size: 11px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.reset-progress-btn:hover { border-color: var(--red); color: var(--red); }

.admin-nav-link {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.admin-nav-link:hover { border-color: var(--accent); color: var(--accent); }

.auth-section { display: flex; align-items: center; }
.signin-btn {
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.signin-btn:hover { border-color: var(--accent); }

.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.filters select {
  flex: 1 1 calc(50% - 4px);
  min-width: 100px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
}

.topic-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(79, 140, 255, 0.08);
  border-bottom: 1px solid rgba(79, 140, 255, 0.25);
  font-size: 12px;
  color: var(--accent);
}
.topic-filter-banner button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.topic-filter-banner button:hover { color: var(--text); }

.problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.problem-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.problem-item:hover { background: var(--panel-2); }
.problem-item.active { background: var(--panel-2); border-left: 3px solid var(--accent); }

.problem-item .title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.problem-item .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.pill.easy { background: rgba(56,193,114,0.15); color: var(--green); }
.pill.medium { background: rgba(217,164,65,0.15); color: var(--amber); }
.pill.hard { background: rgba(227,86,74,0.15); color: var(--red); }
.tag-pill { background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.pill.solved-pill { background: rgba(56,193,114,0.15); color: var(--green); }
.pill.locked-pill { background: linear-gradient(90deg,#f6d365,#fda085); color: #0f1115; }

.problem-item.locked { opacity: 0.65; }
.problem-item.locked:hover { background: none; cursor: default; }

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.empty-state {
  margin: auto;
  max-width: 420px;
  text-align: center;
  color: var(--muted);
  padding: 40px;
}
.empty-state h2 { color: var(--text); }

.problem-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.problem-header h2 { margin: 0 0 8px 0; font-size: 20px; }
.problem-header p { color: var(--muted); line-height: 1.5; margin: 0; white-space: pre-wrap; }

.tables-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.tables-section h3 { font-size: 13px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 10px; }
.schema-block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: #a5d6ff;
  white-space: pre-wrap;
  margin-bottom: 14px;
  overflow-x: auto;
}

.example-block { margin-bottom: 0; }
.example-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.example-row + .example-row { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.example-call { color: #a5d6ff; }
.example-arrow { color: var(--muted); }
.example-result { color: #7ee787; }

.sample-table-wrap { margin-bottom: 16px; overflow-x: auto; }
.sample-table-wrap h4 { font-size: 12px; color: var(--text); margin: 0 0 6px 0; font-family: "SF Mono", Consolas, monospace; }
table.data-table { border-collapse: collapse; font-size: 12px; width: 100%; }
table.data-table th, table.data-table td {
  border: 1px solid var(--border);
  padding: 5px 9px;
  text-align: left;
  white-space: nowrap;
}
table.data-table th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
table.data-table td.null-val { color: var(--muted); font-style: italic; }

.editor-section {
  padding: 18px 24px;
  flex-shrink: 0;
}
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.editor-toolbar .actions { display: flex; gap: 8px; }

.case-answer-section { padding: 18px 24px; flex-shrink: 0; }
.case-answer-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
}
.case-followup {
  max-width: 720px;
  padding: 18px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 24px;
}
.case-followup-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}
.case-followup-question { font-size: 14.5px; margin: 0 0 14px; }
.case-followup .case-answer-textarea { min-height: 120px; margin-bottom: 12px; }
.case-feedback-report { padding: 24px; }
.rubric-checklist { margin-top: 8px; }
.rubric-checklist ul { list-style: none; margin: 0; padding: 0; }
.rubric-checklist li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rubric-checklist li:last-child { border-bottom: none; }
.rubric-checklist li.rubric-hit { color: var(--text); }
.rubric-checklist li.rubric-hit::marker { color: #38c172; }
.rubric-checklist li.rubric-missed { color: var(--muted); }

button.run-btn, button.submit-btn {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
button.run-btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.submit-btn { background: var(--accent); color: white; }
button.submit-btn:disabled, button.run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#editor {
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.results-section {
  padding: 0 24px 24px 24px;
}

.result-banner {
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-banner.pass { background: rgba(56,193,114,0.12); color: var(--green); border: 1px solid rgba(56,193,114,0.3); }
.result-banner.fail { background: rgba(227,86,74,0.12); color: var(--red); border: 1px solid rgba(227,86,74,0.3); }

.upsell-box {
  background: linear-gradient(135deg, rgba(246,211,101,0.1), rgba(253,160,133,0.1));
  border: 1px solid rgba(253,160,133,0.3);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 14px;
}
.upsell-box button {
  margin-top: 8px;
  background: linear-gradient(90deg,#f6d365,#fda085);
  border: none;
  color: #0f1115;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.diff-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.diff-preview .col h4 { font-size: 11px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 0; }

.loading-dots { color: var(--muted); font-size: 13px; }
.ask-phoenix-hint { color: var(--muted); font-size: 13px; }
.ask-phoenix-hint strong { color: var(--text); }

.followup-turn {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.followup-turn.user { background: var(--panel-2); border: 1px solid var(--border); margin-left: 24px; }
.followup-turn.assistant { background: rgba(79,140,255,0.08); border: 1px solid rgba(79,140,255,0.25); margin-right: 24px; }
.followup-turn .who { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; font-weight: 700; }

/* Shared styling for anywhere renderMarkdown()'s output lands --
   Ask Phoenix chat turns and the problem description panel both use
   this, so a markdown-content tweak only needs to happen once. */
.followup-turn p, .markdown-content p { margin: 0 0 8px; }
.followup-turn p:last-child, .markdown-content p:last-child { margin-bottom: 0; }
.followup-turn h4, .followup-turn h5, .followup-turn h6,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
  margin: 10px 0 4px; font-size: 13px; font-weight: 700; color: var(--text);
}
.followup-turn h4:first-child, .followup-turn h5:first-child, .followup-turn h6:first-child,
.markdown-content h4:first-child, .markdown-content h5:first-child, .markdown-content h6:first-child { margin-top: 0; }
.followup-turn ul, .followup-turn ol, .markdown-content ul, .markdown-content ol { margin: 4px 0 8px; padding-left: 20px; }
.followup-turn li, .markdown-content li { margin-bottom: 2px; }
.followup-turn code, .markdown-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.followup-turn pre, .markdown-content pre {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  margin: 6px 0;
}
.followup-turn pre code, .markdown-content pre code { background: none; padding: 0; }
.followup-turn table, .markdown-content table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12px;
  width: 100%;
}
.followup-turn th, .followup-turn td, .markdown-content th, .markdown-content td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  text-align: left;
}
.followup-turn th, .markdown-content th { background: var(--panel-2); font-weight: 700; }

/* Ask Phoenix -- floating trigger + slide-in panel (desktop) / bottom
   sheet (mobile, see the responsive block below). Only shown while a
   problem is loaded, toggled from app.js. */
.ask-phoenix-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a3d, #ff3d5a, #a53dff);
  background-size: 200% 200%;
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(255, 61, 90, 0.6);
  animation: askPhoenixShimmer 4s ease infinite;
  transition: transform 0.15s;
}
.ask-phoenix-fab:hover { transform: translateY(-2px) scale(1.03); }
.ask-phoenix-fab svg { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes askPhoenixShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-phoenix-fab { animation: none; }
}

.ask-phoenix-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: flex-end;
}
.ask-phoenix-panel {
  width: 420px;
  max-width: 100%;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 32px -12px rgba(0, 0, 0, 0.5);
}
.ask-phoenix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ask-phoenix-title {
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(90deg, #ff8a3d, #ff3d5a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ask-phoenix-subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 320px; }
.ask-phoenix-close {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.ask-phoenix-close:hover { color: var(--text); border-color: var(--accent); }
.ask-phoenix-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}
.ask-phoenix-thread { flex: 1; }
.ask-phoenix-empty { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 8px; }
.ask-phoenix-input-row {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.ask-phoenix-input-row input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}
.ask-phoenix-input-row button {
  background: linear-gradient(135deg, #ff8a3d, #ff3d5a);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ask-phoenix-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Home screen */
.home-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.home-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.25);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 16px;
}
.home-screen h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}
.home-sub { color: var(--muted); font-size: 15px; margin: 0 0 40px 0; max-width: 480px; }

.track-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.track-card {
  width: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px 22px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  font-family: inherit;
  display: flex;
  flex-direction: column;
}
.track-card:hover:not(.disabled) {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -12px rgba(79, 140, 255, 0.35);
}
.track-card-gold:hover:not(.disabled) {
  border-color: var(--gold);
  box-shadow: 0 12px 28px -12px var(--gold-glow);
}
.track-card.disabled { opacity: 0.5; cursor: not-allowed; }
.track-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.track-icon svg { width: 24px; height: 24px; }
.track-icon-accent { color: var(--accent); border-color: rgba(79, 140, 255, 0.35); background: rgba(79, 140, 255, 0.08); }
.track-icon-gold { color: var(--gold); border-color: rgba(240, 184, 110, 0.35); background: rgba(240, 184, 110, 0.08); }
.track-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.track-desc { font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; }
.track-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Responsive: tablet and below -- sidebar stacks above the workspace
   instead of sitting beside it, so there's no fixed-width column fighting
   a narrow viewport. */
.mobile-filters-toggle { display: none; }

@media (max-width: 768px) {
  .layout { flex-direction: column; overflow-y: auto; }
  .sidebar {
    width: 100%;
    max-height: 55vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  /* Empty-state ("pick a problem") shouldn't force the workspace to fill
     the rest of the viewport -- let it size to its own content instead,
     so there's no big dead gap below the problem list before anything
     is selected. Once a problem loads, its real content (schema, editor,
     results) naturally determines the height anyway. */
  .workspace { overflow-y: visible; flex: none; }

  .mobile-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--panel-2);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-filters-toggle .chevron { color: var(--muted); transition: transform 0.15s; }
  .mobile-filters-toggle.open .chevron { transform: rotate(180deg); }
  .filters { display: none; }
  .filters.mobile-open { display: flex; }

  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .topbar-right { flex-wrap: wrap; gap: 8px; width: 100%; justify-content: flex-end; }
  .tier-badge { font-size: 11px; padding: 5px 10px; }

  .problem-header, .tables-section, .editor-section, .results-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .diff-preview { grid-template-columns: 1fr; }

  #editor { height: 180px; }

  /* Ask Phoenix: a 420px docked side panel doesn't work on a narrow
     screen, so it becomes a bottom sheet covering most of the viewport
     instead -- same overlay/header/body/input structure, just anchored
     to the bottom edge and full-width. */
  .ask-phoenix-fab { right: 16px; bottom: 16px; padding: 11px 16px; font-size: 13px; }
  .ask-phoenix-overlay { align-items: flex-end; }
  .ask-phoenix-panel {
    width: 100%;
    height: 85vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
  }

  .track-grid { flex-direction: column; align-items: center; }
  .track-card { width: 100%; max-width: 320px; }
  .home-screen { padding: 24px 16px; }
  .home-eyebrow { font-size: 10px; padding: 4px 12px; }
  .home-screen h1 { font-size: 24px; }
  .home-sub { font-size: 13px; margin-bottom: 28px; }
}

/* Responsive: phones -- tighten further and let the toolbar wrap instead
   of squeezing Run/Submit into an unreadably narrow row. */
@media (max-width: 520px) {
  .brand { font-size: 16px; }
  .filters { flex-direction: column; }
  .editor-toolbar { flex-wrap: wrap; gap: 8px; }
  .editor-toolbar .actions { width: 100%; }
  button.run-btn, button.submit-btn { flex: 1; }
  .ask-phoenix-input-row { flex-direction: column; }
  .followup-turn.user, .followup-turn.assistant { margin-left: 0; margin-right: 0; }
  .feedback-cols { grid-template-columns: 1fr; }
}

/* ============================================================
   Mock Interview -- "Pro" identity: deep studio ground + amber/coral
   signature accent (same gradient as the Pro badge elsewhere in the app,
   so the premium feature reads as premium consistently, not a new theme).
   ============================================================ */
:root {
  --studio-bg: #0a0c11;
  --studio-panel: #12151c;
  --studio-panel-2: #191d27;
  --studio-border: #262b37;
  --gold: #f0b86e;
  --gold-2: #fda085;
  --gold-glow: rgba(240, 184, 110, 0.35);
}

.pro-badge {
  font-size: 9px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  color: #0f1115;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 800;
  vertical-align: middle;
  margin-left: 4px;
}
.pro-badge.beta-badge {
  background: var(--panel-2);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.interview-screen {
  flex: 1;
  display: flex;
  overflow-y: auto;
  justify-content: center;
  background: var(--studio-bg);
}

.interview-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.setup-quota-note { font-size: 12px; color: var(--muted); margin: -4px 0 16px 0; }

/* ---- Setup screen ---- */
.interview-setup {
  max-width: 600px;
  width: 100%;
  padding: 48px 24px;
  animation: studio-fade-in 0.4s ease both;
}
.interview-setup h1 { margin: 0 0 10px 0; font-size: 28px; letter-spacing: -0.01em; text-wrap: balance; }

.setup-card {
  margin-top: 28px;
  background: var(--studio-panel);
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-card {
  position: relative;
  border: 1px solid var(--studio-border);
  background: var(--studio-panel-2);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:hover { border-color: #3a4152; }
.mode-card.selected {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(240,184,110,0.09), rgba(253,160,133,0.04));
}
.mode-card.selected::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #14171f;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-card-icon { font-size: 20px; margin-bottom: 8px; }
.mode-card-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.mode-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.persona-chips { display: flex; gap: 8px; margin-top: 8px; }
.persona-chip {
  flex: 1;
  position: relative;
  text-align: center;
  border: 1px solid var(--studio-border);
  background: var(--studio-panel-2);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.persona-chip input { position: absolute; opacity: 0; pointer-events: none; }
.persona-chip:hover { border-color: #3a4152; }
.persona-chip.selected {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(240,184,110,0.09), rgba(253,160,133,0.04));
  color: var(--gold);
}

.setup-row { display: flex; flex-direction: column; gap: 10px; }

.file-drop {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--studio-border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: border-color 0.15s;
}
.file-drop:hover { border-color: var(--gold); }
.file-drop.has-file { border-style: solid; color: var(--text); }
.file-drop input { position: absolute; opacity: 0; width: 0; height: 0; }
.file-drop::before {
  content: "↑";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--studio-panel-2);
  color: var(--gold);
  flex-shrink: 0;
}

.resume-status { font-size: 12px; color: var(--muted); }
.resume-status.ok { color: #8fd4a8; }
.resume-status.error { color: var(--red); }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.toggle-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--studio-panel-2);
  border: 1px solid var(--studio-border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.toggle-row input:checked + .toggle-switch { background: rgba(240,184,110,0.18); border-color: var(--gold); }
.toggle-row input:checked + .toggle-switch::after { transform: translateX(16px); background: var(--gold); }

.duration-row-label { display: flex; justify-content: space-between; align-items: center; }
.duration-value {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
.duration-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  /* background is set inline via JS per the selected value -- see
     updateDurationSliderFill() in interview.js -- so the filled portion
     (gold) vs. remaining track (dark) reflects the actual selection. */
  background: var(--studio-border);
  cursor: pointer;
  margin: 4px 0;
}
.duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.duration-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.duration-slider::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.duration-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--studio-border);
}

.start-interview-btn {
  border: none;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  color: #14171f;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 8px 24px -8px var(--gold-glow);
}
.start-interview-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px var(--gold-glow); }
.start-interview-btn:active { transform: translateY(0); }

/* ---- Live interview ---- */
.interview-live {
  max-width: 720px;
  width: 100%;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  animation: studio-fade-in 0.3s ease both;
}
.interview-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.timer-ring-wrap { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.timer-ring { transform: rotate(-90deg); }
.timer-ring-track { fill: none; stroke: var(--studio-border); stroke-width: 4; }
.timer-ring-progress {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-ring-wrap.timer-low .timer-ring-progress { stroke: var(--red); }
.timer-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.end-interview-btn {
  background: var(--studio-panel-2);
  border: 1px solid var(--studio-border);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.end-interview-btn:hover { border-color: var(--red); color: var(--red); }

.table-context-panel {
  background: var(--studio-panel);
  border: 1px solid var(--studio-border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  flex-shrink: 0;
  animation: studio-fade-in 0.3s ease both;
}
.table-context-panel h4 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-family: "SF Mono", Consolas, monospace;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.table-context-panel .schema-block { margin-bottom: 10px; background: var(--studio-panel-2); border-color: var(--studio-border); }
.sample-rows-block {
  background: var(--studio-panel-2);
  border: 1px solid var(--studio-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: #a5d6ff;
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}

.interview-transcript {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: 40vh;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.interview-transcript.static { max-height: none; }

.chat-turn { display: flex; gap: 10px; animation: studio-rise-in 0.25s ease both; }
.chat-turn.user { flex-direction: row-reverse; }
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 2px;
}
.chat-avatar.assistant { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #14171f; }
.chat-avatar.user { background: var(--studio-panel-2); border: 1px solid var(--studio-border); color: var(--accent); }
.chat-bubble-col { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.chat-turn.user .chat-bubble-col { align-items: flex-end; }
.chat-who {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-topic {
  font-size: 9px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gold);
  background: rgba(240,184,110,0.12);
  border: 1px solid rgba(240,184,110,0.25);
  border-radius: 999px;
  padding: 1px 8px;
}
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}
.chat-turn.assistant .chat-bubble { background: var(--studio-panel); border: 1px solid var(--studio-border); border-top-left-radius: 4px; }
.chat-turn.user .chat-bubble { background: rgba(79,140,255,0.14); border: 1px solid rgba(79,140,255,0.3); border-top-right-radius: 4px; }

.interview-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--studio-border);
}

.mic-btn {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  border-radius: 999px;
  border: none;
  background: var(--studio-panel);
  border: 1px solid var(--studio-border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.mic-btn-icon { font-size: 17px; }
.mic-btn:hover { border-color: var(--gold); }
.mic-btn.listening {
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  color: #14171f;
  border-color: transparent;
  animation: mic-pulse 1.6s ease-in-out infinite;
}
.mic-btn:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }
.interim-text { min-height: 18px; color: var(--muted); font-size: 13px; font-style: italic; text-align: center; }

.typed-answer-row {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#typedAnswer {
  width: 100%;
  min-height: 110px;
  background: var(--studio-panel);
  border: 1px solid var(--studio-border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
#typedAnswer:focus { outline: none; border-color: var(--gold); }
.typed-answer-row .submit-btn { align-self: flex-end; padding: 10px 24px; }
.typed-answer-row .submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Feedback report ---- */
.feedback-report {
  max-width: 720px;
  width: 100%;
  padding: 48px 24px;
  animation: studio-fade-in 0.4s ease both;
}
.feedback-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.feedback-report h1 { margin: 0; font-size: 28px; text-wrap: balance; }
.feedback-header-badges { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.feedback-score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  background: var(--studio-panel-2);
  border: 1px solid var(--studio-border);
  padding: 5px 14px;
  border-radius: 999px;
}
.feedback-score span { font-size: 11px; font-weight: 600; color: var(--muted); }
.feedback-level-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  color: #14171f;
  padding: 6px 14px;
  border-radius: 999px;
  flex-shrink: 0;
}
.feedback-level-icon { font-size: 13px; }
.feedback-summary { color: var(--muted); line-height: 1.65; margin-bottom: 28px; font-size: 14px; }

.feedback-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.feedback-col {
  background: var(--studio-panel);
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  padding: 16px;
}
.feedback-col.strengths { border-top: 2px solid #38c172; }
.feedback-col.weaknesses { border-top: 2px solid var(--gold); }
.feedback-col h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feedback-col-icon { font-size: 13px; }
.feedback-col.strengths .feedback-col-icon { color: #38c172; }
.feedback-col.weaknesses .feedback-col-icon { color: var(--gold); }
.feedback-col ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

.feedback-section-title {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 24px 0 10px 0;
}
.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.topic-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(240,184,110,0.1);
  border: 1px solid rgba(240,184,110,0.28);
  color: var(--gold);
  font-family: inherit;
}
.topic-pill-link { cursor: pointer; transition: transform 0.15s, background 0.15s; }
.topic-pill-link:hover { background: rgba(240,184,110,0.2); transform: translateY(-1px); }
.topic-pill-inert {
  cursor: default;
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  border-color: var(--studio-border);
}
.feedback-report .submit-btn {
  margin-top: 28px;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  color: #14171f;
  font-weight: 800;
}

@keyframes studio-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes studio-rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); }
  50% { box-shadow: 0 0 0 10px rgba(240,184,110,0); }
}
@media (prefers-reduced-motion: reduce) {
  .interview-setup, .interview-live, .feedback-report, .table-context-panel, .chat-turn { animation: none; }
  .mic-btn.listening { animation: none; }
  .timer-ring-progress { transition: none; }
}

@media (max-width: 640px) {
  .mode-cards { grid-template-columns: 1fr; }
  .feedback-cols { grid-template-columns: 1fr; }
  .feedback-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .interview-setup, .interview-live, .feedback-report { padding-left: 16px; padding-right: 16px; }
  .chat-bubble-col { max-width: 88%; }
}
