/* Learning Reels. Uses Study tokens. Does not restyle the hub chrome. */

.lr-app { min-height: 100%; }
.lr-shell { display: flex; min-height: 100vh; background: var(--st-bg); color: var(--st-ink); }
.lr-main { flex: 1 1 auto; min-width: 0; padding: 28px 40px 80px; }
.lr-top { display: flex; align-items: center; gap: 24px; margin-bottom: 18px; }
.lr-title { font-family: var(--st-font-display); font-weight: 800; font-size: 44px; letter-spacing: -0.03em; margin: 0; }
.lr-progress { width: min(240px, 40vw); }
.lr-progress__label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-ink-2); margin-bottom: 8px; }
.lr-segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.lr-segments i { display: block; height: 8px; border-radius: 99px; background: var(--st-fill); }
.lr-segments i.is-done { background: var(--st-accent); }
.lr-segments i.is-current { background: var(--st-warm); }
.lr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.lr-chip { appearance: none; border: 3px solid var(--st-border); background: var(--st-surface); color: var(--st-ink); border-radius: 999px; padding: 8px 14px; font: 700 14px/1 var(--st-font-body); min-height: 44px; cursor: pointer; }
.lr-chip.is-on { background: var(--st-ink); color: #fff; }
.lr-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.lr-stage__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lr-skel { height: 16px; border-radius: 8px; background: var(--st-fill); margin: 16px 0; }
.lr-skel--lg { height: 88px; }
.lr-skel--short { width: 55%; }
.lr-card--error h2, .lr-card--empty h2 { font-family: var(--st-font-display); font-size: 28px; margin: 8px 0 12px; }
.lr-card--error p, .lr-card--empty p { margin: 0 0 16px; font-weight: 700; }
.lr-stage__left { display: flex; align-items: flex-end; gap: 20px; }
.lr-card { background: var(--st-surface); color: var(--st-ink); border: 3px solid var(--st-border); border-radius: 22px; box-shadow: 4px 4px 0 var(--st-shadow-tint, #d8d6e4); padding: 22px; position: relative; }
.lr-card--mobile { display: flex; flex-direction: column; }
.lr-quiz-next { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 16px; }
.lr-quiz-next .st-btn { min-height: 48px; min-width: 96px; }
.lr-card--full { width: min(420px, 100%); min-height: 660px; border-radius: 28px; box-shadow: 6px 6px 0 var(--st-warm); display: flex; flex-direction: column; }
.lr-card--compact { box-sizing: border-box; height: 280px; min-height: 260px; max-height: 300px; display: flex; flex-direction: column; width: 100%; }
.lr-card--indigo, .lr-card--full.lr-card--question { background: var(--st-accent); color: #fff; }
.lr-card--indigo .lr-kicker, .lr-card--question .lr-kicker { color: #fff; }
.lr-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--st-accent); }
.lr-match { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.lr-prompt { font-family: var(--st-font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; margin: 14px 0; }
.lr-card--compact .lr-card__prompt { flex: 1 1 auto; min-height: 0; margin: 14px 0 0; }
.lr-card--compact .lr-kicker, .lr-card--compact .lr-card__foot, .lr-card--compact .lr-match { flex: 0 0 auto; }
.lr-card--compact .lr-prompt { font-family: var(--st-font-body); font-weight: 700; font-size: 20px; line-height: 1.3; letter-spacing: 0; margin: 0; padding-right: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.lr-options { display: flex; flex-direction: column; gap: 10px; }
.lr-option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 3px solid var(--st-border); background: rgba(255,255,255,0.16); color: inherit; border-radius: 16px; padding: 12px 14px; min-height: 52px; font: 700 16px/1.3 var(--st-font-body); cursor: pointer; }
.lr-card--white .lr-option, .lr-card--compact .lr-option { background: var(--st-surface); }
.lr-option__letter { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--st-ink); color: #fff; font-size: 13px; flex: 0 0 auto; }
.lr-option.is-correct { background: #fff; color: var(--st-ink); }
.lr-option.is-wrong { opacity: 0.55; }
.lr-option.is-dim { opacity: 0.4; }
.lr-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lr-reveal { margin-top: 16px; background: var(--st-ink); color: #fff; border-radius: 16px; padding: 16px; }
.lr-reveal__verdict { color: var(--st-warm); font-weight: 800; letter-spacing: 0.08em; font-size: 13px; margin: 0 0 8px; }
.lr-reveal p { margin: 0; font-size: 16px; line-height: 1.45; }
.lr-hint { margin-top: auto; padding-top: 14px; font-size: 13px; font-weight: 700; opacity: 0.8; }
.lr-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 700; }
.lr-iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 3px solid var(--st-border); background: var(--st-surface); color: var(--st-ink); display: grid; place-items: center; cursor: pointer; }
.lr-iconbtn.is-saved { background: var(--st-warm); }
.lr-rail { display: flex; flex-direction: column; gap: 10px; }
.lr-rail button { width: 52px; height: 52px; border-radius: 15px; border: 3px solid var(--st-border); background: var(--st-surface); color: var(--st-ink); display: grid; place-items: center; cursor: pointer; }
.lr-rail button.is-save { background: var(--st-warm); }
.lr-rail button.is-saved { background: var(--st-ink); color: var(--st-warm); }
.lr-side { background: var(--st-surface); border: 3px solid var(--st-border); border-radius: 20px; box-shadow: 4px 4px 0 var(--st-shadow-tint, #d8d6e4); padding: 18px; }
.lr-side h2 { font-family: var(--st-font-display); font-size: 22px; margin: 0 0 8px; }
.lr-side li { margin: 8px 0; font-weight: 700; }
.lr-done { background: var(--st-ink); color: #fff; border-radius: 24px; padding: 28px; box-shadow: 6px 6px 0 var(--st-warm); }
.lr-done h2 { font-family: var(--st-font-display); font-size: 36px; margin: 0 0 8px; }
.lr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.lr-promo { box-sizing: border-box; background: var(--st-ink); color: #fff; border-radius: 22px; border: 3px solid var(--st-border); box-shadow: 4px 4px 0 var(--st-warm); padding: 20px; height: 280px; min-height: 260px; max-height: 300px; display: flex; flex-direction: column; }
.lr-promo__chip { align-self: flex-start; background: var(--st-warm); color: var(--st-warm-ink); font-weight: 800; letter-spacing: 0.06em; font-size: 12px; border-radius: 999px; padding: 6px 10px; flex: 0 0 auto; }
.lr-promo h3 { font-family: var(--st-font-display); font-size: 28px; line-height: 1.2; margin: 14px 0 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.lr-promo .st-btn { margin-top: auto; align-self: flex-start; }
.lr-promo p { margin: 0 0 16px; color: var(--st-ink-on-dark-muted, #c9cbea); }
.lr-quick { margin: 8px 0 28px; }
.lr-quick__head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 12px; }
.lr-quick__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start; }
/* Same box as .lr-card--compact / .lr-promo, so the row is the same height
   before and after home.php answers. */
.lr-quick__skel { box-sizing: border-box; height: 280px; border-radius: 22px; }
.lr-card--link { display: flex; box-sizing: border-box; height: 280px; min-height: 260px; max-height: 300px; color: inherit; text-decoration: none; }
.st-nav__new { margin-left: auto; background: var(--st-accent); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; border-radius: 999px; padding: 3px 6px; }
.lr-menu { position: absolute; top: 12px; right: 12px; }
.lr-popover { position: absolute; z-index: 20; right: 0; top: 48px; width: 240px; background: var(--st-surface); color: var(--st-ink); border: 3px solid var(--st-border); border-radius: 16px; box-shadow: 4px 4px 0 var(--st-shadow-tint, #d8d6e4); padding: 8px; }
.lr-popover button, .lr-popover a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 8px; min-height: 44px; font-weight: 700; color: inherit; cursor: pointer; }
.lr-sheet { position: fixed; inset: auto 0 0 0; background: var(--st-surface); color: var(--st-ink); border-top: 3px solid var(--st-border); border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 -8px 0 var(--st-shadow-tint, #d8d6e4); }
.lr-sheet label { display: block; font-weight: 700; margin: 10px 0 4px; }
.lr-sheet input { width: 100%; min-height: 44px; border: 3px solid var(--st-border); border-radius: 12px; padding: 8px 12px; font: inherit; }
.lr-scrim { position: fixed; inset: 0; background: rgba(28, 26, 58, 0.45); z-index: 30; }
.lr-wordmark { display: flex; align-items: center; gap: 10px; font-family: var(--st-font-display); font-weight: 800; font-size: 22px; color: var(--st-ink); text-decoration: none; }
.lr-quiz { max-width: 420px; margin: 0 auto; padding: 24px 16px 48px; }
.lr-score { background: var(--st-ink); color: #fff; border-radius: 24px; box-shadow: 6px 6px 0 var(--st-warm); padding: 22px; text-align: center; }
.lr-ring { width: 104px; height: 104px; margin: 0 auto 8px; }
.lr-miss { border: 3px solid var(--st-border); border-radius: 16px; padding: 12px; margin: 10px 0; background: var(--st-surface); }
.lr-tabs { display: none; }
.lr-public { background: var(--st-bg); min-height: 100vh; }
.lr-slide { transition: transform 250ms ease, opacity 250ms ease; }
.lr-slide.is-leave { transform: translateY(-28px); opacity: 0; }
.lr-sub { margin: 0 0 22px; font-size: 18px; font-weight: 700; color: var(--st-ink-2); max-width: 36rem; }
.lr-picker { max-width: 720px; }
.lr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lr-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; appearance: none; width: 100%; text-align: left; border: 3px solid var(--st-border); background: var(--st-surface); color: var(--st-ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--st-shadow-tint, #d8d6e4); padding: 16px 18px; min-height: 88px; font: 800 18px/1.2 var(--st-font-display); cursor: pointer; }
.lr-tile__name { display: block; }
.lr-tile small { display: block; margin-top: 2px; font: 700 12px/1.2 var(--st-font-body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--st-accent); }
.lr-set { max-width: 480px; }
.lr-settop { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
.lr-settopic { margin: 0; font-family: var(--st-font-display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; line-height: 1.15; color: var(--st-ink); }
.lr-settop .lr-progress { width: 100%; max-width: none; }
.lr-settop .lr-progress__label { justify-content: flex-start; gap: 12px; }
.lr-quit { align-self: flex-start; appearance: none; border: 0; background: none; color: var(--st-ink-2); font: 800 14px/1 var(--st-font-body); letter-spacing: 0.04em; text-transform: uppercase; min-height: 44px; padding: 8px 0; cursor: pointer; }
.lr-card--set { flex: 1 1 auto; }
.lr-verdict { margin: 16px 0 0; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px; }
.lr-verdict.is-right { color: var(--st-warm); }
.lr-verdict.is-wrong { color: #ffbaba; }
.lr-option.is-picked-right { background: #fff; color: var(--st-ink); box-shadow: 4px 4px 0 #7bc89a; border-color: #7bc89a; }
.lr-option.is-picked-wrong { background: #fff; color: var(--st-ink); opacity: 1; box-shadow: 4px 4px 0 #e88; border-color: #e88; }
.lr-next { margin-top: auto; min-height: 56px; width: 100%; }
.lr-card--set .lr-next { margin-top: 14px; }
.lr-results { max-width: 520px; display: flex; flex-direction: column; gap: 12px; }
.lr-score__topic { margin: 10px 0 0; font: 800 13px/1.2 var(--st-font-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-warm); }
.lr-review { border: 3px solid var(--st-border); border-radius: 16px; padding: 14px; background: var(--st-surface); box-shadow: 3px 3px 0 var(--st-shadow-tint, #d8d6e4); }
.lr-review.is-wrong { border-color: #e88; }
.lr-review.is-right { border-color: #7bc89a; }
.lr-review p { margin: 0 0 8px; font-weight: 700; }
.lr-review p:last-child { margin-bottom: 0; }
.lr-review__topic { margin: 0 0 6px; font: 800 11px/1.2 var(--st-font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--st-accent); }
.lr-answer { font-weight: 800; margin: 8px 0; }
.lr-answer.is-wrong { color: #c44; }
.lr-results__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.lr-results__actions .st-btn { min-height: 56px; width: 100%; justify-content: center; }

@media (max-width: 900px) {
    .lr-stage { grid-template-columns: 1fr; }
    .lr-quick__grid { grid-template-columns: 1fr 1fr; }
    .lr-main { padding: 20px 16px 88px; }
    .lr-title { font-size: 32px; }
}
@media (max-width: 639px) {
    .lr-shell { display: block; background: var(--st-ink); color: #fff; }
    .lr-shell .st-sidebar { display: none; }
    .lr-main { padding: 12px 14px calc(88px + env(safe-area-inset-bottom)); min-height: 100vh; }
    .lr-title, .lr-chips, .lr-stage__left { display: contents; }
    .lr-top { display: block; }
    .lr-progress__label { color: #fff; }
    .lr-segments i { height: 4px; background: #5c5878; }
    .lr-segments i.is-done { background: #fff; }
    .lr-segments i.is-current { background: var(--st-warm); }
    .lr-chips { display: flex; gap: 14px; overflow: auto; margin: 10px 0; }
    .lr-chip { background: transparent; color: #fff; border: 0; border-radius: 0; border-bottom: 3px solid transparent; padding: 8px 2px; }
    .lr-chip.is-on { background: transparent; color: #fff; border-bottom-color: var(--st-warm); }
    .lr-stage { display: block; }
    .lr-card--full, .lr-card--mobile { width: 100%; min-height: calc(100vh - 210px); background: var(--st-accent); color: #fff; border: 3px solid #fff; border-radius: 26px; box-shadow: none; }
    .lr-prompt { font-size: 32px; padding-right: 0; }
    .lr-card--full, .lr-card--mobile { padding-right: 76px; }
    .lr-card--error, .lr-card--empty, .lr-card--skeleton { display: flex; flex-direction: column; }
    .lr-skel { background: rgba(255, 255, 255, 0.28); }
    .lr-option, .lr-tf button { background: #fff; color: var(--st-ink); border: 3px solid var(--st-border); box-shadow: 4px 4px 0 var(--st-warm); min-height: 56px; }
    .lr-stage { position: relative; }
    .lr-rail { position: absolute; right: 12px; bottom: 16px; z-index: 2; }
    .lr-stage__side { display: none; }
    .lr-side, .lr-desktop-only { display: none; }
    .lr-tabs { display: grid; grid-template-columns: repeat(2, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--st-surface); color: var(--st-ink); border-top: 3px solid var(--st-border); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
    .lr-picker .lr-title { display: block; color: #fff; }
    .lr-sub { color: rgba(255, 255, 255, 0.85); }
    .lr-tile { background: var(--st-accent); color: #fff; border-color: #fff; box-shadow: 4px 4px 0 var(--st-warm); min-height: 88px; }
    .lr-tile small { color: var(--st-warm); }
    .lr-settopic { color: #fff; font-size: 24px; }
    .lr-quit { color: rgba(255, 255, 255, 0.85); min-height: 56px; }
    .lr-card--full.lr-card--set, .lr-card--full.lr-card--question { padding-right: 22px; }
    .lr-tabs a { min-height: 56px; display: grid; place-items: center; font-weight: 800; color: inherit; text-decoration: none; }
    .lr-tabs a[aria-current="page"] { color: var(--st-accent); }
    .lr-quick__grid { display: flex; overflow: auto; gap: 12px; }
    .lr-quick__grid > * { flex: 0 0 78%; }
}
@media (prefers-reduced-motion: reduce) {
    .lr-slide { transition: opacity 180ms linear; transform: none !important; }
    .lr-slide.is-leave { transform: none; }
}

.st-tile--reels-quiz { background: var(--st-ink); color: var(--st-warm); }
.st-chip--discover { background: var(--st-accent-soft); color: var(--st-accent); }
