/* Lesson player — learner-facing exercise runner.
   Uses the site's CSS variables (var(--font-base), var(--color-text), etc.)
   with safe fallbacks so it also works standalone. */

:root {
    --lp-yellow: #F5C518;
    --lp-black:  #111111;
    --lp-cyan:   #18B6F5;
    --lp-grey:   #6b6b6b;
    --lp-green:  #1e8a4c;
    --lp-green-bg: #eafaf0;
    --lp-red:    #c0392b;
    --lp-red-bg: #fdecea;
}

.lp-wrap {
    padding-top: 20px;
}

/* .content's flex-column layout centers its children instead of stretching
   them (align-items:center in style.css), so without an explicit width
   #lesson-player shrinks to whatever its narrowest deterministic child is —
   e.g. the quest finish screen's skill-progress box — squashing the whole
   card down to ~260px on a full-width desktop viewport instead of letting
   its own max-width rules (.lp-progress-box, .lp-quest-finish-actions, etc.)
   govern the rendered width. The in-exercise view isn't affected: its content
   (.lp-quest-area) already centers itself via max-width + margin:auto. */
#lesson-player { width: 100%; }

/* Two-column layout: .lp-main is the only child (full width, unchanged from
   before) unless .lp-layout--with-sidebar adds a sidebar next to it. */
.lp-layout {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}
.lp-main { flex: 1 1 auto; min-width: 0; width: 100%; }
.lp-layout--with-sidebar .lp-main { flex: 1 1 640px; }
.lp-sidebar {
    flex: 0 0 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: calc(var(--header-height, 0px) + 20px);
}
.lp-sidebar-card {
    border: 2px solid var(--lp-black);
    box-shadow: 4px 4px 0 var(--lp-yellow);
    background: #fff;
    padding: 16px 18px;
    text-align: left;
}
.lp-sidebar-card:nth-child(2) { box-shadow: 4px 4px 0 var(--lp-cyan); }
.lp-sidebar-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--lp-black);
    margin: 0 0 4px 0;
}
.lp-sidebar-caption {
    font-family: 'Roboto', monospace;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--lp-grey);
    margin: 0 0 12px 0;
}
.lp-sidebar-chart-wrap {
    position: relative;
    height: 180px;
    width: 100%;
}
.lp-sidebar-empty {
    font-family: 'Roboto', sans-serif;
    font-style: italic;
    font-size: 13px;
    color: var(--lp-grey);
    margin: 8px 0 0 0;
}
.lp-sidebar-list { list-style: none; margin: 0; padding: 0; }
.lp-sidebar-list-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.lp-sidebar-list-item:last-child { border-bottom: none; }
.lp-sidebar-list-word {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--lp-black);
}
.lp-sidebar-list-meta {
    font-family: 'Roboto', monospace;
    font-size: 10px;
    letter-spacing: .03em;
    color: var(--lp-red);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .lp-layout { flex-direction: column; }
    /* .lp-layout--with-sidebar .lp-main's flex-basis:640px sets a preferred
       WIDTH in the desktop two-column (row) layout — once flex-direction
       flips to column here, the same value is read as a preferred HEIGHT
       instead, leaving a large empty gap below short content (e.g. the
       Accent Tuner's "Start lesson" screen) before the sidebar cards. */
    .lp-layout--with-sidebar .lp-main { flex: 1 1 auto; }
    /* Stack the two stat cards instead of squeezing them side by side —
       at narrow widths flex:1 1 260px still tries to fit both in one row
       before wrapping, leaving each card too cramped to read. */
    .lp-sidebar { flex: 1 1 auto; max-width: 100%; width: 100%; position: static; flex-direction: column; }
    .lp-sidebar-card { flex: 1 1 auto; }
    /* .lp-layout itself has no side padding (.lp-quest-area, nested in .lp-main, carries its
       own 24px) — .lp-sidebar is a sibling of .lp-main, not nested in it, so without its own
       gutter here the pronunciation cards run edge-to-edge. Scoped to .lp-sidebar alone (not
       the whole .lp-layout) so .lp-main's existing .lp-quest-area margin isn't doubled up.
       Matches the quest hub's page margin. */
    .lp-sidebar { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
}

/* Accent Tuner (.lp-layout--with-sidebar): buttons and the pronunciation
   panel default to filling the whole (up to 640px+) column, which reads as
   oversized next to the small side-by-side rhythm/pitch graphs. Cap them to
   a size proportionate to the rest of the panel instead. .lp-record-actions
   already overrides .lp-btn's width for the Repeat/Continue pair, so this
   only actually affects the Start/Resume lesson button. */
.lp-layout--with-sidebar .lp-btn { width: auto; min-width: 240px; }
.lp-layout--with-sidebar .lp-pron-panel { max-width: 480px; margin-left: auto; margin-right: auto; }

.lp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.lp-back {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-grey);
    text-decoration: none;
}
.lp-back:hover { color: var(--lp-black); text-decoration: underline; }

.lp-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.lp-breadcrumb-badge {
    background-color: var(--lp-black);
    color: #fff;
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 8px;
    text-decoration: none;
}
.lp-breadcrumb-badge:hover { opacity: .8; }
.lp-breadcrumb-arrow {
    color: var(--lp-grey);
    font-size: 12px;
}
.lp-breadcrumb-link {
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--lp-grey);
    text-decoration: none;
}
.lp-breadcrumb-link:hover { color: var(--lp-black); text-decoration: underline; }
.lp-breadcrumb-label {
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--lp-grey);
}

.lp-progress {
    flex-basis: 100%;
    order: 3;
    height: 3px;
    background: #eee;
    border: none;
    border-top: 2px solid var(--lp-black);
    border-bottom: 1px solid var(--lp-black);
    border-radius: 0;
    overflow: hidden;
    margin: 4px 0 4px 0;
}
.lp-progress-fill {
    height: 100%;
    background: var(--lp-cyan);
    width: 0%;
    transition: width 0.3s ease;
}
.lp-progress-text {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--lp-grey);
    order: 2;
    margin-left: auto;
}

.lp-shortcuts-container {
    position: fixed;
    bottom: calc(var(--footer-height-mobile, 48px) + 16px);
    right: 16px;
    z-index: 2;
    text-align: right;
}

.lp-shortcuts-bottom-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

#lp-audio-row-mount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lp-shortcuts-bottom-row .lp-quest-audio-row {
    margin-top: 0;
}

.lp-shortcuts-tip {
    display: none;
    text-align: left;
    white-space: nowrap;
    width: fit-content;
    background: #fff;
    margin-bottom: 10px;
    margin-left: auto;
    border: 3px solid var(--lp-black);
    box-shadow: 6px 6px 0 var(--lp-black);
}

.lp-shortcuts-container.lp-shortcuts-container-open .lp-shortcuts-tip {
    display: block;
}

.lp-shortcuts-tip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--lp-cyan);
    border-bottom: 3px solid var(--lp-black);
    padding: 12px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-black);
}
.lp-shortcuts-tip-header-icon { font-size: 16px; }

.lp-shortcuts-tip-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lp-shortcuts-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lp-shortcuts-row-label {
    font-family: 'Roboto', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-grey);
}
.lp-shortcuts-row-key {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--lp-black);
}
.lp-shortcuts-row-icon {
    font-size: 16px;
    font-weight: 400;
}

.lp-shortcuts-open {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-black);
    background: var(--lp-cyan);
    border: 3px solid var(--lp-black);
    box-shadow: 4px 4px 0 var(--lp-black);
    padding: 10px 16px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease;
}
.lp-shortcuts-open:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--lp-black);
}

.lp-card {
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 16px 4px;
    box-shadow: none;
    text-align: center;
}

.lp-ex-name { margin: 0 0 4px 0; font-size: 20px; font-weight: 800; text-align: left; }
.lp-ex-instructions { margin: 0 0 14px 0; color: var(--lp-grey); text-align: left; }
.lp-tip {
    display: inline-block;
    margin: 8px 0 16px 0;
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--lp-black);
    background: none;
    border: 1px solid var(--lp-black);
    border-radius: 0;
    padding: 6px 10px;
}
.lp-tip::before { content: "\1F4A1 "; }

.lp-body { margin-top: 8px; }
.lp-prompt {
    font-family: 'Roboto', sans-serif;
    font-size: 44px;
    font-weight: 900;
    line-height: 1.1;
    margin: 14px 0 10px 0;
    color: var(--lp-black);
}
.lp-sub {
    color: var(--lp-grey);
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 0 0 12px 0;
}

/* Grammar-form tag (e.g. "Accusative (koho? co?)") */
.lp-form-tag {
    display: inline-block;
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: var(--lp-black);
    color: var(--lp-cyan);
    padding: 6px 12px;
    margin-bottom: 10px;
}

/* Buttons */
.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font: inherit;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .02em;
    cursor: pointer;
    text-decoration: none;
    background: var(--lp-black);
    color: #fff;
    border: 2px solid var(--lp-black);
    padding: 14px 18px;
    margin-top: 2dvh;
    width: 100%;
    text-transform: uppercase;
}

.lp-btn:hover {
    filter: none;
    background: var(--lp-cyan);
    border-color: transparent;
    color: var(--lp-black);
}

.lp-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.lp-btn-secondary { background: #fff; color: var(--lp-black); border: 2px solid var(--lp-black); }
.lp-btn-ghost { background: transparent; color: var(--lp-black); border: 2px solid var(--lp-black); }

/* Replay-audio button, shown next to Submit Answer whenever the current
   question has spoken audio. */
.lp-repeat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    font: inherit;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .02em;
    cursor: pointer;
    background: #fff;
    color: var(--lp-black);
    border: 2px solid var(--lp-black);
    padding: 14px 18px;
    margin-top: 10px;
    width: 100%;
    text-transform: uppercase;
}
.lp-repeat-btn:hover { background: var(--lp-cyan); border-color: transparent; }
.lp-repeat-icon { flex-shrink: 0; width: 18px; height: 18px; }

/* Two equal-width buttons side by side, e.g. "Keep practicing" / "Back to
   quests" on the quest finish screen. */
.lp-quest-finish-actions {
    display: flex;
    gap: 16px;
    box-sizing: border-box;
    max-width: 750px;
    margin: 20px auto 0;
}
.lp-quest-finish-actions .lp-btn {
    width: auto;
    flex: 1 1 0;
    margin-top: 0;
    text-align: center;
}

/* Paginated quest finish screen: one page (.lp-finish-step) visible at a time — see
   RENDERERS["quest-mixed"]'s finish() — with a persistent footer ("Practice again" / "Next",
   or the finishing action on the last page). Pinned to the viewport between the site's fixed
   header and fixed footer bar (position:fixed, not normal flow) so the footer's buttons are
   always on screen with no page scroll at all, regardless of scroll position when the finish
   screen appears; a page's own content scrolls internally (.lp-finish-step) only in the rare
   case it doesn't fit the space between them. */
.lp-finish-paged {
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    right: 0;
    z-index: 10;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.lp-finish-paged .lp-finish-step {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 32px 24px 0;
    box-sizing: border-box;
}
.lp-finish-footer {
    flex: 0 0 auto;
    max-width: 750px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 16px 24px;
    border-top: 1px solid #e2e2e2;
}
.lp-finish-step-label {
    font-family: 'Roboto', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lp-grey);
    text-align: center;
    margin-bottom: 12px;
}
.lp-finish-footer .lp-quest-finish-actions { margin: 0 auto; }
@media (max-width: 600px) {
    .lp-finish-paged { top: var(--header-height-mobile); bottom: var(--footer-height-mobile); }
}

/* ============================================================
   Mic button (left) — turns speaking exercises on/off.
   Standalone: shares no class or rule with .lp-sound-btn below.
   White bg / black border+icon normally, blue bg on hover, in both
   the enabled and disabled state.
   ============================================================ */
.lp-mic-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #fff;
    border: 2px solid var(--lp-black);
    background-image: url('/images/icons8-microphone-24-black.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}
.lp-mic-btn:hover {
    background-color: var(--lp-cyan);
}
.lp-mic-btn.lp-mic-btn-disabled {
    background-image: url('/images/icons8-block-microphone-24-black.png');
}

/* ============================================================
   Sound button (right) — mutes/unmutes auto-played audio.
   Standalone: shares no class or rule with .lp-mic-btn above.
   White bg / black border+icon normally, blue bg on hover, in both
   the on and muted state.
   ============================================================ */
.lp-sound-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #fff;
    border: 2px solid var(--lp-black);
    background-image: url('/images/icons8-sound-24-black.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}
.lp-sound-btn:hover {
    background-color: var(--lp-cyan);
}
.lp-sound-btn.lp-sound-btn-muted {
    background-image: url('/images/icons8-mute-24-black.png');
}

/* ============================================================
   Record control — big circular "tap to record" button used by
   read-aloud speaking exercises. Red mic circle, switches to a
   pulsing "recording" state (square/stop icon) on tap; caption
   below flips between "Tap to record" and "Recording… / Tap to stop".
   ============================================================ */
.lp-record-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 28px 0 8px 0;
}
.lp-record-btn {
    width: 84px;
    height: 84px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    background-color: var(--lp-red);
    border: 3px solid var(--lp-black);
    box-shadow: 4px 4px 0 var(--lp-black);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3z'/%3E%3Cpath d='M19 11a1 1 0 0 0-2 0 5 5 0 0 1-10 0 1 1 0 0 0-2 0 7 7 0 0 0 6 6.92V20H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2h-2v-2.08A7 7 0 0 0 19 11z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
    transition: transform .1s ease;
}
.lp-record-btn:hover { transform: scale(1.04); }
.lp-record-btn.lp-record-btn-active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Crect x='7' y='7' width='10' height='10' rx='1.5'/%3E%3C/svg%3E");
    animation: lp-record-pulse 1.4s ease-in-out infinite;
}
@keyframes lp-record-pulse {
    0%, 100% { box-shadow: 4px 4px 0 var(--lp-black), 0 0 0 0 rgba(192, 57, 43, .5); }
    50% { box-shadow: 4px 4px 0 var(--lp-black), 0 0 0 10px rgba(192, 57, 43, 0); }
}
/* The record circle morphs into these once the transcription result is in,
   instead of a separate checkmark indicator appearing below it (see
   buildRecordControl's showResult / renderSpeechResult in lesson-player.js).
   Colors match .lp-record-status-correct/-wrong below. */
.lp-record-btn.lp-record-btn-correct {
    background-color: #1e8a4c;
    cursor: default;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}
/* Wrong stays clickable (see buildRecordControl) — the redo icon inside the
   red circle IS the "repeat" action, so there's no separate Repeat button
   for this case (renderSpeechResult). */
.lp-record-btn.lp-record-btn-wrong {
    background-color: var(--lp-red);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 3v5h-5'/%3E%3C/svg%3E");
}
.lp-record-caption {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-grey);
    margin: 0;
    text-align: center;
}
.lp-record-caption-live {
    color: var(--lp-red);
}
.lp-record-transcript {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-style: italic;
    color: var(--lp-black);
    margin: 4px 0 12px 0;
}
.lp-record-transcript-wrong { color: var(--lp-red); }
.lp-record-actions {
    display: flex;
    gap: 12px;
    margin-top: 2dvh;
}
.lp-record-actions .lp-btn { width: auto; flex: 1 1 0; margin-top: 0; }

/* Multiple choice */
.lp-options { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; text-align: left; }
.lp-option {
    font: inherit;
    font-family: 'Roboto', sans-serif;
    text-align: left;
    cursor: pointer;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    padding: 14px 16px;
}
.lp-option:hover:not(:disabled) { background: var(--lp-cyan); border-color: transparent; color: var(--lp-black); }
.lp-option:disabled { cursor: default; }
.lp-option-correct { border-color: #1e8a4c; background: #eafaf0; }
.lp-option-wrong   { border-color: #c0392b; background: #fdecea; }

/* Typed answers */
.lp-input {
    font: inherit;
    font-family: 'Roboto', monospace;
    font-size: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 18px 16px;
    border: 2px solid var(--lp-cyan);
    border-radius: 3px;
    margin: 6px 0;
    box-shadow: 0 0 0 1px var(--lp-cyan);
}
.lp-input::placeholder { color: #b3b3b3; }
.lp-input.lp-correct { border-color: #1e8a4c; background: #eafaf0; box-shadow: none; }
.lp-input.lp-wrong   { border-color: #c0392b; background: #fdecea; box-shadow: none; }
.lp-feedback { margin: 8px 0; font-family: 'Roboto', sans-serif; font-weight: 700; font-size: 15px; min-height: 20px; }
.lp-feedback-correct { color: #1e8a4c; }
.lp-feedback-wrong   { color: #c0392b; }

/* Hint reveal + report error row */
.lp-toolrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 18px 0;
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lp-hint-toggle {
    background: none;
    border: none;
    color: var(--lp-grey);
    cursor: pointer;
    padding: 0;
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.lp-hint-toggle:hover { color: var(--lp-black); text-decoration: underline; }

/* Icon-only round "report a problem" button — label is visually-hidden,
   exposed via the button's title attribute + a screen-reader-only span. */
.lp-report-link {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--as-yellow);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lp-report-link:hover {
    background: var(--as-black);
}
.lp-report-icon {
    width: 16px;
    height: 16px;
    background-color: #000;
    mask-image: url('/images/icons8-error-24.png');
    -webkit-mask-image: url('/images/icons8-error-24.png');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}
.lp-report-link:hover .lp-report-icon {
    background-color: var(--as-white);
}
.lp-hint-revealed {
    text-align: left;
    color: var(--lp-black) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: 'Roboto', sans-serif !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}
.lp-report-popup {
    margin: 10px 0;
    padding: 12px;
    border: 1px dashed #c9c9c9;
    text-align: left;
}
.lp-report-popup-fixed {
    position: fixed;
    right: 16px;
    bottom: calc(var(--footer-height-mobile, 48px) + 16px + 54px);
    width: 280px;
    max-width: calc(100dvw - 32px);
    background: #fff;
    border: 2px solid var(--lp-black);
    box-shadow: 6px 6px 0 var(--lp-black);
    margin: 0;
    z-index: 3;
}
.lp-report-popup textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-family: 'Roboto', sans-serif;
    border: 2px solid #ccc;
    border-radius: 3px;
    padding: 8px;
    min-height: 60px;
    margin-bottom: 8px;
}

.lp-textarea {
    font: inherit;
    font-family: 'Roboto', sans-serif;
    width: 100%;
    box-sizing: border-box;
    min-height: 140px;
    padding: 12px 14px;
    border: 2px solid #ccc;
    border-radius: 3px;
}

/* Media */
.lp-media { width: 100%; margin: 10px 0; }
.lp-image { max-width: 100%; border-radius: 3px; margin: 10px 0; }
.lp-html-body { line-height: 1.5; text-align: left; }
.lp-html-body p { margin: 0 0 10px 0; }

/* Flashcards (flip study) */
.lp-flashcard {
    perspective: 1000px;
    margin: 14px auto;
}

.lp-flashcard-inner {
    position: relative;
    min-height: 160px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.5s;
    transform-style: preserve-3d;
}

.lp-flashcard.flipped .lp-flashcard-inner {
    transform: rotateY(180deg);
}

.lp-flashcard-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    border: 3px solid var(--lp-black);
    border-radius: 0;
    box-shadow: 8px 8px 0 var(--lp-black);
    font-family: 'Roboto', sans-serif;
    font-size: 26px;
    font-weight: 800;
    background: #fff;
    padding: 16px;
}

.lp-flashcard-back {
    transform: rotateY(180deg);
    background: #f5fdfe;
}

/* Dialog / transcript */
.lp-dialog-line {
    margin: 4px 0;
    text-align: left;
}
.lp-dialog-speaker {
    font-weight: 700;
    margin-right: 6px;
}
.lp-dialog-en {
    color: var(--lp-grey);
    font-style: italic;
    margin-left: 8px;
}

/* Match pairs */
.lp-match { display: flex; gap: 24px; margin: 12px 0; }
.lp-match-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lp-match-item {
    font: inherit; font-family: 'Roboto', sans-serif; text-align: left; cursor: pointer;
    background: #fff; border: 2px solid #ddd; border-radius: 3px; padding: 12px 14px;
}
.lp-match-item.selected { border-color: var(--lp-cyan); background: #f0fbfd; }
.lp-match-item.matched { border-color: #1e8a4c; background: #eafaf0; opacity: 0.6; cursor: default; }
.lp-match-item.wrong { border-color: #c0392b; background: #fdecea; }

/* Categorize */
.lp-cat-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.lp-chip {
    font: inherit; font-family: 'Roboto', sans-serif; cursor: pointer;
    background: #fff; border: 2px solid var(--lp-black); border-radius: 20px; padding: 8px 14px;
}
.lp-chip.selected { border-color: var(--lp-cyan); background: #f0fbfd; }
.lp-chip.placed-correct { border-color: #1e8a4c; background: #eafaf0; }
.lp-chip.placed-wrong { border-color: #c0392b; background: #fdecea; }
.lp-cat-bins { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.lp-cat-bin {
    flex: 1 1 160px; min-height: 90px;
    border: 2px dashed #bbb; border-radius: 3px; padding: 10px;
}
.lp-cat-bin.active { border-color: var(--lp-cyan); }
.lp-cat-bin h4 { margin: 0 0 8px 0; font-size: 15px; font-family: 'Roboto', sans-serif; }
.lp-cat-bin-items { display: flex; flex-wrap: wrap; gap: 6px; }

/* Summary */
.lp-summary {
    width: 100%;
}

/* Matches the site's other brutalist headlines (.qp-headline, .pq-headline,
   .qp-challenge-title in pages/quests.css) — Roboto 800/900, fixed -0.5px
   tracking, not the em-based tracking or var(--font-display)/Montserrat used
   on the separate login/register hero titles, which is a different context. */
.lp-summary h1 {
    font-family: 'Roboto', sans-serif;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.05;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    color: var(--lp-black);
}

.lp-summary-score {
    font-family: 'Roboto', sans-serif;
    font-size: 88px; font-weight: 900; letter-spacing: -0.5px; margin: 10px 0; line-height: 1;
    color: var(--lp-black);
}
/* Desktop's larger celebratory type wraps the emoji onto its own line at
   phone widths — scale both back down to fit "Nice progress!" on one
   line. Placed after the base rules (not the earlier shared 600px block)
   since equal-specificity .lp-summary h1 rules resolve by source order,
   and the unconditional declaration above would otherwise win regardless
   of viewport. */
@media (max-width: 600px) {
    .lp-summary h1 { font-size: 28px; }
    .lp-summary-score { font-size: 56px; }
}
/* CEFR level + next-topic line on the quest finish screen. Deliberately a
   calmer, lighter card than .lp-progress-box's bold black-border+shadow
   treatment below it — flat gray fill, no border or shadow. */
.lp-mastery-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
    max-width: 750px;
    margin: 16px auto;
    padding: 16px 20px;
    background: #f8f8f8;
    text-align: left;
}
.lp-mastery-cefr {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 64px;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: var(--lp-black);
    background: var(--as-cyan);
    line-height: 1;
    flex: 0 0 auto;
}
.lp-mastery-text {
    margin: 0;
    font-family: 'Roboto', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.7;
    color: var(--lp-black);
}
.lp-mastery-text .lp-highlight {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}
.lp-mastery-count {
    display: block;
    box-sizing: border-box;
    max-width: 750px;
    margin: 0 auto 16px;
    padding: 10px 20px;
    text-align: left;
    font-family: 'Roboto', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.7;
    color: var(--lp-black);
    background: #f8f8f8;
}
.lp-mastery-count::before {
    content: "\2713";
    display: inline-block;
    margin-right: 8px;
    color: var(--as-cyan);
    font-weight: 900;
}
/* "Skill gains" + "Large quests progress" boxes on the quest finish screen */
.lp-progress-boxes {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    margin: 24px 0;
    text-align: left;
}
.lp-progress-box {
    flex: 1 1 320px;
    max-width: 680px;
    background: #fff;
    border: 3px solid var(--lp-black);
    box-shadow: 6px 6px 0 var(--lp-black);
    padding: 32px;
}
/* Matches .lp-sub's established caption pattern (Roboto Mono, grey,
   letter-spacing .06em) below, just italic + slightly larger for a
   section title instead of a small inline caption. */
.lp-progress-box-title {
    font-family: 'Roboto', monospace;
    font-size: 13px;
    font-weight: 600;
    font-style: italic;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--lp-grey);
    padding-bottom: 16px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--lp-black);
}

.lp-skill-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}
.lp-skill-row:last-child { margin-bottom: 0; }
.lp-skill-row-unpracticed { opacity: .45; }
.lp-skill-row-unpracticed .lp-skill-bar { background: #eee; }
.lp-skill-row-label {
    flex: 0 0 80px;
    font-family: 'Roboto', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--lp-black);
}
.lp-skill-bar {
    flex: 1 1 auto;
    height: 18px;
    background: #e2e2e2;
    border: 2px solid var(--lp-black);
    overflow: hidden;
}
.lp-skill-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    --pct: 100%;
    background: linear-gradient(
        to right,
        var(--lp-cyan) 0%, var(--lp-cyan) var(--pct),
        var(--lp-yellow) var(--pct), var(--lp-yellow) 100%
    );
    transition: width .9s ease;
}
.lp-skill-bar-fill-full { background: var(--lp-cyan); }
.lp-skill-row-value {
    /* One fixed width for every row ("13/15 + 87% accuracy" and "not practiced" alike), so all the bars are the same length */
    flex: 0 0 104px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.lp-skill-row-count {
    font-family: 'Roboto Mono', monospace;
    font-size: 22px;
    font-weight: 800;
    color: var(--lp-black);
    line-height: 1;
    white-space: nowrap;
}
.lp-skill-row-sub {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--lp-grey);
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1;
    white-space: nowrap;
}

.lp-quest-progress-card {
    background: #f7f7f7;
    border: 2px solid var(--lp-black);
    padding: 16px;
    margin-bottom: 16px;
}
.lp-quest-progress-card:last-child { margin-bottom: 0; }
.lp-quest-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.lp-quest-progress-title {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--lp-black);
    text-transform: uppercase;
}
.lp-quest-progress-delta {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: var(--lp-green);
    flex-shrink: 0;
}
.lp-quest-progress-bar {
    height: 10px;
    background: #e2e2e2;
    border: 2px solid var(--lp-black);
    overflow: hidden;
    margin-bottom: 10px;
}
.lp-quest-progress-bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--lp-yellow);
    transition: width .9s ease, background-color .3s ease;
}
.lp-quest-progress-bar-fill-done { background: var(--lp-cyan); }
.lp-quest-progress-sub {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--lp-grey);
}

/* Badges shown on a quest/test finish screen */
.lp-badge-grid { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 12px 0; }
.lp-badge { text-align: center; width: 96px; }
.lp-badge img { display: block; margin: 0 auto; }

/* Non-blocking "New grammar form" toast — sits beside the question instead
   of covering it, and auto-dismisses so it never demands interaction. */
.lp-intro-toast {
    position: fixed; z-index: 1200;
    right: 16px; bottom: 16px;
    background: #fff; border: 2px solid var(--lp-black); padding: 16px 18px;
    max-width: 300px; width: calc(100% - 32px);
    box-shadow: 6px 6px 0 var(--lp-yellow);
    animation: lp-intro-in .25s ease-out;
}
@keyframes lp-intro-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.lp-intro-toast h3 { margin: 0 0 10px; font-size: 15px; font-family: 'Roboto', sans-serif; }
.lp-intro-item { margin-bottom: 10px; }
.lp-intro-item:last-of-type { margin-bottom: 0; }
.lp-intro-label { font-weight: 700; color: var(--lp-black); font-family: 'Roboto', monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.lp-intro-link { display: inline-block; margin-top: 4px; font-family: 'Roboto', sans-serif; font-size: 13px; font-weight: 700; color: var(--lp-cyan); text-decoration: none; }
.lp-intro-link:hover { text-decoration: underline; }
.lp-intro-close {
    margin-top: 10px; background: none; border: none; padding: 0;
    font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
    text-decoration: underline; cursor: pointer; color: var(--lp-black);
}

@media (max-width: 600px) {
    .lp-intro-toast { left: 16px; right: 16px; max-width: none; bottom: 12px; }
    .lp-card { padding-top: 0; }
    /* The fixed mic/sound/report row floated over the practice area on
       narrow screens. Put it back in normal document flow, right under the
       submit button, and drop the keyboard-shortcuts button/tip — the
       Ctrl/Cmd shortcuts it documents don't apply on a touch device. */
    .lp-shortcuts-container {
        position: static;
        left: auto; right: auto;
        margin: 16px 0 0 0;
        text-align: center;
    }
    .lp-shortcuts-bottom-row { flex-wrap: wrap; row-gap: 8px; justify-content: center; }
    .lp-shortcuts-open { display: none; }
    /* A little breathing room between the topbar/progress bars above and
       the "CHOOSE THE RIGHT MEANING"-style instruction row. */
    .lp-quest-kicker { margin-top: 20px; }
    /* Side gutters so the inputs, answer buttons and their 4px drop shadows
       do not run edge-to-edge (and clip) against the screen. */
    .lp-quest-area { padding-left: 24px; padding-right: 24px; }
    /* Tighten the gap between the answer box and Submit: the status row is
       usually empty, so it only takes margin once it has text ("Correct!"),
       which then sits a little below the input. Only the Submit button that
       follows the status row is tightened; the "Got it" button under a
       flashcard keeps its normal margin. */
    .lp-quest-area .lp-quest-status-row { margin: 10px 0 0; }
    .lp-quest-area .lp-quest-status-row:has(.lp-quest-status:empty) { margin: 0; }
    .lp-quest-area .lp-quest-status-row + .lp-btn { margin-top: 10px; }
}

/* Quest status bar: "Topic: X" | "Q: i/total" + segmented progress */
.lp-statusbar {
    display: flex;
    align-items: stretch;
    border-top: 2px solid var(--lp-black);
    border-bottom: 2px solid var(--lp-black);
    margin: 0 0 14px 0;
}
.lp-statusbar-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    flex: 1 1 50%;
}
.lp-statusbar-cell + .lp-statusbar-cell { border-left: 1px solid var(--lp-black); }
.lp-statusbar-q { justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.lp-statusbar-label {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-grey);
    white-space: nowrap;
}
.lp-statusbar-value {
    font-family: 'Roboto', monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--lp-black);
    white-space: nowrap;
}
.lp-qbar {
    width: 140px;
    max-width: 40vw;
    height: 8px;
    background: #e2e2e2;
    border: 1px solid var(--lp-black);
    overflow: hidden;
}
.lp-qbar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--lp-cyan);
    transition: width .25s ease;
}
.lp-statusbar-eta {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    color: var(--lp-grey);
    white-space: nowrap;
}

/* Quest practice: one interleaved word at a time (flashcard or review question) */
.lp-quest-area {
    margin: 0 auto;
    min-width: 200px;
    width: 100%;
    max-width: 460px;
    box-sizing: border-box;
}

.lp-quest-area.lp-quest-slide-out {
    transform: translateX(-40px);
    opacity: 0;
    transition: transform .15s ease-in, opacity .15s ease-in;
}
.lp-quest-area.lp-quest-slide-in {
    animation: lp-quest-slide-in .18s ease-out;
}
@keyframes lp-quest-slide-in {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.lp-quest-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Roboto', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--lp-cyan);
    margin-bottom: 10px;
}
.lp-quest-word-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}
.lp-quest-word {
    font-family: 'Roboto', sans-serif;
    font-size: 42px;
    font-weight: 900;
    color: var(--lp-black);
}
.lp-quest-flashcard {
    max-width: 100%;
    margin: 0 auto;
}

.lp-quest-flashcard .lp-flashcard-inner {
    min-height: 260px;
    min-width: 260px;
    max-width: 460px;
    margin: 0 auto;
}

.lp-quest-answer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}
.lp-quest-audio-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.lp-quest-answer-box {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 16px 0 0 0;
    padding: 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    background: #fff;
    color: var(--lp-black);
    border: 2px solid var(--lp-black);
    border-radius: 0;
    box-shadow: 6px 6px 0 var(--lp-black);
    cursor: pointer;
}
.lp-quest-answer-box::placeholder { color: #b3b3b3; font-weight: 400; }
.lp-quest-answer-box:disabled { cursor: default; }
.lp-quest-answer-box.lp-quest-correct {
    border-color: var(--lp-green);
    background: var(--lp-green-bg);
    color: var(--lp-green);
    box-shadow: 6px 6px 0 var(--lp-green);
}
.lp-quest-answer-box.lp-quest-wrong {
    border-color: var(--lp-red);
    background: var(--lp-red-bg);
    color: var(--lp-red);
    box-shadow: 6px 6px 0 var(--lp-red);
}

/* Fill-in-the-blank layout for decline-with-preposition: the input sits
   inline in the sentence ("chodit ____") instead of below a separate
   headword, with the word being declined shown small underneath. */
.lp-quest-blank-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.lp-quest-blank-word {
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--lp-black);
}
.lp-quest-blank-input {
    width: 140px;
    max-width: 55vw;
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    color: var(--lp-black);
    background: transparent;
    border: none;
    border-bottom: 3px solid var(--lp-black);
    border-radius: 0;
    padding: 0 4px 2px;
}
.lp-quest-blank-input::placeholder { color: #b3b3b3; font-weight: 400; font-size: 18px; }
.lp-quest-blank-input:disabled { cursor: default; }
.lp-quest-blank-input.lp-quest-correct { border-color: var(--lp-green); color: var(--lp-green); }
.lp-quest-blank-input.lp-quest-wrong { border-color: var(--lp-red); color: var(--lp-red); }
.lp-quest-blank-hint {
    margin-top: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--lp-grey);
    text-align: center;
}
.lp-quest-blank-placeholder {
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--lp-grey);
    letter-spacing: 2px;
}
/* A real sentence with one word blanked out: text on both sides of the input, so it
   reads as a sentence (smaller, wrapping) rather than the one-word "chodit ____" prompt. */
.lp-quest-blank-row-sentence { gap: 6px 8px; padding: 0 4px; line-height: 1.25; }
.lp-quest-blank-row-sentence .lp-quest-blank-word { font-size: 24px; font-weight: 700; }
.lp-quest-blank-row-sentence .lp-quest-blank-input { font-size: 24px; width: 120px; }
.lp-quest-blank-row-sentence .lp-quest-blank-placeholder { font-size: 24px; }
.lp-quest-credit {
    margin-top: 6px;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    color: var(--lp-grey);
    text-align: center;
}
.lp-quest-grammar-prompt {
    text-align: center;
    margin-bottom: 0;
}
.lp-quest-grammar-prompt .lp-form-tag {
    margin-bottom: 10px;
}
/* Conjugation prompt: one tag for who (blue) and one for when (yellow) */
.lp-form-tags {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 10px;
}
.lp-form-tags .lp-form-tag {
    margin-bottom: 0; border: 2px solid var(--lp-black); color: var(--lp-black); font-size: 13px; padding: 5px 12px;
}
.lp-form-tag-who { background: var(--lp-cyan); }
.lp-form-tag-when { background: var(--lp-yellow); }
.lp-quest-grammar-word {
    font-family: 'Roboto', sans-serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--lp-black);
}

.lp-quest-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.lp-quest-options .lp-quest-answer-box {
    margin-top: 0;
    box-shadow: 4px 4px 0 var(--lp-black);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}
.lp-quest-options .lp-quest-answer-box:hover:not(:disabled) { background: #fafafa; }
.lp-quest-options .lp-quest-answer-box.lp-quest-correct { box-shadow: 4px 4px 0 var(--lp-green); }
.lp-quest-options .lp-quest-answer-box.lp-quest-wrong { box-shadow: 4px 4px 0 var(--lp-red); }
.lp-quest-option-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    font-size: 12px;
    font-family: 'Roboto', monospace;
}
.lp-quest-option-text { flex: 1; text-align: center; }

.lp-quest-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin: 14px 0;
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lp-quest-status {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
/* Hint reveal below the submit button — hidden by default, shown via the
   .lp-quest-hint-shown class (toggled either by holding Ctrl/Cmd on desktop
   or tapping .lp-quest-hint-btn on touch — see lesson-player.js). */
.lp-quest-hint-revealed {
    display: none;
    text-align: center;
    color: var(--lp-cyan);
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin: 18px 0 0 0;
}
.lp-quest-hint-revealed.lp-quest-hint-shown { display: block; }

/* Tap-to-reveal hint button — touch-device equivalent of the Ctrl/Cmd hold,
   shown just above the (hidden until toggled) hint text. */
.lp-quest-hint-btn {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    color: var(--lp-grey);
    cursor: pointer;
    font-family: 'Roboto', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.lp-quest-hint-btn:hover { color: var(--lp-black); text-decoration: underline; }

.lp-quest-status { color: var(--lp-grey); }
.lp-quest-status-correct { color: var(--lp-green); }
.lp-quest-status-correct::before { content: "✓ "; }
.lp-quest-status-wrong { color: var(--lp-red); }
.lp-quest-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    background: #fdf6e3;
    border: 1px solid #ecdfb0;
    text-align: left;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--lp-black);
}
.lp-quest-tip-icon { flex-shrink: 0; }

/* Skip button — square icon button matching mic/sound/report, sitting in
   the same fixed corner row instead of a separate text link in the flow. */
.lp-skip-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #fff;
    border: 2px solid var(--lp-black);
    background-image: url('/images/icons8-fast-forward-48.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}
.lp-skip-btn:hover { background-color: var(--lp-cyan); }

/* ============================================================
   Pronunciation-comparison panel — Rhythm/Pitch graphs vs a real
   native recording (read-aloud items that have one; see
   apiGetWordReferenceAudio). Sits under the prompt, above the
   record button.
   ============================================================ */
.lp-pron-panel {
    border: 2px solid var(--lp-black);
    box-shadow: 4px 4px 0 var(--lp-cyan);
    background: #fff;
    margin: 18px 0 8px 0;
    padding: 14px 16px;
    text-align: left;
}
.lp-pron-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.lp-pron-title {
    font-family: 'Roboto', monospace;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lp-grey);
}
.lp-pron-score {
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
    font-size: 15px;
    color: var(--lp-black);
}
.lp-pron-graphs {
    display: flex;
    flex-direction: row;
    gap: 14px;
    flex-wrap: wrap;
}
.lp-pron-graph-card {
    flex: 1 1 220px;
    min-width: 200px;
}
.lp-pron-graph-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Roboto', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--lp-grey);
    margin: 0 0 4px 0;
}
.lp-pron-graph-label--weak { color: var(--lp-red); }
.lp-pron-graph-label--weak .lp-pron-help-trigger { border-color: var(--lp-red); color: var(--lp-red); }

/* "?" help icon on each graph label, explaining what the curves/highlight
   mean — same hover/focus-reveal bubble pattern as .us-help-tooltip on the
   stats page, themed with this panel's own black-border/cyan-shadow look
   instead of that page's yellow so it reads as part of this component. */
.lp-pron-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    outline: none;
}
.lp-pron-help-trigger {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    border: 1px solid var(--lp-grey);
    color: var(--lp-grey);
    font-family: 'Roboto', sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.lp-pron-help-bubble {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 220px;
    max-width: calc(100vw - 48px);
    padding: 10px 12px;
    border: 1.5px solid var(--lp-black);
    background-color: #fff;
    color: var(--lp-black);
    box-shadow: 4px 4px 0 var(--lp-cyan);
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease;
}
.lp-pron-help:hover .lp-pron-help-bubble,
.lp-pron-help:focus-within .lp-pron-help-bubble {
    opacity: 1;
    visibility: visible;
}
.lp-pron-canvas {
    display: block;
    width: 100%;
    height: 72px;
    background: #fafafa;
    border: 1.5px solid #e2e2e2;
}

/* Admin "Edit word" modal (site admins only, launched mid-practice-session). */
.lp-edit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    z-index: 1000;
}
.lp-edit-modal {
    background: #fff;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid var(--lp-black);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
    padding: 20px;
}
.lp-edit-modal-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: 16px;
    margin-bottom: 16px;
}
.lp-edit-modal-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}
.lp-edit-field { display: flex; flex-direction: column; gap: 3px; }
.lp-edit-field-label {
    font-family: 'Roboto', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--lp-grey);
}
.lp-edit-field input[type="text"],
.lp-edit-field input[type="number"],
.lp-edit-field textarea,
.lp-edit-field select {
    font: inherit;
    font-size: 13px;
    padding: 6px 8px;
    border: 1.5px solid #ccc;
}
.lp-edit-field-highlight {
    background: #fff9db;
    outline: 2px solid var(--lp-cyan);
    padding: 6px;
}
.lp-edit-modal-error {
    color: var(--lp-red);
    font-size: 13px;
    margin-top: 10px;
    min-height: 1em;
}
.lp-edit-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.lp-edit-modal-actions .lp-btn { width: auto; flex: 1 1 0; margin-top: 0; }

/* Scene gate: the "let's make it harder" / "subscribe to continue" modal a scene quest shows
   once the ordinary word/grammar practice is ~85% done (see RENDERERS["quest-mixed"] in
   lesson-player.js). Reuses .lp-edit-modal's overlay/box/title/actions, just narrower. */
.lp-scene-gate-modal { max-width: 420px; text-align: center; }
.lp-scene-gate-modal .lp-edit-modal-title { margin-bottom: 10px; }
.lp-scene-gate-modal .lp-sub { margin-bottom: 4px; }
.lp-scene-gate-modal .lp-edit-modal-actions { flex-direction: column; }
.lp-scene-gate-cta-btn { box-shadow: 4px 4px 0 var(--lp-yellow); }

/* ---- Mobile overrides (kept last so they win over the base rules above) ---- */
@media (max-width: 600px) {
    /* Yellow drop shadows on practice inputs, answer buttons and flashcards.
       The green/red correct/wrong shadows are more specific and still win. */
    .lp-flashcard-face,
    .lp-quest-answer-box,
    .lp-quest-options .lp-quest-answer-box {
        box-shadow: 4px 4px 0 var(--lp-yellow);
    }
    .lp-flashcard-face { box-shadow: 6px 6px 0 var(--lp-yellow); }

    /* Quest finish screen ("Nice progress"): breathing room above, an even
       side gutter around everything, and every box the same width. */
    .lp-summary {
        box-sizing: border-box;
        padding: 32px 24px 0;
    }
    /* The paginated variant (.lp-finish-paged) handles its own padding per .lp-finish-step
       instead — the outer shell is a fixed-position flex container, not a padded block. */
    .lp-summary.lp-finish-paged {
        padding: 0;
    }
    .lp-summary .lp-mastery-summary,
    .lp-summary .lp-quest-finish-actions,
    .lp-summary .lp-progress-boxes,
    .lp-summary .lp-progress-box {
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }
    .lp-progress-boxes {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    /* Skill stats box: light gray fill like the level (A1) box, no border. */
    .lp-skill-row-label { flex-basis: 96px; }
    .lp-progress-box {
        flex: none;
        background: #f8f8f8;
        border: 0;
        box-shadow: none;
        padding: 20px;
    }
}

/* Quest finish screen extras + the contextual paywall (public/javascripts/next-quest.js) */
.lp-summary-extras { width: 100%; box-sizing: border-box; margin: 16px auto; max-width: 750px; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.lp-extra-box { background: #f8f8f8; padding: 20px; box-sizing: border-box; }
.lp-extra-box-strong { background: #FFF8DC; }
.lp-extra-label {
    font-family: 'Roboto', monospace; font-size: 12px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--lp-grey); margin: 0 0 12px 0;
}
.lp-extra-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 17px; line-height: 1.35; font-weight: 500; }
.lp-extra-list li { display: flex; gap: 12px; }
.lp-extra-list li::before { content: "✓"; font-weight: 900; color: var(--lp-cyan); }
.lp-extra-big { font-family: 'Roboto', sans-serif; font-size: 24px; font-weight: 900; line-height: 1.15; color: var(--lp-black); }
.lp-extra-sub { margin: 8px 0 0 0; font-size: 14px; color: #444; line-height: 1.4; }

.nq-card {
    border: 3px solid var(--lp-black); box-shadow: 6px 6px 0 var(--lp-yellow); background: #fff;
    padding: 20px; box-sizing: border-box; text-align: left; display: flex; flex-direction: column; gap: 10px;
}
.nq-kicker { font-family: 'Roboto', monospace; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lp-grey); }
.nq-title { font-family: 'Roboto', sans-serif; font-size: 22px; font-weight: 900; line-height: 1.2; color: var(--lp-black); }
.nq-why { font-size: 14px; color: #444; line-height: 1.4; }
.nq-benefits {
    list-style: none; margin: 16px 0 0 0; padding: 20px; background: var(--lp-black); color: #fff; box-shadow: 6px 6px 0 var(--lp-cyan);
    display: flex; flex-direction: column; gap: 12px; font-size: 16px; text-align: left;
}
.nq-benefits li { display: flex; gap: 12px; }
.nq-benefits li::before { content: "✓"; font-weight: 900; color: var(--lp-yellow); }
.nq-slot:empty { display: none; }
.nq-error { margin: 8px 0 0 0; font-size: 14px; color: var(--lp-red); }

/* "Finish the conversation": the line spoken just before the sentence being practiced */
.lp-quest-dialogue-line {
    max-width: 420px; margin: 0 auto 14px; padding: 10px 14px; box-sizing: border-box;
    background: #f3f3f3; text-align: left; border-left: 4px solid var(--lp-cyan);
}
.lp-quest-dialogue-cz { font-family: 'Roboto', sans-serif; font-size: 17px; font-weight: 700; color: var(--lp-black); }
.lp-quest-dialogue-en { margin-top: 2px; font-size: 13px; color: var(--lp-grey); }
