/* ============================================
   Single Quest — Step Runner (Split Pane)
   ============================================ */

.abq-runner {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #f4f7fb 0%, #eef6ff 100%);
    padding: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.abq-runner-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Sidebar ── */
.abq-runner-sidebar-card {
    background: #fff;
    border-radius: var(--abq-corner-radius, 16px);
    padding: 28px 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    position: sticky;
    top: 24px;
}

.abq-progress-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    position: relative;
    transform: none; /* override style.css .abq-progress-ring rotate(-90deg) */
}

.abq-progress-ring__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.abq-progress-ring__track,
.abq-progress-ring__fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.abq-progress-ring__track { stroke: #e2e8f0; }
.abq-progress-ring__fill { stroke: var(--abq-primary, #22c55e); transition: stroke-dashoffset 0.6s ease; }

.abq-progress-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    font-weight: 900;
}

.abq-progress-ring__number { font-size: 2rem; }
.abq-progress-ring__percent { font-size: 1rem; margin-top: 6px; }

.abq-runner-sidebar__title {
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    color: #1e293b;
    margin: 0 0 24px;
    line-height: 1.4;
}

.abq-runner-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abq-runner-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.abq-runner-step.is-current {
    background: #f0fdf4;
    color: var(--step-color, var(--abq-primary, #22c55e));
    box-shadow: 0 0 0 2px var(--step-color, var(--abq-primary, #22c55e)) inset;
    font-weight: 800;
}

.abq-runner-step.is-done {
    background: #f0fdf4;
    color: #22c55e;
}

.abq-runner-step.is-locked { opacity: 0.55; }

.abq-runner-step__num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    font-weight: 800;
    transition: all 0.2s ease;
}

.abq-runner-step.is-current .abq-runner-step__num {
    background: var(--step-color, var(--abq-primary, #22c55e));
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.abq-runner-step.is-done .abq-runner-step__num {
    background: #22c55e;
    color: #fff;
}

.abq-runner-step__name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abq-runner-step__icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Main Area ── */
.abq-runner-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.abq-runner-main__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.abq-runner-main__label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.abq-runner-main__step-count {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 700;
}

.abq-runner-main__title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.abq-runner-main__title-icon {
    font-size: 1.2rem;
}

.abq-runner-exit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.abq-runner-exit:hover { color: #64748b; }
.abq-runner-exit span { font-size: 1.3rem; line-height: 1; }

/* ── Card ── */
.abq-runner-card {
    background: #fff;
    border-radius: var(--abq-corner-radius, 16px);
    padding: 48px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
    flex: 1;
    animation: abqRunnerFadeIn 0.35s ease;
}

.abq-runner-card--center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.abq-runner-card__hero {
    font-size: 4rem;
    margin-bottom: 16px;
}

.abq-runner-step-intro {
    text-align: center;
}

/* ── Warm-up Intro ── */
.abq-warmup-intro {
    text-align: center;
    padding: 8px 0 16px;
}

.abq-warmup-intro__icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    margin: 0 auto 32px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.06);
    border: 4px solid rgba(255,255,255,0.6);
}

.abq-warmup-intro__heading {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    margin: 0 0 16px;
    line-height: 1.3;
}

.abq-warmup-intro__desc {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Tags ── */
.abq-runner-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.abq-runner-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #f0fdf4;
    background: color-mix(in srgb, var(--tag-color, #22c55e) 12%, #fff);
    color: var(--tag-color, #22c55e);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-color: color-mix(in srgb, var(--tag-color, #22c55e) 24%, transparent);
    transition: transform 0.2s ease;
}

.abq-runner-tag:hover {
    transform: translateY(-2px);
}

.abq-runner-tag__icon { font-size: 1rem; }

/* ── Navigation ── */
.abq-runner-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.abq-runner-nav__spacer { flex: 1; }

.abq-runner-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.abq-runner-btn--primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

.abq-runner-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(34, 197, 94, 0.4);
    color: #fff;
}

.abq-runner-btn--text {
    background: transparent;
    color: #94a3b8;
    padding-left: 8px;
    padding-right: 8px;
}

.abq-runner-btn--text:hover { color: #64748b; }

.abq-runner-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.abq-runner-btn--listen {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

.abq-runner-btn--listen:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, 0.4);
    color: #fff;
}

/* ── Phonics Step ── */
.abq-phonics-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.abq-phonics-step__hint {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.abq-phonics-step__word {
    font-size: 3.2rem;
    font-weight: 900;
    color: #8b5cf6;
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 1;
}

.abq-phonics-step__tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 28px 36px;
    background: #f3f0ff;
    border-radius: 20px;
    max-width: 640px;
}

.abq-phonics-step__tile {
    width: 50px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
    transition: transform 0.15s ease;
}

.abq-phonics-step__tile:hover {
    transform: translateY(-3px);
}

/* ── Overlay ── */

.abq-runner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: abqRunnerFadeIn 0.3s ease;
}

.abq-runner-overlay-card {
    background: #fff;
    border-radius: var(--abq-corner-radius, 20px);
    padding: 48px 40px;
    text-align: center;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: abqRunnerScaleIn 0.4s ease;
}

.abq-runner-overlay-card__icon { font-size: 4rem; margin-bottom: 12px; }

.abq-runner-overlay-card h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    margin: 0 0 8px;
}

.abq-runner-overlay-card p {
    color: #64748b;
    margin: 0 0 20px;
    font-size: 1.05rem;
}

.abq-runner-xp {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--abq-primary, #22c55e);
    margin-bottom: 24px;
}

/* ── Keyframes ── */
@keyframes abqRunnerFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ── Content Blocks ── */
.abq-block {
    margin-bottom: 24px;
}

.abq-block:last-child {
    margin-bottom: 0;
}

/* Heading Block */
.abq-block-heading {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.abq-block-heading__icon {
    font-size: 1.6rem;
}

/* Text Block */
.abq-block-text {
    font-size: 1rem;
    color: #334155;
    line-height: 1.8;
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

/* Image Block */
.abq-block-image {
    text-align: center;
    margin: 0;
}

.abq-block-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.abq-block-image figcaption {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #64748b;
}

/* Audio Block */
.abq-block-audio__title {
    text-align: center;
    font-weight: 700;
    color: #475569;
    margin: 0 0 8px;
}

.abq-block-audio {
    width: 100%;
    max-width: 480px;
    display: block;
    margin: 0 auto;
}

/* Vocab Card Block */
.abq-vocab-card {
    text-align: center;
    padding: 24px;
    background: #f8fafc;
    border-radius: 16px;
    max-width: 380px;
    margin: 0 auto;
}

.abq-vocab-card__img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
}

.abq-vocab-card__word {
    font-size: 1.4rem;
    font-weight: 900;
    color: #3b82f6;
}

.abq-vocab-card__phonetic {
    font-size: 0.95rem;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 6px;
}

.abq-vocab-card__meaning {
    font-size: 1rem;
    color: #475569;
    margin-bottom: 6px;
}

.abq-vocab-card__example {
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 10px;
}

.abq-vocab-card__audio {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.abq-vocab-card__audio:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Vocab List Block (multiple vocab cards emitted by the AI generator) */
.abq-vocab-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}
.abq-vocab-list .abq-vocab-card {
    max-width: none;
    margin: 0;
}

/* Reading sync-audio player */
.abq-reading-audio {
    margin-top: 16px;
    text-align: center;
}
.abq-reading-audio .abq-block-audio {
    width: 100%;
    max-width: 480px;
}

/* Quiz Block */
.abq-block-quiz {
    max-width: 620px;
    margin: 0 auto;
    text-align: left;
}

.abq-quiz-q {
    font-weight: 700;
    color: #1e293b;
}

.abq-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.abq-quiz-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.abq-quiz-opt:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.abq-quiz-opt input[type="radio"] {
    accent-color: #22c55e;
}

.abq-quiz-feedback {
    margin-top: 8px;
    font-weight: 700;
    min-height: 22px;
}

/* Speaking Block */
.abq-speaking-block {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.abq-speaking-prompt {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.abq-speaking-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.abq-label {
    font-weight: 700;
    color: #64748b;
    font-size: 0.9rem;
}

.abq-kw-chip {
    display: inline-block;
    padding: 4px 12px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.abq-model-answer {
    margin-top: 16px;
    text-align: left;
    font-size: 0.95rem;
}

/* Reading Block */
.abq-reading-block {
    max-width: 680px;
    margin: 0 auto;
}

.abq-reading-transcript,
.abq-reading-translation {
    margin-bottom: 20px;
}

.abq-reading-transcript h4,
.abq-reading-translation h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
}

.abq-reading-transcript p,
.abq-reading-translation p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #334155;
}

.abq-reading-translation p {
    color: #64748b;
    font-style: italic;
}

/* Dialog Block */
.abq-dialogue-block {
    max-width: 560px;
    margin: 0 auto;
}

.abq-dialogue-line {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    align-items: baseline;
}

.abq-dialogue-speaker {
    font-weight: 800;
    color: #8b5cf6;
    white-space: nowrap;
    min-width: 60px;
}

.abq-dialogue-text {
    color: #334155;
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .abq-runner { padding: 16px; background: #f4f7fb; }
    .abq-runner-grid { grid-template-columns: 1fr; gap: 16px; }
    .abq-runner-sidebar-card { position: static; padding: 20px 16px; }
    .abq-runner-sidebar__title { margin-bottom: 16px; }
    .abq-runner-steps { flex-direction: row; overflow-x: auto; padding-bottom: 8px; gap: 6px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
    .abq-runner-steps::-webkit-scrollbar { display: none; }
    .abq-runner-step { min-width: 130px; padding: 10px 12px; touch-action: manipulation; }
    .abq-runner-step__name { font-size: 0.875rem; }
    .abq-runner-step__icon { display: none; }
    .abq-runner-main__header { align-items: center; }
    .abq-runner-main__title { font-size: 1.25rem; }
    .abq-runner-main__step-count { font-size: 0.8rem; }
    .abq-runner-card { padding: 28px 20px; }
    .abq-runner-btn { padding: 12px 22px; font-size: 0.95rem; touch-action: manipulation; }
    .abq-runner-nav { padding: 0; }
    .abq-warmup-intro__icon { width: 96px; height: 96px; font-size: 2.8rem; }
    .abq-warmup-intro__heading { font-size: 1.3rem; }
    .abq-warmup-intro__desc { font-size: 0.95rem; }
    .abq-runner-tags { gap: 8px; }
    .abq-runner-tag { padding: 6px 12px; font-size: 0.8rem; }
    .abq-phonics-step__word { font-size: 2.2rem; }
    .abq-phonics-step__tiles { padding: 20px 16px; gap: 8px; }
    .abq-phonics-step__tile { width: 40px; height: 46px; font-size: 1.25rem; }
    .abq-block-heading { font-size: 1.2rem; }
}


