/* Electric study workspace layout. Relies on tokens and shared controls in electric-brand.css.
   Compact and function-first: calm reading surfaces, one primary action per card. */

body.electric-study main{max-width:960px;padding:0 5%}
.study-skip{position:absolute;left:16px;top:-80px;z-index:20;background:#fff;color:#1b2620;padding:14px 18px;border:2px solid #154f9c;border-radius:8px;font-weight:700}
.study-skip:focus{top:12px}

/* Compact heading: this is a tool, not a landing page. */
.study-intro{margin:0;padding:28px 0 6px}
body.electric-study .study-intro h1{font-size:clamp(30px,4vw,42px);letter-spacing:-.025em;margin:8px 0 12px}
body.electric-study .study-intro .lead{font-size:18px;max-width:60ch;margin:0 0 6px}

/* Status line. The error variant adds a text label, not color alone. */
body.electric-study .study-message{margin:14px 0 6px;padding:14px 18px;background:var(--e-sunken);border-left:6px solid var(--e-forest);border-radius:0 10px 10px 0;font-size:17px;line-height:1.6;max-width:var(--e-measure)}
body.electric-study .study-message.error{background:var(--e-bad-bg);border-color:var(--e-bad);color:#5f1d13}
body.electric-study .study-message.error::before{content:"Problem: ";font-weight:800}

/* Wayfinding */
.study-mobile-nav{display:none}
.study-sections{display:flex;gap:4px;padding:4px;margin:18px 0 6px;background:var(--e-sunken);border:1px solid var(--e-line);border-radius:12px}
.study-sections a{flex:1 1 0;display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 10px;border-radius:9px;font-size:16px;font-weight:700;color:var(--e-ink-soft);text-align:center}
.study-sections a:hover{background:var(--e-surface);color:var(--e-ink)}
.study-anchor{height:0;scroll-margin-top:16px}
#studyMocks,#studyProgress,#lessonCard,#studyControls,#studyAccess{scroll-margin-top:16px}

/* Cards: quiet surfaces, generous reading padding */
.study-card{background:var(--e-surface);border:1px solid var(--e-line);border-radius:16px;padding:26px 30px;margin:16px 0;min-width:0}
.study-card h2{font-size:24px;line-height:1.25;letter-spacing:-.015em;margin:8px 0 14px}
.study-card h3{font-size:20px;line-height:1.35}
.study-card p,.study-card li{line-height:1.7}
.study-card label{display:block;margin:14px 0 8px;font-size:16px;font-weight:700}
.study-card button{cursor:pointer;min-height:48px}
.study-card button:disabled{cursor:not-allowed}
.study-card .fine{margin:14px 0 0}
.study-access #accessDetails p{margin:0 0 14px;max-width:var(--e-measure)}

.study-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin:20px 0 4px}
.study-actions:empty{display:none}
.study-secondary{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:11px 20px;border:2px solid var(--e-line-strong);border-radius:10px;background:#fff;color:var(--e-ink);font:600 16px/1.3 var(--e-font);text-align:center}
.study-secondary:hover{border-color:var(--e-forest);background:var(--e-lime-soft)}
.study-secondary:disabled{background:var(--e-sunken);border-color:var(--e-line);color:var(--e-ink-soft)}

/* Question area: question, answer, hint and feedback are separate groups. */
#questionMeta:not(:empty){display:inline-block;padding:4px 14px;background:var(--e-sunken);border:1px solid var(--e-line);border-radius:999px;font-size:13px;letter-spacing:.1em}
#questionMeta:empty{display:none}
.study-clock{position:sticky;top:8px;z-index:4;display:flex;width:fit-content;align-items:center;gap:10px;margin:14px 0;padding:8px 18px;background:var(--e-forest);color:#fff;border-radius:10px;font:700 20px/1.3 var(--e-font);font-variant-numeric:tabular-nums}
.study-card h2.study-question{white-space:pre-line;font-size:22px;line-height:1.55;font-weight:600;letter-spacing:-.005em;max-width:62ch;margin:14px 0 18px}
.study-choices{border:0;padding:0;margin:18px 0 8px;min-width:0}
.study-choices legend{padding:0;margin-bottom:8px;font-size:16px;font-weight:700;color:var(--e-ink-soft)}
.study-card label.study-choice{display:flex;gap:14px;align-items:flex-start;min-height:56px;margin:10px 0;padding:14px 16px;background:#fff;border:2px solid var(--e-line);border-radius:12px;font-size:17px;font-weight:400;line-height:1.55;cursor:pointer}
.study-card label.study-choice:hover{border-color:var(--e-line-strong)}
.study-choice input{flex:none;width:22px;height:22px;margin:3px 0 0;accent-color:var(--e-forest)}
.study-card label.study-choice:has(input:checked){background:var(--e-lime-soft);border-color:var(--e-forest);box-shadow:inset 6px 0 0 var(--e-forest);font-weight:600}
.study-card label.study-choice:has(input:disabled){cursor:default}
#feedback:not(:empty){margin-top:22px;padding:18px 22px;background:var(--e-sunken);border-left:6px solid var(--e-forest);border-radius:0 12px 12px 0}
#feedback h3{font-size:20px;margin:0 0 8px}
#feedback>p{white-space:pre-line;margin:8px 0;max-width:var(--e-measure)}

/* Drawings keep a light plate so original diagrams stay readable in any setting. */
.study-diagram{margin:20px 0;padding:16px;background:#fff;border:1px solid var(--e-line);border-radius:12px}
.study-diagram img{display:block;width:min(100%,640px);height:auto;margin:auto}
.study-diagram figcaption{margin-top:10px;font-size:16px;color:var(--e-ink-soft);text-align:center}
.study-diagram summary{display:flex;align-items:center;min-height:48px;cursor:pointer;font-size:16px;font-weight:700}
.study-diagram details h3{font-size:18px;margin:14px 0 6px}
.study-diagram p,.study-diagram li{font-size:16px;line-height:1.65;max-width:var(--e-measure)}

/* Lessons: long-session reading comfort */
.study-lesson{border-bottom:1px solid var(--e-line);padding:6px 0}
.study-lesson:last-child{border-bottom:0}
.study-lesson>summary{display:flex;align-items:center;min-height:56px;cursor:pointer;font:700 19px/1.4 var(--e-display)}
.study-lesson section{margin:12px 0 28px;padding-top:6px}
.study-lesson section+section{border-top:1px solid var(--e-line);padding-top:24px}
.study-lesson h3{font-size:22px;margin:0 0 10px}
.study-lesson h4{font:700 16px/1.4 var(--e-font);letter-spacing:.02em;color:var(--e-leaf);margin:24px 0 6px}
.study-lesson section>p{white-space:pre-line;font-size:17.5px;line-height:1.8;max-width:66ch}
.study-lesson h4+p{padding-left:16px;border-left:4px solid var(--e-line-strong)}
.study-lesson section ul{max-width:66ch;padding-left:22px;font-size:17.5px;line-height:1.75}

/* History and progress */
.study-history-row{padding:16px 0;border-bottom:1px solid var(--e-line)}
.study-history-row:last-child{border-bottom:0}
.study-history-row h3{font-size:18px;margin:0 0 4px}
.study-history-row p{margin:6px 0;font-size:16px;max-width:var(--e-measure)}
.study-history-row .study-secondary{margin-top:6px}
.study-feedback{border-top:1px solid var(--e-line);padding-top:16px;margin-top:20px}
#mockReview>h3{margin-top:24px}
#progressDetails p{margin:0 0 12px;max-width:var(--e-measure)}
#progressDetails p:first-child{font-size:19px;font-weight:600}
#exportStudy{margin-top:8px}

/* Shown only while practice, lessons and mocks are all unavailable (sibling state selectors, no script). */
.study-pending{display:none}
#studyControls[hidden]~#questionCard[hidden]~#lessonCard[hidden]~#studyPending{display:block}
.study-steps{list-style:none;margin:18px 0;padding:0;border-top:1px solid var(--e-line)}
.study-steps li{display:grid;grid-template-columns:120px minmax(0,1fr);gap:4px 20px;padding:14px 0;border-bottom:1px solid var(--e-line)}
.study-steps b{font:700 18px/1.4 var(--e-display)}
.study-steps span{color:var(--e-ink-soft);max-width:60ch}
.study-pending .textlink{display:inline}

.study-footer{margin:32px 0 64px}

@media (max-width:760px){
  body.electric-study .e-header nav{display:none}
  .study-mobile-nav{display:flex;gap:8px;margin:14px 0 0}
  .study-mobile-nav a{flex:1 1 0;display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 12px;border:1.5px solid var(--e-line-strong);border-radius:10px;font-size:15px;font-weight:700;text-align:center}
  .study-intro{padding-top:18px}
  .study-card{padding:20px 18px}
  .study-card h2.study-question{font-size:20px}
  .study-actions>*{max-width:100%}
  .study-actions .button,.study-actions .study-secondary{width:100%}
  .study-sections a{font-size:15px;padding:0 4px}
  .study-steps li{grid-template-columns:minmax(0,1fr)}
  .study-clock{width:100%}
}
@media (forced-colors:active){
  .study-card,.study-card label.study-choice,.study-diagram,.study-secondary,.study-sections{border:1px solid CanvasText}
  .study-clock{border:1px solid CanvasText}
}

/* Comfortable problem text remains distinct from section headings. */
body.electric .study-card .study-question{font-size:1.25rem;line-height:1.6;letter-spacing:0;font-weight:500;white-space:pre-line;max-width:66ch}
body.electric #studyConfirmation{border:2px solid var(--e-forest);scroll-margin-top:16px}

/* Checkout offer and tutor. Same tokens as the rest of the study space. */
.study-pending[hidden]{display:none!important}
.study-offer,.study-tutor{margin:18px 0 6px;padding:18px 20px;background:var(--e-sunken);border:1px solid var(--e-line);border-radius:12px}
.study-offer[hidden],.study-tutor[hidden],#paymentCheck[hidden]{display:none}
.study-offer h3,.study-tutor h3{font-size:20px;margin:0 0 10px}
.study-offer-row{padding:10px 0;border-bottom:1px solid var(--e-line)}
.study-offer-row:last-child{border-bottom:0}
.study-offer dt{font:700 15px/1.4 var(--e-font);color:var(--e-leaf)}
.study-offer dd{margin:2px 0 0;max-width:var(--e-measure);line-height:1.65}
.study-card label.study-consent{display:flex;gap:12px;align-items:flex-start;font-weight:600;line-height:1.55;max-width:var(--e-measure)}
.study-consent input{flex:0 0 auto;width:24px;height:24px;margin-top:2px}
.study-tutor textarea{display:block;width:100%;max-width:var(--e-measure);box-sizing:border-box;padding:12px;font:inherit;border:2px solid var(--e-line-strong);border-radius:10px}
#tutorOut{margin-top:12px;max-width:var(--e-measure)}
#tutorOut p{white-space:pre-line}
/* Shared resume/next pattern, styled with this course's brand tokens. */
.study-journey{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(220px,1fr);gap:28px;border:2px solid var(--e-forest)}
.study-journey[hidden]{display:none}
.study-journey h2{margin-top:0}
.study-journey-main>p{max-width:62ch}
.study-up-next{background:var(--e-sunken);border-radius:12px;padding:22px;align-self:stretch}
.study-up-next h3{font-size:21px;line-height:1.35;margin:8px 0 12px}
.study-up-next p{font-size:16px;line-height:1.65}
@media(max-width:760px){.study-journey{grid-template-columns:minmax(0,1fr);gap:18px}.study-up-next{padding:18px}}
