/* ============================================================
   GLOBAL RESET (Fix white borders + scrollbars forever)
   ============================================================ */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;   /* ✅ prevents left/right whitespace */
    background: #070b14;       /* dark background */
    color: #e5e7eb;            /* light text */
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  }
  
  
  /* ============================================================
     BLAZOR ROOT FIX (app/main/page containers)
     ============================================================ */
  
  app, main, .page {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    background: transparent !important;
  }
  
  
  /* ============================================================
     RECORDER FULL PAGE LAYOUT (No 100vw bug)
     ============================================================ */
  
  .recorder {
    width: 100%;          /* ✅ DO NOT use 100vw */
    min-height: 100vh;
  
    padding: 24px;
    overflow-x: hidden;
  
    background: radial-gradient(1200px 600px at 10% 0%,
                rgba(99,102,241,0.18), transparent 50%),
                radial-gradient(1200px 600px at 90% 0%,
                rgba(16,185,129,0.14), transparent 55%),
                #0b1220;
  
    color: #e5e7eb;
  }
  
  .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 14px;
  }
  
  .title {
    font-size: 20px;
    font-weight: 700;
  }
  
  .subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(229,231,235,0.72);
  }
  
  .badge {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #4f46e5;
    color: #fff;
  }
  
  
  /* ============================================================
     STATUS PILL
     ============================================================ */
  
  .status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    font-size: 13px;
  }
  
  .status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(148,163,184,0.9);
  }
  
  .status.ok .dot   { background: #34d399; }
  .status.busy .dot { background: #fbbf24; }
  .status.err .dot  { background: #fb7185; }
  
  
  /* ============================================================
     BUTTON CONTROLS
     ============================================================ */
  
  .source-selector {
    display: flex;
    gap: 8px;
    padding-bottom: 14px;
  }

  .btn-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(229,231,235,0.65);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .btn-source:hover:not(:disabled) {
    background: rgba(99,102,241,0.14);
    border-color: rgba(99,102,241,0.40);
    color: #e5e7eb;
  }

  .btn-source.active {
    background: rgba(99,102,241,0.22);
    border-color: rgba(99,102,241,0.65);
    color: #fff;
    font-weight: 600;
  }

  .btn-source:disabled {
    opacity: 0.38;
    cursor: not-allowed;
  }

  .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 18px;
  }

  .mode-select {
    min-width: 360px;
    max-width: 100%;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
  }

  .btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .icon {
    width: 20px;
    text-align: center;
  }
  
  .btn-stop {
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.4);
  }

  .btn-start:hover,
  .btn-extract:hover,
  .btn-stop:hover {
    background: rgba(99,102,241,0.3);
  }

  /* form inputs */
  .input-field {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
  }

  .input-field:focus {
    outline: none;
    border-color: #6398f1;
    background: rgba(255,255,255,0.12);
  }
  
  
  /* ============================================================
     GRID LAYOUT
     ============================================================ */
  
  .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  @media (min-width: 840px) {
    .grid {
      grid-template-columns: 1fr 1fr;
    }
  }
  
  
  /* ============================================================
     CARDS
     ============================================================ */
  
  .card {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
    padding: 14px;
  }
  
  .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
    margin-bottom: 10px;
  }
  
  .card-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
  }
  
  .card-body {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.45;
  }
  
  .card-muted {
    color: rgba(229,231,235,0.62);
  }
  
  .card.full {
    width: 100%;
    margin-bottom: 16px;
  }
  
  .timer-box {
    margin: 12px 4px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 14px;
    color: rgba(229,231,235,0.95);
  }  
  
  /* ============================================================
     ERROR BOX
     ============================================================ */
  
  .error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(244,63,94,0.28);
    background: rgba(244,63,94,0.12);
    color: rgba(254,226,226,0.95);
    font-size: 13px;
  }
  
  
  /* ============================================================
     MARKDOWN OUTPUT — interview-ready bullet style
     ============================================================ */

  .markdown {
    line-height: 1.7;
  }

  .card-body.markdown {
    white-space: normal;
  }

  .markdown p {
    margin: 0 0 10px;
  }

  .markdown h1,
  .markdown h2,
  .markdown h3 {
    margin: 10px 0;
    font-weight: 800;
  }

  /* Remove default list chrome — we draw our own bullets */
  .markdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Each bullet is a card-style row — large, scannable */
  .markdown li {
    counter-increment: answer-bullet;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.10);
    border: 1px solid rgba(99, 102, 241, 0.22);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.55;
    color: rgba(229, 231, 235, 0.97);
  }

  /* Numbered badge before each bullet */
  .markdown li::before {
    content: counter(answer-bullet);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
  }

  /* Reset the counter on each new list */
  .markdown ul {
    counter-reset: answer-bullet;
  }

  .markdown code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 6px;
  }

  .markdown pre {
    background: rgba(255,255,255,0.06);
    padding: 10px;
    border-radius: 12px;
    overflow-x: auto;
  }



  /* ============================================================
   BETA BAR + TOKENS
   ============================================================ */

.beta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  padding: 12px 16px;
  margin: 14px 0 18px;

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.10);

  font-size: 14px;
}

.token-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-weight: 700;
}

/* ============================================================
   COMING SOON FEATURE BUTTONS
   ============================================================ */

.coming-soon {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.premium-locked-grid {
  margin-bottom: 8px;
}

@media (min-width: 840px) {
  .coming-soon {
    grid-template-columns: repeat(4, 1fr);
  }
}

.soon-btn {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);

  background: rgba(255,255,255,0.04);
  color: rgba(229,231,235,0.85);

  font-size: 14px;
  font-weight: 700;

  display: flex;
  flex-direction: column;
  gap: 6px;

  cursor: not-allowed;
  opacity: 0.55;
}

.soon-btn span {
  font-size: 12px;
  font-weight: 500;
  color: rgba(229,231,235,0.55);
}

.locked-module {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(148, 163, 184, 0.12);
  color: rgba(226,232,240,0.95);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.locked-module:disabled {
  opacity: 1;
  cursor: default;
}

.pro-availability-note {
  margin-top: 2px;
}

.home-hero {
  background:
    radial-gradient(680px 340px at 5% 0%, rgba(99,102,241,0.20), transparent 55%),
    radial-gradient(680px 340px at 95% 0%, rgba(16,185,129,0.15), transparent 55%),
    rgba(255,255,255,0.04);
}

.snapshot-card,
.modules-card {
  border: 1px solid rgba(255,255,255,0.12);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.snapshot-item {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 12px;
}

.snapshot-label {
  font-size: 12px;
  color: rgba(229,231,235,0.70);
  margin-bottom: 4px;
}

.snapshot-value {
  font-size: 15px;
  font-weight: 700;
}

.modules-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.module-tile {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.module-title {
  font-size: 16px;
  font-weight: 700;
}

.module-text {
  font-size: 13px;
  color: rgba(229,231,235,0.75);
}

.module-locked {
  opacity: 0.88;
}

.pro-pill {
  margin-left: 8px;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.20);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

@media (min-width: 900px) {
  .modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


.token-section {
  margin: -6px 0 24px;
}

.token-header {
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.token-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.token-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.3s ease;
}

.privacy-disclaimer {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.10);
  color: rgba(224, 242, 254, 0.95);
  font-size: 13px;
}

/* ============================================================
   LEVEL 1 QUIZ
   ============================================================ */

.quiz-top-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.quiz-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.level1-quiz .quiz-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
}

.level1-quiz .assessment-selector-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
}

.level1-quiz .assessment-selector-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(226,232,240,0.82);
}

.level1-quiz .quiz-filter-row .mode-select {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
  max-width: 100%;
}

.level1-quiz .assessment-note {
  margin-top: 8px;
}

.level1-quiz .assessment-summary-note {
  margin-top: 8px;
}

.quiz-options {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.quiz-option {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}

.quiz-option.quiz-option-correct {
  background: rgba(16,185,129,0.20);
  border-color: rgba(16,185,129,0.55);
}

.quiz-option.quiz-option-wrong {
  background: rgba(244,63,94,0.18);
  border-color: rgba(244,63,94,0.55);
}

.quiz-feedback-correct,
.quiz-feedback-wrong {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.quiz-feedback-correct {
  border: 1px solid rgba(16,185,129,0.45);
  background: rgba(16,185,129,0.14);
}

.quiz-feedback-wrong {
  border: 1px solid rgba(244,63,94,0.40);
  background: rgba(244,63,94,0.12);
}

@media (min-width: 840px) {
  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }
}

.quiz-gradient-header {
  background:
    radial-gradient(600px 300px at 5% 0%, rgba(99,102,241,0.20), transparent 55%),
    radial-gradient(600px 300px at 95% 0%, rgba(16,185,129,0.16), transparent 55%),
    rgba(255,255,255,0.04);
}

.quiz-answer-wrap {
  margin-top: 14px;
}

.quiz-textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}

/* ============================================================
   QUIZ VISUAL ENHANCEMENTS
   ============================================================ */

.quiz-gradient-header {
  border: 1px solid rgba(99,102,241,0.24);
  box-shadow: 0 10px 30px rgba(2, 8, 23, 0.25);
}

.quiz-badges .badge {
  margin-left: 0;
  letter-spacing: 0.25px;
  background: linear-gradient(90deg, rgba(79,70,229,0.95), rgba(37,99,235,0.92));
  border: 1px solid rgba(255,255,255,0.12);
}

.quiz-option {
  min-height: 52px;
  border-radius: 12px;
  transition: transform 0.14s ease, border-color 0.2s ease, background 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(129,140,248,0.62);
  background: rgba(99,102,241,0.20);
}

.quiz-option:active:not(:disabled) {
  transform: translateY(0);
}

.quiz-option:disabled {
  opacity: 0.95;
  cursor: default;
}

.quiz-option.quiz-option-correct,
.quiz-feedback-correct {
  color: rgba(220, 252, 231, 0.98);
}

.quiz-option.quiz-option-wrong,
.quiz-feedback-wrong {
  color: rgba(254, 226, 226, 0.98);
}

.quiz-feedback-correct,
.quiz-feedback-wrong {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.quiz-textarea {
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
}

.quiz-textarea:focus {
  border-color: rgba(99,152,241,0.85);
  box-shadow: 0 0 0 2px rgba(99,152,241,0.18);
}

.quiz-page-stack > .card,
.quiz-page-stack > .token-section,
.quiz-page-stack > .beta-bar {
  margin-bottom: 16px;
}

.quiz-result-stack > * + * {
  margin-top: 10px;
}

.planned-grid .soon-btn {
  width: 100%;
  min-height: 112px;
  justify-content: flex-start;
  text-align: left;
}

.level1-coming-soon {
  grid-template-columns: 1fr;
}

@media (min-width: 840px) {
  .level1-coming-soon {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nav-actions {
  gap: 12px;
}

.nav-card-link {
  text-decoration: none;
}

/* ============================================================
   LEVEL 1 SPECIFIC LAYOUT STABILITY
   ============================================================ */

.level1-quiz .level1-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.level1-quiz .level1-options .quiz-option {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  align-items: flex-start;
}

.level1-quiz .quiz-result-stack {
  margin-top: 12px;
}

.level1-quiz .beta-bar {
  margin-bottom: 16px;
}

.level1-quiz .quiz-feedback-panel {
  margin-bottom: 0;
}

.level1-quiz .quiz-feedback-panel .quiz-feedback-correct,
.level1-quiz .quiz-feedback-panel .quiz-feedback-wrong {
  margin-top: 0;
}

.level1-quiz .quiz-top-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .level1-quiz .level1-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level1-quiz .quiz-top-meta {
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
  }

  .level1-quiz .quiz-top-meta .beta-bar {
    margin-bottom: 0;
  }
}

.token-section {
  border-radius: 14px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.46);
  border: 1px solid rgba(255,255,255,0.08);
}

.token-bar {
  height: 12px;
}

.token-fill {
  background: linear-gradient(90deg, #10b981, #22c55e 45%, #f59e0b 95%);
}

.token-fill.tone-green {
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.token-fill.tone-yellow {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.token-fill.tone-red {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.readiness-pop {
  animation: readinessPulse 1.8s ease-in-out infinite;
}

.readiness-emphasis {
  font-size: 14px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.25px;
  color: #e0e7ff;
  background: linear-gradient(90deg, rgba(79,70,229,0.92), rgba(37,99,235,0.92));
  border: 1px solid rgba(191,219,254,0.5);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
}

.milestone-pop {
  animation: milestoneRise 320ms ease-out;
}

.muted-weak-hint {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

@keyframes readinessPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes milestoneRise {
  from { transform: translateY(6px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 839px) {
  .recorder {
    padding: 16px;
  }

  .quiz-top-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .level1-quiz .quiz-filter-row {
    width: 100%;
    margin-left: 0;
  }

  .level1-quiz .quiz-filter-row .mode-select {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .quiz-badges {
    flex-wrap: wrap;
  }

  .quiz-option {
    min-height: 48px;
  }

  .quiz-textarea {
    min-height: 150px;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-card-link {
    justify-content: center;
    width: 100%;
  }

  .level1-quiz .level1-options {
    grid-template-columns: 1fr;
  }

  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   COPILOT PREMIUM GATE
   ============================================================ */

.copilot-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 3rem 2rem;
}

.gate-lock {
  font-size: 3rem;
  line-height: 1;
}

.gate-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f1f5f9;
}

.gate-body {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 480px;
  line-height: 1.7;
  margin: 0;
}

.gate-cta-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin: 0;
}

.gate-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.65rem 1.5rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.gate-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.gate-btn-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #94a3b8;
  pointer-events: none;
}

.gate-btn-disabled:hover {
  opacity: 0.45;
  transform: none;
}
