/* On Easy app — the course panel. Wide desktop (>=1200): the right third, beside the thread.
   Below 1200: a full-screen sheet. */
   Uses the app's dark tokens (member.css / os.css): --panel, --ink, --dim, --rule, --accent, --rim, --glass, --focus. */
#course-panel {
  min-width: 0; min-height: 0; overflow: auto; color: var(--ink); background: var(--bg);
  border-left: 1px solid var(--rule); padding: 0 0 calc(1.25rem + var(--oe-sab));
  scroll-behavior: smooth;
}
.oe-course-head { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: calc(0.75rem + var(--oe-sat)) max(1rem, var(--oe-sar, 0px)) 0.75rem max(1rem, var(--oe-sal, 0px)); border-bottom: 1px solid var(--rule); }
.oe-course-head .kicker { margin: 0 0 0.3rem; }
.oe-course-chrome { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.55rem; }
.oe-course-chrome .oe-course-close { margin-left: auto; }
.oe-course-moremenu { position: relative; }
.oe-course-moremenu > summary { list-style: none; }
.oe-course-moremenu > summary::-webkit-details-marker { display: none; }
.oe-course-menu { position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 4; min-width: 12rem; padding: 0.35rem; border: 1px solid var(--rule); border-radius: 0.75rem; background: var(--panel); box-shadow: 0 8px 24px #0008; }
.oe-course-menuitem { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.85rem; color: var(--ink); background: none; border: 0; border-radius: 0.5rem; padding: 0.45rem 0.6rem; cursor: pointer; }
.oe-course-menuitem:hover { background: #ffffff12; }
.oe-course-media { margin: 0 0 0.65rem; padding: 0.7rem 0.85rem; border: 1px solid var(--rule); border-radius: 0.9rem; background: var(--panel); }
.oe-course-media-note { margin: 0; }
.oe-course-pills { display: flex; gap: 0.3rem; margin: 0.75rem 0 0; padding: 0.2rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--panel); }
.oe-course-pill { flex: 1; min-height: 2.4rem; border: 0; border-radius: 999px; background: transparent; color: var(--dim); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.oe-course-pill.is-on, .oe-course-pill[aria-selected="true"] { background: #7c5cff33; color: #fff; }
.oe-course-pane[hidden] { display: none !important; }
.oe-course-chapters { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.35rem; }
.oe-course-chapter { display: flex; align-items: center; gap: 0.7rem; }
.oe-course-stamp { font: inherit; font-size: 0.82rem; font-weight: 650; color: #4cc9f0; background: none; border: 0; padding: 0; cursor: pointer; min-width: 2.6rem; text-align: left; }
.oe-course-stamp:hover { text-decoration: underline; }
.oe-course-chapter-title { color: var(--ink); font-size: 0.9rem; }
.oe-course-related { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.oe-course-related-btn { font: inherit; font-size: 0.88rem; color: var(--accent); background: none; border: 0; padding: 0.2rem 0; cursor: pointer; text-align: left; }
.oe-course-related-btn:hover { text-decoration: underline; }
.oe-course-sumh { margin: 1rem 0 0.35rem; font-size: 0.95rem; }
.oe-course-find { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; }
.oe-course-find-input { flex: 1; min-height: 2.6rem; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 0.75rem; padding: 0.4rem 0.75rem; }
.is-find { box-shadow: -3px 0 0 0 #4cc9f0; }
.oe-course-nextcta { margin: 0.65rem 0 0; }
.oe-course-tools { position: static; display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.5rem; z-index: 2; }
.oe-course-play { width: auto; min-width: 2.75rem; height: 2.75rem; padding: 0 0.75rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em; }
.oe-course-play[aria-pressed="true"] { background: #7c5cff33; border-color: var(--rim-hot); color: #fff; }
.oe-course-nav { display: flex; align-items: center; gap: 0.4rem; margin: 0 7.25rem 0.6rem 0; }
.oe-course-step { width: 2.75rem; height: 2.75rem; font-size: 1.1rem; }
.oe-course-step:disabled { opacity: 0.35; cursor: default; }
.oe-course-select { flex: 1; min-width: 0; min-height: 2.75rem; font: inherit; font-size: 0.85rem; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 0.8rem; padding: 0.4rem 0.7rem; }
.oe-course-where { margin: 0.5rem 0 0; color: var(--dim); font-size: 0.85rem; }
.oe-course-mismatch { margin: 0.65rem 0 0; padding: 0.75rem 0.9rem; border: 1px solid #f0c14b; border-radius: 0.85rem; background: #f0c14b1f; color: var(--ink); font-size: 0.9rem; font-weight: 650; }
.oe-course-mismatch-line { margin: 0; }
.oe-course-mismatch-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.55rem; align-items: center; }
.oe-course-back { font: inherit; font-size: 0.85rem; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.oe-course-head h2 { margin: 0 7.25rem 0.35rem 0; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.25; }
.oe-course-open { margin: 0; color: var(--dim); font-size: 0.9rem; line-height: 1.45; }
.oe-course-close { position: static; width: 2.75rem; height: 2.75rem; font-size: 1.15rem; }

.oe-course-body { padding: 0.5rem max(1rem, var(--oe-sar, 0px)) 1rem max(1rem, var(--oe-sal, 0px)); font-size: 0.94rem; line-height: 1.55; }
.oe-course-h { margin: 1.25rem 0 0.4rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.oe-course-p { margin: 0 0 0.7rem; }
.oe-course-list { margin: 0 0 0.7rem; padding-left: 1.3rem; }
.oe-course-list li { margin: 0 0 0.35rem; }
.oe-course-note { margin: 0.5rem 0 0; }

/* steps and the seven answers: ticked by the Coach thread, never here */
.oe-course-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.oe-course-steps li { display: grid; gap: 0.1rem; padding: 0.55rem 0.75rem 0.55rem 2.1rem; border: 1px solid var(--rule); border-radius: 0.85rem; background: var(--panel); position: relative; }
.oe-course-steps li:before { content: ""; position: absolute; left: 0.75rem; top: 0.8rem; width: 0.85rem; height: 0.85rem; border-radius: 50%; border: 1.5px solid var(--dim); }
.oe-course-steps li.is-done:before { border-color: #3ddc97; background: #3ddc97; }
.oe-course-steps li.is-done { color: var(--dim); }
.oe-course-steps li strong { font-size: 0.92rem; }
.oe-course-steps li span { color: var(--dim); font-size: 0.85rem; line-height: 1.4; }

/* the guide: where the Coach thread is right now */
.is-current { scroll-margin: 6rem; }
p.is-current, ol.oe-course-list.is-current { box-shadow: -3px 0 0 0 var(--accent); padding-left: 0.75rem; margin-left: -0.75rem; border-radius: 0 0.4rem 0.4rem 0; }
ol.oe-course-list.is-current { padding-left: 2.05rem; }
h3.is-current { color: var(--accent); }
.oe-course-steps li.is-current { border-color: var(--rim-hot, var(--accent)); box-shadow: 0 0 18px #7c5cff33; color: var(--ink); }

.oe-course-fig { margin: 1rem 0 0; }
.oe-course-fig img { width: 100%; height: auto; border-radius: 0.85rem; border: 1px solid var(--rule); background: var(--panel); }
.oe-course-fig figcaption { margin-top: 0.4rem; color: var(--dim); font-size: 0.82rem; line-height: 1.4; }

#course-panel :focus-visible, [data-course-toggle]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[data-course-toggle][aria-expanded="true"] { border-color: var(--rim-hot); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  #course-panel { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .oe-course-steps li, .oe-course-p, .oe-course-h { transition: box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
}

/* Below 1200: a full-screen sheet over the thread — third pane only at >=1200.
   Hide stays tappable. Phone (<700) and tablet keep this sheet. */
@media (max-width: 1199px) {
  #course-panel { position: fixed; inset: 0; z-index: 80; border-left: 0; padding-left: var(--oe-sal); padding-right: var(--oe-sar); padding-bottom: calc(3.25rem + var(--oe-sab, 0px)); }
  .oe-course-head { padding-bottom: 0.9rem; }
  .oe-course-tools { position: static; margin: 0 0 0.65rem; justify-content: flex-end; width: 100%; }
  .oe-course-close {
    position: static; width: auto; min-width: 5.5rem; height: 2.6rem; padding: 0 1rem;
    border-radius: 999px; font-size: 0.95rem; font-weight: 650; letter-spacing: 0.01em;
    background: var(--panel); border: 1px solid var(--rim-hot, var(--accent)); color: #fff;
  }
  /* Solid bed, not a fade. iPhone Safari interpolates `transparent` as black, so
     to-top gradients over --bg (#08080b) paint a muddy fog on the transcript. */
  .oe-course-hidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
    display: flex; justify-content: center; padding: 0.4rem max(1rem, var(--oe-sar)) calc(0.4rem + var(--oe-sab));
    background: var(--bg);
    border-top: 1px solid var(--rule);
    pointer-events: none;
  }
  .oe-course-hidebar .oe-course-close {
    pointer-events: auto; min-width: 70%; height: 2.6rem; font-size: 0.95rem;
  }
  /* Composer fade sits in the thread under this sheet; kill it while the lesson is open. */
  body[data-course="open"] .oe-compose:before { display: none; }
  /* One stack: lesson sheet + answer dock. Hide Today's sentence / Next+Lesson —
     they were painting through the sheet on iPhone (thread transform traps z-index). */
  body[data-course="open"] #oe-mouth-thread,
  body[data-course="open"] #coach-row { display: none !important; }
  body[data-course="open"] #course-panel { padding-bottom: calc(10.25rem + var(--oe-sab, 0px)); }
}

/* Phone push-shell: .oe-thread has a transform, so a fixed composer stays under the
   lesson sheet. Raise a transparent thread and keep only the answer dock. */
@media (max-width: 899px) {
  body[data-course="open"] .oe-thread {
    z-index: 81;
    background: transparent;
    pointer-events: none;
  }
  body[data-course="open"] .oe-thread > *:not(.oe-compose-stack) { display: none !important; }
  body[data-course="open"] .oe-compose-stack {
    margin-top: auto;
    margin-bottom: calc(3.25rem + var(--oe-sab, 0px));
    pointer-events: auto;
    background: #000;
  }
}

/* Tablet sheet: no transform on the thread, so the dock can sit above the sheet. */
@media (min-width: 900px) and (max-width: 1199px) {
  body[data-course="open"] .oe-compose-stack {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(3.25rem + var(--oe-sab, 0px));
    z-index: 82;
    background: #000;
  }
}
