/* Clear location and lightweight problem selection across learner pages.
   Loaded after existing page styles. The modal fills the right edge on desktop
   and the screen on phones; the underlying dialogue stays mounted and untouched. */
.learner-header { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.learner-header nav, .practice-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.learner-header nav { margin-left: auto; }
.learner-header nav a, .practice-links a, .practice-links button { color: var(--muted); text-decoration: none; }
.learner-header [aria-current="page"], .practice-links [aria-current="page"] { color: var(--teal-strong); font-weight: 650; border-bottom: 2px solid var(--teal-strong); padding-bottom: 5px; }
.practice-links button { background: transparent; border: 0; font: inherit; padding: 8px 0; color: var(--teal-strong); cursor: pointer; }
/* Problems opens the drawer in place. Its outlined button differs from the
   adjacent library link, which intentionally opens the separate catalogue. */
.practice-links .practice-problems { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--teal-line); border-radius: 8px; background: var(--surface); font-weight: 600; }
.practice-links .practice-problems:hover { background: var(--teal-soft); }
/* Only the separators are subdued. Subject/topic are readable, real links;
   the current problem wraps naturally instead of overflowing a small screen. */
.practice-breadcrumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 9px; order: 5; flex-basis: 100%; min-width: 0; margin: 0; color: var(--ink); font-size: 12px; line-height: 1.6; }
.practice-breadcrumb a { color: var(--teal-strong); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.practice-breadcrumb a:hover { color: var(--teal-hover); }
.practice-breadcrumb .breadcrumb-separator { color: var(--muted); }
.practice-breadcrumb strong { min-width: 0; font-weight: 550; overflow-wrap: anywhere; }
.practice-header .account-menu { margin-left: 0; }
.practice-links { margin-left: auto; }
/* Account details are discoverable without a row of competing actions. */
.account-menu.account-dropdown { position: relative; display: block; margin: 0; padding: 0; font-size: 13px; }
.account-dropdown summary { cursor: pointer; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.account-dropdown-content { position: absolute; z-index: 20; top: 100%; right: 0; min-width: 230px; max-width: min(320px, 85vw); padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 30px #26232118; }
.account-dropdown-content p { overflow-wrap: anywhere; margin-top: 0; }
.account-dropdown-content a, .account-dropdown-content button { display: block; min-height: 44px; padding: 10px 0; }
.account-dropdown-content a { color: var(--teal-strong); }
.account-dropdown-content form { margin: 0; }
.account-dropdown-content button { width: 100%; padding-inline: 12px; font: inherit; text-align: left; }
/* Every keyboard target is visible against the cream background. Native details
   still handles expanding/collapsing and submitting sign-out without scripting. */
.account-dropdown summary:focus-visible, .practice-header a:focus-visible, .practice-problems:focus-visible, .change-problem:focus-visible, .browser-library-link:focus-visible { outline: 2px solid var(--teal-strong); outline-offset: 4px; }
/* The beginning is one choice, with an optional shortcut back to existing work. */
.start-main { width: min(1120px, calc(100% - 40px)); margin: 55px auto; }
.start-main h1 { font-family: Georgia, serif; font-size: clamp(32px, 4vw, 52px); font-weight: 400; margin: 12px 0; }
.start-intro { color: var(--muted); line-height: 1.7; }
.subject-choices { display: flex; gap: 12px; margin: 30px 0 22px; flex-wrap: wrap; }
.subject-choices a { flex: 1; min-width: 170px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 600; }
.subject-choices span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 400; }
.subject-choices .subject-background { font-size: 14px; line-height: 1.6; margin-top: 18px; }
.subject-choices .subject-action { color: var(--teal-strong); margin-top: 20px; }
.subject-choices [aria-current] { border-color: var(--teal-strong); background: var(--teal-soft); }
.starter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 20px; }
.starter-card { background: var(--surface); border: 1px solid var(--line); padding: 28px; border-radius: 12px; }
.starter-card h2, .starter-card h3 { font-family: Georgia, serif; font-weight: 400; }
.starter-problem { margin: 24px 0; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.65; }
.starter-card .text-button { display: inline-block; margin-top: 18px; }
.resume-card, .library-start { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 20px; margin: 24px 0; background: var(--teal-soft); border-radius: 10px; }
.resume-card > div, .library-start > div { flex: 1; }
.resume-card h2, .library-start p { margin: 6px 0 0; }
.progress-tabs { display: flex; gap: 20px; flex-wrap: wrap; margin: 12px 0 28px; }
.progress-tabs [aria-current] { font-weight: 650; color: var(--teal-strong); }
/* Give conversation more vertical space, without removing rich mathematics. */
.composer-formatting { border-top: 1px solid var(--line); }
.composer-formatting > summary { font-size: 12px; cursor: pointer; color: var(--teal-strong); padding: 7px 12px; }
.practice-page .composer-hint { font-size: 10px; }
.practice-page .editor-status:empty { display: none; }
/* Keep the main task visible behind the drawer and all controls keyboard usable. */
.practice-page .problem-browser { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(540px, 96vw); height: 100dvh; max-height: 100dvh; max-width: none; padding: 24px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); overflow-y: auto; }
.problem-browser::backdrop { background: #26232145; }
.problem-browser-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.problem-browser-heading h2 { margin: 8px 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.browser-close { position: static; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 25px; }
.browser-help { font-size: 13px; line-height: 1.6; color: var(--muted); }
/* The library shortcut precedes results so a long list never hides it. */
.browser-library-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 44px; padding: 11px 13px; color: var(--teal-strong); background: var(--teal-soft); border: 1px solid var(--teal-line); border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; }
.browser-library-link:hover { border-color: var(--teal-strong); text-decoration: underline; text-underline-offset: 3px; }
.browser-filters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; padding: 16px 0; }
.browser-filters label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.browser-search { grid-column: 1/-1; }
.browser-filters input, .browser-filters select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: inherit; }
.browser-problem { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 17px; }
.browser-current { border: 1px solid var(--teal-strong); background: var(--teal-soft); padding: 17px; border-radius: 10px; }
.browser-problem-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--muted); }
.browser-problem h3 { font-family: Georgia, serif; font-weight: 400; margin: 12px 0 8px; font-size: 22px; }
.browser-problem-status { font-size: 12px; color: var(--teal-strong); }
.browser-problem details { font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.browser-problem summary { cursor: pointer; color: var(--teal-strong); }
.browser-problem .primary-button { padding: 10px 14px; font-size: 12px; }
.browser-error { color: #8c3045; border: 1px solid #bd506866; background: #bd506810; padding: 12px; border-radius: 8px; }
.browser-footer { display: flex; flex-direction: column; gap: 12px; font-size: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.browser-footer span { font-size: 11px; color: var(--muted); }
@media (max-width: 650px) {
  .learner-header { gap: 12px; padding: 14px 18px; }
  .learner-header nav { margin: 0; order: 3; flex-basis: 100%; }
  .learner-header .account-menu { margin-left: auto; }
  .practice-header .account-menu { width: auto; }
  .practice-links { gap: 12px; font-size: 12px; }
  .practice-breadcrumb { font-size: 12px; gap: 3px 7px; }
  .practice-page .problem-browser { width: 100vw; padding: 18px; }
  .browser-filters { grid-template-columns: 1fr 1fr; }
  .browser-filters label:last-child { grid-column: 1/-1; }
  .start-main { margin-top: 28px; }
}

/* Advanced catalogue filters are optional; active filters reopen on the server. */
.library-extra-filters { align-self: center; min-width: 230px; }
.library-extra-filters summary { cursor: pointer; color: var(--teal-strong); padding: 10px 0; font-size: 13px; }
.library-extra-filters > div { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
.library-extra-filters label { min-width: 130px; }

/* Drawer fields use compact spacing instead of the full-page form margins. */
.problem-browser .browser-filters { margin: 12px 0; }
.problem-browser .browser-filters label { margin: 0; }
.problem-browser .browser-help { margin: 12px 0; }
