/* The guided study start shares the existing session preference and player. */
.next-session { --next-ink: #302747; --next-muted: #68647b; --next-line: #e1ddef; --next-bg: #fff; --next-wash: #f6f4ff; color: var(--next-ink); width: 100%; margin: 0 0 24px; }
.next-session__card { background: linear-gradient(120deg, var(--next-wash), var(--next-bg) 72%); border: 1px solid var(--next-line); border-radius: 22px; padding: 28px 32px; box-shadow: 0 5px 22px #40308706; }
.next-session__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.next-session__top h2 { font-size: 14px; font-weight: 750; letter-spacing: .015em; margin: 0; color: var(--next-ink); }
.next-session__signal { color: #7769dc; font-size: 23px; line-height: 1; }
.next-session__course { color: var(--next-muted); font-size: 12px; font-weight: 600; margin: 0 0 10px; }
.next-session h3.next-session__topic { color: var(--next-ink); font-size: clamp(23px, 3vw, 31px); font-weight: 750; line-height: 1.23; letter-spacing: -.035em; max-width: 720px; margin: 0 0 12px; overflow-wrap: anywhere; }
.next-session__reason { font-size: 14px; line-height: 1.65; color: var(--next-muted); max-width: 640px; margin: 0 0 24px; }
.next-session__time { padding: 0; border: 0; margin: 0 0 22px; min-width: 0; }
.next-session__time legend { font-size: 11px; font-weight: 650; color: var(--next-muted); margin: 0 0 8px; }
.next-session__segments { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--next-line); border-radius: 12px; background: var(--next-bg); }
.next-session__segments label { position: relative; cursor: pointer; margin: 0; }
.next-session__segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.next-session__segments span { display: block; min-width: 72px; padding: 11px 13px; border-radius: 8px; color: var(--next-muted); font-size: 12px; line-height: 22px; text-align: center; font-weight: 650; transition: background .15s, color .15s; }
.next-session__segments input:checked + span { color: #fff; background: #5b50e8; }
.next-session__segments input:focus-visible + span { outline: 3px solid #8d82ef; outline-offset: 3px; }
.next-session__segments input:disabled + span { opacity: .7; cursor: default; }
.next-session__footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 20px; border-top: 1px solid var(--next-line); }
.next-session__summary { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.next-session__note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--next-muted); }
.next-session button { font: inherit; cursor: pointer; }
.next-session button.next-session__start { border: 1px solid transparent; background: #5b50e8; color: #fff; border-radius: 12px; padding: 14px 24px; font-size: 13px; font-weight: 750; min-height: 48px; white-space: nowrap; transition: background .15s; box-shadow: none; }
.next-session button.next-session__start:hover { background: #493cce; }
.next-session button:focus-visible, #backToNextSession:focus-visible { outline: 3px solid #9386ec; outline-offset: 4px; }
.next-session button:disabled { opacity: .65; cursor: wait; }
.next-session__tools { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 9px 8px; }
.next-session__tools button, .next-session__progress button, #backToNextSession { border: 0; background: none; color: #6257ad; min-height: 44px; font-size: 12px; font-weight: 650; padding: 9px 0; text-align: left; }
.next-session__status { color: var(--next-ink); font-size: 13px; line-height: 1.5; margin: 16px 0 0; }
.next-session__progress { border-top: 1px solid var(--next-line); margin-top: 14px; padding: 24px 8px 0; }
.next-session__eyebrow { color: var(--next-muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 750; margin: 0 0 12px; }
.next-session__progress h3 { font-size: 16px; line-height: 1.4; margin: 0 0 10px; color: var(--next-ink); }
.next-session__progress p:not(.next-session__eyebrow) { color: var(--next-muted); font-size: 13px; line-height: 1.6; margin: 5px 0; max-width: 640px; }
.next-session__progress p.next-session__progress-topic { font-weight: 650; color: var(--next-ink); }
.next-session [hidden] { display: none !important; }
html[data-dark] .next-session { --next-ink: #f0edf9; --next-muted: #b1abc4; --next-line: #363044; --next-bg: #18181b; --next-wash: #302747; }
html[data-dark] .next-session__tools button, html[data-dark] .next-session__progress button, html[data-dark] #backToNextSession { color: #b5a8ff; }
#homeNextSession { display: none; }
body.study-guided:not(.quiz-active) #homeNextSession { display: block; grid-column: 1 / -1; }
body.study-guided:not(.quiz-active) #mainContent > :is(#practiceOptions, #inputSection, #generateBtn, #builderFooter, #usageMeter, #todayStrip, #achievementsPanel, #backToNextSession) { display: none !important; }
body.study-guided:not(.quiz-active) #mainContent { grid-template-columns: minmax(0, 1fr) !important; max-width: 920px; }
body.quiz-active :is(#homeNextSession, #practiceOptions, #backToNextSession, #examCountdownBanner), #statsPage #dashStartGuide { display: none !important; }
body:has(#loading[style*="display: block"]) #practiceOptions { display: none !important; }
#backToNextSession { display: block; margin: 0 0 10px; grid-column: 1 / -1; cursor: pointer; }
#statsPage #dashUpNext { margin-bottom: 18px; }
@media (max-width: 600px) {
    .next-session__card { padding: 21px 20px; border-radius: 18px; }
    .next-session__top { margin-bottom: 20px; }
    .next-session__reason { margin-bottom: 20px; font-size: 13px; }
    .next-session__footer { flex-direction: column; align-items: stretch; gap: 15px; padding-top: 17px; }
    .next-session__footer .next-session__start { width: 100%; }
    .next-session__tools { justify-content: flex-start; padding-inline: 3px; }
    .next-session__progress { padding-inline: 3px; }
}
@media (prefers-reduced-motion: reduce) { .next-session * { transition: none !important; } }

#mainContent > #examCountdownBanner { grid-column: 1 / -1; width: 100%; margin-bottom: 20px; }

body.next-session-complete #studySessionPanel { display: none; }
/* Retire the old Up next wrapper only for the new shared component. */
.student-workspace #statsPage #dashUpNext.next-session { display: block; padding: 0; border: 0; background: none; box-shadow: none; }
#statsPage #dashUpNext .next-session__course { font-size: 12px; }
#statsPage #dashUpNext .next-session__reason { font-size: 14px; }
#statsPage #dashUpNext .next-session__summary, #statsPage #dashUpNext .next-session__status { font-size: 13px; }
#statsPage #dashUpNext .next-session__note { font-size: 11px; }
#statsPage #dashUpNext .next-session__eyebrow { font-size: 10px; }
@media (max-width: 600px) { #statsPage #dashUpNext .next-session__reason { font-size: 13px; } }
/* Keep in-page navigation clear of the fixed app header. */
#studySessionPanel, #courseFields, #inputSection { scroll-margin-top: 96px; }
@media (min-width: 1100px) {
    /* The sidebar spans the form rows. A full-width back link would force
       itself and the form below that sidebar, leaving an empty first column. */
    #backToNextSession { grid-column: 1; }
}
