#study {
  min-height: 100vh;
  background: var(--app-bg);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--app-text);
}
#study * {
  box-sizing: border-box;
}
#study a:focus-visible,
#study button:focus-visible,
#study input:focus-visible {
  outline: 3px solid var(--app-accent);
  outline-offset: 4px;
}
#study button,
#study input {
  font: inherit;
}
#study button {
  cursor: pointer;
}
#study button:disabled {
  cursor: default;
  opacity: 0.65;
}
.study-top {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--app-separator);
  background: var(--app-bg);
}
.study-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 750;
}
.study-brand span {
  font-weight: 400;
  color: var(--app-secondary);
  font-size: 0.875rem;
}
.study-top > a:last-child {
  padding: 12px;
}
#study-nav {
  position: fixed;
  top: 108px;
  left: 24px;
  width: 180px;
  display: grid;
  gap: 8px;
}
#study-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  text-decoration: none;
  border-radius: 14px;
  color: var(--app-secondary);
  font-weight: 650;
}
#study-nav a span {
  font-size: 1.5625rem;
}
#study-nav a[aria-current="page"] {
  background: var(--app-accent-soft);
  color: var(--app-accent-text);
}
#study-root {
  margin-left: 220px;
  padding: 44px 28px 80px;
}
#study .shell {
  width: 100%;
  max-width: 1000px;
  margin: auto;
  padding: 0;
}
#study .narrow,
#study .lesson-reader {
  max-width: 720px;
}
#study .section {
  padding: 0;
}
#study h1 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 10px 0 16px;
}
#study h2 {
  font-size: 1.5625rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 12px 0;
}
#study h3 {
  font-size: 1.25rem;
  margin: 0;
}
#study p {
  margin: 10px 0 18px;
}
#study .eyebrow {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  color: var(--app-secondary);
}
.study-subtitle {
  color: var(--app-secondary);
  margin-bottom: 30px !important;
}
#study .today-card {
  background: var(--app-surface);
  border: 1px solid var(--app-separator);
  border-radius: 24px;
  padding: 30px;
  margin: 26px 0;
}
.today-card > img {
  float: right;
}
#study .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--app-separator);
  border-radius: 13px;
  background: var(--app-surface);
  color: var(--app-accent-text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  gap: 8px;
}
#study .button.primary {
  background: var(--app-accent);
  color: var(--app-on-accent);
  border-color: var(--app-accent);
}
#study .text-link {
  border: 0;
  background: none;
  color: var(--app-accent-text);
  min-height: 44px;
  padding: 8px 0;
}
#study .card {
  padding: 24px;
  background: var(--app-surface);
  border: 1px solid var(--app-separator);
  border-radius: 20px;
  box-shadow: none;
  margin-bottom: 14px;
}
#study .subject-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.subject-card {
  text-decoration: none;
}
.study-stats {
  display: flex;
  gap: 30px;
  padding: 8px 0 26px;
  color: var(--app-secondary);
}
.study-stats strong {
  font-size: 1.75rem;
  display: block;
  color: var(--app-text);
}
.route-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}
.route-list li {
  padding: 24px 0;
  border-top: 1px solid var(--app-separator);
}
.route-list p {
  color: var(--app-secondary);
}
.lesson-rows {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
#study .lesson-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  background: var(--app-surface);
  border: 1px solid var(--app-separator);
  border-radius: 15px;
  padding: 20px;
  text-decoration: none;
}
.concept-path {
  list-style: none;
  padding: 0;
}
.concept-path li {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--app-separator);
}
.path-number {
  background: var(--app-accent-soft);
  border-radius: 50%;
  min-width: 40px;
  height: 40px;
  text-align: center;
  padding-top: 6px;
  color: var(--app-accent-text);
  font-weight: 700;
}
#study .lesson-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}
#study progress {
  display: block;
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 10px;
  accent-color: var(--app-accent);
  margin: 15px 0 25px;
}
#study progress::-webkit-progress-bar {
  background: var(--app-track);
  border-radius: 10px;
}
#study progress::-webkit-progress-value {
  background: var(--app-accent);
  border-radius: 10px;
}
.lesson-stage {
  background: var(--app-surface);
  border: 1px solid var(--app-separator);
  padding: 30px;
  border-radius: 22px;
  margin-top: 28px;
  min-height: 240px;
}
.lesson-prose {
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-size: 1.1875rem;
  line-height: 1.75;
}
.lesson-prose p:last-child {
  margin-bottom: 0 !important;
}
#study .options {
  display: grid;
  gap: 12px;
  margin: 24px 0 10px;
}
#study .option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--app-separator);
  background: var(--app-surface);
  border-radius: 14px;
  padding: 16px;
  color: var(--app-text);
  min-height: 56px;
}
#study .option.chosen {
  border: 2px solid var(--app-accent);
  background: var(--app-accent-soft);
  opacity: 1;
}
#study .option:disabled {
  opacity: 1;
}
.option-key {
  font-weight: 700;
  color: var(--app-accent);
}
.lesson-feedback:empty {
  display: none;
}
.lesson-feedback {
  background: var(--app-accent-soft);
  padding: 20px;
  border-radius: 14px;
  margin-top: 22px;
}
.lesson-feedback .lesson-prose {
  font-size: 1rem;
}
.lesson-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
}
.save-note {
  font-size: 0.8125rem;
  color: var(--app-secondary);
}
.worked-step {
  border-left: 3px solid var(--app-accent);
  padding-left: 20px;
  margin: 24px 0;
}
.graph-bars {
  display: grid;
  gap: 12px;
}
.graph-bars > div {
  background: var(--app-accent-soft);
  padding: 12px;
}
.answer-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--app-separator);
  border-radius: 12px;
  margin: 14px 0;
}
#study .auth {
  display: grid;
  gap: 16px;
  max-width: 500px;
}
#study .auth label {
  display: grid;
  gap: 6px;
}
#study .auth input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--app-separator);
  border-radius: 10px;
  background: var(--app-surface);
}
#study .account-actions,
#study .next {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
#study .muted {
  color: var(--app-secondary);
}
#study .check {
  display: flex;
  gap: 10px;
}
#study .misses {
  display: grid;
  gap: 18px;
}
#study .run-meta {
  display: flex;
  justify-content: space-between;
}
#study .stem {
  font-size: 1.5rem;
}
#study .quality {
  font-size: 0.8125rem;
  color: var(--app-secondary);
}
#study .lesson-stage ul {
  padding-left: 22px;
}
#study .lesson-stage li {
  margin-bottom: 12px;
}
#study-nav:empty {
  display: none;
}
body:has(#study-nav:empty) #study-root {
  margin-left: 0;
}
@media (max-width: 760px) {
  .study-top {
    height: 64px;
    padding: 0 18px;
  }
  .study-brand span {
    display: none;
  }
  #study-root {
    margin-left: 0;
    padding: 28px 18px 110px;
  }
  #study-nav {
    z-index: 30;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    background: var(--app-surface);
    border-top: 1px solid var(--app-separator);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  #study-nav a {
    flex-direction: column;
    gap: 0;
    padding: 6px 0;
    font-size: 0.75rem;
    border-radius: 10px;
  }
  #study-nav a span {
    font-size: 1.375rem;
  }
  #study .subject-list {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  #study .subject-card {
    padding: 17px;
  }
  #study .subject-card h2 {
    font-size: 1.3125rem;
  }
  #study .subject-card p {
    font-size: 0.875rem;
  }
  #study .today-card {
    padding: 24px;
  }
  #study .lesson-stage {
    padding: 22px 18px;
  }
  .lesson-prose {
    font-size: 1.125rem;
  }
  .lesson-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .lesson-controls .save-note {
    margin: 0 !important;
    text-align: center;
  }
  .study-stats {
    gap: 20px;
    font-size: 0.875rem;
  }
  #study .lesson-row {
    padding: 18px;
    font-size: 0.9375rem;
  }
  #study .lesson-reader h1 {
    font-size: 1.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  #study * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
.lesson-graph {
  margin: 24px 0;
}
.lesson-graph svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--app-surface-2);
  border-radius: 14px;
}
.lesson-graph figcaption {
  font-size: 0.875rem;
  margin-top: 12px;
  color: var(--app-secondary);
}
.visual-model {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--app-accent-soft);
  padding: 24px;
  border-radius: 14px;
  font-size: 1.3125rem;
  line-height: 2;
  text-align: center;
}
.contrast-rows p {
  padding: 14px;
  background: var(--app-surface-2);
  border-radius: 10px;
}
#study summary {
  cursor: pointer;
  font-weight: 650;
  min-height: 44px;
}
#study .miss[open] summary {
  margin-bottom: 20px;
}
#study .option {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: auto;
  align-items: center;
  line-height: 1.5;
}
#study .option-key {
  flex: 0 0 22px;
}
#study .option-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
#study .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}
#study .curriculum {
  margin-top: 28px;
  border-top: 1px solid var(--app-separator);
  padding-top: 22px;
}
#study h1:focus,
#study h2:focus {
  outline: none;
}
#study .option .lesson-prose {
  font-size: inherit;
  line-height: inherit;
  white-space: normal;
}
#study .option .lesson-prose p {
  margin: 0;
}

/* Shared app shell: chrome floats; reading surfaces stay opaque. */
body:has(#study) { background:var(--app-bg, #f5f4f0); }
#study { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; line-height:1.5; min-height:100dvh; }
#study input, #study textarea, #study select {color:var(--app-text);background:var(--app-surface-2);}
#study a {color:var(--app-accent-text);}
#study a:focus-visible,#study button:focus-visible,#study input:focus-visible,#study summary:focus-visible {outline:3px solid var(--app-accent);outline-offset:4px;}
#study .study-top {height:76px;border:0;padding:0 32px;position:relative;}
#study .study-brand {color:var(--app-text);}
#study .study-brand span {font-size:1.125rem;font-weight:700;color:inherit;}
#study-section-title {display:none;}
#study .app-icon {width:28px;height:28px;flex-shrink:0;}
#study .app-icon-button {display:inline-flex;align-items:center;justify-content:center;width:48px;min-height:48px;padding:10px;border:1px solid var(--app-separator);border-radius:50%;background:var(--app-surface);color:var(--app-accent-text);cursor:pointer;}
#study:not([data-signed-in]) .study-account {visibility:hidden;}
#study-nav {top:104px;left:24px;width:192px;gap:8px;z-index:30;}
#study-nav a {color:var(--app-text);min-height:56px;border-radius:var(--radius-pill);gap:12px;padding:12px 16px;}
#study-nav a span {font-size:1rem;}
#study-nav a[aria-current="page"] {background:var(--app-selected);color:var(--app-accent-text);}
#study-root {margin-left:232px;padding:24px 40px 80px;}
#study .shell {max-width:960px;}
#study .narrow,#study .lesson-reader {max-width:680px;}
#study h1 {font-size:clamp(2.125rem,3.5vw,2.75rem);font-weight:750;margin:12px 0 12px;}
#study h2 {font-size:1.375rem;} #study h3 {font-size:1.125rem;}
#study .study-subtitle {font-size:1.0625rem;margin-bottom:32px!important;max-width:64ch;}
#study .card,#study .today-card {border:0;border-radius:var(--radius-card);padding:24px;}
#study .subject-card {border:1px solid color-mix(in srgb,var(--subject,var(--app-separator)) 32%,transparent);}
#study .subject-card h2 {color:var(--subject,var(--app-text));}
#study .button {min-height:var(--hit-standard);border-radius:var(--radius-embedded);font-size:1.0625rem;white-space:normal;text-align:center;}
#study .button.primary {color:var(--app-on-accent);}
#study .option {min-height:var(--hit-answer);border-radius:var(--radius-embedded);}
#study .lesson-row {min-height:var(--hit-row);border-radius:var(--radius-card);}
#study .lesson-row>* {min-width:0;} #study .lesson-row strong {overflow-wrap:anywhere;}
#study .app-empty-state {text-align:center;padding:48px 24px;max-width:640px;margin:32px auto;}
#study .mito-mark {display:block;margin:0 auto 24px;}
#study .app-empty-state p {color:var(--app-secondary);max-width:40ch;margin:16px auto 24px;}
#study .app-ring {width:80px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--subject,var(--app-accent)) var(--ring-value),var(--app-track) 0);}
#study .app-ring span {width:64px;aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:var(--app-surface);font-weight:700;}
#study .app-sheet {color:var(--app-text);background:var(--app-surface);border:0;border-radius:var(--radius-sheet);padding:24px;width:min(560px,calc(100% - 32px));max-height:85dvh;overflow:auto;}
#study .app-sheet::backdrop {background:rgb(0 0 0/.4);}
#study .app-sheet-header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px;}
@media (hover:hover) {
  #study-nav a:hover {background:var(--app-selected);}
  #study .button:hover {filter:brightness(.94);}
  #study .subject-card:hover {background:var(--app-surface-2);}
}
@media (max-width:760px) {
  #study .study-top {height:64px;padding:8px 16px;}
  #study .study-brand span {display:none;}
  #study-section-title {display:block;font-size:1.0625rem;font-weight:650;position:absolute;left:50%;transform:translateX(-50%);}
  #study .study-account {width:44px;min-height:44px;}
  #study-root {margin-left:0;padding:12px 16px calc(136px + env(safe-area-inset-bottom));}
  #study-nav {top:auto;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;width:auto;max-width:480px;margin:auto;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding:5px;background:var(--app-glass);border:1px solid var(--app-separator);border-radius:var(--radius-pill);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);box-shadow:0 4px 20px rgb(0 0 0/.04);}
  #study-nav a {flex-direction:column;min-width:0;min-height:56px;padding:6px 2px;gap:3px;}
  #study-nav a span {font-size:.6875rem;line-height:1.25;font-weight:600;}
  #study-nav .app-icon {width:25px;height:25px;}
  #study .card,#study .today-card {padding:20px;}
  #study .subject-card h2 {font-size:1.25rem;}
  #study .subject-card p {font-size:.9375rem;}
  #study .app-sheet {margin:auto 0 0;width:100%;max-width:none;border-radius:32px 32px 0 0;padding-bottom:calc(24px + env(safe-area-inset-bottom));}
}
@media (max-width:360px) {
  #study-nav {left:6px;right:6px;}
  #study .subject-list {grid-template-columns:1fr;}
  #study .study-stats {flex-wrap:wrap;}
}
@media (prefers-reduced-motion:reduce) {#study * {animation:none!important;transition:none!important;scroll-behavior:auto!important;}}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more) {#study-nav {background:var(--app-surface);backdrop-filter:none;-webkit-backdrop-filter:none;} #study .card {border:1px solid var(--app-separator);}}
@media (prefers-color-scheme:dark) {body:has(#study) {background:#0a0b0d;}}
#study .subject-card {position:relative;overflow:hidden;isolation:isolate;}
#study .subject-artwork {position:absolute;width:180px;height:180px;right:-8px;bottom:0;color:var(--subject);opacity:.14;z-index:-1;pointer-events:none;}
#study .subject-card p {color:var(--app-secondary);}
html:has(#study) {scroll-behavior:auto;}
#study .subject-list {grid-template-columns:repeat(auto-fit,minmax(min(100%,max(10rem,calc((100% - 18px)/2))),1fr));}
#study .subject-artwork {mask-image:linear-gradient(to right,transparent,#000);-webkit-mask-image:linear-gradient(to right,transparent,#000);}
@media (max-width:760px) {
  #study-nav {grid-template-columns:repeat(auto-fit,minmax(min(100%,3.5rem),1fr));border-radius:32px;}
  #study-nav a span {overflow-wrap:anywhere;text-align:center;}
  #study-root {padding-bottom:calc(8.5rem + env(safe-area-inset-bottom));}
}
@media (max-width:760px) {
  #study .study-top {padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));}
  #study-root {padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right));}
  #study-nav {left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));}
}
/* Test hub: original iOS art, opaque cards and compact practice carousel. */
#study .full-mock-card {padding:16px;margin-top:24px;}
#study .test-hero-art {position:relative;min-height:240px;border-radius:18px;overflow:hidden;isolation:isolate;}
#study .test-hero-art>img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:70% 50%;z-index:-2;}
#study .test-hero-art::before {content:'';position:absolute;inset:0;background:linear-gradient(90deg,var(--app-surface) 5%,color-mix(in srgb,var(--app-surface) 90%,transparent) 32%,transparent 80%);z-index:-1;}
#study .test-hero-copy {padding:24px 16px;max-width:72%;}
#study .test-hero-copy h2 {font-size:1.75rem;margin:12px 0 8px;}
#study .test-hero-copy p {margin:8px 0;font-size:1rem;}
#study .test-badge {display:inline-block;border-radius:999px;padding:4px 12px;font-size:.8125rem;font-weight:700;color:var(--app-accent-text);background:var(--app-accent-soft);}
#study .test-badge-muted {background:var(--app-surface-2);color:var(--app-secondary);}
#study .test-facts {color:var(--app-accent-text);font-weight:650;}
#study .full-mock-card>.muted {margin:18px 0;}
#study .full-mock-card>.button {margin-right:16px;}
#study .test-section-heading {margin:32px 0 16px;}
#study .test-section-heading h2,#study .test-section-heading p {margin:0;}
#study .test-practice-strip {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;}
#study .test-practice-card {display:flex;flex-direction:column;min-width:0;text-decoration:none;color:var(--app-text);padding:12px;margin:0;}
#study .test-practice-card img {width:100%;aspect-ratio:1.5;object-fit:cover;border-radius:16px;margin-bottom:12px;}
#study .test-practice-card p {font-size:1rem;color:var(--app-secondary);margin:8px 0 16px;}
#study .test-card-bottom {display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:auto;}
#study .test-card-bottom>span:last-child {font-size:1.5rem;color:var(--app-secondary);}
#study .test-placement-card {display:grid;grid-template-columns:32% 1fr;gap:20px;align-items:center;}
#study .test-placement-card>img {width:100%;aspect-ratio:1;object-fit:cover;border-radius:16px;}
#study .test-placement-card p {margin:8px 0;}
#study .test-placement-card .button {margin-top:8px;min-height:44px;border-radius:999px;font-size:1rem;}
#study .test-log-card {display:flex;align-items:center;gap:20px;margin:24px 0;}
#study .test-log-card p {margin:0;flex:1;}
#study .test-log-card button {flex-shrink:0;font-weight:650;}
#study .test-history-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;}
#study .test-history-heading h2 {font-size:.8125rem;text-transform:uppercase;letter-spacing:.08em;color:var(--app-secondary);}
#study .test-history-row {display:grid;grid-template-columns:1fr auto;gap:12px;padding:20px 0;border-top:1px solid var(--app-separator);}
#study .test-history-row p {margin:4px 0 0;font-size:.9375rem;}
#study .test-history-row button {grid-column:1/-1;text-align:left;font-weight:650;}
#study .test-result-form {display:grid;gap:16px;}
#study .test-result-form label {display:grid;gap:8px;}
#study .test-result-form input {width:100%;min-height:48px;border:1px solid var(--app-separator);border-radius:12px;padding:12px;}
#study .question-map {display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:8px;}
#study .question-map button {min-height:44px;border-radius:12px;border:1px solid var(--app-separator);background:var(--app-surface);color:var(--app-text);}
#study .question-map button[data-answered] {background:var(--app-accent-soft);border-color:var(--app-accent);}
#study .question-map button[aria-current] {outline:2px solid var(--app-accent);}
@media(max-width:900px){
 #study .test-practice-strip {display:flex;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:12px;}
 #study .test-practice-card {flex:0 0 min(78%,290px);scroll-snap-align:start;}
}
@media(max-width:480px){
 #study .test-hero-copy {max-width:88%;padding:16px 8px;}
 #study .test-hero-art {min-height:220px;}
 #study .test-hero-copy h2 {font-size:1.5rem;}
 #study .test-hero-copy p {max-width:24ch;}
 #study .test-placement-card {grid-template-columns:30% 1fr;gap:12px;padding:16px;}
 #study .test-log-card {flex-wrap:wrap;gap:8px;}
 #study .test-log-card p {flex-basis:100%;}
 #study .test-placement-card .button {padding:8px 12px;}
}
@media(max-width:380px){#study .test-placement-card {grid-template-columns:1fr;}#study .test-placement-card>img {max-height:160px;aspect-ratio:1.8;}}
#study .study-subtitle:empty {display:none;}
#study .test-section-select {display:grid;gap:8px;margin-bottom:20px;font-weight:600;}
#study .test-section-select select {font:inherit;min-height:48px;padding:10px;border:1px solid var(--app-separator);border-radius:12px;}
@media(max-width:480px){
 #study .test-placement-card {grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));}
 #study .test-placement-card>img {max-height:180px;}
}

/* Phase 3: focused purchase screens, using the app's existing semantic tokens. */
#study .purchase-shell{max-width:1060px;margin:0 auto;padding:16px 16px 48px;}
#study .purchase-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:32px;}
#study .purchase-brand{font-weight:650;color:var(--app-secondary);}
#study .purchase-close{min-height:44px;padding:8px 18px;background:var(--app-surface);border-radius:999px;}
#study .purchase-eyebrow{font-size:.8rem;letter-spacing:.09em;font-weight:700;color:var(--app-accent-text);}
#study .purchase-shell h1{font-size:clamp(2rem,4vw,3rem);line-height:1.1;letter-spacing:-.035em;margin:12px 0 20px;}
#study .shop-layout{display:grid;grid-template-columns:1fr 1fr;gap:36px;align-items:start;}
#study .shop-art{width:100%;border-radius:24px;margin-top:20px;aspect-ratio:1.1;object-fit:cover;}
#study .shop-offer{padding:28px;border:1px solid var(--app-accent);}
#study .shop-offer h2{margin:10px 0 20px;font-size:1.65rem;}
#study .shop-price{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;}
#study .shop-price strong,#study .pass-total{font-size:2.8rem;letter-spacing:-.04em;}
#study .shop-price span{color:var(--app-secondary);}
#study .shop-saving{color:var(--app-accent-text);font-weight:650;}
#study .shop-included{list-style:none;padding:8px 0;margin:20px 0;border-block:1px solid var(--app-separator);}
#study .shop-included li{display:flex;justify-content:space-between;gap:16px;padding:10px 0;font-size:.95rem;}
#study .shop-included li span:last-child{color:var(--app-secondary);}
#study .shop-included .owned-label{font-weight:700;}
#study .shop-offer>.button{width:100%;white-space:normal;text-align:center;}
#study .shop-overlap{display:flex;align-items:flex-start;gap:12px;padding:16px 0;line-height:1.5;}
#study .shop-overlap input{flex:0 0 22px;width:22px;height:22px;margin-top:3px;}
#study .shop-singles{margin-top:20px;border:1px solid var(--app-separator);border-radius:22px;padding:16px 20px;background:var(--app-surface);}
#study .shop-singles summary{cursor:pointer;min-height:44px;align-content:center;}
#study .shop-singles summary strong{display:block;color:var(--app-accent-text);}
#study .shop-singles select{width:100%;min-height:52px;color:var(--app-text);background:var(--app-surface-2);border:1px solid var(--app-separator);border-radius:12px;padding:10px;font:inherit;}
#study .single-action{margin-top:16px;}
#study .purchase-status:empty{display:none;}
#study .purchase-status{overflow-wrap:anywhere;}
#study .purchase-trust{max-width:640px;margin:32px auto 0;text-align:center;font-size:.9rem;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 24px;}
#study .purchase-trust p{margin:0 0 8px;}
#study .pass-stage{max-width:680px;margin:0 auto;text-align:center;outline:none;}
#study .pass-stage>p{max-width:520px;margin:14px auto;}
#study .mito-introduction{margin:38px auto 26px;}
#study .mito-speech{display:table;margin:0 auto -15px;background:var(--app-surface);padding:20px 24px;border-radius:24px;font-size:1.2rem;font-weight:600;}
#study .paywall-mito{display:block;width:240px;height:240px;max-width:80%;margin:auto;}
#study .pass-anchor{font-weight:650;}
#study .pass-footer{max-width:520px;margin:32px auto 0;text-align:center;display:flex;align-items:center;flex-direction:column;gap:12px;}
#study .pass-footer>.button{width:min(100%,360px);}
#study .pass-footer>p{margin:0;color:var(--app-secondary);font-size:.9rem;}
#study .purchase-steps{display:flex;justify-content:center;gap:4px;}
#study .purchase-steps button{width:44px;height:44px;border:0;background:transparent;color:var(--app-secondary);cursor:pointer;border-radius:50%;}
#study .purchase-steps button span{display:block;border:1px solid var(--app-separator);border-radius:999px;padding:3px;font:inherit;}
#study .purchase-steps [aria-current] span{background:var(--app-accent);color:var(--app-on-accent);border-color:var(--app-accent);}
#study .pass-demo{padding:24px;text-align:left;margin:28px auto;max-width:480px;}
#study .pass-demo-heading{display:flex;align-items:center;gap:14px;color:var(--app-accent-text);font-size:.85rem;font-weight:650;}
#study .pass-demo-heading .paywall-mito{height:60px;width:60px;margin:0;}
#study .pass-demo h2{font-size:1.4rem;margin:16px 0;}
#study .pass-demo .option{width:100%;}
#study .pass-demo-answer{border-top:1px solid var(--app-separator);margin-top:20px;padding-top:20px;}
#study .pass-demo-caption{font-size:.9rem;color:var(--app-secondary);}
#study .pass-benefits{list-style:none;text-align:left;padding:0;margin:28px auto;max-width:530px;}
#study .pass-benefits li{display:flex;gap:16px;margin:24px 0;}
#study .pass-benefits li p{margin:4px 0 0;}
#study .benefit-check{border-radius:50%;background:var(--app-accent-soft);color:var(--app-accent-text);width:38px;height:38px;flex-shrink:0;display:grid;place-items:center;}
#study .pass-price{padding:24px;max-width:530px;margin:auto;}
#study .pass-price h2{font-size:1.35rem;margin:0 0 12px;}
#study .pass-price p:last-child{font-size:.9rem;}
#study .checkout-actions{display:flex;flex-wrap:wrap;gap:16px;}
@media(max-width:760px){#study .shop-layout{grid-template-columns:1fr;gap:24px;}#study .shop-art{aspect-ratio:2.2;max-height:190px;}#study .shop-intro h1{max-width:14ch;}#study .shop-offer{padding:22px;}#study .purchase-header{margin-bottom:24px;}#study .mito-introduction{margin:24px auto 8px;}}
@media(prefers-reduced-motion:no-preference){#study .mito-introduction .paywall-mito{animation:mito-arrive .45s ease-out both;}@keyframes mito-arrive{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}}
/* Purchasing is a focused temporary flow, dismissed through its own Close action. */
#study:has(.purchase-shell)>.study-top,#study:has(.purchase-shell)>#study-nav{display:none;}
#study:has(.purchase-shell)>#study-root{margin-left:0;padding:0 16px calc(24px + env(safe-area-inset-bottom));}
#study .purchase-header{position:sticky;top:0;z-index:10;padding:12px 0;background:var(--app-bg);}
#study .purchase-shell{padding-top:max(4px,env(safe-area-inset-top));}
#study .shop-offer.card{border:1px solid var(--app-accent);}
#study .pass-footer{padding-bottom:16px;}

/* Today: iOS reference hierarchy, with evidence-backed coverage and activity. */
#study .today-page {position:relative;isolation:isolate;max-width:900px;padding-top:32px;}
#study .today-greeting {margin-bottom:24px;}
#study .today-greeting h1 {font-size:clamp(32px,5vw,46px);line-height:1.14;letter-spacing:-1.2px;margin:16px 0 8px;}
#study .today-plan-edit {text-align:left;font-size:16px;color:var(--app-secondary);font-weight:400;}
#study .today-budget {font-size:13px;color:var(--app-secondary);margin:0;}
#study .today-budget button {font-size:inherit;min-height:44px;}
#study .today-page .card {margin:0 0 24px;}
#study .journey-heading {display:flex;align-items:center;gap:16px;}
#study .journey-heading .app-ring {flex-shrink:0;--subject:var(--subject-biology);width:82px;}
#study .journey-heading .app-ring span {width:66px;}
#study .journey-heading>div:nth-child(2) {flex:1;min-width:0;}
#study .journey-heading h2 {font-size:22px;line-height:1.2;margin:0 0 6px;}
#study .journey-heading p {font-size:15px;color:var(--app-secondary);margin:0;}
#study .today-week {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));list-style:none;gap:8px;padding:0;margin:22px 0;}
#study .today-week li {display:grid;justify-items:center;gap:8px;color:var(--app-secondary);}
#study .today-week abbr {text-decoration:none;font-size:13px;}
#study .today-week li[aria-current] abbr {font-weight:750;color:var(--subject-biology);}
#study .today-week span {border:2px solid var(--app-track);border-radius:50%;width:28px;height:28px;display:grid;place-items:center;font-size:17px;}
#study .today-week span.active {background:var(--subject-biology);border-color:var(--subject-biology);color:var(--app-bg);}
#study .today-next-title {font-size:17px;font-weight:650;line-height:1.4;margin:0 0 6px;}
#study .today-next-reason {color:var(--app-secondary);font-size:14px;margin:0 0 16px;}
#study .today-continue {display:flex;width:100%;justify-content:center;min-height:56px;box-sizing:border-box;}
#study .today-section-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
#study .today-section-heading h2 {font-size:23px;margin:0;}
#study .today-section-heading>a {font-size:15px;white-space:nowrap;min-height:44px;display:flex;align-items:center;}
#study .today-subject-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
#study .today-subject {display:block;position:relative;overflow:hidden;padding:16px;border-radius:22px;background:color-mix(in srgb,var(--subject) 13%,var(--app-bg));color:var(--subject);text-decoration:none;}
#study .today-subject h3 {font-size:18px;color:var(--app-text);margin:40px 0 12px;letter-spacing:-.3px;}
#study .today-subject .subject-artwork {position:absolute;top:0;left:4px;width:66px;height:62px;opacity:.85;}
#study .today-subject progress {display:block;width:100%;height:4px;appearance:none;border:0;border-radius:5px;background:color-mix(in srgb,var(--subject) 20%,transparent);margin-bottom:8px;}
#study .today-subject progress::-webkit-progress-bar {background:color-mix(in srgb,var(--subject) 20%,transparent);border-radius:5px;}
#study .today-subject progress::-webkit-progress-value {background:var(--subject);border-radius:5px;}
#study .today-subject progress::-moz-progress-bar {background:var(--subject);border-radius:5px;}
#study .today-subject span {font-size:16px;}
#study .today-coverage-label {font-size:12px;color:var(--app-secondary);margin:12px 0 24px;}
#study .today-practice {display:flex;align-items:center;gap:16px;text-decoration:none;color:var(--app-text);}
#study .today-practice>div {flex:1;}
#study .today-practice h2 {font-size:20px;margin:0 0 4px;}
#study .today-practice p {font-size:15px;margin:0;color:var(--app-secondary);}
#study .today-practice-icon {display:grid;place-items:center;border-radius:16px;background:color-mix(in srgb,var(--subject-physics) 14%,var(--app-bg));color:var(--subject-physics);font-size:36px;width:52px;height:52px;flex-shrink:0;}
#study .today-route>p {color:var(--app-secondary);font-size:14px;}
#study .today-route ol {list-style:none;padding:0;margin:20px 0 0;}
#study .today-route li {display:flex;gap:12px;padding:12px 0;border-top:1px solid var(--app-separator);}
#study .today-route li small {display:block;color:var(--app-secondary);font-size:13px;margin-top:4px;}
#study .today-route li a {color:var(--app-text);font-weight:600;}
#study .today-route-state {color:var(--app-secondary);}
#study .today-route [data-done=true] .today-route-state {color:var(--subject-biology);}
#study .today-settings {display:grid;gap:12px;}
#study .today-settings>label {font-weight:600;}
#study .today-settings input:not([type=checkbox]),#study .today-settings select {box-sizing:border-box;width:100%;min-width:0;min-height:48px;background:var(--app-surface);color:var(--app-text);border:1px solid var(--app-separator);border-radius:12px;padding:10px;font:inherit;}
#study .today-settings .plan-weekdays {display:flex;flex-wrap:wrap;gap:4px;border:0;padding:8px 0;margin:0;}
#study .plan-weekdays label {display:flex;align-items:center;gap:6px;min-height:44px;padding:4px 8px;font-size:14px;}
#study .today-settings p {color:var(--app-secondary);font-size:14px;}
#study .account-setup .shell {max-width:620px;}
#study .account-setup .card {display:flex;flex-direction:column;gap:16px;padding:clamp(20px,4vw,36px);}
#study .account-setup .card>h1 {font-size:clamp(28px,4vw,38px);line-height:1.15;margin:0;}
#study .account-setup .card>p {margin:0;}
#study .account-setup .mito-mark {width:64px;height:54px;}
#study .setup-plan-form {margin:8px 0 0;}
#study .setup-plan-form .setup-plan-hint {margin:0;line-height:1.5;}
#study .setup-details {border-top:1px solid var(--app-separator);border-bottom:1px solid var(--app-separator);}
#study .setup-details summary {display:list-item;min-height:48px;padding:14px 0;box-sizing:border-box;font-size:15px;font-weight:600;color:var(--app-accent-text);cursor:pointer;}
#study .setup-detail-fields {display:grid;gap:12px;padding-bottom:20px;}
#study .setup-detail-fields>label {font-weight:600;}
#study .setup-secondary {align-self:center;min-height:44px;padding:10px 14px;border:0;border-radius:12px;background:transparent;color:var(--app-accent-text);font:inherit;font-weight:600;cursor:pointer;}
#study .setup-secondary:hover {background:var(--app-accent-soft);}
#study .setup-secondary:disabled {opacity:.65;cursor:wait;}
#study .setup-secondary:focus-visible,#study .setup-details summary:focus-visible {outline:3px solid var(--app-accent);outline-offset:3px;}
#study .setup-status {margin:0;}
#study .setup-status:empty {display:none;}
#study .recall-reader .lesson-stage {margin-top:24px;}
#study .recall-reader button[hidden] {display:none;}
@media(min-width:1000px) {
 #study .today-page {display:grid;grid-template-columns:1.15fr 1fr;gap:0 28px;align-items:start;}
 #study .today-greeting {grid-column:1/-1;}
 #study .today-journey {grid-column:1;grid-row:2;}
 #study .today-subjects {grid-column:2;grid-row:2/4;}
 #study .today-route {grid-column:1;grid-row:3/6;}
 #study .today-practice {grid-column:2;}
}
@media(max-width:374px) {
 #study .today-subject-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
 #study .journey-heading {gap:10px;flex-wrap:wrap;}
 #study .journey-heading h2 {font-size:20px;}
}
#study .today-subject .app-icon {position:absolute;top:14px;left:16px;width:26px;height:26px;color:var(--subject);}
#study .journey-heading h2 {font-size:20px;}
#study .journey-heading {gap:12px;}
#study .journey-heading .app-ring {width:72px;}
#study .journey-heading .app-ring span {width:58px;}
@media(min-width:1000px) {
 #study .today-page {grid-template-rows:repeat(4,max-content) minmax(0,1fr);}
 #study .today-subjects {grid-row:2;}
 #study .today-practice {grid-row:3;}
 #study .today-practice:last-child {grid-row:4;}
}
#study .recall-reader .option.correct {border-color:var(--subject-biology);background:color-mix(in srgb,var(--subject-biology) 12%,var(--app-surface));}

/* Etappe 5: native Learn hierarchy, shared semantic colours and real state. */
#study .learn-page {max-width:900px;}
#study .learn-heading {margin-bottom:1.5rem;}
#study .learn-heading h1 {font-size:2.5rem;line-height:1.12;letter-spacing:-.035em;margin:1rem 0;overflow-wrap:anywhere;}
#study .learn-back {display:inline-flex;align-items:center;min-height:44px;color:var(--app-accent-text);font-weight:600;}
#study .learn-subjects {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,max(9rem,calc((100% - 1rem)/2))),1fr));gap:1rem;}
#study .learn-tile {display:flex;flex-direction:column;min-height:12rem;padding:1.1rem;border-radius:var(--app-radius-card,22px);background:var(--app-surface);text-decoration:none;}
#study .learn-tile h2 {font-size:1.5rem;margin:0 0 .5rem;line-height:1.15;overflow-wrap:anywhere;}
#study .learn-tile p {font-size:1rem;line-height:1.4;margin:0;max-width:15rem;}
#study .learn-tile .subject-artwork {width:80%;height:80%;bottom:0;right:0;opacity:.15;}
#study .learn-tile .app-ring {align-self:flex-end;margin-top:auto;width:3.5rem;background:conic-gradient(var(--subject) var(--ring-value),color-mix(in srgb,var(--subject) 25%,var(--app-track)) 0 var(--ring-started),var(--app-track) 0);}
#study .learn-tile .app-ring span {width:2.7rem;font-size:.95rem;color:var(--app-secondary);font-weight:500;}
#study .learn-legend {color:var(--app-secondary);font-size:.875rem;margin:.75rem 0 1.5rem;}
#study .learn-progress {display:flex;height:6px;overflow:hidden;border-radius:10px;background:var(--app-track);}
#study .learn-progress .secured {background:var(--subject,var(--app-accent));}
#study .learn-progress .started {background:color-mix(in srgb,var(--subject,var(--app-accent)) 30%,var(--app-track));}
#study .learn-next {background:var(--app-surface);border:1px solid color-mix(in srgb,var(--app-accent) 25%,transparent);padding:1.4rem;border-radius:22px;margin:1.5rem 0 2rem;}
#study .learn-next h2 {font-size:1.35rem;line-height:1.3;margin:.4rem 0;}
#study .learn-next p:not(.eyebrow) {font-size:1rem;color:var(--app-secondary);margin:.65rem 0 1rem;}
#study .learn-next .button {font-size:1rem;}
#study .learn-next>.text-link {display:block;margin-top:.75rem;}
#study .learn-section-heading {display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin-bottom:1rem;}
#study .learn-section-heading h2 {font-size:1.2rem;margin:0;}
#study .learn-modes {display:flex;padding:3px;background:var(--app-track);border-radius:999px;}
#study .learn-modes button {min-width:4rem;min-height:44px;border:0;border-radius:999px;background:transparent;font:inherit;font-size:.9rem;color:var(--app-secondary);padding:.4rem .75rem;}
#study .learn-modes button[aria-pressed=true] {background:var(--app-surface);color:var(--app-accent-text);box-shadow:0 1px 3px #0001;}
#study .learn-domain {margin:0 0 1.5rem;}
#study .learn-domain>summary {display:flex;align-items:center;gap:.6rem;min-height:44px;padding:.5rem 0;cursor:pointer;flex-wrap:wrap;font-size:1.1rem;font-weight:600;}
#study .learn-domain>summary::after {content:'›';margin-left:auto;font-size:1.5rem;}
#study .learn-domain[open]>summary::after {transform:rotate(90deg);}
#study .learn-domain>summary::-webkit-details-marker {display:none;}
#study .learn-topic-list,#study .learn-concepts {list-style:none;padding:0;margin:0;}
#study .learn-topic-row,#study .learn-concept {position:relative;display:flex;gap:1rem;align-items:flex-start;background:var(--app-surface);border:1.5px solid transparent;border-radius:22px;padding:1.2rem;margin:.65rem 0;color:var(--app-text);text-decoration:none;}
#study .learn-topic-row>div,#study .learn-concept>div {min-width:0;flex:1;}
#study .learn-topic-row h2,#study .learn-concept h2 {font-size:1.15rem;line-height:1.35;margin:0;overflow-wrap:anywhere;}
#study .learn-topic-row p,#study .learn-concept-meta {font-size:.95rem;color:var(--app-secondary);margin:.35rem 0;}
#study .learn-position {min-width:1.5rem;min-height:1.5rem;display:grid;place-items:center;color:var(--app-secondary);font-size:.9rem;flex-shrink:0;}
#study .learn-route[data-mode=path] .learn-position {border:2px solid var(--app-track);border-radius:50%;width:2rem;height:2rem;}
#study .learn-route[data-mode=path] .learn-position.is-secured {background:var(--subject);border-color:var(--subject);color:var(--app-surface);}
#study .learn-route[data-mode=path] .learn-topic-list>li:not(:last-child),#study .learn-route[data-mode=path]>.learn-concept:not(:last-child) {position:relative;}
#study .learn-route[data-mode=path] .learn-topic-list>li:not(:last-child)::after,#study .learn-route[data-mode=path]>.learn-concept:not(:last-child)::after {content:'';position:absolute;left:2.3rem;bottom:-.65rem;width:2px;height:.65rem;background:var(--app-track);}
#study .learn-route[data-mode=list] .learn-position {display:none;}
#study .learn-route .is-next {border-color:color-mix(in srgb,var(--app-accent) 50%,transparent);}
#study .learn-badges {display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.4rem;}
#study .learn-badge {display:inline-block;font-size:.8rem;line-height:1.35;font-weight:600;padding:.22rem .65rem;border-radius:999px;background:color-mix(in srgb,var(--app-accent) 12%,var(--app-surface));color:var(--app-accent-text);}
#study .learn-chevron {color:var(--app-secondary);font-size:1.6rem;}
#study .learn-concept-title {color:var(--app-text);text-decoration:none;display:block;min-height:44px;}
#study .learn-actions {display:flex;gap:.4rem 1rem;flex-wrap:wrap;margin-top:.5rem;}
#study .learn-actions a,#study .learn-requires a {min-height:44px;display:flex;align-items:center;font-size:.95rem;}
#study .learn-requires {margin-top:.65rem;color:var(--app-secondary);font-size:.875rem;}
#study .learn-requires summary {cursor:pointer;min-height:44px;padding:.5rem 0;}
#study .learn-requires p {font-size:inherit;}
#study .learn-requires a {color:var(--app-accent-text);}
@media(min-width:1000px) {#study .learn-tile {min-height:14rem;padding:1.5rem;} #study .learn-tile h2 {font-size:1.7rem;}}
@media(max-width:360px) {#study .learn-subjects {gap:.6rem;}#study .learn-tile {padding:.8rem;}#study .learn-tile h2 {font-size:1.2rem;}}
/* rem-based breakpoint also responds to large default text settings. */
@media(max-width:22rem) {#study .learn-subjects {grid-template-columns:1fr;}}

/* Focused acquisition lesson: same semantic palette as the native sheet. */
#study[data-lesson=true] #study-nav,#study[data-lesson=true] .study-sidebar {display:none;}
#study .acquisition-reader {max-width:760px;padding-top:1rem;}
#study .acquisition-reader h1 {font-size:1.65rem;line-height:1.22;margin:.6rem 0 1.5rem;letter-spacing:-.02em;}
#study .acquisition-reader .lesson-top {display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;}
#study .acquisition-reader .lesson-top>span {margin-left:auto;white-space:nowrap;color:var(--app-secondary);font-size:.85rem;}
#study .acquisition-reader .lesson-top .text-link {min-height:44px;font-size:.875rem;}
#study .lesson-mito {display:grid;place-items:center;border:0;background:transparent;min-width:44px;min-height:44px;padding:0;}
#study .lesson-mito .mito-mark {width:34px;height:28px;margin:0;}
#study .acquisition-reader>.eyebrow {margin-top:1.8rem;font-size:.8rem;}
#study .acquisition-reader .lesson-stage {padding:0;border:0;background:transparent;}
#study .acquisition-reader .lesson-prose {font-size:1.125rem;line-height:1.65;}
#study .acquisition-reader .options {gap:.65rem;}
#study .acquisition-reader .option {border:1.5px solid transparent;border-radius:22px;background:var(--app-surface);padding:1.2rem;min-height:64px;align-items:flex-start;}
#study .acquisition-reader .option.chosen {border-color:var(--app-accent);background:var(--app-surface-2);}
#study .acquisition-reader .option:disabled {opacity:1;}
#study .acquisition-reader .option-key {font-size:1.1rem;color:var(--app-secondary);min-width:1.4rem;}
#study .acquisition-reader .lesson-feedback:not(:empty) {border-radius:18px;background:var(--app-surface);padding:1.2rem;margin-top:1rem;}
#study .acquisition-reader .lesson-feedback strong {color:var(--app-accent-text);}
#study .lesson-help-anchor {border:0;background:transparent;color:var(--app-secondary);min-height:44px;font:inherit;font-size:.95rem;margin:1.25rem 0;padding:.5rem 0;}
#study .acquisition-reader .lesson-controls {position:static;padding:1rem 0 calc(1rem + env(safe-area-inset-bottom));background:var(--app-bg);display:block;z-index:3;}
#study .acquisition-reader .lesson-controls>.primary {width:100%;min-height:54px;font-size:1.1rem;}
#study .lesson-block-hint {font-size:.85rem;color:var(--app-secondary);margin:0 0 .6rem;}
#study .lesson-earlier {margin:1rem 0 1.5rem;color:var(--app-secondary);}
#study .lesson-earlier summary {min-height:44px;cursor:pointer;font-size:.9rem;}
#study .lesson-earlier section {padding:1rem 0;border-bottom:1px solid var(--app-separator);}
#study .acquisition-reader .worked-step {background:var(--app-surface);border-radius:18px;padding:1rem;}
#study .acquisition-reader input,#study .recap-draft {width:100%;font:inherit;font-size:1rem;color:var(--app-text);background:var(--app-surface);border:1px solid var(--app-separator);border-radius:16px;padding:1rem;box-sizing:border-box;}
#study .recap-grades {display:flex;flex-wrap:wrap;gap:.65rem;margin:1rem 0;}
#study .recap-grades .button {flex:1;min-width:5rem;font-size:1rem;}
#study .recap-grades [aria-pressed=true] {background:var(--app-accent);color:var(--app-on-accent);opacity:1;}
#study .lesson-help-choice {display:flex;align-items:center;gap:.7rem;justify-content:space-between;width:100%;text-align:left;color:var(--app-accent-text);background:var(--app-surface);border:1px solid var(--app-separator);border-radius:18px;padding:1rem;margin:.5rem 0;min-height:56px;font:inherit;}
#study .lesson-help-choice .mito-mark {width:32px;height:28px;margin:0;}
#study .mito-messages {display:grid;gap:1rem;margin:1rem 0;}
#study .mito-bubble {padding:1rem;border-radius:20px;background:var(--app-surface-2);overflow-wrap:anywhere;}
#study .mito-bubble.user {background:var(--app-accent);color:var(--app-on-accent);margin-left:1.5rem;}
#study .mito-bubble .lesson-prose {font-size:1rem;}
#study .mito-compose {display:flex;align-items:flex-end;gap:.5rem;flex-wrap:wrap;}
#study .mito-compose textarea {flex:1;min-width:0;width:100%;font:inherit;border:1px solid var(--app-separator);border-radius:16px;padding:.75rem;color:var(--app-text);background:var(--app-surface);}
#study .mito-quota {font-size:.85rem;color:var(--app-secondary);}
@media(min-width:761px){#study[data-lesson=true] .acquisition-reader{margin-inline:auto;}}

#study[data-lesson=true] #study-root {margin-left:0;padding-bottom:2rem;}
#study[data-lesson=true] .study-top {display:none;}
#study .chemistry-figure {margin:1rem 0;padding:1rem;background:var(--app-surface);border-radius:22px;}
#study .chemistry-figure h3 {font-size:1.15rem;}
#study .chemistry-figure h4 {font-size:1rem;margin:.75rem 0;}
#study .chemistry-figure p {font-size:1rem;line-height:1.6;}
#study .chemistry-canvas {overflow-x:auto;background:var(--app-surface-2);border-radius:16px;}
#study .chemistry-canvas svg {display:block;width:100%;min-width:20.4rem;height:auto;}
#study .lesson-bridge summary {min-height:44px;cursor:pointer;}

#study [hidden] {display:none!important;}

/* Progress mirrors the native readiness card, four levels and expandable reports. */
#study .progress-page {max-width:860px;}
#study .progress-card {display:block;background:var(--app-surface);color:var(--app-text);border-radius:28px;padding:1.5rem;margin:0 0 1.25rem;text-decoration:none;}
#study .progress-label {font-size:.85rem;text-transform:uppercase;letter-spacing:.08em;font-weight:600;color:var(--app-secondary);margin:0 0 1rem;}
#study .progress-row,#study .progress-score {display:flex;justify-content:space-between;align-items:baseline;gap:1rem;flex-wrap:wrap;margin:.9rem 0;font-size:1.05rem;}
#study .progress-row>span {color:var(--app-secondary);}
#study .progress-row strong {font-weight:600;}
#study .progress-score>strong {font-size:1.8rem;letter-spacing:-.025em;white-space:nowrap;}
#study .progress-note {font-size:.95rem;line-height:1.55;color:var(--app-secondary);margin:.75rem 0;}
#study .progress-card hr {border:0;border-top:1px solid var(--app-separator);margin:1.25rem 0;}
#study .progress-levers {display:grid;gap:.2rem;}
#study .progress-page .text-link {display:inline-flex;align-items:center;min-height:44px;line-height:1.5;}
#study .progress-levels {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr));gap:1rem;}
#study .progress-level {min-width:0;}
#study .progress-level strong {font-size:1.8rem;}
#study .progress-level-line {display:block;margin-top:1.5rem;height:3px;background:var(--app-accent);border-radius:3px;}
#study .progress-disclosure summary {display:flex;align-items:center;flex-wrap:wrap;gap:.65rem;cursor:pointer;min-height:44px;}
#study .progress-disclosure summary .progress-label {flex:1;margin:0;}
#study .progress-disclosure summary>span:last-child {color:var(--app-secondary);font-size:1.5rem;}
#study .progress-disclosure[open] summary>span:last-child {transform:rotate(90deg);}
#study .progress-details {border-top:1px solid var(--app-separator);margin-top:1rem;padding-top:.5rem;}
#study .progress-chart svg {width:100%;height:auto;max-height:220px;overflow:visible;}
#study .progress-chart text {font-size:14px;fill:var(--app-secondary);}
#study .chart-grid {stroke:var(--app-separator);stroke-width:1;}
#study .chart-line {fill:none;stroke:var(--app-accent);stroke-width:2.5;}
#study .chart-band {fill:var(--app-accent);opacity:.18;}
#study .progress-chart summary {min-height:44px;cursor:pointer;display:flex;align-items:center;color:var(--app-accent-text);}
#study .progress-chart table {width:100%;font-size:.9rem;text-align:left;border-collapse:collapse;}
#study .progress-chart td,#study .progress-chart th {padding:.65rem .25rem;border-bottom:1px solid var(--app-separator);}
#study .progress-subject {display:grid;grid-template-columns:1fr auto;gap:.25rem 1rem;border-top:1px solid var(--app-separator);padding:.5rem 0;}
#study .progress-subject strong {align-self:center;}
#study .progress-subject .progress-note {grid-column:1/-1;}
#study .test-confidence {display:grid;gap:.5rem;margin-top:1.25rem;font-size:1rem;}
#study .test-confidence select {font:inherit;padding:.75rem;border:1px solid var(--app-separator);border-radius:14px;background:var(--app-surface);color:var(--app-text);min-height:44px;width:100%;}
#study .comparable-score {display:flex;align-items:flex-start;gap:.75rem;font-size:.9rem;line-height:1.5;}
#study .comparable-score input {width:24px;height:24px;flex-shrink:0;margin-top:.3rem;}
@media(max-width:380px){#study .progress-card{padding:1.1rem;}#study .progress-levels{gap:.65rem;}}
@media(max-width:22rem){#study .progress-levels{grid-template-columns:1fr;}}
#study .progress-sparkline {display:block;width:100%;height:28px;margin-top:1.2rem;}
#study .progress-no-trend {display:block;min-height:1rem;}

#study .progress-page {overflow-wrap:anywhere;}
#study .progress-disclosure summary .progress-label {flex:1 1 9rem;max-width:100%;}
#study .progress-chart text {font-size:1rem;}

/* A clear account entry, with the diagnostic as an optional alternative. */
#study:not([data-signed-in]) #study-root {margin-left:0;padding:32px 20px 64px;}
#study .auth-entry {max-width:1100px;}
#study .auth-welcome {margin-bottom:28px;}
#study .auth-welcome p {color:var(--app-secondary);}
#study .auth-entry-grid {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;align-items:start;}
#study .auth {margin:0;max-width:none;display:flex;flex-direction:column;gap:12px;}
#study .auth>h2,#study .auth>p {margin:0;}
#study .auth>label:not(.check) {margin-top:4px;}
#study .auth .check {display:flex;align-items:flex-start;gap:10px;font-size:13px;color:var(--app-secondary);font-weight:400;}
#study .auth .check input {margin-top:4px;flex-shrink:0;}
#study .auth .auth-submit {width:100%;}
#study .auth-choices {display:flex;gap:6px;padding:5px;border-radius:18px;background:var(--app-bg);margin-bottom:8px;}
#study .auth-choices button {flex:1;min-height:44px;border:0;border-radius:14px;background:transparent;color:var(--app-secondary);font:inherit;font-weight:650;cursor:pointer;}
#study .auth-choices button[aria-pressed="true"] {background:var(--app-accent);color:var(--app-on-accent);}
#study .auth-choices button:focus-visible {outline:3px solid var(--app-accent);outline-offset:3px;}
#study .auth-help {font-size:14px;margin-top:8px;}
#study .auth-help summary {cursor:pointer;}
#study .auth-extras {display:grid;gap:24px;}
#study .auth-diagnostic {margin:0;}
#study .auth-diagnostic h2 {margin-top:0;}
#study .auth-diagnostic small {display:block;margin-top:12px;color:var(--app-secondary);}
#study .free-paper-banner {--accent:var(--app-accent);--accent-text:var(--app-accent-text);--accent-soft:var(--app-accent-soft);--sep:var(--app-separator);flex-wrap:wrap;margin:0 0 24px;}
#study .free-paper-copy {flex-basis:calc(100% - 80px);}
#study .free-paper-actions {flex-basis:100%;}
#study .free-paper-banner h2 {margin:0;font-size:1rem;}
#study .free-paper-banner p {margin:0;font-size:.9375rem;}
#study .free-paper-banner .free-paper-kicker {margin-bottom:3px;font-size:.6875rem;}
#study .auth-extras .free-paper-banner {margin:0;}
@media(max-width:760px) {
 #study:not([data-signed-in]) #study-root {padding:20px 16px 40px;}
 #study .auth-entry {padding:0;}
 #study .auth-entry-grid {grid-template-columns:1fr;gap:24px;}
}
