* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}

.pearson-top-bar {
  background: linear-gradient(to bottom, #3b6e91 0%, #1e4663 100%);
  color: #ffffff;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  border-bottom: 1px solid #122d42;
  flex-shrink: 0;
  gap: 10px;
}

.pearson-title-left {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pearson-mode-pill {
  background: #f59e0b;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.skill-weight-pill {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fde047;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
}

.pearson-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 700;
  flex-shrink: 0;
}

.timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-row.urgent,
.timer-row.timer-urgent {
  color: #fde047;
}

.item-count-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #e2e8f0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-nav-strip {
  background: #0f172a;
  border-bottom: 1px solid #334155;
  padding: 7px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.quick-nav-selects,
.quick-nav-audio-opts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pearson-instruction-band {
  background-color: #dbeafe;
  border-bottom: 1px solid #93c5fd;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  color: #0f172a;
  line-height: 1.45;
  flex-shrink: 0;
}

.pearson-workspace {
  flex: 1;
  background-color: #ffffff;
  overflow-y: auto;
  padding: 22px 32px;
  position: relative;
  user-select: text;
}

.pearson-box,
.pearson-gray-box {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 18px auto;
  background-color: #e4e7ec;
  border: 1px solid #8c96a5;
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 3px rgba(15, 23, 42, 0.06);
}

.pearson-box-title {
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
}

.pearson-status-line,
.pearson-box-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #1e293b;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.volume-row,
.pearson-volume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #1e293b;
  margin-top: 6px;
}

.pearson-progress-track,
.pearson-progress-outer {
  width: 100%;
  height: 16px;
  background-color: #ffffff;
  border: 1px solid #64748b;
  border-radius: 3px;
  padding: 1px;
  overflow: hidden;
}

.pearson-progress-fill,
.pearson-progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(to bottom, #38bdf8 0%, #0284c7 100%);
  transition: width 0.2s linear;
}

.mic-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  margin-right: 4px;
}

.mic-dot.recording {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25);
}

.reading-prompt-text,
.pearson-stimulus-text {
  max-width: 920px;
  margin: 0 auto 18px auto;
  font-size: 16px;
  line-height: 1.75;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 16px 20px;
}

.split-2col,
.pearson-split-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto 16px auto;
  align-items: start;
}

.chart-frame,
.pearson-image-frame {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 14px;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.chart-frame svg,
.pearson-image-frame svg {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.writing-Action-row,
.pearson-writing-controls {
  max-width: 920px;
  margin: 0 auto 8px auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pearson-small-btn,
.pearson-classic-btn {
  background: linear-gradient(to bottom, #f8fafc 0%, #cbd5e1 100%);
  border: 1px solid #64748b;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 4px;
}

.pearson-textarea {
  display: block;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  height: 185px;
  border: 1px solid #64748b;
  border-radius: 6px;
  background-color: #ffffff;
  padding: 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: #0f172a;
  resize: vertical;
  outline: none;
}

.pearson-textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.word-counter-bar,
.pearson-word-count {
  max-width: 920px;
  margin: 8px auto 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #0f172a;
}

.fib-select,
.pearson-select {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid #0284c7;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  margin: 3px 4px;
  max-width: 100%;
}

.lfib-input,
.pearson-inline-input {
  font-family: inherit;
  font-size: 15px;
  width: 145px;
  max-width: 48vw;
  padding: 4px 8px;
  border: 1px solid #0284c7;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  margin: 3px 4px;
}

.rfib-drop-slot {
  display: inline-block;
  min-width: 115px;
  min-height: 30px;
  vertical-align: middle;
  border: 1.5px dashed #0284c7;
  border-radius: 4px;
  background: #ffffff;
  margin: 3px 4px;
  padding: 3px 10px;
  text-align: center;
  font-weight: 700;
  font-size: 14.5px;
  color: #0369a1;
  cursor: pointer;
}

.rfib-drop-slot.filled {
  background: #e0f2fe;
  border-style: solid;
  border-color: #0284c7;
}

.rfib-word-bank {
  max-width: 920px;
  margin: 14px auto 0 auto;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 62px;
  align-items: center;
}

.rfib-word-chip,
.rfib-word-tile {
  background: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 4px;
  padding: 6px 13px;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.rfib-word-chip.used,
.rfib-word-tile.used-tile {
  opacity: 0.35;
  pointer-events: none;
}

.rop-container {
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.rop-panel {
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  min-height: 260px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rop-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
}

.rop-card {
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rop-card:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.rop-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.rop-btn {
  background: #e2e8f0;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #0f172a;
}

.pearson-options-list {
  max-width: 920px;
  margin: 0 auto;
}

.pearson-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1.45;
}

.pearson-option-row input {
  margin-top: 3px;
  transform: scale(1.15);
  flex-shrink: 0;
}

.pearson-option-row:hover {
  background: #f1f5f9;
}

.pearson-option-row.selected {
  background: #fef9c3;
  border-color: #eab308;
}

.hiw-word,
.hiw-token {
  display: inline-block;
  padding: 2px 4px;
  margin: 1px 0;
  border-radius: 3px;
  cursor: pointer;
}

.hiw-word.highlighted,
.hiw-token.selected {
  background-color: #fde047;
  font-weight: 700;
  box-shadow: 0 0 0 1px #ca8a04;
}

.canvas-quick-actions {
  max-width: 920px;
  margin: 18px auto 6px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.canvas-act-btn {
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.canvas-act-btn.blue {
  background: #0284c7;
  color: #ffffff;
}

.canvas-act-btn.amber {
  background: #f59e0b;
  color: #0f172a;
}

.canvas-act-btn.slate {
  background: #334155;
  color: #ffffff;
}

.canvas-act-btn.emerald {
  background: #16a34a;
  color: #ffffff;
}

.canvas-act-btn.outline {
  background: #ffffff;
  color: #0f172a;
  border-color: #94a3b8;
}

.score-result-box,
.ai-eval-banner {
  max-width: 920px;
  margin: 16px auto 8px auto;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #1e4663;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.score-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
}

.practice-drawer {
  background: #0f172a;
  color: #f8fafc;
  border-top: 2px solid #f59e0b;
  padding: 10px 18px;
  font-size: 12px;
  flex-shrink: 0;
}

.practice-drawer.hidden,
.hidden {
  display: none !important;
}

.practice-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.toolbar-btn-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.q-Select {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #475569;
  padding: 5px 8px;
  font-size: 12.5px;
  border-radius: 4px;
  max-width: 100%;
}

.q-Select.gold-border {
  border-color: #f59e0b;
  color: #fde047;
  font-weight: 700;
}

.helper-btn {
  background: #334155;
  color: #ffffff;
  border: 1px solid #64748b;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.helper-btn:hover:not(:disabled) {
  background: #475569;
}

.helper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.helper-btn.gold {
  background: #f59e0b;
  color: #111827;
  border-color: #fbbf24;
  font-weight: 700;
}

.helper-btn.green {
  background: #16a34a;
  border-color: #4ade80;
  font-weight: 700;
}

.whisper-check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #38bdf8;
  cursor: pointer;
  background: #1e293b;
  padding: 4px 8px;
  border: 1px solid #334155;
  border-radius: 4px;
}

.template-overlay-panel {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  background: #020617;
  border: 1px solid #334155;
  padding: 10px 12px;
  border-radius: 5px;
  max-height: 155px;
  overflow-y: auto;
}

.strategy-guide-title {
  color: #fbbf24;
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.strategy-guide-body {
  white-space: pre-wrap;
  line-height: 1.45;
  color: #e2e8f0;
  user-select: text;
  font-size: 12px;
}

.asr-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.asr-live-title {
  color: #38bdf8;
  font-weight: 700;
  font-size: 12px;
}

.asr-conf-badge {
  font-size: 11px;
  color: #4ade80;
}

.spoken-transcript-area {
  width: 100%;
  height: 58px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12.5px;
}

.azure-config-row {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 11px;
  color: #94a3b8;
}

.azure-inputs-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.azure-input {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #475569;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 11px;
  width: 125px;
}

.azure-input.region {
  width: 85px;
}

.db-stats-badge {
  color: #fbbf24;
  font-weight: 700;
}

.pearson-bottom-bar {
  background: linear-gradient(to bottom, #3b6e91 0%, #1e4663 100%);
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px;
  border-top: 1px solid #122d42;
  flex-shrink: 0;
  gap: 8px;
}

.footer-left-group,
.footer-right-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pearson-footer-btn {
  background: linear-gradient(to bottom, #f0f7fc 0%, #bcd5e8 100%);
  border: 1px solid #122d42;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #ffffff;
}

.pearson-footer-btn.gold-footer {
  background: linear-gradient(to bottom, #fde047 0%, #f59e0b 100%);
  color: #0f172a;
  border-color: #78350f;
}

.noteboard-floating {
  position: fixed;
  right: 18px;
  bottom: 64px;
  width: 400px;
  max-width: calc(100vw - 24px);
  background: #fef9c3;
  border: 2px solid #ca8a04;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 1100;
  overflow: hidden;
}

.noteboard-header {
  background: #ca8a04;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.noteboard-actions {
  display: flex;
  gap: 4px;
}

.noteboard-textarea {
  width: 100%;
  height: 155px;
  border: none;
  background-color: #fef9c3;
  background-image: linear-gradient(#fde047 1px, transparent 1px), linear-gradient(90deg, #fde047 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 10px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  resize: none;
  outline: none;
}

.pro-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  padding: 16px;
}

.pro-modal-box {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 1040px;
  max-height: 90dvh;
  border-radius: 6px;
  border: 2px solid #1e4663;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.pro-modal-header {
  background: linear-gradient(to bottom, #3b6e91 0%, #1e4663 100%);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pro-modal-header h2 {
  font-size: 15px;
  line-height: 1.3;
}

.pro-modal-body {
  padding: 16px;
  overflow-y: auto;
  user-select: text;
}

.clb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.clb-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #1e4663;
  border-radius: 5px;
  padding: 12px;
  text-align: center;
}

.clb-card h4 {
  font-size: 12.5px;
  color: #334155;
  margin-bottom: 6px;
}

.clb-score-big {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.modal-2col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 66px;
  }

  .pearson-top-bar {
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .pearson-title-left {
    justify-content: space-between;
    font-size: 13.5px;
  }

  .brand-title-text {
    font-size: 13.5px;
  }

  .pearson-meta-right {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding-top: 5px;
    font-size: 12px;
  }

  .quick-nav-strip {
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .quick-nav-selects {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
  }

  .quick-nav-audio-opts {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .q-Select,
  .fib-select,
  .lfib-input,
  .pearson-textarea,
  .spoken-transcript-area,
  .noteboard-textarea,
  .azure-input {
    font-size: 16px;
  }

  .q-Select {
    width: 100%;
    padding: 8px 10px;
  }

  .pearson-instruction-band {
    padding: 9px 12px;
    font-size: 13px;
  }

  .pearson-workspace {
    flex: none;
    overflow: visible;
    padding: 14px 12px;
  }

  .reading-prompt-text,
  .pearson-stimulus-text {
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.65;
  }

  .split-2col,
  .pearson-split-layout,
  .rop-container,
  .template-overlay-panel,
  .modal-2col-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .template-overlay-panel {
    max-height: none;
    overflow: visible;
  }

  .score-grid,
  .clb-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .canvas-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .canvas-act-btn {
    width: 100%;
    padding: 10px 8px;
    font-size: 13px;
  }

  .practice-drawer {
    padding: 12px;
  }

  .practice-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-btn-cluster {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .helper-btn,
  .whisper-check-label {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12.5px;
    text-align: center;
  }

  .pearson-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 8px 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
  }

  .pearson-footer-btn {
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .noteboard-floating {
    left: 10px;
    right: 10px;
    bottom: 62px;
    width: auto;
  }
}

@media (max-width: 480px) {
  .quick-nav-audio-opts {
    grid-template-columns: 1fr 1fr;
  }

  .quick-nav-audio-opts select:last-child {
    grid-column: span 2;
  }

  .score-grid,
  .clb-grid {
    grid-template-columns: 1fr;
  }

  .pearson-footer-btn {
    padding: 7px 9px;
    font-size: 12px;
  }
}
