/* Interview page styles (merged). Source: interview-animations.css, interview-answers.css, interview-tts.css */

/* === interview-animations.css === */
/* ===== Interview visual animations ===== */
.iqa-visual {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem 1.25rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.08), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(167, 139, 250, 0.08), transparent 42%),
    rgba(110, 231, 183, 0.05);
  border: 1px solid rgba(110, 231, 183, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.iqa-visual-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.iqa-visual-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gradient);
  border-radius: 999px;
}

.iqa-visual-badge i {
  animation: visBadgePulse 2.4s ease-in-out infinite;
}

@keyframes visBadgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.75; }
}

.iqa-visual-replay {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.iqa-visual-replay:hover {
  transform: translateY(-1px);
  background: rgba(110, 231, 183, 0.18);
  box-shadow: 0 4px 14px rgba(110, 231, 183, 0.2);
}

.iqa-visual-replay.is-spinning i {
  animation: visReplaySpin 0.6s ease;
}

@keyframes visReplaySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.iqa-visual-head small {
  width: 100%;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.vis-stage {
  position: relative;
  min-height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.vis-stage.vis-play {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Keep concept content above the animated backdrop layers */
.vis-stage > *:not(.vis-grid):not(.vis-glow) {
  position: relative;
  z-index: 2;
}

/* Animated grid backdrop */
.vis-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(110, 231, 183, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 183, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 32%, transparent 80%);
  mask-image: radial-gradient(circle at 50% 50%, #000 32%, transparent 80%);
  opacity: 0.55;
}

.vis-stage.vis-play .vis-grid {
  animation: visGridPan 7s linear infinite;
}

@keyframes visGridPan {
  from { background-position: 0 0, 0 0; }
  to { background-position: 22px 22px, 22px 22px; }
}

/* One-shot glow sweep when the stage plays */
.vis-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(110, 231, 183, 0.14) 50%, transparent 68%);
  transform: translateX(-120%);
}

.vis-stage.vis-play .vis-glow {
  animation: visGlowSweep 1.1s ease forwards;
}

@keyframes visGlowSweep {
  to { transform: translateX(120%); }
}

.iqa-visual-teaching {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.iqa-teach-card {
  padding: 0.9rem;
  background: rgba(10, 11, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  animation: iqaTeachIn 0.45s ease backwards;
}

.iqa-teach-card:nth-child(1) { animation-delay: 0.05s; }
.iqa-teach-card:nth-child(2) { animation-delay: 0.12s; }
.iqa-teach-card:nth-child(3) { animation-delay: 0.19s; }
.iqa-teach-card:nth-child(4) { animation-delay: 0.26s; }
.iqa-teach-card:nth-child(5) { animation-delay: 0.33s; }
.iqa-teach-card:nth-child(6) { animation-delay: 0.4s; }

.iqa-official-card,
.iqa-diagram-card,
.iqa-story-card {
  grid-column: 1 / -1;
}

.iqa-official-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.13), transparent 38%),
    rgba(10, 11, 16, 0.65);
  border-color: rgba(56, 189, 248, 0.28);
}

.iqa-teach-card h5 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.iqa-teach-card p,
.iqa-teach-card li {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.iqa-official-card p {
  margin: 0 0 0.35rem;
}

.iqa-official-card strong {
  color: var(--text);
}

.iqa-official-figure {
  color: var(--text-muted);
}

.iqa-official-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  padding: 0.45rem 0.75rem;
  color: var(--bg);
  background: var(--gradient);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform var(--transition), opacity var(--transition);
}

.iqa-official-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.iqa-official-card small {
  display: block;
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.iqa-teach-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.iqa-teach-card ul li {
  margin-bottom: 0.35rem;
}

.iqa-teach-card ul li:last-child {
  margin-bottom: 0;
}

.iqa-teach-card pre {
  margin: 0;
  padding: 0.85rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre;
}

.iqa-teach-card code {
  color: inherit;
  font: inherit;
}

.iqa-story-card ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.iqa-story-card li {
  position: relative;
  min-height: 86px;
  padding: 0.75rem 0.7rem 0.7rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  animation: iqaStoryboardPulse 3.8s ease-in-out infinite;
}

.iqa-story-card li:nth-child(2) { animation-delay: 0.25s; }
.iqa-story-card li:nth-child(3) { animation-delay: 0.5s; }
.iqa-story-card li:nth-child(4) { animation-delay: 0.75s; }
.iqa-story-card li:nth-child(5) { animation-delay: 1s; }

.iqa-story-card li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-bottom: 0.45rem;
  color: var(--bg);
  background: var(--gradient);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.iqa-story-card li p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

@keyframes iqaTeachIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes iqaStoryboardPulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.07); transform: translateY(0); }
  40% { border-color: rgba(110, 231, 183, 0.35); transform: translateY(-2px); }
}

.vis-stage.vis-play * {
  animation-play-state: running;
}

.vis-stage:not(.vis-play) * {
  animation-play-state: paused;
}

/* Paragraph stagger on open */
.iqa-text p.iqa-para-in {
  animation: iqaParaIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes iqaParaIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Accordion body slide */
.iqa-item[open] .iqa-body {
  animation: iqaBodyOpen 0.35s ease;
}

@keyframes iqaBodyOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.iqa-item[open] .iqa-summary {
  background: rgba(110, 231, 183, 0.05);
}

/* Default pulse */
.vis-default {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
}

.vis-pulse-ring {
  position: absolute;
  inset: -8px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: visPulse 2s ease-out infinite;
}

.vis-star {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 1.25rem;
}

.vis-star span {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent);
  animation: visPulse 2.2s ease-in-out infinite;
}

.vis-star small {
  width: 100%;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.vis-k-big { font-weight: 700; font-size: 2.5rem; color: var(--accent-3); }

.vis-kotlin-what {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.vis-kw-step {
  min-width: 120px;
  padding: 0.45rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.35);
  animation: visPop 0.5s ease backwards;
}

.vis-kw-step:nth-child(1) { animation-delay: 0.05s; }
.vis-kw-step:nth-child(5) { animation-delay: 0.35s; }
.vis-kw-step:nth-child(9) { animation-delay: 0.65s; }
.vis-kw-step.vis-kw-art {
  background: rgba(110, 231, 183, 0.25);
  border-color: var(--accent);
}

.vis-kw-arrow {
  font-size: 0.85rem;
  color: var(--accent-2);
  animation: visBounce 1.2s ease infinite;
}

@keyframes visPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Equals */
.vis-equals { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.vis-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  animation: visPop 0.6s ease backwards;
}
.vis-ref { background: rgba(56, 189, 248, 0.2); border: 2px solid var(--accent-2); animation-delay: 0.1s; }
.vis-eq { background: rgba(110, 231, 183, 0.2); border: 2px solid var(--accent); animation-delay: 0.4s; }
.vis-box small { display: block; font-size: 0.65rem; font-weight: 400; color: var(--text-muted); margin-top: 0.25rem; }
.vis-vs { font-weight: 700; color: var(--accent-3); animation: visPulse 1.5s ease infinite; }

/* OOP pillars */
.vis-oop { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; max-width: 320px; }
.vis-pillar {
  padding: 0.5rem 0.6rem;
  font-size: 0.7rem;
  text-align: center;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  animation: visPop 0.5s ease backwards;
}
.vis-p1 { animation-delay: 0.05s; }
.vis-p2 { animation-delay: 0.15s; }
.vis-p3 { animation-delay: 0.25s; }
.vis-p4 { animation-delay: 0.35s; }

/* Array list */
.vis-array-list { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.vis-array { display: flex; gap: 4px; }
.vis-array i {
  width: 28px; height: 28px;
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  animation: visPop 0.4s ease backwards;
}
.vis-array i.vis-active { background: var(--accent-2); animation: visHighlight 1s ease infinite; }
.vis-linked { display: flex; gap: 0; }
.vis-linked span {
  width: 24px; height: 24px;
  background: rgba(167, 139, 250, 0.4);
  border-radius: 50%;
  margin-right: -6px;
  animation: visLinkMove 2s ease-in-out infinite;
}
.vis-linked span:nth-child(2) { animation-delay: 0.2s; }
.vis-linked span:nth-child(3) { animation-delay: 0.4s; }

/* Lifecycle */
.vis-lifecycle { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; max-width: 100%; }
.vis-lifecycle .lc {
  font-size: 0.65rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  animation: visLifecycle 3s ease-in-out infinite;
}
.vis-lifecycle .lc.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.vis-lifecycle .onCreate { animation-delay: 0s; }
.vis-lifecycle .onStart { animation-delay: 0.5s; }
.vis-lifecycle .onResume { animation-delay: 1s; }
.vis-lifecycle .onPause { animation-delay: 1.5s; }
.vis-lifecycle .onStop { animation-delay: 2s; }

@keyframes visLifecycle {
  0%, 15%, 100% { opacity: 0.4; transform: scale(0.95); }
  5%, 10% { opacity: 1; transform: scale(1.05); box-shadow: 0 0 12px rgba(110, 231, 183, 0.4); }
}

/* MVVM */
.vis-mvvm { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.vis-layer {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  animation: visPop 0.5s ease backwards;
}
.vis-view { background: rgba(56, 189, 248, 0.25); animation-delay: 0.1s; }
.vis-vm { background: rgba(110, 231, 183, 0.25); animation-delay: 0.3s; }
.vis-model { background: rgba(167, 139, 250, 0.25); animation-delay: 0.5s; }
.vis-mvvm .vis-arrow { font-size: 0.7rem; color: var(--accent); animation: visBounce 1.2s ease infinite; }

/* Coroutine */
.vis-coroutine { position: relative; width: 200px; height: 80px; }
.vis-thread-pool {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 24px; background: rgba(255,255,255,0.08);
  border-radius: 4px; font-size: 0.6rem; text-align: center; line-height: 24px; color: var(--text-muted);
}
.vis-co {
  position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  animation: visCoFloat 2s ease-in-out infinite;
}
.vis-co.co1 { left: 20%; top: 10%; animation-delay: 0s; }
.vis-co.co2 { left: 45%; top: 25%; animation-delay: 0.3s; }
.vis-co.co3 { left: 70%; top: 5%; animation-delay: 0.6s; }
.vis-suspend { position: absolute; right: 0; top: 0; font-size: 0.7rem; color: var(--accent-2); animation: visBlink 1s step-end infinite; }

@keyframes visCoFloat {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-12px); opacity: 0.6; }
}

/* HashMap */
.vis-hashmap { display: flex; gap: 0.5rem; align-items: flex-end; }
.vis-bucket {
  width: 48px; min-height: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px dashed var(--border);
  border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px;
}
.vis-key { width: 20px; height: 20px; border-radius: 4px; background: var(--accent-2); animation: visDrop 0.6s ease backwards; }
.vis-collide .vis-key.k2 { animation-delay: 0.2s; }
.vis-collide .vis-key.k3 { animation-delay: 0.4s; background: var(--accent-3); }

/* Two sum */
.vis-two-sum { text-align: center; }
.vis-nums span {
  display: inline-block; width: 32px; height: 32px; line-height: 32px;
  background: var(--bg-card); border-radius: 6px; margin: 0 2px;
  animation: visPop 0.4s ease backwards;
}
.vis-nums span:nth-child(2) { animation-delay: 0.15s; background: rgba(110, 231, 183, 0.3); }
.vis-map { font-size: 0.75rem; color: var(--accent-2); margin: 0.5rem 0; animation: visFadeIn 0.8s ease 0.3s backwards; }
.vis-target { font-size: 0.8rem; color: var(--accent); font-weight: 600; animation: visPop 0.5s ease 0.6s backwards; }

/* Sliding window */
.vis-sliding { position: relative; width: 220px; height: 40px; overflow: hidden; }
.vis-track { font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.2em; color: var(--text-muted); white-space: nowrap; animation: visTrackScroll 4s linear infinite; }
.vis-window {
  position: absolute; top: 0; bottom: 0; width: 60px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  animation: visWindowMove 4s ease-in-out infinite;
}

@keyframes visWindowMove {
  0%, 100% { left: 0; }
  50% { left: calc(100% - 60px); }
}
@keyframes visTrackScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-40px); }
}

/* Binary search */
.vis-binary { display: flex; align-items: center; gap: 0.5rem; width: 100%; max-width: 280px; }
.vis-range { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; animation: visShrink 2s ease-in-out infinite; }
.vis-mid {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: visPulse 1.5s ease infinite;
}

/* Flow */
.vis-flow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.vis-emitter, .vis-collector { font-size: 0.75rem; padding: 0.35rem 0.6rem; background: var(--bg-card); border-radius: 4px; animation: visPop 0.5s ease backwards; }
.vis-stream { color: var(--accent); font-family: var(--font-mono); animation: visStream 2s linear infinite; }

@keyframes visStream {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Payment */
.vis-payment { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.vis-payment > div { font-size: 0.7rem; padding: 0.4rem 0.6rem; border-radius: 6px; animation: visPop 0.5s ease backwards; }
.vis-app { background: rgba(56, 189, 248, 0.2); animation-delay: 0s; }
.vis-rzp { background: rgba(167, 139, 250, 0.2); animation-delay: 0.2s; }
.vis-server { background: rgba(110, 231, 183, 0.3); animation-delay: 0.5s; }

/* Sealed states */
.vis-sealed { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.vis-state {
  padding: 0.4rem 0.7rem; font-size: 0.7rem; border-radius: 999px;
  animation: visStateCycle 4s ease-in-out infinite;
}
.s-loading { background: rgba(255,255,255,0.1); animation-delay: 0s; }
.s-success { background: rgba(110, 231, 183, 0.3); animation-delay: 1.3s; }
.s-error { background: rgba(248, 113, 113, 0.3); animation-delay: 2.6s; }

@keyframes visStateCycle {
  0%, 25%, 100% { opacity: 0.35; transform: scale(0.92); }
  5%, 20% { opacity: 1; transform: scale(1.05); }
}

/* Stack */
.vis-stack { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.vis-stack-box {
  width: 60px; height: 0;
  background: var(--accent-2);
  border-radius: 4px;
  animation: visStackGrow 2s ease-in-out infinite;
}
.vis-push, .vis-pop { font-size: 0.7rem; color: var(--text-muted); }

@keyframes visStackGrow {
  0%, 100% { height: 0; }
  40%, 60% { height: 48px; }
}

/* Recycler */
.vis-recycler { display: flex; gap: 1rem; align-items: center; }
.vis-rows { display: flex; gap: 4px; }
.vis-rows i { width: 24px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 4px; }
.vis-rows i.vis-bind { background: var(--accent); animation: visHighlight 1s ease infinite; }

/* FCM */
.vis-fcm { display: flex; align-items: center; gap: 0.5rem; }
.vis-fcm > div { font-size: 0.7rem; padding: 0.4rem 0.5rem; border-radius: 6px; background: var(--bg-card); }
.vis-server { animation: visPop 0.4s ease backwards; }
.vis-cloud { animation: visFcmFly 2s ease-in-out infinite; }
.vis-device { animation: visPop 0.4s ease 0.8s backwards; }

@keyframes visFcmFly {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; box-shadow: 0 0 10px var(--accent); }
}

/* Shared keyframes */
@keyframes visPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes visHighlight {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}
@keyframes visBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
@keyframes visBlink {
  50% { opacity: 0.3; }
}
@keyframes visDrop {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes visFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes visLinkMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@keyframes visShrink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; transform: scaleX(0.7); }
}

/* Group title icon animation */
.iqa-group-title i {
  animation: visIconSpin 8s linear infinite;
}
@keyframes visIconSpin {
  0%, 90% { transform: rotate(0deg); }
  95% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

/* Tab active pulse */
.interview-tab.active {
  animation: visTabGlow 2s ease-in-out infinite;
}
@keyframes visTabGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 16px rgba(110, 231, 183, 0.25); }
}

.iqa-teach-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(110, 231, 183, 0.08);
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.iqa-teach-toggle:hover {
  background: rgba(110, 231, 183, 0.14);
  border-color: rgba(110, 231, 183, 0.4);
}

.iqa-visual-teaching-slot {
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .vis-stage *, .iqa-para-in, .iqa-item[open] .iqa-body,
  .interview-tab.active, .iqa-group-title i, .iqa-teach-card,
  .iqa-story-card li, .vis-grid, .vis-glow,
  .iqa-visual-badge i, .iqa-visual-replay.is-spinning i {
    animation: none !important;
  }
  .vis-stage.vis-play { opacity: 1; transform: none; }
  .vis-glow { display: none; }
  .iqa-text p.iqa-para-in { opacity: 1; }
}

@media (max-width: 900px) {
  .iqa-visual-teaching {
    grid-template-columns: 1fr;
  }

  .iqa-story-card ol {
    grid-template-columns: 1fr;
  }

  .iqa-story-card li {
    min-height: auto;
  }

  .iqa-teach-card pre {
    font-size: 0.72rem;
  }
}

/* === interview-answers.css === */
/* Structured What / Why / How answer layout */

.iqa-answer-panel {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.iqa-answer-panel + .iqa-answer-panel {
  margin-top: 1rem;
}

.iqa-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.iqa-answer-head h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.iqa-answer-head.iqa-en h4 { color: var(--accent-2); }
.iqa-answer-head.iqa-hi h4 { color: var(--accent-3); }

.iqa-answer-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.iqa-answer-head.iqa-en .iqa-answer-badge {
  border-color: rgba(96, 165, 250, 0.35);
  color: var(--accent-2);
}

.iqa-answer-head.iqa-hi .iqa-answer-badge {
  border-color: rgba(167, 139, 250, 0.35);
  color: var(--accent-3);
}

.iqa-answer-content {
  padding: 1rem 1rem 1.15rem;
}

/* Quick nav chips */
.iqa-wwh-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.iqa-wwh-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}

.iqa-wwh-chip-what:hover,
.iqa-wwh-chip-what:focus-visible {
  border-color: rgba(96, 165, 250, 0.5);
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.12);
}

.iqa-wwh-chip-why:hover,
.iqa-wwh-chip-why:focus-visible {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.1);
}

.iqa-wwh-chip-how:hover,
.iqa-wwh-chip-how:focus-visible {
  border-color: rgba(110, 231, 183, 0.5);
  color: var(--accent);
  background: rgba(110, 231, 183, 0.1);
}

.iqa-wwh-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .iqa-wwh-grid {
    grid-template-columns: 1fr;
  }
}

/* Section cards */
.iqa-wwh-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  animation: iqaCardIn 0.45s ease backwards;
}

.iqa-wwh-card:nth-child(1) { animation-delay: 0.05s; }
.iqa-wwh-card:nth-child(2) { animation-delay: 0.12s; }
.iqa-wwh-card:nth-child(3) { animation-delay: 0.19s; }

@keyframes iqaCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.iqa-wwh-what {
  border-color: rgba(96, 165, 250, 0.28);
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.08) 0%, transparent 55%);
}

.iqa-wwh-why {
  border-color: rgba(251, 191, 36, 0.28);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.07) 0%, transparent 55%);
}

.iqa-wwh-how {
  border-color: rgba(110, 231, 183, 0.28);
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.08) 0%, transparent 55%);
}

.iqa-wwh-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.iqa-wwh-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.iqa-wwh-what .iqa-wwh-icon {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

.iqa-wwh-why .iqa-wwh-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}

.iqa-wwh-how .iqa-wwh-icon {
  background: rgba(110, 231, 183, 0.2);
  color: var(--accent);
}

.iqa-wwh-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.iqa-wwh-what .iqa-wwh-label { color: #93c5fd; }
.iqa-wwh-why .iqa-wwh-label { color: #fcd34d; }
.iqa-wwh-how .iqa-wwh-label { color: var(--accent); }

.iqa-wwh-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.iqa-wwh-body {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text);
}

.iqa-wwh-body p {
  margin: 0 0 0.75rem;
  color: inherit;
}

.iqa-wwh-body p:last-child {
  margin-bottom: 0;
}

.iqa-sublead {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.iqa-sublead strong {
  color: var(--text);
  margin-right: 0.25rem;
}

.iqa-bullet-list {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.iqa-bullet-list li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

.iqa-subhead {
  margin: 0.9rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.iqa-subhead strong {
  color: var(--accent);
}

.iqa-wwh-body strong {
  color: var(--text);
  font-weight: 600;
}

.iqa-code-inline {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  color: #c4b5fd;
  white-space: nowrap;
}

.iqa-code-block {
  position: relative;
  margin: 0.6rem 0 0.9rem;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.iqa-code-lang {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 0.4rem 0.85rem 0;
}

.iqa-code-block pre {
  margin: 0;
  padding: 0.7rem 0.9rem 0.85rem;
  overflow-x: auto;
}

.iqa-code-block code {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.6;
  color: #d6cff7;
  white-space: pre;
}

.iqa-inline-code {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  color: #c4b5fd;
}

.iqa-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.65rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px dashed rgba(110, 231, 183, 0.25);
}

.iqa-flow-step {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  background: rgba(110, 231, 183, 0.12);
  color: var(--accent);
}

.iqa-flow-arrow {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.85rem;
}

.iqa-body-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.iqa-item[open] .iqa-wwh-card {
  animation-play-state: running;
}

@media (prefers-reduced-motion: reduce) {
  .iqa-wwh-card {
    animation: none;
  }
}

/* === interview-tts.css === */
/* Interview Prep — text-to-speech controls */

.interview-tts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(110, 231, 183, 0.06) 100%);
}

.interview-tts-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  width: 100%;
}

@media (min-width: 900px) {
  .interview-tts-controls {
    width: auto;
    margin-left: auto;
  }
}

.interview-tts-voice-hint {
  width: 100%;
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.interview-tts-toolbar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.interview-tts-toolbar-title i {
  font-size: 1rem;
}

.interview-tts-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
}

.interview-tts-hint strong {
  color: var(--text);
  font-weight: 600;
}

.interview-tts-rate-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 140px;
  flex: 1;
}

.interview-tts-voice {
  width: 100%;
  max-width: 220px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.interview-tts-rate-wrap label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.interview-tts-rate {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

.interview-tts-warn {
  font-size: 0.78rem;
  color: #fcd34d;
  margin: 0 0 1rem;
}

.interview-mobile-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #a5f3fc;
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.08);
}

.interview-mobile-hint[hidden] {
  display: none !important;
}

.interview-mobile-hint code {
  font-size: 0.72rem;
}

/* Fixed background music-style player */
.interview-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-top: 1px solid rgba(110, 231, 183, 0.3);
  background: rgba(10, 11, 16, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.interview-player[hidden] {
  display: none !important;
}

.interview-player-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .interview-player-inner {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

.interview-player-info {
  flex: 1;
  min-width: 0;
}

.interview-player-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.interview-player-meta {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.interview-player-sep {
  margin: 0 0.25rem;
  opacity: 0.5;
}

.interview-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.interview-player-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform 0.15s ease;
}

.interview-player-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(110, 231, 183, 0.45);
  background: rgba(110, 231, 183, 0.12);
}

.interview-player-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.interview-player-btn-main {
  width: 48px;
  height: 48px;
  color: #0f172a;
  background: linear-gradient(135deg, var(--accent) 0%, #a7f3d0 100%);
  border-color: transparent;
}

.interview-player-btn-main:hover {
  color: #0f172a;
  transform: scale(1.05);
}

.interview-player-btn-main.is-paused {
  background: rgba(110, 231, 183, 0.2);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 183, 0.4);
}

@keyframes ttsPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.iqa-tts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.iqa-tts-row-label {
  width: 100%;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.iqa-tts-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.iqa-tts-btn:hover {
  color: var(--accent);
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(110, 231, 183, 0.1);
}

.iqa-tts-btn.iqa-tts-active {
  color: #fff;
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.2);
}

.iqa-tts-btn.iqa-tts-active:hover {
  color: #fecaca;
}

.iqa-summary-tts {
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0.25rem;
}

.iqa-summary-tts .iqa-tts-btn {
  padding: 0.4rem 0.55rem;
}

.iqa-summary-tts .iqa-tts-label {
  display: none;
}

@media (min-width: 640px) {
  .iqa-summary-tts .iqa-tts-label {
    display: inline;
  }
}

.iqa-answer-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.iqa-answer-head-actions .iqa-tts-btn .iqa-tts-label {
  display: none;
}

@media (min-width: 900px) {
  .iqa-answer-head-actions .iqa-tts-btn .iqa-tts-label {
    display: inline;
  }
}

.iqa-item.iqa-tts-item-active {
  border-color: rgba(110, 231, 183, 0.45);
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.15);
}

/* Inline word highlight in existing question / answer text */
.iqa-item.iqa-tts-reading-active .iqa-title.iqa-tts-highlight-root {
  color: var(--text);
}

.iqa-live-word {
  display: inline;
  margin-right: 0.2em;
  padding: 0.1em 0.15em;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.iqa-live-word.iqa-live-done {
  color: rgba(148, 163, 184, 0.55);
}

.iqa-live-word.iqa-live-current {
  color: #0f172a;
  background: linear-gradient(135deg, #6ee7b7 0%, #a7f3d0 100%);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.45);
  transform: scale(1.05);
}

.iqa-answer-content.iqa-hi .iqa-live-word.iqa-live-current,
.iqa-tts-highlight-root.iqa-hi .iqa-live-word.iqa-live-current {
  color: #1e1b4b;
  background: linear-gradient(135deg, #c4b5fd 0%, #ddd6fe 100%);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.45);
}

.iqa-answer-badge {
  display: none;
}

@media (min-width: 900px) {
  .iqa-answer-head .iqa-answer-badge {
    display: inline;
  }
}

/* ===================================================================
   STUDY PLAN FLOWCHART + DECISION TREE
   =================================================================== */

/* ── Section wrapper ────────────────────────────────────────────── */
.spf-section {
  margin: 2.5rem 0 3rem;
  padding: 2rem 1.5rem 2.5rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(110, 231, 183, 0.06), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(167, 139, 250, 0.07), transparent 50%),
    rgba(18, 20, 28, 0.55);
  border: 1px solid rgba(110, 231, 183, 0.15);
  border-radius: var(--radius);
  overflow-x: clip;
}

.spf-header-row {
  margin-bottom: 1.5rem;
  text-align: center;
}

.spf-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.4rem 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  text-align: center;
  line-height: 1.3;
}

.spf-title i {
  color: var(--accent);
}

.spf-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto;
}

/* ── How to use ─────────────────────────────────────────────────── */
.spf-howto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(110, 231, 183, 0.12);
  border-radius: calc(var(--radius) - 4px);
}

.spf-howto-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
}

.spf-howto-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: rgba(110, 231, 183, 0.15);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.spf-howto-step p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.spf-howto-step strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Plan meta strip ────────────────────────────────────────────── */
.spf-plan-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  margin-bottom: 1rem;
}

.spf-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.spf-meta-item i {
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Tabs ────────────────────────────────────────────────────────── */
.spf-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.spf-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), box-shadow var(--transition);
  text-align: left;
}

.spf-tab-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.spf-tab-label {
  font-size: 0.86rem;
}

.spf-tab-hint {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.85;
}

.spf-tab-btn.active .spf-tab-hint {
  color: rgba(15, 23, 42, 0.65);
}

.spf-tab-btn:hover {
  color: var(--accent);
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(110, 231, 183, 0.08);
}

.spf-tab-btn.active {
  color: #0f172a;
  background: linear-gradient(135deg, var(--accent) 0%, #a7f3d0 100%);
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(110, 231, 183, 0.3);
}

/* Working Pro tab — amber accent */
.spf-tab-btn--working {
  border-color: rgba(251, 191, 36, 0.25);
  color: #fbbf24;
}

.spf-tab-btn--working:hover {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}

.spf-tab-btn--working.active {
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24 0%, #fde68a 100%);
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.35);
}

/* ── Progress bar ────────────────────────────────────────────────── */
.spf-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.spf-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.spf-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.spf-progress-fill--complete {
  background: linear-gradient(90deg, #6ee7b7, #a7f3d0);
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.5);
  animation: spfProgressPulse 2s ease-in-out infinite;
}

@keyframes spfProgressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.spf-progress-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  min-width: 0;
}

.spf-reset-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.spf-reset-btn:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

/* ── Flowchart canvas ────────────────────────────────────────────── */
.spf-flowchart {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ── Entrance animation ──────────────────────────────────────────── */
.spf-enter {
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.spf-enter.spf-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Connectors ──────────────────────────────────────────────────── */
.spf-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2px;
  gap: 0;
}

.spf-connector-line {
  width: 2px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(110, 231, 183, 0.6), rgba(110, 231, 183, 0.15));
  transform-origin: top;
  animation: spfLineGrow 0.7s ease forwards;
  border-radius: 1px;
}

.spf-connector-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid rgba(110, 231, 183, 0.5);
  animation: spfArrowIn 0.4s ease 0.55s both;
  opacity: 0;
}

@keyframes spfLineGrow {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

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

/* ── Start / End caps ────────────────────────────────────────────── */
.spf-node--cap {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.22) 0%, rgba(56, 189, 248, 0.18) 100%);
  border: 1.5px solid rgba(110, 231, 183, 0.45);
  box-shadow: 0 0 24px rgba(110, 231, 183, 0.12);
}

.spf-cap-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.spf-node--cap.spf-done .spf-cap-label::after {
  content: ' ✓';
  color: var(--accent);
}

/* ── Step nodes ──────────────────────────────────────────────────── */
.spf-node--step {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--spf-c, var(--accent));
  background: var(--bg-card);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.spf-node--step:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3),
              inset 0 0 0 1px var(--spf-c, var(--accent));
}

.spf-node--step.spf-done {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, rgba(110, 231, 183, 0.06) 0%, var(--bg-card) 60%);
}

.spf-step-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
}

.spf-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--spf-c, var(--accent));
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background var(--transition);
}

.spf-node--step:hover .spf-step-icon {
  background: rgba(255, 255, 255, 0.09);
}

.spf-step-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spf-step-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.spf-step-focus {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--spf-c, var(--accent));
  opacity: 0.95;
}

.spf-step-focus i {
  font-size: 0.62rem;
}

.spf-done-badge {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(110, 231, 183, 0.2);
  color: var(--accent);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.spf-node--step.spf-done .spf-done-badge {
  display: flex;
  animation: spfBadgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes spfBadgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.spf-expand-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), transform var(--transition);
}

.spf-expand-btn:hover {
  color: var(--spf-c, var(--accent));
  border-color: var(--spf-c, var(--accent));
  background: rgba(255, 255, 255, 0.05);
}

.spf-node--step.spf-expanded .spf-expand-btn {
  transform: rotate(180deg);
  color: var(--spf-c, var(--accent));
  border-color: var(--spf-c, var(--accent));
}

/* Step body (expandable) */
.spf-step-body {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: spfBodyOpen 0.3s ease;
}

.spf-task-heading {
  margin: 0.85rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

@keyframes spfBodyOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.spf-task-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.spf-task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.spf-task-bullet {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.55rem;
  border-radius: 50%;
  background: var(--spf-c, var(--accent));
}

.spf-task-item i {
  display: none;
}

.spf-complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--spf-c, var(--accent));
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition), transform 0.15s ease;
}

.spf-complete-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--spf-c, var(--accent));
  transform: translateY(-1px);
}

.spf-node--step.spf-done .spf-complete-btn {
  color: var(--text-muted);
}

/* ── Checkpoint nodes ────────────────────────────────────────────── */
.spf-node--checkpoint {
  width: 100%;
}

.spf-checkpoint-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  background: rgba(251, 191, 36, 0.06);
  border: 1px dashed rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
}

.spf-checkpoint-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.spf-task-item span:last-child {
  overflow-wrap: anywhere;
  min-width: 0;
}

.spf-checkpoint-q {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}

.spf-checkpoint-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.spf-branch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.spf-branch-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.78rem;
}

.spf-branch-action {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.spf-branch--yes {
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.25);
}

.spf-branch--yes .spf-branch-head {
  color: var(--accent);
}

.spf-branch--no {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.spf-branch--no .spf-branch-head {
  color: #f87171;
}

/* ── Daily loop strip ─────────────────────────────────────────────── */
.spf-daily-wrap {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.spf-daily-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.spf-daily-desc {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.spf-daily-loop {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
}

.spf-loop-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--spf-c, var(--accent));
  border-radius: 10px;
  width: 100%;
  animation: spfLoopIn 0.5s ease backwards;
}

@keyframes spfLoopIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.spf-loop-step.spf-visible {
  opacity: 1;
  transform: none;
}

.spf-loop-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--spf-c, var(--accent));
  color: #0f172a;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spf-loop-icon {
  color: var(--spf-c, var(--accent));
  font-size: 0.85rem;
  flex-shrink: 0;
}

.spf-loop-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.spf-loop-step strong {
  font-size: 0.86rem;
  color: var(--text);
}

.spf-loop-step span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.spf-loop-sep {
  display: flex;
  justify-content: center;
  padding: 0.15rem 0;
  color: var(--text-muted);
  font-size: 0.65rem;
  opacity: 0.6;
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .spf-enter,
  .spf-connector-line,
  .spf-connector-arrow,
  .spf-progress-fill,
  .spf-loop-step {
    animation: none !important;
    transition: none !important;
  }
  .spf-enter { opacity: 1; transform: none; }
  .spf-connector-line { transform: scaleY(1); opacity: 1; }
  .spf-connector-arrow { opacity: 1; transform: none; }
  .spf-progress-fill { transition: width 0.15s !important; }
}

/* ── Responsive (mobile-friendly) ─────────────────────────────────── */
@media (max-width: 768px) {
  .interview-tts-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
  }

  .interview-tts-toolbar-title {
    width: 100%;
  }

  .interview-tts-hint {
    min-width: 0;
    flex: none;
    width: 100%;
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .interview-tts-controls {
    width: 100%;
    margin-left: 0;
  }

  .interview-tts-rate-wrap {
    min-width: 0;
    flex: 1 1 calc(50% - 0.35rem);
  }

  .interview-tts-voice,
  .interview-tts-rate {
    max-width: none;
    width: 100%;
  }

  .iqa-answer-head {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }

  .iqa-answer-head h4 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.74rem;
  }

  .iqa-answer-head-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .iqa-answer-content {
    padding: 0.85rem 0.85rem 1rem;
  }

  .iqa-wwh-card-head {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
  }

  .iqa-wwh-body {
    padding: 0.75rem 0.85rem 0.9rem;
  }

  .iqa-code-block,
  .iqa-inline-code {
    max-width: 100%;
  }

  .iqa-code-block pre {
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .iqa-flow {
    gap: 0.35rem;
  }

  .iqa-visual {
    padding: 0.85rem 0.9rem 1rem;
    margin-bottom: 1rem;
  }

  .iqa-visual-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .iqa-visual-replay {
    margin-left: 0;
  }

  .vis-oop {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .vis-binary {
    flex-wrap: wrap;
    justify-content: center;
  }

  .vis-kw-step {
    min-width: 0;
    width: 100%;
    max-width: 200px;
  }

  .spf-section {
    margin: 1.5rem 0 2rem;
    padding: 1.15rem 0.85rem 1.5rem;
  }

  .spf-howto {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.85rem;
  }

  .spf-title {
    font-size: 1.12rem;
  }

  .spf-subtitle {
    font-size: 0.88rem;
    padding: 0 0.15rem;
  }

  .spf-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .spf-tab-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .spf-plan-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .spf-progress-row {
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
  }

  .spf-progress-track {
    flex: 1 1 100%;
  }

  .spf-progress-label {
    white-space: normal;
    flex: 1 1 auto;
    line-height: 1.35;
  }

  .spf-step-header {
    flex-wrap: wrap;
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .spf-step-titles {
    flex: 1 1 calc(100% - 4.5rem);
    min-width: 0;
  }

  .spf-step-label {
    font-size: 0.88rem;
  }

  .spf-step-body {
    padding: 0 0.85rem 0.9rem;
  }

  .spf-node--cap {
    max-width: calc(100% - 1rem);
    padding: 0.6rem 1.1rem;
  }

  .spf-cap-label {
    font-size: 0.84rem;
    line-height: 1.35;
    text-align: center;
  }

  .spf-checkpoint-wrap {
    padding: 0.9rem;
  }

  .spf-checkpoint-branches {
    grid-template-columns: 1fr;
  }

  .spf-daily-wrap {
    padding: 1rem 0.85rem;
  }

  .interview-player-inner {
    padding: 0.65rem 0.85rem 0.75rem;
  }

  .spf-expand-btn {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  .spf-complete-btn {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 1rem;
  }

  .spf-reset-btn {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .spf-section {
    padding: 1rem 0.65rem 1.25rem;
  }

  .spf-step-icon {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .spf-task-item {
    font-size: 0.84rem;
  }

  .spf-loop-step {
    padding: 0.65rem 0.75rem;
  }

  .iqa-tts-rate-wrap {
    flex: 1 1 100%;
  }

  .interview-tts-warn {
    font-size: 0.74rem;
    line-height: 1.45;
  }
}

