/* Pages outside the course: Plans, My study, legal text, and account pages. They use the full width and have no course outline. */
body.page-wide .shell { grid-template-columns: minmax(0, 1fr); }
body.page-wide .outline, body.page-wide #outline-toggle, body.page-wide .topbar-progress { display: none; }
body.page-wide .topbar { gap: 10px; }
.study { max-width: 780px; margin: 0 auto; padding: 40px 24px 40px; }
.study h1 { font-size: 32px; margin-bottom: 8px; }
.study h2 { font-size: 22px; margin: 28px 0 8px; }
.legal h2 { font-size: 20px; margin: 26px 0 6px; }
.legal li { margin-bottom: 8px; color: #d7e2fa; }
.legal p, .legal li { max-width: 68ch; }

.site-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 8px; }
.site-footer a, .link-button { color: var(--muted); }
.site-footer a:hover, .link-button:hover { color: var(--green); }
.link-button { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.site-footer a, .site-footer .link-button { text-decoration: none; }
.outline .site-footer { margin-top: 28px; padding: 16px 6px 0; }

.consent-banner { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; padding: 16px 20px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 12px 40px #000a; }
.consent-banner p { margin: 0 0 12px; }

/* Plans */
.plans { max-width: 1200px; margin: 0 auto; padding: 48px 24px 40px; }
.plans-hero { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.plans-hero h1 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.plans-hero p { color: var(--muted); font-size: 18px; margin-bottom: 24px; }
.billing-toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--sunken); border: 1px solid var(--border-strong); border-radius: 999px; }
.toggle-option { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.toggle-option[aria-checked=true] { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1px var(--green); }
.save-badge { padding: 2px 8px; border-radius: 999px; background: #103346; color: #b6f7ff; font-size: 13px; font-weight: 700; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 20px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.plan-card.featured { border-color: var(--green); background: radial-gradient(ellipse at top right, #123650 0%, transparent 55%), var(--panel); box-shadow: 0 0 0 1px #5cecff33, 0 18px 50px #0008; }
.plan-card h2 { font-size: 26px; }
.plan-tagline { margin: 6px 0 18px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.plan-price-box { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 6px; min-height: 52px; white-space: nowrap; }
.plan-amount { font-size: clamp(34px, 3vw, 46px); line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.plan-per { color: var(--muted); font-size: 16px; }
.plan-billing { margin: 8px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.plan-cta { margin-bottom: 16px; min-height: 0; }
.plan-cta .btn { width: 100%; }
.btn.large { min-height: 48px; font-size: 17px; }
.plan-note, .plan-state { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.plan-includes { margin: 4px 0 8px; font-weight: 600; }
.plan-list { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.plan-list li { position: relative; padding-left: 26px; color: #d7e2fa; font-size: 15px; line-height: 1.45; }
.plan-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.plans-manage { text-align: center; margin: 20px 0 0; }
.plans-section { margin-top: 56px; }
.plans-section h2 { font-size: 26px; margin-bottom: 18px; }
.compare { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.compare caption { text-align: left; padding: 0 0 10px; color: var(--muted); font-size: 14px; }
.compare th, .compare td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; }
.compare thead th { background: var(--raised); font-size: 15px; }
.compare tbody th { font-weight: 500; color: #d7e2fa; }
.compare td { width: 110px; text-align: center; font-weight: 800; }
.compare td.yes { color: var(--green); }
.compare td.no { color: #7e94c5; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 14px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: #d7e2fa; }
@media (max-width: 640px) { .plans { padding: 36px 16px; } .compare td { width: 70px; } .compare th, .compare td { padding: 12px 10px; } }

/* Top navigation */
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a { padding: 6px 12px; border-radius: var(--radius); color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; }
.topnav a:hover { color: var(--text); background: var(--raised); }
@media (max-width: 520px) { .topnav a { padding: 6px 8px; font-size: 14px; } .topnav a:first-child { display: none; } }

/* Landing */
.landing { max-width: 1120px; margin: 0 auto; padding: 0 24px 40px; }
.hero-landing { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 32px; align-items: center; padding: 44px 0 24px; }
.hero-copy h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 18px; }
.hero-sub { font-size: 20px; color: #cddbf8; max-width: 34em; margin-bottom: 28px; }
.hero-actions-landing { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: grid; place-items: center; }
.hero-art img { width: min(320px, 70%); height: auto; filter: drop-shadow(0 0 60px #5cecff55); }
.landing-section { margin-top: 36px; }
.landing-section h2 { font-size: 28px; margin-bottom: 22px; }
.steps, .topics, .plan-teaser { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.step, .topic-card { padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.topic-card.featured { border-color: var(--green); background: radial-gradient(ellipse at top right, #123650 0%, transparent 60%), var(--panel); }
.step h3, .topic-card h3 { font-size: 19px; margin-bottom: 8px; }
.step p, .topic-card p { color: #cddbf8; }
.step-number { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 50%; background: #123650; color: #b6f7ff; font-weight: 800; }
.topic-card ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.landing-cta { margin-top: 72px; padding: 48px 24px; text-align: center; background: radial-gradient(ellipse at top, #123650 0%, transparent 70%), var(--panel); border: 1px solid var(--border); border-radius: 20px; }
.landing-cta h2 { margin-bottom: 20px; font-size: 30px; }
@media (max-width: 800px) { .hero-landing { grid-template-columns: 1fr; padding-top: 40px; } .hero-art { display: none; } }

#view-study {
  width: 100%;
  max-width: 1200px;
  padding: 36px clamp(16px, 3vw, 40px) 40px;
}
.study-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.study-header h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); }
.study-summary { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
.study-columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.study-primary, .study-secondary { display: grid; gap: 14px; min-width: 0; }
#view-study .study-section { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
#view-study .study-section h2 { margin: 0 0 12px; font-size: 18px; }
#view-study .study-section h3 { font-size: 20px; overflow-wrap: anywhere; }
#view-study .study-section p { overflow-wrap: anywhere; }
#view-study .study-section p:last-child { margin-bottom: 0; }
#view-study .study-next { border-top: 3px solid var(--green); }
.study-resume { display: grid; justify-items: start; gap: 10px; }
.study-resume .study-note { margin: 0; font-size: 14px; }
.study-resume .btn { margin-top: 6px; min-width: 120px; }
.study-progress-count { color: var(--muted); }
.study-progress-count strong { font-size: 38px; line-height: 1.2; font-weight: 650; color: var(--text); }
.study-summary progress { height: 10px; }
.study-chapters { display: grid; gap: 10px; }
.study-chapter { border: 1px solid var(--border); border-radius: var(--radius); background: var(--sunken); overflow: hidden; }
.study-chapter summary { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 16px; cursor: pointer; list-style: none; }
.study-chapter summary::-webkit-details-marker { display: none; }
.study-chapter-title { display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.study-chapter-title::before { content: '›'; color: var(--green); font-size: 20px; line-height: 1; }
.study-chapter[open] .study-chapter-title::before { transform: rotate(90deg); }
.study-chapter-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.study-course-list { list-style: none; margin: 0; padding: 0 16px; border-top: 1px solid var(--border); }
.study-course-list li { display: grid; grid-template-columns: minmax(0, 1fr) 76px; align-items: center; gap: 16px; padding: 16px 0; }
.study-course-list li + li { border-top: 1px solid var(--border); }
.study-course-list a { color: var(--text); font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }
.study-course-list a:hover { color: var(--green); text-decoration: underline; }
.study-lesson-progress { display: grid; gap: 5px; color: var(--muted); font-size: 13px; text-align: right; }
.study-lesson-progress progress { height: 5px; }
#view-study .study-list { margin: 0; padding: 0; list-style: none; gap: 0; }
#view-study .study-list > li { padding: 12px 0; overflow-wrap: anywhere; }
#view-study .study-list > li + li { border-top: 1px solid var(--border); }
#view-study .study-list > li:first-child { padding-top: 0; }
#view-study .study-list > li:last-child { padding-bottom: 0; }
#view-study .study-list a { text-underline-offset: 3px; }
#view-study .study-note, #view-study .study-empty { font-size: 14px; color: var(--muted); }
#view-study .field, #view-study input, #view-study select, #view-study textarea { min-width: 0; max-width: 100%; }
#view-study .account-form { gap: 12px; }
#view-study .account-form + .account-form { margin-top: 16px; }
#view-study .account-form .btn { justify-self: start; }
#view-study .choice { align-items: start; }
.study-notice:empty, .study-plan:empty { display: none; }
.study-notice:not(:empty) { margin-bottom: 20px; }
#view-study .site-footer { margin-top: 32px; }
@media (max-width: 760px) {
  .study-summary, .study-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .study-header { align-items: start; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  #view-study .study-section { padding: 20px; }
  .study-primary, .study-secondary { gap: 16px; }
}
@media (max-width: 380px) {
  #view-study .study-section { padding: 16px; }
  .study-chapter summary { padding: 12px; grid-template-columns: minmax(0, 1fr); }
  .study-chapter-count { padding-left: 20px; }
  .study-course-list { padding: 0 12px; }
  .study-course-list li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .study-lesson-progress { grid-template-columns: auto 1fr; align-items: center; gap: 12px; text-align: left; }
}
.study-progress-count strong { margin-right: 6px; }
#view-study .class-table { display: block; max-width: 100%; overflow-x: auto; }
#view-study .class-card { min-width: 0; }
#view-study .class-card .account-form { margin-top: 16px; }
#view-study .field { grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; }
#view-study .field input, #view-study .field select { width: 100%; }
#view-study .study-section > .study-note { margin-bottom: 16px; }
.study-email-schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 4px; }
@media (max-width: 380px) { .study-email-schedule { grid-template-columns: minmax(0, 1fr); } }
.topnav a[aria-current=page], .mobile-main-menu a[aria-current=page] { color: var(--green); background: var(--raised); }
#view-study .study-list > li { min-width: 0; }
#view-study .study-list select { width: 100%; margin: 8px 0; }
#view-study .choice input { flex-shrink: 0; }

.course-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; margin: 20px 0; }
.course-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--border); background: var(--panel); }
.course-card h2, .course-card h3, .course-card p { margin: 0; }
#view-shell > nav { margin-bottom: 20px; }
.exam-banks { list-style: none; margin: 20px 0; padding: 0; border: 1px solid var(--border); }
.bank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.bank-row + .bank-row { border-top: 1px solid var(--border); }
.bank-title { min-height: 48px; width: 100%; padding: 12px 16px; border: 0; background: var(--panel); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.bank-title:hover { background: var(--raised); color: var(--green); }
.bank-score { padding-right: 16px; color: var(--muted); font-size: 13px; }
#view-courses { max-width: 1120px; padding-top: 24px; }
.practice-app { margin: 28px 0; }
.practice-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.practice-toolbar select { min-width: 0; max-width: 100%; flex: 1; padding: 10px; background: var(--sunken); color: var(--text); border: 1px solid var(--border); }
.practice-app fieldset { border: 0; padding: 0; margin: 24px 0; min-width: 0; }
.practice-app legend { margin-bottom: 12px; font-weight: 650; }
.practice-option { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); padding: 16px; margin: 10px 0; cursor: pointer; }
.practice-option input { flex: 0 0 auto; margin-top: 6px; }
.practice-option-id { font-weight: 700; }
.practice-prose { min-width: 0; overflow-wrap: anywhere; }
.practice-prose p { margin-top: 0; }
.practice-prose math { max-width: 100%; overflow-x: auto; }
.practice-code pre, .practice-metadata { max-height: 420px; max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--border); }
.practice-figure { display: block; width: auto; max-width: 100%; max-height: 520px; height: auto; margin: 24px auto; background: white; }
.practice-feedback { margin: 24px 0; }
.practice-feedback details { margin-top: 20px; }
@media (max-width: 600px) { .practice-toolbar select { flex-basis: 100%; } .practice-option { padding: 12px; gap: 8px; } }
body:has(.practice-app) #view-shell { max-width: 1240px; padding: 24px clamp(16px, 3vw, 32px) 32px; }
.practice-intro { margin: 12px 0; }
.practice-intro details { color: var(--muted); font-size: 14px; }
.practice-intro summary { cursor: pointer; }
.exam-header { position: sticky; top: var(--header); z-index: 5; background: var(--page); border-bottom: 1px solid var(--border); padding: 8px 0; }
.exam-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; } .question-picker { display: flex; align-items: center; gap: 8px; min-width: 0; }
.question-picker select { max-width: min(420px, 55vw); min-width: 0; }
.exam-progress { display: flex; align-items: center; gap: 14px; margin: 8px 0 0; color: var(--muted); font-size: 13px; } .exam-progress progress { flex: 1; height: 6px; }
.exam-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; } .exam-workspace.has-feedback { grid-template-columns: minmax(0, 1fr); }
.exam-question, .practice-feedback:not(:empty) { min-width: 0; padding: 24px; border: 1px solid var(--border); background: var(--panel); }
.exam-question #practice-question-title { margin: 0 0 8px; font-size: 23px; line-height: 1.3; }
.question-context { font-size: 13px; color: var(--muted); margin-bottom: 16px; } .exam-question .practice-prose { line-height: 1.7; }
.exam-question fieldset { margin: 20px 0; }
.practice-option { border-radius: var(--radius); background: var(--sunken); }
.practice-option:has(input:checked) { border-color: var(--green); background: #10313b; }
.practice-option.is-correct { border-color: #49b78b; background: #0d2a21; }
.practice-option.is-incorrect:has(input:checked) { border-color: #e3939c; background: #351e28; }
.practice-option .practice-prose { flex: 1; }
.practice-option .practice-prose p:last-child { margin-bottom: 0; }
.exam-answer-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.exam-assumptions { margin: 16px 0; color: var(--muted); font-size: 14px; } .exam-question-nav { margin: 12px 0; border-bottom: 1px solid var(--border); }
.exam-question-nav > summary { cursor: pointer; padding: 10px 0; font-size: 14px; min-height: 44px; }
.exam-question-nav > p { font-size: 13px; margin: 8px 0; }
.practice-feedback { margin: 0; }
.practice-feedback:empty { display: none; }
.practice-feedback .answer-status { margin-top: 0; }
.practice-feedback.is-correct .answer-status { color: #8be2bd; }
.practice-feedback.is-incorrect .answer-status { color: #f0abb5; }
.practice-feedback details { padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.practice-feedback details summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-weight: 600; }
.exam-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; } .exam-settings { margin-top: 18px; color: var(--muted); font-size: 14px; }
.exam-settings summary { cursor: pointer; }
.exam-settings .btn { margin-top: 12px; }
@media (max-width: 850px) { .exam-workspace.has-feedback { grid-template-columns: minmax(0, 1fr); } .exam-question, .practice-feedback:not(:empty) { padding: 18px; } }
@media (max-width: 520px) { .exam-controls .question-picker { order: 3; width: 100%; } .question-picker select { flex: 1; max-width: 100%; } .exam-progress { align-items: start; flex-direction: column; gap: 8px; } .exam-progress progress { flex: none; width: 100%; } }
a.course-card { color: var(--text); text-decoration: none; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
a.course-card h2, a.course-card h3 { color: var(--green); }
a.course-card:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; box-shadow: 0 0 20px #5cecff20; }
@media (hover: hover) and (pointer: fine) { a.course-card:hover { transform: translateY(-3px); border-color: #5cecff88; box-shadow: 0 10px 28px #061d2d88, 0 0 18px #5cecff18; } }
@media (prefers-reduced-motion: reduce) { a.course-card { transition: none; } a.course-card:hover { transform: none; } }
html[data-reduce-motion="1"] a.course-card { transition: none; transform: none; }
body.structured-course .model-limits { display: none; }
.outline-step-group h2 { padding: 10px 12px 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.outline-step-group button.outline-link { width: 100%; }
.qiskit-code-pane { padding: 20px; }
.qiskit-code-pane .practice-code { margin: 0 0 20px; }
.structured-course .choice { min-width: 0; }
.structured-course .choice > div { min-width: 0; flex: 1; }
.structured-course .choice p { margin: 0; }
.structured-course .choice .practice-code { margin: 0; }
.structured-course .choice .practice-code > .study-note { display: none; }
.lesson-feedback h2 { margin-bottom: 8px; font-size: 16px; }
.question-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 4px; margin: 16px 0 20px; }
.question-number { aspect-ratio: 1; min-width: 24px; min-height: 28px; display: grid; place-items: center; padding: 0; font: inherit; font-size: 13px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; border-radius: 0; }
.question-number:hover { border-color: var(--green); }
.question-number.is-current { outline: 2px solid var(--green); outline-offset: 1px; }
.question-number.is-correct { background: var(--correct-bg, #0d2a21); border-color: var(--correct-border, #49b78b); }
.question-number.is-incorrect { background: var(--incorrect-bg, #351e28); border-color: var(--incorrect-border, #e3939c); }
.question-number.is-flagged { box-shadow: inset 0 -3px var(--green); }
.exam-clock { display: flex; align-items: center; gap: 10px; }
.exam-time { font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; } .exam-timer-status { padding: 12px 16px; border: 1px solid var(--border); background: var(--raised); }
.exam-assumptions { padding: 12px 16px; border-left: 2px solid var(--border-strong); background: var(--sunken); }
.exam-assumptions h3 { font-size: 14px; margin: 0 0 6px; } .exam-assumptions p { margin: 0; line-height: 1.6; }
.source-records { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.source-records h3 { margin-top: 0; }
.validation-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; }
.validation-facts dt { color: var(--muted); }
.validation-facts dd { margin: 0; overflow-wrap: anywhere; }
.exam-version { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.exam-version dd { margin: 0 14px 0 0; }
.exam-paused fieldset { opacity: .65; }

@supports (interpolate-size: allow-keywords) {
  .faq details, .chapter-card { interpolate-size: allow-keywords; }
  .faq details::details-content, .chapter-card::details-content {
    block-size: 0; opacity: 0; overflow: clip;
    transition: block-size 180ms ease, opacity 180ms ease, content-visibility 180ms allow-discrete;
  }
  .faq details[open]::details-content, .chapter-card[open]::details-content { block-size: auto; opacity: 1; }
}
@supports not (interpolate-size: allow-keywords) {
  .faq details[open] > :not(summary), .chapter-card[open] > .lesson-list { animation: disclosure-open 180ms ease; }
}
@keyframes disclosure-open { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .faq details::details-content, .chapter-card::details-content { transition: none; }
  .faq details[open] > :not(summary), .chapter-card[open] > .lesson-list { animation: none; }
}
html[data-reduce-motion="1"] .faq details::details-content, html[data-reduce-motion="1"] .chapter-card::details-content { transition: none; }
html[data-reduce-motion="1"] .faq details[open] > :not(summary), html[data-reduce-motion="1"] .chapter-card[open] > .lesson-list { animation: none; }

.study-course-switcher { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 24px; padding: 4px; border-bottom: 1px solid var(--border); }
.study-course-switcher a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; text-decoration: none; color: var(--muted); border-radius: 6px; }
.study-course-switcher a[aria-current=page] { background: var(--raised); color: var(--green); }
.study-exams-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; }
.study-exams-table th, .study-exams-table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
.study-exams-table thead th { color: var(--muted); font-weight: 500; }
.study-exams-table tbody th { font-weight: 500; }
.study-exams-table a { text-decoration: none; }

a.bank-title { text-decoration: none; }

#reward-notices { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; width: min(24rem, calc(100vw - 2rem)); max-height: 60vh; overflow: auto; }
.reward-toast { padding: 1rem; margin-top: .5rem; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); }

.plan-comparison-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.plan-comparison { width: 100%; min-width: 500px; border-collapse: collapse; text-align: left; }
.plan-comparison th, .plan-comparison td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.5; }
.plan-comparison thead { background: var(--raised); }
.plan-comparison tbody th { font-weight: 550; }
.plan-comparison tbody tr:last-child > * { border-bottom: 0; }

.course-card-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.course-card-logo { display: block; flex: none; width: 80px; height: 80px; object-fit: contain; }
.course-card-heading h2, .course-card-heading h3 { min-width: 0; }

#view-study .reward-panel { margin: 0 0 18px; display: grid; gap: 12px; }
#view-study .reward-panel h2 { margin-bottom: 0; }
.reward-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.reward-stat { display: grid; gap: 4px; padding: 10px 12px; background: var(--sunken); border: 1px solid var(--border); border-radius: 6px; }
.reward-stat > span { color: var(--muted); font-size: 13px; }
.reward-stat > strong { font-size: 17px; }
.achievement-collection { display: grid; gap: 10px; }
.achievement-collection > p { margin: 0; }
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.achievement-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); align-content: start; }
.achievement-card.is-earned { border-color: var(--green); }
.achievement-card > svg { width: 32px; height: 32px; }
#view-study .achievement-card h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.4; }
#view-study .achievement-card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.achievement-bonus { display: inline-block; margin-top: 5px; font-size: 13px; color: var(--green); }
.achievement-more > summary, .reward-rules > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.achievement-more[open] > summary { margin-bottom: 10px; }
.reward-rules p { font-size: 13px; line-height: 1.5; }
@media (min-width: 1100px) {
  .study-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-primary > .study-section:first-child, .study-primary > .study-section:has(table) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement-card { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .reward-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.topnav #account-button { min-height: auto; padding: 6px 12px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; }
.topnav #account-button:hover { color: var(--text); background: var(--raised); }
.mobile-main-menu [data-account-trigger] { padding: 12px; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; }

.saved-experiments-scroll { overflow-x: auto; max-width: 100%; }
.saved-experiments-table { width: 100%; min-width: 620px; border-collapse: collapse; text-align: left; font-size: 13px; }
.saved-experiments-table th, .saved-experiments-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.saved-experiments-table thead { background: var(--raised); }
.saved-experiments-table tbody th { font-weight: 600; min-width: 110px; }
.saved-experiments-table tr:last-child > td, .saved-experiments-table tbody tr:last-child > th { border-bottom: 0; }
.saved-experiment-date { min-width: 105px; color: var(--muted); }
.saved-experiment-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: start; }
.saved-experiment-actions .btn { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.saved-experiment-actions select { width: 120px; }
.saved-result-summary p { margin: 0 0 6px; }
.saved-result-summary details > summary { cursor: pointer; color: var(--green); }

.topnav #reward-level { display: inline-flex; align-items: center; flex: none; white-space: nowrap; margin: 0 0 0 8px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); font-size: 13px; }

body[data-plan="pro"] a[href="/pricing"]:not([data-footer-pricing]), body[data-plan="checking"] a[href="/pricing"]:not([data-footer-pricing]), body[data-plan="unknown"] a[href="/pricing"]:not([data-footer-pricing]) { display: none; }

.course-card-description { flex: 1; }
.course-card-details { margin-top: auto; display: grid; align-content: end; gap: 8px; }
.course-card-progress { align-self: end; display: grid; gap: 6px; }
.course-card-progress progress { display: block; width: 100%; }
@supports (grid-template-rows: subgrid) {
  .course-card { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 10px; }
  .course-card-details { margin-top: 0; }
}

.exam-clock { flex-wrap: wrap; max-width: 100%; }

@media (max-width: 480px) {
  #view-study a, #view-study button, #view-study summary { min-height: 44px; }
  #view-study a { display: inline-flex; align-items: center; }
  .study-course-list li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #view-study .study-table td { vertical-align: middle; }
}

.pricing-load-error { position: static; padding: 16px; margin: 16px 0; border: 1px solid var(--border-strong); background: var(--panel); }
.pricing-load-error .btn { min-height: 44px; }

/* My study, one column. The page reads top to bottom: title, course tabs, the hero with the next exercise and the progress, then the sections. */
#view-study:has(.study-page) { max-width: 1080px; }
.study-page { display: grid; gap: 20px; }
.study-page .study-header { margin: 0; align-items: center; }
.study-page .study-header > div { display: grid; gap: 6px; }
.study-back { font-size: 14px; color: var(--muted); text-decoration: none; }
.study-back::before { content: '‹ '; }
.study-back:hover { color: var(--green); text-decoration: underline; }
.study-page .study-course-switcher { margin: 0; padding: 0 0 4px; gap: 4px; }
.study-page .study-course-switcher a { border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; }
.study-page .study-course-switcher a[aria-current=page] { background: transparent; border-bottom-color: var(--green); color: var(--text); }
.study-page .study-primary { gap: 20px; }
.study-page .study-notice:not(:empty) { margin: 0; padding: 14px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); }
#view-study .study-page .study-section { padding: 22px 24px; }
#view-study .study-page .study-section > h2 { margin-bottom: 14px; font-size: 17px; }
#view-study .study-page .study-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; padding: 26px 28px; }
.study-hero-main, .study-hero-side { display: grid; align-content: start; gap: 6px; min-width: 0; }
#view-study .study-hero h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
#view-study .study-hero h3 { margin: 2px 0 6px; font-size: 26px; line-height: 1.2; }
.study-hero-side { padding-left: 24px; border-left: 1px solid var(--border); }
.study-hero-side .study-progress-count { margin: 0; }
.study-hero-side progress { height: 8px; margin-top: 4px; }
.study-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.study-unit-grid .study-resume { padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--sunken); }
.study-unit-grid .study-resume h3 { margin: 0; font-size: 16px; }
.study-unit-grid .study-resume progress { width: 100%; height: 6px; }
/* Rewards as one strip: plain figures with dividers instead of five boxes. */
#view-study .study-page .reward-panel { gap: 14px; }
.study-page .reward-stats { display: flex; flex-wrap: wrap; gap: 0; }
.study-page .reward-stat { flex: 1 1 120px; gap: 2px; padding: 4px 18px 4px 0; margin-right: 18px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; }
.study-page .reward-stat:last-child { border-right: 0; margin-right: 0; }
.study-page .reward-stat > strong { font-size: 22px; }
.study-page .reward-panel > .study-note { margin: 0; }
.study-page .achievement-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.study-page .study-settings { gap: 20px; }
.study-page .study-settings .class-card { margin: 0 0 12px; }
.study-page .study-settings .study-email-schedule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 420px; }
@media (max-width: 760px) {
  #view-study .study-page .study-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; }
  .study-hero-side { padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--border); }
  #view-study .study-hero h3 { font-size: 22px; }
  .study-page .study-course-switcher { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
  .study-page .study-course-switcher a { white-space: nowrap; }
  .study-page .reward-stat { flex-basis: 45%; margin-right: 0; padding: 6px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .study-page .study-settings .study-email-schedule { grid-template-columns: minmax(0, 1fr); }
}
.study-page .study-primary { grid-template-columns: minmax(0, 1fr); }
.study-page .study-primary > .study-section { grid-column: auto; }
#view-study:has(.study-settings) { max-width: 820px; }
.study-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .study-trio { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Account pages (verify, reset, confirm, Google return): one card with a full-width field and a left-aligned button. */
#view-account-page { max-width: 640px; }
#view-account-page h1 { margin-bottom: 6px; }
#view-account-page .account-page-card { margin-top: 16px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
#view-account-page .account-form { display: grid; gap: 14px; }
#view-account-page .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
#view-account-page .field input { width: 100%; min-height: 44px; box-sizing: border-box; }
#view-account-page .account-form .btn { justify-self: start; min-width: 120px; }
#view-account-page [role=status] { margin-top: 16px; }

/* Team card and Enterprise row on Pricing; the Team page. */
.plan-enterprise { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-top: 24px; padding: 22px 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); }
.plan-enterprise h2 { margin: 0 0 6px; font-size: 22px; }
.plan-enterprise p { margin: 0; color: var(--muted); max-width: 70ch; }
.team-seat-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.team-seat-row .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; min-width: 120px; }
.team-seat-row .field input { min-height: 44px; }
.study-settings textarea { width: 100%; min-height: 72px; box-sizing: border-box; }
@media (max-width: 760px) { .plan-enterprise { grid-template-columns: minmax(0, 1fr); } .plan-enterprise .btn { justify-self: start; } }

/* The access table keeps its columns readable and scrolls inside its region on a narrow screen. */
.plan-comparison-scroll { overflow-x: auto; max-width: 100%; }
.plan-comparison { min-width: 680px; }
@media (max-width: 760px) { .plan-comparison-scroll { background: linear-gradient(to left, rgba(92, 236, 255, .18), transparent 24px) right / 24px 100% no-repeat; } }

/* New-team flow: a three-step strip and the setup form. */
.team-steps { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.team-steps li { display: inline-flex; align-items: center; gap: 8px; }
.team-steps .is-current { color: var(--text); font-weight: 600; }
.team-steps .is-done { color: var(--green); }
.team-step-number { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 13px; }
.team-steps .is-current .team-step-number { border-color: var(--green); background: var(--green); color: #06080f; }
.team-steps .is-done .team-step-number { border-color: var(--green); }
.study-settings .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: 0 0 4px; }
.study-settings .field input { min-height: 44px; }
#view-study .team-seats-field input { width: 160px; max-width: 160px; }
.team-total { margin: 12px 0 4px; font-weight: 600; }
.team-next-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: #d7e2fa; }

/* Pro badge: a small gem beside an item that Pro includes. A Pro account, and the owner, see no badge. */
.pro-badge { display: inline-flex; align-items: center; flex: none; margin-left: 6px; vertical-align: middle; }
.pro-badge img { display: block; width: 20px; height: 20px; filter: drop-shadow(0 0 4px rgba(92, 236, 255, .35)); }
.lesson-title .pro-badge, .bank-title .pro-badge { margin-left: 8px; }
.outline-lesson > summary .pro-badge img { width: 16px; height: 16px; }
.pro-mark { display: inline-flex; align-items: center; margin-right: 8px; vertical-align: -6px; }
.pro-mark img { display: block; width: 28px; height: 28px; }
body[data-plan="pro"] .pro-badge { display: none; }
/* The Pro offer for a free account, shown once after each sign-in. */
.pro-offer { width: min(520px, calc(100% - 32px)); }
.pro-offer .account-dialog-body { gap: 16px; }
.pro-offer-head { display: flex; align-items: center; gap: 14px; }
.pro-offer-head img { width: 64px; height: 64px; flex: none; }
.pro-offer-head h2 { margin: 0; font-size: 24px; }
.pro-offer-price { margin: 0; color: var(--muted); }
.pro-offer .plan-list { padding-top: 14px; }
.pro-offer .account-secondary-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 440px) { .pro-offer .account-secondary-actions { grid-template-columns: minmax(0, 1fr); } }
#pro-offer-title:focus, #access-title:focus { outline: none; }
.hero > .course-framing, .hero > .course-exam { margin-top: 20px; padding: 12px 16px; border: 1px solid var(--border); background: var(--panel); }
.hero > .course-framing > summary, .hero > .course-exam > summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: 16px; font-weight: 600; }
.hero > .course-exam[open] > h3 { margin: 16px 0 12px; font-size: 20px; }

.practice-question-figure { margin: 20px 0; min-width: 0; }
.practice-chart-values { padding: 12px; border: 1px solid var(--border); }
.practice-chart-values table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px; }
.practice-chart-values :is(th, td) { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; }
.practice-chart-values caption { text-align: left; margin-bottom: 8px; }
