/* LM101 learning pages. All values come from the --lm-* tokens; Phase 7 restyles by changing them. */
.lm {
  --lm-ink: #051145;
  --lm-accent: #0170B9;
  --lm-accent-dark: #015a94;
  --lm-bg: #FFFFFF;
  --lm-surface: #F2F5F7;
  --lm-muted: #4B4F58;
  --lm-line: #D9E1E7;
  --lm-radius: 8px;
  --lm-radius-sm: 4px;
  --lm-measure: 68ch;
  --lm-font-heading: Montserrat, sans-serif;
  color: var(--lm-ink);
  background: var(--lm-bg);
}
.lm *, .lm *::before, .lm *::after { box-sizing: border-box; }
.lm-wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 64px; }
.lm h1, .lm h2, .lm h3 { font-family: var(--lm-font-heading); font-weight: 700; color: var(--lm-ink); line-height: 1.15; margin: 0 0 16px; }
.lm h1 { font-size: 2rem; }
.lm h2 { font-size: 1.4rem; margin-top: 40px; }
.lm p, .lm li { line-height: 1.6; }
.lm p { margin: 0 0 16px; }
.lm a { color: var(--lm-ink); }
.lm a:hover { color: var(--lm-accent); }
.lm a:focus-visible, .lm button:focus-visible, .lm summary:focus-visible { outline: 3px solid var(--lm-accent); outline-offset: 2px; }

.lm-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 8px; padding: 0; margin: 0 0 24px; font-size: 0.9rem; color: var(--lm-muted); }
.lm-crumbs li { margin: 0; }
.lm-crumbs li + li::before { content: '/'; margin-right: 8px; }
.lm-crumbs a { color: var(--lm-muted); }

.lm-head { margin-bottom: 8px; }
.lm-lead { max-width: var(--lm-measure); font-size: 1.05rem; }
.lm-note { color: var(--lm-muted); font-size: 0.95rem; }
.lm-meta { color: var(--lm-muted); font-size: 0.95rem; }
.lm-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.lm-cta .lm-note { margin: 0; }

.lm .lm-btn { display: inline-block; min-height: 44px; padding: 10px 22px; background: var(--lm-accent); color: #FFFFFF; border: 2px solid var(--lm-accent); border-radius: var(--lm-radius); font: inherit; font-weight: 700; line-height: 1.4; text-decoration: none; text-align: center; cursor: pointer; }
.lm .lm-btn:hover { background: var(--lm-accent-dark); border-color: var(--lm-accent-dark); color: #FFFFFF; }
.lm .lm-btn--ghost { background: transparent; color: var(--lm-ink); border-color: var(--lm-ink); }
.lm .lm-btn--ghost:hover { background: var(--lm-surface); color: var(--lm-ink); border-color: var(--lm-ink); }
.lm .lm-btn[disabled] { cursor: default; opacity: 0.75; }

.lm-progress { max-width: var(--lm-measure); margin: 20px 0; }
.lm-bar { height: 6px; background: var(--lm-line); border-radius: var(--lm-radius-sm); overflow: hidden; }
.lm-bar > span { display: block; height: 100%; background: var(--lm-accent); }
.lm-progress p { margin: 8px 0 0; font-size: 0.9rem; color: var(--lm-muted); }

.lm-module { border-top: 1px solid var(--lm-line); }
.lm-module:last-of-type { border-bottom: 1px solid var(--lm-line); }
.lm-module > summary { display: flex; align-items: baseline; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; }
.lm-module > summary::-webkit-details-marker { display: none; }
.lm-module > summary::before { content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--lm-ink); border-bottom: 2px solid var(--lm-ink); transform: rotate(-45deg); }
.lm-module[open] > summary::before { transform: rotate(45deg); }
.lm-module-title { flex: 1; font-family: var(--lm-font-heading); font-weight: 700; font-size: 1.05rem; }
.lm-module-meta { color: var(--lm-muted); font-size: 0.9rem; white-space: nowrap; }
.lm-module-meta span + span { margin-left: 12px; }

.lm-lessons { list-style: none; margin: 0 0 16px; padding: 0; }
.lm-lessons li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0; padding: 10px 0; border-top: 1px solid var(--lm-line); }
.lm-module .lm-lessons li:first-child { border-top: 0; }
.lm-tag { flex: none; font-size: 0.85rem; color: var(--lm-muted); white-space: nowrap; }
.lm-tag--done { color: var(--lm-accent); font-weight: 700; }

.lm-courses { list-style: none; margin: 0; padding: 0; }
.lm-courses li { padding: 24px 0; border-top: 1px solid var(--lm-line); }
.lm-courses h2 { margin: 0 0 8px; font-size: 1.3rem; }

.lm-reader { background: var(--lm-surface); border: 1px solid var(--lm-line); border-radius: var(--lm-radius); padding: 20px 24px; margin: 0 0 24px; }
.lm-reader h2 { margin: 0 0 8px; font-size: 1.15rem; }
.lm-reader p { margin: 0; }
.lm-passage { max-width: var(--lm-measure); font-size: 20px; line-height: 1.7; }
.lm-passage video, .lm-passage img, .lm-passage iframe { max-width: 100%; height: auto; }
.lm-exercise { margin: 24px 0; }

.lm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 32px; }
.lm-actions .lm-note { margin: 0; }
.lm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lm-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--lm-line); }
.lm-pager a { display: block; max-width: 48%; padding: 12px 16px; border: 2px solid var(--lm-line); border-radius: var(--lm-radius); text-decoration: none; }
.lm-pager small { display: block; color: var(--lm-muted); font-size: 0.85rem; }
.lm-pager .lm-pager-next { margin-left: auto; text-align: right; }
.lm .lm-pager .lm-pager-next.is-primary { background: var(--lm-accent); border-color: var(--lm-accent); color: #FFFFFF; }
.lm .lm-pager .lm-pager-next.is-primary small { color: #FFFFFF; }

@media (max-width: 600px) {
  .lm-wrap { padding: 24px 16px 48px; }
  .lm h1 { font-size: 1.6rem; }
  .lm .lm-btn { width: 100%; }
  .lm-pager { flex-direction: column; }
  .lm-pager a, .lm-pager .lm-pager-next { max-width: 100%; margin-left: 0; text-align: left; }
  .lm-module > summary { flex-wrap: wrap; }
  .lm-module-meta { white-space: normal; padding-left: 20px; flex-basis: 100%; }
}

/* ---- Teacher Dashboard (Phase 5) ---- */
.lm-teacher { max-width: 900px; margin: 0 auto; padding: 32px 16px 64px; }
.lm-teacher h2 { font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.6rem; margin: 8px 0 20px; color: var(--lm-ink, #051145); }
.lm-teacher-overall { font-size: 1.1rem; margin-bottom: 20px; }
.lm-teacher-table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; }
.lm-teacher-table th { text-align: left; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: #4B4F58; padding: 10px 12px; border-bottom: 2px solid #D9E1E7; }
.lm-teacher-table td { padding: 12px; border-bottom: 1px solid #D9E1E7; }
.lm-teacher-table tr:hover td { background: #F2F5F7; }
.lm-teacher-table a { color: #0170B9; font-weight: 600; text-decoration: none; }
.lm-teacher-table a:hover { text-decoration: underline; }
.lm-teacher-modules { max-width: 520px; margin: 16px 0 24px; }
.lm-teacher-module-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #D9E1E7; }
.lm-teacher-marks { font-family: monospace; letter-spacing: 2px; color: #0170B9; font-weight: 700; white-space: nowrap; }

/* ---- Student dashboard v2 (emulates the reference screenshots) ---- */
.lm-dash2 { max-width: 1040px; margin: 0 auto; padding: 32px 20px 64px; }
.lm-dash2-hi { color: #4B4F58; font-size: 0.95rem; margin: 0; }
.lm-dash2-welcome { font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.9rem; font-weight: 800; color: #051145; margin: 4px 0 24px; }
.lm-dash2-top { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.lm-dash2-card { background: #fff; border: 1px solid #D9E1E7; border-radius: 14px; padding: 24px 28px; box-shadow: 0 6px 18px rgba(5,17,69,0.05); }
.lm-dash2-progress-card { flex: 1 1 420px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.lm-dash2-progress-card h3 { margin: 0 0 6px; font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.15rem; color: #051145; }
.lm-dash2-progress-card p { margin: 0 0 18px; color: #4B4F58; font-size: 0.95rem; }
.lm-dash2-progress-card p a { color: #0170B9; font-weight: 600; text-decoration: none; }
.lm-ring { position: relative; width: 108px; height: 108px; border-radius: 50%; flex: none; background: conic-gradient(#0170B9 calc(var(--pct, 0) * 3.6deg), #E4EAF0 0deg); }
.lm-ring::after { content: ''; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.lm-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--lm-font-heading, Montserrat, sans-serif); font-weight: 800; font-size: 1.2rem; color: #051145; }
.lm-dash2-grid-title { font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.3rem; font-weight: 800; color: #051145; margin: 0 0 16px; }
.lm-dash2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.lm-dash2-course { background: #fff; border: 1px solid #D9E1E7; border-radius: 14px; padding: 20px; box-shadow: 0 6px 18px rgba(5,17,69,0.05); display: flex; flex-direction: column; }
.lm-dash2-course-badge { display: inline-block; width: 44px; height: 44px; border-radius: 10px; background: #0170B9; color: #fff; font-family: var(--lm-font-heading, Montserrat, sans-serif); font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.lm-dash2-course h4 { margin: 0 0 8px; font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.05rem; color: #051145; }
.lm-dash2-course-bar { height: 6px; background: #E4EAF0; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.lm-dash2-course-bar > span { display: block; height: 100%; background: #0170B9; }
.lm-dash2-course-pct { font-size: 0.82rem; color: #4B4F58; text-align: right; margin: 0 0 14px; }
.lm-dash2-teacher { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid #F2F5F7; }
.lm-dash2-teacher img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.lm-dash2-teacher span { font-size: 0.82rem; color: #4B4F58; flex: 1; }
.lm-dash2-pill { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.lm-dash2-pill--done { background: #E6F4EA; color: #1B7D3C; }
.lm-dash2-pill--go { background: #0170B9; color: #fff; }
@media (max-width: 640px) {
  .lm-dash2-progress-card { flex-direction: column; text-align: center; }
}

/* ---- Class booking (Calendly) ---- */
.lm-booking { max-width: 900px; margin: 40px auto 0; }
.lm-booking h2 { font-family: var(--lm-font-heading, Montserrat, sans-serif); font-size: 1.4rem; color: #051145; }
.lm-booking h3 { font-size: 1.05rem; color: #051145; margin: 24px 0 10px; }
/* ---- Logged-in top icon bar (2026-09-26) ---- */
.lm-topbar { background: #FFFFFF; border-bottom: 1px solid #D9E1E7; position: sticky; top: 0; z-index: 9999; }
.lm-topbar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 20px; }
.lm-topbar-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #4B4F58; background: none; border: none; cursor: pointer; text-decoration: none; }
.lm-topbar-icon:hover { background: #F2F5F7; color: #051145; }
.lm-topbar-grid-wrap { position: relative; }
.lm-topbar-dropdown { display: none; position: absolute; right: 0; top: 46px; background: #fff; border: 1px solid #D9E1E7; border-radius: 12px; box-shadow: 0 10px 30px rgba(5,17,69,0.12); min-width: 190px; padding: 8px; z-index: 10000; }
.lm-topbar-dropdown.is-open { display: block; }
.lm-topbar-dropdown a { display: block; padding: 10px 12px; border-radius: 8px; color: #051145; text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.lm-topbar-dropdown a:hover { background: #F2F5F7; }
.lm-topbar-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #0170B9; color: #fff; font-family: var(--lm-font-heading, Montserrat, sans-serif); font-weight: 700; font-size: 0.8rem; text-decoration: none; margin-left: 4px; }