/* IELTS Core Speaking page: a calm, voice-first examiner panel in the workspace style
   (brand blue #245bc7, 16px cards, 12px controls, DM Sans). */

.speaking-shell { max-width: 1040px; margin: 0 auto; padding: 32px 32px 56px; display: flex; flex-direction: column; gap: 18px; }

.speaking-head .page-kicker { margin: 0 0 6px; }
.speaking-title { margin: 0 0 6px; font: 600 34px/1.15 'DM Sans', Arial, sans-serif; letter-spacing: -0.03em; color: #10233f; }
.speaking-lead { margin: 0; max-width: 640px; color: #5b6b80; font-size: 16px; line-height: 1.55; }

/* Shown inside in-app browsers (Telegram and others), which cannot turn speech into text. */
.speaking-note { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid #f1d9a8; border-radius: 16px; background: #fffaf0; }
.speaking-note[hidden] { display: none; }
.speaking-note > .material-symbols-outlined { flex: none; font-size: 22px; color: #b45309; }
.speaking-note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.5; color: #5b4a2a; }
.speaking-note-text strong { color: #10233f; font-weight: 600; font-size: 15px; }
.speaking-note-btn { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: #245bc7; color: #fff; font: 600 14px 'DM Sans', Arial, sans-serif; text-decoration: none; }
.speaking-note-btn:hover { background: #2446a9; }
@media (max-width: 640px) {
  .speaking-note { flex-wrap: wrap; }
  .speaking-note-btn { width: 100%; justify-content: center; }
}
html[data-theme="dark"] .speaking-note { background: #1d1912; border-color: #433821; }
html[data-theme="dark"] .speaking-note-text { color: #c6b99f; }
html[data-theme="dark"] .speaking-note-text strong { color: #e1e2e5; }
html[data-theme="dark"] .speaking-note > .material-symbols-outlined { color: #dab376; }

/* Mode switcher */
.speaking-mode-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.speaking-mode-btn,
.speaking-mode-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #dce3ed; background: #fff; color: #10233f; font: 600 14px 'DM Sans', Arial, sans-serif; cursor: pointer; text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.speaking-mode-btn:hover { border-color: #c5d4f0; background: #f7f9fd; }
.speaking-mode-btn.active { background: #245bc7; border-color: #245bc7; color: #fff; }
.speaking-mode-link { margin-left: auto; border-color: transparent; background: transparent; color: #245bc7; }
.speaking-mode-link:hover { background: #edf3fc; }
.speaking-mode-btn .material-symbols-outlined,
.speaking-mode-link .material-symbols-outlined { font-size: 18px; }

/* Test parts */
.speaking-stage-indicator { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stage-pill { padding: 6px 12px; border-radius: 999px; background: #eef2f7; color: #5b6b80; font: 600 13px 'DM Sans', Arial, sans-serif; }
.stage-pill.active { background: #edf3fc; color: #245bc7; box-shadow: inset 0 0 0 1px #c5d4f0; }

/* Examiner panel */
.vx-exam { position: relative; display: flex; flex-direction: column; min-height: 540px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; }
.vx-exam-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #eef2f6; }
.vx-exam-role { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vx-exam-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: 0 0 auto; transition: background .2s ease; }
.vx-exam[data-state="speaking"] .vx-exam-dot { background: #245bc7; }
.vx-exam[data-state="listening"] .vx-exam-dot { background: #1f7a4d; }
.vx-exam[data-state="thinking"] .vx-exam-dot { background: #b7791f; }
.vx-exam-name { font: 600 15px 'DM Sans', Arial, sans-serif; color: #10233f; }
.vx-exam-status { font-size: 13px; color: #5b6b80; }
.vx-exam-progress { font: 600 13px 'DM Sans', Arial, sans-serif; color: #5b6b80; white-space: nowrap; }

.vx-exam-stage { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 320px; padding: 40px 32px; text-align: center; background: radial-gradient(620px 260px at 50% 0%, #f4f7fd, rgba(244, 247, 253, 0) 70%); }

/* Voice: five bars that move while the examiner speaks or the student's microphone picks up sound. */
.vx-voice { display: flex; align-items: center; justify-content: center; gap: 6px; height: 56px; }
.vx-voice span { width: 6px; height: 10px; border-radius: 6px; background: #c5d4f0; transition: height .2s ease, background .2s ease; }
.vx-voice span:nth-child(1), .vx-voice span:nth-child(5) { --h: 22px; }
.vx-voice span:nth-child(2), .vx-voice span:nth-child(4) { --h: 38px; }
.vx-voice span:nth-child(3) { --h: 52px; }
.vx-exam[data-state="speaking"] .vx-voice span { background: #245bc7; animation: vx-wave 1s ease-in-out infinite; }
.vx-exam[data-state="speaking"] .vx-voice span:nth-child(2) { animation-delay: -.2s; }
.vx-exam[data-state="speaking"] .vx-voice span:nth-child(3) { animation-delay: -.4s; }
.vx-exam[data-state="speaking"] .vx-voice span:nth-child(4) { animation-delay: -.6s; }
.vx-exam[data-state="speaking"] .vx-voice span:nth-child(5) { animation-delay: -.8s; }
.vx-exam[data-state="listening"] .vx-voice span { background: #9fd3b6; }
.vx-exam[data-state="listening"].voice-active .vx-voice span { background: #1f7a4d; animation: vx-wave .8s ease-in-out infinite; }
.vx-exam[data-state="thinking"] .vx-voice span { animation: vx-pulse 1.2s ease-in-out infinite; }
.vx-exam[data-state="thinking"] .vx-voice span:nth-child(2) { animation-delay: .15s; }
.vx-exam[data-state="thinking"] .vx-voice span:nth-child(3) { animation-delay: .3s; }
.vx-exam[data-state="thinking"] .vx-voice span:nth-child(4) { animation-delay: .45s; }
.vx-exam[data-state="thinking"] .vx-voice span:nth-child(5) { animation-delay: .6s; }
@keyframes vx-wave { 0%, 100% { height: 10px; } 50% { height: var(--h, 40px); } }
@keyframes vx-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.vx-question p { margin: 0; max-width: 680px; font: 500 24px/1.4 'DM Sans', Arial, sans-serif; letter-spacing: -0.01em; color: #10233f; }
.vx-question.is-hidden { display: none; }

.vx-candidate { width: 100%; max-width: 680px; padding: 12px 14px; text-align: left; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
.vx-candidate-label { display: block; margin-bottom: 4px; font: 600 12px 'DM Sans', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.vx-candidate p { margin: 0; font-size: 15px; line-height: 1.55; color: #10233f; white-space: pre-line; }

/* Part 2 cue card */
.vx-cue { width: 100%; max-width: 680px; flex-direction: column; align-items: flex-start; padding: 20px 24px; text-align: left; background: #fbfcfe; border: 1px solid #dce3ed; border-radius: 12px; }
.vx-exam-stage:has(.vx-cue[style*="flex"]) .vx-question { display: none; }
.vx-cue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font: 600 12px 'DM Sans', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.slide-timer-pill:empty { display: none; }
.slide-timer-pill { padding: 3px 10px; border-radius: 999px; background: #edf3fc; color: #245bc7; font: 600 13px 'DM Sans', Arial, sans-serif; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.vx-cue h3 { margin: 12px 0 6px; font: 600 22px/1.3 'DM Sans', Arial, sans-serif; letter-spacing: -0.01em; color: #10233f; }
.vx-cue .slide-say-label { margin: 0 0 4px; font-size: 14px; color: #5b6b80; }
.slide-bullets ul { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.7; color: #334155; }
.vx-cue .slide-ready-btn { margin-top: 16px; }

/* Start screen */
.vx-start { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center; background: rgba(255, 255, 255, .95); }
.vx-start h2 { margin: 0; font: 600 26px/1.25 'DM Sans', Arial, sans-serif; letter-spacing: -0.02em; color: #10233f; }
.vx-start p { max-width: 460px; margin: 0 0 8px; font-size: 15px; line-height: 1.55; color: #5b6b80; }

/* Answer area */
.vx-exam-answer { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; border-top: 1px solid #eef2f6; background: #fcfdff; }
.vx-exam.is-waiting .vx-exam-answer { opacity: .45; pointer-events: none; }
.vx-compose { display: flex; gap: 8px; }
.vx-compose input { flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid #dce3ed; border-radius: 12px; background: #fff; color: #10233f; font: 400 15px 'DM Sans', Arial, sans-serif; }
.vx-compose input:focus { outline: 3px solid rgba(36, 91, 199, .15); border-color: #245bc7; }
.vx-send { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #245bc7; color: #fff; cursor: pointer; }
.vx-send:hover { background: #2446a9; }
.vx-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vx-controls .button .material-symbols-outlined { font-size: 18px; }
.vx-mic.recording { background: #b42318 !important; border-color: #b42318 !important; color: #fff !important; }
.vx-text-toggle { margin-left: auto; padding: 8px 4px; border: 0; background: none; color: #245bc7; font: 600 14px 'DM Sans', Arial, sans-serif; cursor: pointer; }

/* Result */
.vx-score { position: fixed; inset: 0; z-index: 1000; align-items: center; justify-content: center; padding: 24px; background: rgba(16, 35, 63, .45); }
.vx-score-card { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(16, 35, 63, .25); }
.vx-score-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid #eef2f6; }
.vx-score-head h3 { margin: 0 0 2px; font: 600 20px 'DM Sans', Arial, sans-serif; color: #10233f; }
.vx-score-head p { margin: 0; font-size: 13px; color: #5b6b80; }
.vx-score-close { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid #dce3ed; border-radius: 12px; background: #fff; color: #10233f; cursor: pointer; }
.vx-score-body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; }
.vx-score-overall { display: flex; align-items: center; gap: 20px; padding: 16px 18px; background: #f5f8fe; border-radius: 12px; }
.vx-score-band span { display: block; font: 600 12px 'DM Sans', Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #5b6b80; }
.vx-score-band strong { font: 600 44px/1 'DM Sans', Arial, sans-serif; letter-spacing: -0.03em; color: #245bc7; }
.vx-score-summary { margin: 0; font-size: 15px; line-height: 1.55; color: #10233f; }
.vx-score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.criterion-card { padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; }
.crit-head { display: flex; justify-content: space-between; gap: 8px; font: 600 14px 'DM Sans', Arial, sans-serif; color: #10233f; }
.crit-badge { color: #245bc7; white-space: nowrap; }
.crit-bar-track { height: 6px; margin: 10px 0; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.crit-bar-fill { height: 100%; background: #245bc7; border-radius: 6px; }
.crit-desc { margin: 0; font-size: 14px; line-height: 1.5; color: #5b6b80; }
.vx-score-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feedback-col h4 { margin: 0 0 6px; font: 600 14px 'DM Sans', Arial, sans-serif; color: #10233f; }
.feedback-col ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: #334155; }
.vx-score-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid #eef2f6; }

/* Conversation feedback and answer review */
.practice-feedback-box,
.speaking-audio-manager { padding: 16px 20px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; }
.practice-tip-item { font-size: 15px; line-height: 1.55; color: #10233f; }
.practice-vocab-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.practice-vocab-tag { padding: 4px 10px; border-radius: 999px; background: #edf3fc; color: #245bc7; font: 600 13px 'DM Sans', Arial, sans-serif; }
.practice-vocab-tags .speaking-review-turn { flex: 1 1 100%; padding: 10px 0; border-top: 1px solid rgba(15, 23, 42, .08); color: #10233f; font-size: 14px; line-height: 1.55; }
.practice-vocab-tags .speaking-review-turn p { margin: 0; }
.practice-vocab-tags .speaking-review-question { margin-bottom: 4px !important; color: #5b6b80; font-size: 13px; }
.practice-vocab-tags > .button { margin-top: 8px; }

/* Solo recording */
.audio-manager-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #10233f; }
.duration-tag { color: #5b6b80; font-variant-numeric: tabular-nums; }
.custom-audio-player { width: 100%; }
.audio-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 720px) {
  .speaking-shell { padding: 20px 16px 40px; }
  .speaking-title { font-size: 28px; }
  .speaking-mode-link { margin-left: 0; }
  .vx-exam { min-height: 0; }
  .vx-exam-head { flex-wrap: wrap; padding: 12px 16px; }
  .vx-exam-stage { min-height: 280px; padding: 28px 16px; gap: 18px; }
  .vx-question p { font-size: 20px; }
  .vx-cue { padding: 16px; }
  .vx-cue h3 { font-size: 19px; }
  .vx-exam-answer { padding: 14px 16px; }
  .vx-text-toggle { margin-left: 0; }
  .vx-score { padding: 12px; }
  .vx-score-head, .vx-score-body, .vx-score-actions { padding-left: 16px; padding-right: 16px; }
  .vx-score-overall { flex-direction: column; align-items: flex-start; gap: 10px; }
  .vx-score-grid, .vx-score-lists { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .vx-voice span { animation: none !important; transition: none; }
  .vx-exam[data-state="speaking"] .vx-voice span,
  .vx-exam[data-state="listening"].voice-active .vx-voice span { height: var(--h, 40px); }
}

/* Dark theme */
html[data-theme="dark"] .speaking-title,
html[data-theme="dark"] .vx-exam-name,
html[data-theme="dark"] .vx-question p,
html[data-theme="dark"] .vx-candidate p,
html[data-theme="dark"] .vx-cue h3,
html[data-theme="dark"] .vx-start h2,
html[data-theme="dark"] .vx-score-head h3,
html[data-theme="dark"] .vx-score-summary,
html[data-theme="dark"] .crit-head,
html[data-theme="dark"] .feedback-col h4,
html[data-theme="dark"] .practice-tip-item,
html[data-theme="dark"] .audio-manager-top,
html[data-theme="dark"] .practice-vocab-tags .speaking-review-turn { color: #e1e2e5; }
html[data-theme="dark"] .speaking-lead,
html[data-theme="dark"] .vx-exam-status,
html[data-theme="dark"] .vx-exam-progress,
html[data-theme="dark"] .vx-candidate-label,
html[data-theme="dark"] .vx-cue-head,
html[data-theme="dark"] .vx-cue .slide-say-label,
html[data-theme="dark"] .vx-start p,
html[data-theme="dark"] .vx-score-head p,
html[data-theme="dark"] .vx-score-band span,
html[data-theme="dark"] .crit-desc,
html[data-theme="dark"] .duration-tag,
html[data-theme="dark"] .practice-vocab-tags .speaking-review-question { color: #94a3b8; }
html[data-theme="dark"] .slide-bullets ul,
html[data-theme="dark"] .feedback-col ul { color: #d4d5d8; }
html[data-theme="dark"] .speaking-mode-btn { background: #212223; border-color: #46474a; color: #e1e2e5; }
html[data-theme="dark"] .speaking-mode-btn.active { background: #3f64ac; border-color: #3f64ac; color: #e1e2e5; }
html[data-theme="dark"] .speaking-mode-link { color: #9aaed6; }
html[data-theme="dark"] .speaking-mode-link:hover { background: #313234; }
html[data-theme="dark"] .stage-pill { background: #272829; color: #94a3b8; }
html[data-theme="dark"] .stage-pill.active { background: #313234; color: #9aaed6; box-shadow: inset 0 0 0 1px #46474a; }
html[data-theme="dark"] .vx-exam,
html[data-theme="dark"] .vx-score-card,
html[data-theme="dark"] .practice-feedback-box,
html[data-theme="dark"] .speaking-audio-manager { background: #212223; border-color: #363739; }
html[data-theme="dark"] .vx-exam-head,
html[data-theme="dark"] .vx-exam-answer,
html[data-theme="dark"] .vx-score-head,
html[data-theme="dark"] .vx-score-actions { border-color: #313234; }
html[data-theme="dark"] .vx-exam-stage { background: none; }
html[data-theme="dark"] .vx-exam-answer { background: #212223; }
html[data-theme="dark"] .vx-voice span { background: #46474a; }
html[data-theme="dark"] .vx-exam[data-state="speaking"] .vx-voice span { background: #7995c8; }
html[data-theme="dark"] .vx-candidate,
html[data-theme="dark"] .vx-cue,
html[data-theme="dark"] .vx-score-overall { background: #272829; border-color: #363739; }
html[data-theme="dark"] .vx-start { background: rgba(33, 34, 35, .95); }
html[data-theme="dark"] .vx-compose input,
html[data-theme="dark"] .vx-score-close { background: #212223; border-color: #46474a; color: #e1e2e5; }
html[data-theme="dark"] .criterion-card { border-color: #363739; }
html[data-theme="dark"] .crit-bar-track { background: #2e2f31; }
html[data-theme="dark"] .crit-badge,
html[data-theme="dark"] .vx-score-band strong,
html[data-theme="dark"] .vx-text-toggle { color: #9aaed6; }
html[data-theme="dark"] .crit-bar-fill { background: #7995c8; }
html[data-theme="dark"] .slide-timer-pill,
html[data-theme="dark"] .practice-vocab-tag { background: #313234; color: #9aaed6; }
html[data-theme="dark"] .practice-vocab-tags .speaking-review-turn { border-top-color: rgba(225, 226, 229, .12); }

/* Older workspace rules give these a shadow and a solid blue active pill; the Speaking page keeps them quiet. */
.speaking-shell .speaking-mode-bar { padding: 0; border: 0 !important; background: none !important; box-shadow: none !important; flex-wrap: wrap !important; overflow: visible !important; }
.speaking-shell .speaking-stage-indicator { flex-wrap: wrap !important; overflow: visible !important; }
.speaking-shell .stage-pill { border: 0 !important; box-shadow: none !important; }
.speaking-shell .stage-pill.active { background: #edf3fc !important; color: #245bc7 !important; box-shadow: inset 0 0 0 1px #c5d4f0 !important; }
.speaking-shell .speaking-mode-btn.active { box-shadow: none !important; }
html[data-theme="dark"] .speaking-shell .stage-pill.active { background: #313234 !important; color: #9aaed6 !important; box-shadow: inset 0 0 0 1px #46474a !important; }