
/* ═══════════════════════════════════════════════════════════════
   PRACTICE — shared engine styles
   6-round gamified practice (Word Order / Fill Blank / Vocab Match /
   Choose the Better / Translation / Build Your Own), XP + combo
   system, contextual hints, PoS colour coding.
   ⑩ --pr-primary delegates to site's --lejp-primary automatically
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ⑩ Site accent — falls back to Duolingo green if lejp vars absent */
    --pr-primary:    var(--lejp-primary,    #58cc02);
    --pr-primary-dk: var(--lejp-primary-dk, #46a302);
    --pr-primary-lt: var(--lejp-primary-lt, #e8fcd8);

    --pr-indigo:     #4f46e5;
    --pr-indigo-dk:  #3730a3;
    --pr-indigo-lt:  #eef2ff;
    --pr-amber:      #f59e0b;
    --pr-amber-lt:   #fef3c7;
    --pr-red:        #ef4444;
    --pr-red-lt:     #fef2f2;
    --pr-surface:    #ffffff;
    --pr-bg:         #f7f9fc;
    --pr-border:     rgba(0,0,0,.08);
    --pr-border-hi:  rgba(0,0,0,.15);
    --pr-ink:        #1e293b;
    --pr-ink-2:      #475569;
    --pr-ink-3:      #94a3b8;

    /* Part-of-speech colours */
    --pr-subject:  #2563eb;
    --pr-verb:     #dc2626;
    --pr-object:   #059669;
    --pr-modifier: #d97706;
    --pr-punct:    #64748b;

    --pr-radius:    16px;
    --pr-radius-sm: 10px;
    --pr-font:      'Sora', system-ui, sans-serif;
    --pr-mono:      'JetBrains Mono', monospace;
}

/* ── Grid background ──────────────────────────────────────────── */
.pr-grid-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(59,130,246,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59,130,246,.04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.pr-activity-wrap { font-family: var(--pr-font); }

/* ── XP badge ─────────────────────────────────────────────────── */
.pr-xp-badge {
    display: flex; flex-direction: column; align-items: center;
    background: var(--pr-amber-lt); border: 2px solid var(--pr-amber);
    border-radius: var(--pr-radius); padding: 10px 18px; flex-shrink: 0;
}
.pr-xp-num {
    font-family: var(--pr-mono); font-size: 1.4rem; font-weight: 700;
    color: var(--pr-amber); line-height: 1;
    transition: transform .15s cubic-bezier(.34,1.56,.64,1);
}
.pr-xp-num.pop { transform: scale(1.4); }
.pr-xp-label { font-size: .65rem; font-weight: 700; letter-spacing: .1em; color: var(--pr-ink-2); margin-top: 2px; }

/* ── Header row ───────────────────────────────────────────────── */
.pr-header-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; position: relative; z-index: 2;
}
.pr-header-eyebrow {
    font-size: .7rem; font-weight: 700; letter-spacing: .18em;
    text-transform: uppercase; color: var(--pr-indigo); margin-bottom: 4px;
}
.pr-header-title {
    font-family: var(--pr-font); font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 800; color: var(--pr-ink); line-height: 1.1;
}

/* ── Round progress strip ─────────────────────────────────────── */
.pr-round-strip {
    display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: nowrap;
}
.pr-round-pill {
    flex: 1; height: 6px; border-radius: 3px;
    background: #e2e8f0; transition: background .3s;
}
.pr-round-pill.done    { background: var(--pr-primary); }
.pr-round-pill.current { background: var(--pr-indigo); }

/* ── Progress row ─────────────────────────────────────────────── */
.pr-progress-row {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px; position: relative; z-index: 2;
}
.pr-step-label {
    font-size: .75rem; font-weight: 700; color: var(--pr-ink-2);
    white-space: nowrap; min-width: 48px;
}
.pr-bar-track {
    flex: 1; height: 10px; background: #e2e8f0;
    border-radius: 100px; overflow: visible; position: relative;
}
.pr-bar-fill {
    height: 100%; background: var(--pr-primary);
    border-radius: 100px; width: 0%;
    transition: width .5s cubic-bezier(.34,1.56,.64,1); position: relative;
}
.pr-bar-fill::after {
    content: ''; position: absolute; right: -5px; top: 50%;
    transform: translateY(-50%); width: 18px; height: 18px;
    border-radius: 50%; background: var(--pr-primary);
    box-shadow: 0 0 10px var(--pr-primary), 0 0 20px rgba(88,204,2,.4);
    opacity: 0; transition: opacity .3s ease;
}
.pr-bar-fill.active::after { opacity: 1; }

/* ── Streak dots ──────────────────────────────────────────────── */
.pr-streak-dots { display: flex; gap: 5px; align-items: center; }
.pr-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #e2e8f0; border: 1.5px solid var(--pr-border-hi);
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.pr-dot.lit {
    background: var(--pr-primary); border-color: var(--pr-primary);
    box-shadow: 0 0 8px rgba(88,204,2,.5); transform: scale(1.2);
}

/* ── XP toast ─────────────────────────────────────────────────── */
.pr-xp-toast {
    position: fixed; top: 80px; right: 24px; z-index: 9999;
    font-family: var(--pr-mono); font-size: 1.1rem; font-weight: 700;
    color: var(--pr-amber); pointer-events: none;
    animation: prToastUp 1.2s ease forwards;
}
@keyframes prToastUp {
    0%   { opacity:1; transform:translateY(0) scale(1); }
    60%  { opacity:1; transform:translateY(-40px) scale(1.2); }
    100% { opacity:0; transform:translateY(-80px) scale(.9); }
}

/* ── Combo banner ─────────────────────────────────────────────── */
.pr-combo {
    display: none; align-items: center; justify-content: center; gap: 6px;
    padding: .45rem 1.1rem; border-radius: 100px;
    background: linear-gradient(135deg, var(--pr-amber), var(--pr-red));
    color: #fff; font-family: var(--pr-font);
    font-size: .82rem; font-weight: 800; margin-bottom: .75rem;
    animation: prComboIn .35s cubic-bezier(.34,1.56,.64,1);
}
.pr-combo.active { display: flex; }
@keyframes prComboIn { from{transform:scale(.7);opacity:0} to{transform:scale(1);opacity:1} }

/* ── Exercise slide-in ────────────────────────────────────────── */
.pr-exercise {
    display: none; position: relative; z-index: 2;
    animation: prSlideUp .3s cubic-bezier(.22,.61,.36,1) forwards;
}
.pr-exercise.active { display: block; }
@keyframes prSlideUp {
    from { opacity:0; transform:translateY(20px); }
    to   { opacity:1; transform:none; }
}

/* ── Round tag ────────────────────────────────────────────────── */
.pr-round-tag {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--pr-font); font-size: .75rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--pr-indigo); background: var(--pr-indigo-lt);
    border: 2px solid var(--pr-indigo); border-radius: 100px;
    padding: 6px 14px; margin-bottom: 14px;
}
.pr-round-progress { font-size: .68rem; font-weight: 800; opacity: .65; }

/* ── JP sentence card ─────────────────────────────────────────── */
.pr-jp-card {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 2px solid var(--pr-indigo);
    border-radius: var(--pr-radius); padding: 16px 20px; margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(79,70,229,.06);
}
.pr-jp-icon {
    width: 36px; height: 36px; border-radius: 9px;
    background: var(--pr-indigo-lt); border: 1px solid rgba(79,70,229,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.pr-jp-text {
    font-family: var(--pr-font); font-size: clamp(1rem,3.5vw,1.2rem);
    font-weight: 700; color: var(--pr-ink); line-height: 1.4;
}

/* ── Function label pill (Round 5) ───────────────────────────── */
.pr-func-label {
    display: inline-block; font-size: .72rem; font-weight: 800;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--pr-indigo); background: var(--pr-indigo-lt);
    border-radius: 20px; padding: 3px 10px; margin-bottom: .6rem;
    border: 1px solid rgba(79,70,229,.2);
}

/* ── Working card ─────────────────────────────────────────────── */
.pr-card {
    background: var(--pr-surface); border: 2px solid var(--pr-border-hi);
    border-radius: var(--pr-radius); padding: clamp(16px,4vw,24px);
    position: relative; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.04);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.pr-card::before {
    content: ''; position: absolute; top:0; left:0; right:0; height: 4px;
    background: linear-gradient(90deg, var(--pr-indigo), var(--pr-primary));
}
.pr-card.correct-state { border-color: var(--pr-primary); box-shadow: 0 8px 24px rgba(88,204,2,.12); }
.pr-card.wrong-state   { border-color: var(--pr-red);     box-shadow: 0 8px 24px rgba(239,68,68,.12); }
.pr-card-label {
    font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--pr-ink-2); margin-bottom: 14px;
}

/* ── Word Order: dropzone & pool ──────────────────────────────── */
.pr-dropzone {
    min-height: 60px; background: #f8fafc;
    border: 2px dashed #cbd5e1; border-radius: var(--pr-radius-sm);
    padding: 10px; display: flex; flex-wrap: wrap; gap: 8px;
    align-items: center; margin-bottom: 18px;
    transition: border-color .2s, background .2s;
}
.pr-dropzone.has-items {
    border-style: solid; border-color: rgba(79,70,229,.3); background: #f0f7ff;
}
.pr-dropzone-hint { font-size: .84rem; color: var(--pr-ink-2); pointer-events: none; }
.pr-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }

/* Chunk token */
.pr-chunk {
    display: inline-flex; align-items: center;
    padding: 9px clamp(12px,2.5vw,16px);
    background: #fff; border: 2px solid #cbd5e1;
    border-radius: var(--pr-radius-sm);
    font-family: var(--pr-font);
    font-size: clamp(.85rem,2.5vw,.97rem); font-weight: 700; color: var(--pr-ink);
    cursor: pointer; user-select: none; min-height: 42px;
    box-shadow: 0 3px 6px rgba(0,0,0,.04);
    transition: transform .15s cubic-bezier(.34,1.56,.64,1),
                background .12s, border-color .12s, box-shadow .12s, opacity .18s;
}
.pr-chunk:hover:not(.placed) {
    transform: translateY(-3px); border-color: var(--pr-indigo);
    background: var(--pr-indigo-lt);
    box-shadow: 0 6px 14px rgba(79,70,229,.15);
}
.pr-chunk:active:not(.placed) { transform: translateY(1px) scale(.97); }
.pr-chunk.placed { opacity: .22; pointer-events: none; background: #e2e8f0; border-color: #cbd5e1; box-shadow: none; }

/* PoS colouring in dropzone */
.pr-dropzone .pr-chunk[data-type="subject"]     { border-color: var(--pr-subject);  background: #eff6ff; color: var(--pr-subject);  }
.pr-dropzone .pr-chunk[data-type="verb"]        { border-color: var(--pr-verb);     background: #fef2f2; color: var(--pr-verb);     }
.pr-dropzone .pr-chunk[data-type="object"]      { border-color: var(--pr-object);   background: #ecfdf5; color: var(--pr-object);   }
.pr-dropzone .pr-chunk[data-type="modifier"]    { border-color: var(--pr-modifier); background: #fffbeb; color: var(--pr-modifier); }
.pr-dropzone .pr-chunk[data-type="punctuation"] { color: var(--pr-ink-2); background: #f8fafc; }
.pr-chunk--auto { opacity: .28; cursor: not-allowed; pointer-events: none; font-family: var(--pr-mono); }

/* ── Fill Blank ───────────────────────────────────────────────── */
.pr-input-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-family: var(--pr-font); font-size: clamp(1rem,3vw,1.15rem);
    font-weight: 700; color: var(--pr-ink); line-height: 1.7; margin-bottom: 12px;
}
.pr-text-input {
    background: #fff; border: 2px solid #cbd5e1;
    border-bottom: 4px solid #b0bec5;
    border-radius: var(--pr-radius-sm); padding: 10px 14px;
    font-family: var(--pr-font); font-size: clamp(.92rem,2.5vw,1rem);
    font-weight: 700; color: var(--pr-ink); outline: none;
    min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
.pr-text-input:focus {
    border-color: var(--pr-indigo); border-bottom-color: var(--pr-indigo-dk);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.pr-text-input.shake { animation: prShake .35s ease; }
.pr-text-input.is-correct {
    border-color: var(--pr-primary); border-bottom-color: var(--pr-primary-dk);
    background: var(--pr-primary-lt); box-shadow: 0 0 0 3px rgba(88,204,2,.12);
}
@keyframes prShake {
    0%,100% { transform:translateX(0); }
    25%      { transform:translateX(-6px); }
    75%      { transform:translateX(6px); }
}

.pr-hint-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 2px solid var(--pr-amber);
    border-radius: 100px; color: #92400e;
    font-family: var(--pr-font); font-size: .8rem; font-weight: 700;
    padding: 5px 13px; cursor: pointer;
    box-shadow: 0 2px 4px rgba(245,158,11,.1);
    transition: all .15s ease;
}
.pr-hint-btn:hover { background: var(--pr-amber-lt); transform: translateY(-1px); }
.pr-hint-display {
    font-family: var(--pr-mono); font-size: 1rem; font-weight: 700;
    color: var(--pr-indigo); letter-spacing: .12em; min-height: 1.4em;
    margin-top: 8px;
}
.pr-hint-cost { font-size: .72rem; color: var(--pr-ink-3); margin-left: 4px; }

/* ── Translation ──────────────────────────────────────────────── */
.pr-textarea {
    width: 100%; min-height: 100px; resize: vertical;
    background: #fff; border: 2px solid #cbd5e1;
    border-bottom: 4px solid #b0bec5;
    border-radius: var(--pr-radius-sm); padding: 12px 14px;
    font-family: var(--pr-font); font-size: clamp(.92rem,2.5vw,1rem);
    font-weight: 700; color: var(--pr-ink); outline: none; line-height: 1.65;
    transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.pr-textarea:focus {
    border-color: var(--pr-indigo); border-bottom-color: var(--pr-indigo-dk);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* ── Vocab Match: section + row layout ────────────────────────── */
.pr-vocab-section { margin-bottom: 1.5rem; }
.pr-vocab-section-title {
    font-size: .75rem; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; color: var(--pr-indigo);
    background: var(--pr-indigo-lt); border-radius: 6px;
    padding: 5px 10px; display: inline-block; margin-bottom: .75rem;
}
.pr-vocab-pairs { display: flex; flex-direction: column; gap: 8px; }
.pr-vocab-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch;
}
.pr-vocab-btn {
    padding: 10px 12px; border-radius: 10px;
    border: 2px solid #cbd5e1; background: #fff;
    font-family: var(--pr-font); font-size: .85rem; font-weight: 700;
    color: var(--pr-ink); cursor: pointer; text-align: left;
    transition: all .15s; line-height: 1.3;
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
}
.pr-vocab-btn:hover:not(:disabled):not(.matched) {
    border-color: var(--pr-indigo); background: var(--pr-indigo-lt); color: var(--pr-indigo);
    transform: translateY(-1px);
}
.pr-vocab-btn.selected { border-color: var(--pr-indigo); background: var(--pr-indigo); color: #fff; }
.pr-vocab-btn.matched  { border-color: var(--pr-primary); background: var(--pr-primary-lt); color: #059669; cursor: default; opacity: .85; }
.pr-vocab-btn.wrong-flash { border-color: var(--pr-red); background: var(--pr-red-lt); color: var(--pr-red); }

/* ── Choose Better ────────────────────────────────────────────── */
.pr-choice-question { font-size: 1rem; font-weight: 800; color: var(--pr-ink); margin-bottom: .35rem; }
.pr-choice-jp       { font-size: .82rem; color: var(--pr-ink-2); font-weight: 600; margin-bottom: 1rem; }
.pr-choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; }
.pr-choice-btn {
    width: 100%; padding: 14px 18px; border-radius: 12px;
    border: 2px solid #cbd5e1; background: #fff;
    font-family: var(--pr-font); font-size: .95rem; font-weight: 700;
    color: var(--pr-ink); cursor: pointer; text-align: left;
    transition: all .15s; line-height: 1.4;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.pr-choice-btn .pr-choice-label {
    width: 28px; height: 28px; border-radius: 50%;
    background: #e2e8f0; display: flex; align-items: center;
    justify-content: center; font-size: .8rem; font-weight: 900;
    flex-shrink: 0; transition: all .15s;
}
.pr-choice-btn:hover:not(:disabled) { border-color: var(--pr-indigo); background: var(--pr-indigo-lt); }
.pr-choice-btn:hover:not(:disabled) .pr-choice-label { background: var(--pr-indigo); color: #fff; }
.pr-choice-btn.is-correct { border-color: var(--pr-primary); background: var(--pr-primary-lt); }
.pr-choice-btn.is-correct .pr-choice-label { background: var(--pr-primary); color: #fff; }
.pr-choice-btn.is-wrong   { border-color: var(--pr-red); background: var(--pr-red-lt); }
.pr-choice-btn.is-wrong   .pr-choice-label { background: var(--pr-red); color: #fff; }
.pr-choice-btn:disabled { cursor: default; }
.pr-why-box {
    display: none; padding: 10px 14px; border-radius: 8px;
    background: var(--pr-primary-lt); border: 1.5px solid #84e02b;
    font-size: .85rem; font-weight: 700; color: #047857; line-height: 1.5;
    margin-top: .5rem;
}
.pr-why-box.visible { display: block; }
.pr-why-box.wrong-why { background: var(--pr-red-lt); border-color: #f87171; color: #b91c1c; }
.pr-why-jp { font-size: .78rem; color: var(--pr-ink-2); margin-top: 4px; font-weight: 600; }

/* ── Build Your Own ───────────────────────────────────────────── */
.pr-build-template {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 2px solid #c4b5fd; border-radius: var(--pr-radius);
    padding: 20px; margin-bottom: 1.25rem;
}
.pr-build-template p {
    font-size: 1.05rem; font-weight: 700; color: var(--pr-ink); line-height: 2.4; margin: 0;
}
.pr-build-input {
    border: none; border-bottom: 2.5px solid #7c3aed;
    background: transparent; font-family: var(--pr-font);
    font-size: 1rem; font-weight: 900; color: #7c3aed;
    outline: none; text-align: center; padding: 2px 6px; min-width: 100px;
    transition: border-color .15s;
}
.pr-build-input:focus { border-color: #5b21b6; }
.pr-build-label {
    font-size: .65rem; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: #7c3aed; opacity: .65;
    display: block; text-align: center; margin-top: 1px;
}
.pr-build-field { display: inline-flex; flex-direction: column; vertical-align: baseline; }
.pr-result-card {
    display: none; padding: 20px; background: #fff;
    border: 2px solid var(--pr-primary); border-radius: var(--pr-radius);
    box-shadow: 0 8px 24px rgba(88,204,2,.1); margin-top: 1rem;
}
.pr-result-card.visible { display: block; }
.pr-result-card__title { font-size: .8rem; font-weight: 800; color: var(--pr-primary); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .75rem; }
.pr-result-card__text  { font-size: 1.1rem; font-weight: 700; color: var(--pr-ink); line-height: 1.7; }
.pr-result-card__jp    { font-size: .88rem; color: var(--pr-ink-2); margin-top: .5rem; line-height: 1.6; font-weight: 600; }

/* ── Feedback ─────────────────────────────────────────────────── */
.pr-feedback {
    display: none; border-radius: var(--pr-radius-sm); padding: 14px 18px;
    margin-top: 14px; font-family: var(--pr-font); font-size: .9rem;
    font-weight: 700; line-height: 1.55; border: 2px solid transparent;
    border-bottom-width: 3px;
}
.pr-feedback.correct { display:flex; gap:10px; align-items:flex-start; background:var(--pr-primary-lt); border-color:#84e02b; color:#047857; }
.pr-feedback.wrong   { display:flex; gap:10px; align-items:flex-start; background:var(--pr-red-lt);     border-color:#f87171; color:#b91c1c; }
.pr-feedback.warning { display:flex; gap:10px; align-items:flex-start; background:var(--pr-amber-lt);   border-color:#fcd34d; color:#92400e; }
.pr-feedback-icon { font-size:1.2rem; flex-shrink:0; line-height:1; }
.pr-feedback-body strong { display:block; font-size:.95rem; margin-bottom:2px; }
.pr-listen-btn {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 9px;
    background: #fff; border: 1.5px solid rgba(0,0,0,.12); border-radius: 100px;
    padding: 4px 12px; font-family: var(--pr-font); font-size: .76rem;
    font-weight: 800; color: var(--pr-ink-2); cursor: pointer; transition: all .12s ease;
}
.pr-listen-btn:hover, .pr-listen-btn.active { border-color: var(--pr-indigo); color: var(--pr-indigo); }

/* ── Actions ──────────────────────────────────────────────────── */
.pr-actions { display: flex; gap: 10px; margin-top: 16px; }
.pr-btn-check {
    flex: 1; min-height: 50px; border: none;
    border-bottom: 4px solid var(--pr-primary-dk);
    border-radius: var(--pr-radius); background: var(--pr-primary); color: #fff;
    font-family: var(--pr-font); font-size: .95rem; font-weight: 800;
    cursor: pointer; transition: all .12s ease;
    box-shadow: 0 4px 14px rgba(88,204,2,.3);
}
.pr-btn-check:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(88,204,2,.45); }
.pr-btn-check:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 1px; }
.pr-btn-check:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.pr-btn-reset {
    padding: 0 20px; min-height: 50px; border-radius: var(--pr-radius);
    border: 2px solid #cbd5e1; border-bottom: 4px solid #b0bec5;
    background: #fff; font-family: var(--pr-font);
    font-size: .9rem; font-weight: 800; color: var(--pr-ink-2);
    cursor: pointer; transition: all .12s ease; flex-shrink: 0;
}
.pr-btn-reset:hover { border-color: var(--pr-ink-2); color: var(--pr-ink); }
.pr-btn-reset:active { transform: translateY(2px); border-bottom-width: 2px; }

/* ── Related links ────────────────────────────────────────────── */
.pr-related { display: flex; flex-direction: column; gap: 8px; margin-top: 1.5rem; }
.pr-related-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-radius: var(--pr-radius-sm); text-decoration: none;
    border: 1.5px solid #e2e8f0; background: #fff; color: var(--pr-ink);
    transition: all .15s ease;
}
.pr-related-link:hover { border-color: var(--pr-indigo); background: var(--pr-indigo-lt); transform: translateX(3px); }
.pr-related-link__text { font-size: .9rem; font-weight: 800; display: block; margin-bottom: 2px; }
.pr-related-link__sub  { font-size: .76rem; color: var(--pr-ink-2); font-weight: 600; display: block; }

/* ── Completion screen ────────────────────────────────────────── */
.pr-complete {
    display: none; flex-direction: column; align-items: center; text-align: center;
    padding: clamp(32px,8vw,56px) clamp(20px,5vw,40px);
    background: #fff; border: 2px solid var(--pr-primary);
    border-radius: var(--pr-radius); position: relative; overflow: hidden;
    box-shadow: 0 12px 32px rgba(88,204,2,.12);
    animation: prSlideUp .4s cubic-bezier(.22,.61,.36,1) forwards;
}
.pr-complete.active { display: flex; }
.pr-complete::before {
    content: ''; position: absolute; top:-60px; left:50%; transform:translateX(-50%);
    width: 280px; height: 280px; border-radius: 50%;
    background: radial-gradient(circle, rgba(88,204,2,.15) 0%, transparent 70%);
    pointer-events: none;
}
.pr-complete-trophy {
    font-size: 4rem; margin-bottom: 16px;
    animation: prTrophyBounce .6s .2s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes prTrophyBounce {
    from { opacity:0; transform:scale(.4) rotate(-10deg); }
    to   { opacity:1; transform:scale(1) rotate(0); }
}
.pr-complete-title { font-family: var(--pr-font); font-size: clamp(1.4rem,5vw,2rem); font-weight: 800; color: var(--pr-ink); margin: 0 0 6px; position: relative; }
.pr-complete-sub   { font-size: .95rem; color: var(--pr-ink-2); margin: 0 0 18px; line-height: 1.6; position: relative; }
.pr-complete-xp {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--pr-amber-lt); border: 2px solid var(--pr-amber);
    border-radius: 100px; padding: 8px 22px; margin-bottom: 20px;
    font-family: var(--pr-mono); font-size: 1.3rem; font-weight: 700; color: #d97706;
    position: relative;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .pr-actions { flex-direction: column; }
    .pr-btn-reset { min-height: 46px; }
    .pr-streak-dots { display: none; }
    .pr-vocab-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Pre-activity lesson banner ───────────────────────────────── */
.pr-lesson-banner {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; padding: 16px 18px;
    background: var(--pr-indigo-lt); border: 2px solid var(--pr-indigo);
    border-radius: var(--pr-radius); margin-bottom: 20px;
    position: relative; z-index: 2;
    animation: prSlideUp .35s cubic-bezier(.22,.61,.36,1) forwards;
}
.pr-lesson-banner__icon {
    font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 2px;
}
.pr-lesson-banner__body { flex: 1; }
.pr-lesson-banner__title {
    font-family: var(--pr-font); font-size: .82rem; font-weight: 800;
    color: var(--pr-indigo); letter-spacing: .06em; text-transform: uppercase;
    margin-bottom: 3px;
}
.pr-lesson-banner__text {
    font-family: var(--pr-font); font-size: .9rem; font-weight: 700;
    color: var(--pr-ink); line-height: 1.4; margin-bottom: 8px;
}
.pr-lesson-banner__link {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--pr-indigo); color: #fff;
    font-family: var(--pr-font); font-size: .78rem; font-weight: 800;
    padding: 6px 14px; border-radius: 100px; text-decoration: none;
    transition: background .15s, transform .15s;
}
.pr-lesson-banner__link:hover { background: var(--pr-indigo-dk); transform: translateY(-1px); }
.pr-lesson-banner__actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-direction: column;
}
.pr-lesson-banner__dismiss {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--pr-ink-3); font-size: 1.1rem; line-height: 1;
    border-radius: 50%; transition: color .15s, background .15s;
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
}
.pr-lesson-banner__dismiss:hover { color: var(--pr-ink); background: rgba(0,0,0,.06); }
.pr-lesson-banner__restore {
    display: none; align-items: center; gap: 6px;
    background: none; border: 1.5px dashed rgba(79,70,229,.4);
    border-radius: 8px; padding: 5px 10px; cursor: pointer;
    font-family: var(--pr-font); font-size: .72rem; font-weight: 700;
    color: var(--pr-indigo); margin-bottom: 12px; position: relative; z-index: 2;
    transition: border-color .15s, background .15s;
}
.pr-lesson-banner__restore:hover { border-color: var(--pr-indigo); background: var(--pr-indigo-lt); }
.pr-lesson-banner__restore.visible { display: flex; }

/* ── Already-completed banner (shown on reload/revisit) ───────── */
.pr-completed-banner {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--pr-primary-lt); border: 2px solid var(--pr-primary);
    border-radius: var(--pr-radius); padding: 16px 18px; margin-bottom: 18px;
}
.pr-completed-banner__icon { font-size: 1.6rem; line-height: 1; }
.pr-completed-banner__body { flex: 1; min-width: 200px; }
.pr-completed-banner__title {
    font-family: var(--pr-font); font-weight: 700;
    color: var(--pr-primary-dk); margin-bottom: 2px;
}
.pr-completed-banner__sub {
    font-size: .85rem; color: var(--pr-ink-2); margin: 0;
}
.pr-completed-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Dashboard navigation tabs (tabbed Study Guide variant only) ── */
.pr-view-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.pr-switch-btn {
    flex: 1;
    padding: 14px;
    font-size: .95rem;
    font-weight: 700;
    border-radius: var(--pr-radius);
    cursor: pointer;
    font-family: var(--pr-font);
    border: 2px solid var(--pr-border);
    background: var(--pr-surface);
    color: var(--pr-ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.pr-switch-btn.active {
    background: var(--pr-indigo);
    color: #fff;
    border-color: var(--pr-indigo-dk);
    box-shadow: 0 4px 12px rgba(79,70,229,0.2);
}

/* ── View panels (tabbed Study Guide variant only) ─────────── */
.pr-panel { display: none; }
.pr-panel.active { display: block; animation: prPanelFade 0.3s ease forwards; }
@keyframes prPanelFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Study guide panel content (tabbed Study Guide variant only) ── */
.pr-guide-card {
    background: var(--pr-surface);
    border: 2px solid var(--pr-border);
    border-radius: var(--pr-radius);
    padding: 24px;
    margin-bottom: 24px;
}
.pr-guide-card h2 { font-size: 1.4rem; color: var(--pr-indigo); margin-top: 0; border-bottom: 2px solid var(--pr-indigo-lt); padding-bottom: 8px; }
.pr-guide-card h3 { font-size: 1.1rem; color: var(--pr-ink); margin: 18px 0 10px; }
.pr-guide-card h4 { font-size: 1rem; color: var(--pr-ink-2); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.02em; }

/* Vocabulary grid block */
.pr-vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pr-vocab-item { background: var(--pr-bg); border: 1px solid var(--pr-border); padding: 12px 14px; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.pr-vocab-en { font-family: var(--pr-mono); font-weight: 700; color: var(--pr-indigo); font-size: .95rem; }
.pr-vocab-jp { font-size: .82rem; color: var(--pr-ink-2); font-weight: 600; }

/* Functional phrase items */
.pr-phrase-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pr-phrase-item { background: var(--pr-bg); border-left: 4px solid var(--pr-indigo); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.pr-phrase-en { font-weight: 700; color: var(--pr-ink); font-size: .95rem; margin-bottom: 4px; }
.pr-phrase-jp { font-size: .85rem; color: var(--pr-ink-2); }

/* Comparative styling cards (naturalness blocks) */
.pr-compare-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .pr-compare-grid { grid-template-columns: 1fr 1fr; } }
.pr-compare-card { padding: 14px 16px; border-radius: var(--pr-radius); border: 2px solid var(--pr-border); position: relative; }
.pr-compare-card--bad { background: var(--pr-red-lt); border-color: var(--pr-red); color: #991b1b; }
.pr-compare-card--good { background: var(--pr-primary-lt); border-color: var(--pr-primary); color: #166534; }
.pr-compare-badge { font-family: var(--pr-mono); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 6px; display: block; }

/* Common error containers */
.pr-mistake-block { background: var(--pr-bg); border: 2px solid var(--pr-border); border-left: 4px solid var(--pr-red); border-radius: var(--pr-radius); padding: 16px; margin-bottom: 16px; }
.pr-mistake-title { font-weight: 700; color: var(--pr-ink); margin-bottom: 8px; font-size: 1.05rem; }

/* Dialogue flow container */
.pr-dialogue-wrap { background: var(--pr-bg); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.pr-line { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px dashed var(--pr-border); }
.pr-line:last-child { border-bottom: none; padding-bottom: 0; }
.pr-speaker { font-family: var(--pr-mono); font-weight: 700; color: var(--pr-indigo); font-size: 0.85rem; text-transform: uppercase; }
.pr-text-en { font-weight: 600; color: var(--pr-ink); font-size: .95rem; }
.pr-text-jp { font-size: .82rem; color: var(--pr-ink-2); }

/* Practice template rendering box */
.pr-template-box { background: linear-gradient(135deg, var(--pr-indigo-lt), #f3e8ff); border: 2px dashed var(--pr-indigo); border-radius: var(--pr-radius); padding: 18px; font-size: .95rem; line-height: 1.6; color: var(--pr-ink); font-weight: 600; margin-bottom: 16px; }

/* Header intro paragraph (tabbed Study Guide variant only) */
.pr-header-intro { font-size: .95rem; color: var(--pr-ink-2); margin: 6px 0 0; line-height: 1.5; }
