.study-mode { color-scheme:dark; }
.study-mode .mode-main { max-width:1440px; margin-inline:auto; }
.study-mode .header { padding:14px 18px; flex-wrap:wrap; }
.study-mode .header-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:12px; min-width:0; max-width:100%; }
/* Reserve the account control before the deferred authentication script adds it. */
.study-mode .header-actions::after,.study-mode .header-actions > .scanner-account { flex:0 0 216px; width:216px; max-width:100%; height:46px; margin-left:0; }
.study-mode .header-actions::after { content:""; }
.study-mode .header-actions:has(> .scanner-account)::after { display:none; }
.study-mode .header-actions > .scanner-account .scanner-account-button { width:100%; }
.study-mode .study-progress { gap:9px; color:var(--text-muted); background:linear-gradient(120deg,#10263d,#19233e); border-color:#5376a566; }
.study-mode .study-progress strong { min-width:48px; color:var(--text-main); font-variant-numeric:tabular-nums; }
.study-mode .study-progress progress { width:84px; }
.study-mode .study-intro { padding:28px; margin-bottom:16px; border-radius:12px; }
.study-mode .study-intro h1 { margin:10px 0 14px; color:#a4e2ff; text-shadow:0 0 18px #4eb7ff70; font-size:clamp(26px,3.2vw,38px); line-height:1.2; }
.study-mode .study-intro > p:not(.eyebrow) { max-width:850px; font-size:15px; line-height:1.7; }
.study-mode .study-intro > .study-author { margin:0 0 12px; font-size:12px; line-height:1.5; }
.study-mode .study-course-link { margin-top:14px; }
.study-mode .study-course-link a { color:var(--cyan); text-decoration:none; }
.study-mode .study-course-link a:hover { text-decoration:underline; }
.study-mode .study-guide { padding:20px 24px; gap:20px; border-radius:12px; }
.study-mode .study-guide h2 { font-size:17px; line-height:1.4; }
.study-mode .study-guide p { line-height:1.7; }
.study-mode .primary { display:inline-flex; align-items:center; justify-content:center; padding:11px 16px; border:1px solid #a6d5ff; border-radius:8px; background:linear-gradient(115deg,#226bc3,#6459dc); color:#fff; font-size:13px; box-shadow:0 0 22px #578fff45,inset 0 1px #d6efff70; }
.study-mode .primary:hover { background:linear-gradient(115deg,#2a7bda,#7568ea); }
.study-mode .study-toolbar { display:grid; gap:14px; margin:24px 0 18px; }
.study-mode .collection-tabs { gap:8px; }
.study-mode .collection-tabs button { padding:9px 13px; font-size:13px; }
.study-mode .study-controls { display:flex; flex-wrap:wrap; align-items:end; gap:14px 20px; }
.study-mode .study-search { display:grid; flex:1 1 260px; max-width:420px; gap:7px; color:var(--text-muted); font-size:12px; }
.study-mode .study-search input { min-width:0; }
.study-mode .check-row { margin:0 0 10px; }
.study-mode #study-results { margin:0 0 10px auto; font-size:12px; }
.study-mode .study-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.study-mode .study-card { padding:22px; border-radius:12px; }
.study-mode .study-card h2 { margin:14px 0 16px; color:var(--text-main); font-size:19px; line-height:1.4; }
.study-mode .study-card > p,.study-mode .study-card details p { font-size:14px; line-height:1.75; }
.study-mode .study-card details { margin:16px 0 20px; }
.study-mode .study-card summary { font-size:13px; line-height:1.6; }
.study-mode .study-card .read-toggle { padding:9px 12px; font-size:12px; }
.study-mode .study-card.is-read { border-color:#39c99180; }
.study-mode .read-toggle[aria-pressed=true] { color:#6cf2b9; border-color:#52d99b66; background:linear-gradient(130deg,#123c37,#12312f); }
.study-mode .sample-metrics { padding:14px 8px; gap:8px; background:linear-gradient(145deg,#0b182a,#0c1223); border-color:#46638a80; border-radius:9px; }
.study-mode .sample-metrics div { min-width:0; overflow-wrap:anywhere; }
.study-mode .sample-metrics strong { font-size:13px; line-height:1.4; }
.study-mode .lesson-limit { padding:12px; border-radius:0 8px 8px 0; }
.study-mode .lesson-source { margin-top:12px; }
.study-mode .lesson-source a { color:var(--cyan); font-size:12px; }
.study-mode .empty-state { padding:24px; font-size:14px; }
.study-mode .mode-footer { margin-top:24px; padding:18px 0; font-size:12px; line-height:1.8; }
@media(max-width:1100px) { .study-mode .study-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:680px) {
  .study-mode .header { padding:14px; gap:14px; }
  .study-mode .brand-text { font-size:23px; }
  .study-mode .study-intro { padding:22px 18px; }
  .study-mode .study-guide { padding:18px; gap:12px; }
  .study-mode .study-guide > div { flex-basis:calc(100% - 80px); }
  .study-mode .study-grid { grid-template-columns:minmax(0,1fr); }
  .study-mode .study-card { padding:20px; }
  .study-mode .study-search { max-width:none; flex-basis:100%; }
  .study-mode #study-results { margin-left:0; }
}
