body.learning-insights-mode { overflow: hidden; }

/* The learning workspace owns the full-screen chrome. */
body.learning-insights-mode :where(
  .app-header,
  #adminEntryBtn,
  #profileBtn,
  #profilePanel,
  #whatsappBtn,
  #installPrompt
) { display: none !important; }

#learningInsightsScreen {
  --li-action: var(--color-primary, #3a4efb);
  --li-action-dark: #263bd4;
  --li-ink: #17233a;
  --li-navy: #12315f;
  --li-teal: #138f86;
  --li-teal-soft: #e7f6f3;
  --li-blue-soft: #eaf0ff;
  --li-amber: #a96c16;
  --li-amber-soft: #fff3d9;
  --li-coral: #c84f4b;
  --li-coral-soft: #fff0ee;
  --li-muted: #64728a;
  --li-page: #f3f6fb;
  --li-surface: #ffffff;
  --li-line: #d9e2ee;
  --li-line-strong: #c8d4e3;
  --li-shadow: 0 16px 42px rgba(25, 47, 83, 0.09);
  --li-shadow-soft: 0 8px 24px rgba(25, 47, 83, 0.07);
  --li-topbar-height: 64px;
  --li-safe-top: max(0px, env(safe-area-inset-top, 0px));
  --li-safe-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 700;
  inset: 0;
  min-width: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-top: calc(140px + var(--li-safe-top));
  scrollbar-color: #94a5bc #e8edf4;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  background: var(--li-page);
  color: var(--li-ink);
  font-family: "Inter", Arial, sans-serif;
  text-align: left;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
}

#learningInsightsScreen.hidden { display: none; }
#learningInsightsScreen::-webkit-scrollbar { width: 10px; height: 10px; }
#learningInsightsScreen::-webkit-scrollbar-track { background: #e8edf4; }
#learningInsightsScreen::-webkit-scrollbar-thumb { border: 2px solid #e8edf4; border-radius: 999px; background: #94a5bc; }
#learningInsightsScreen::-webkit-scrollbar-thumb:hover { background: #778aa5; }
#learningInsightsScreen::-webkit-scrollbar-thumb:active { background: #617691; }

#learningInsightsScreen { box-sizing: border-box; }
#learningInsightsScreen :where(*) { box-sizing: border-box; font-family: inherit; }
#learningInsightsScreen :where(h1, h2, h3, h4, p, ol, ul, dl, dd, figure) { margin: 0; }
#learningInsightsScreen :where(ol, ul) { padding: 0; list-style: none; }
#learningInsightsScreen :where(img, svg) { display: block; max-width: 100%; }
#learningInsightsScreen :where(a) { color: inherit; text-decoration: none; }
#learningInsightsScreen :where(button:not(.d-btn)) {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
#learningInsightsScreen :where(button, a):focus-visible { outline: 3px solid rgba(58, 78, 251, 0.34); outline-offset: 3px; }
#learningInsightsHeading:focus,
.li-chapter-detail h3:focus,
.li-error-detail h3:focus { outline: none; }

.li-shell { min-height: 100dvh; padding-bottom: var(--li-safe-bottom); }
.li-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: calc(var(--li-topbar-height) + var(--li-safe-top));
  padding: var(--li-safe-top) clamp(14px, 3vw, 54px) 0;
  border-bottom: 1px solid var(--li-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 5px 18px rgba(24, 44, 77, 0.05);
}
.li-icon-button.d-btn,
.li-refresh.d-btn,
.li-route-nav .d-btn {
  min-height: 42px;
  border-color: transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--li-navy);
  box-shadow: none;
  text-transform: none;
}
.li-icon-button.d-btn { width: 44px; min-width: 44px; padding: 10px; border: 1px solid var(--li-line); background: #fff; }
.li-icon-button img { width: 20px; height: 20px; object-fit: contain; }
.li-brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; min-width: 0; }
.li-brand > img { width: 34px; height: 34px; object-fit: contain; }
.li-brand span { display: grid; min-width: 0; line-height: 1.12; }
.li-brand strong { overflow: hidden; color: var(--li-ink); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.li-brand small { overflow: hidden; margin-top: 3px; color: var(--li-muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.li-refresh.d-btn { justify-self: end; gap: 8px; padding-inline: 13px; border: 1px solid var(--li-line); background: #fff; font-weight: 700; }
.li-refresh[aria-disabled="true"] { pointer-events: none; opacity: 0.68; }
.li-refresh-icon { display: grid; width: 18px; height: 18px; place-items: center; }
.li-refresh-icon img { width: 18px; height: 18px; object-fit: contain; }
.li-refresh[aria-busy="true"] .li-refresh-icon { animation: li-spin 0.85s linear infinite; }

.li-route-nav {
  position: sticky;
  z-index: 25;
  top: calc(var(--li-topbar-height) + var(--li-safe-top) + 10px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: min(500px, calc(100% - 28px));
  margin: 16px auto 0;
  padding: 5px;
  border: 1px solid var(--li-line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--li-shadow-soft);
}
.li-route-nav .d-btn { gap: 9px; height: 48px; min-height: 48px; font-size: 15px; font-weight: 700; }
.li-route-nav .d-btn img { width: 23px; height: 23px; object-fit: contain; }
.li-route-nav .d-btn[aria-current="page"] { background: var(--li-navy); color: #fff; }

.li-main { width: min(1720px, calc(100% - clamp(28px, 5vw, 96px))); margin: clamp(24px, 3vw, 42px) auto 70px; }
.li-main > * + * { margin-top: 20px; }
.li-kicker { color: var(--li-teal); font-size: 13px; font-weight: 800; letter-spacing: 0.105em; line-height: 1.2; text-transform: uppercase; }
.li-page-heading h1,
.li-errors-heading h1 { margin-top: 7px; color: var(--li-navy); font-size: clamp(34px, 3.2vw, 42px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.06; }
.li-page-heading > p:last-child,
.li-errors-heading > div > p:last-child { margin-top: 10px; max-width: 660px; color: var(--li-muted); font-size: 16px; line-height: 1.55; }

.li-data-banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid #c9dedb; border-radius: 14px; background: var(--li-teal-soft); color: #315b59; font-size: 13px; line-height: 1.45; }
.li-live-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--li-teal); }

.li-stat-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr); gap: 20px; align-items: stretch; }
.li-overview,
.li-review-now,
.li-progress-groups,
.li-chapters,
.li-errors-heading,
.li-emerging,
.li-error-explorer,
.li-plan,
.li-recovered { min-width: 0; border: 1px solid var(--li-line); border-radius: 24px; background: var(--li-surface); box-shadow: var(--li-shadow-soft); }
.li-overview { padding: clamp(22px, 3vw, 38px); }
.li-recent-score { display: grid; grid-template-columns: minmax(210px, 0.7fr) minmax(240px, 1.3fr); align-items: end; gap: 30px; margin-top: 28px; padding: 22px 0 24px; border-top: 1px solid var(--li-line); border-bottom: 1px solid var(--li-line); }
.li-recent-score > div:first-child > span { color: var(--li-muted); font-size: 14px; font-weight: 700; }
.li-recent-score strong { display: block; margin-top: 2px; color: var(--li-navy); font-size: clamp(42px, 4vw, 62px); line-height: 1; letter-spacing: -0.055em; }
.li-recent-score p { margin-top: 8px; color: var(--li-muted); font-size: 14px; line-height: 1.45; }
.li-score-track { position: relative; height: 12px; overflow: hidden; border-radius: 999px; background: #e3e9f2; }
.li-score-track::before { position: absolute; inset: -8px auto -8px 50%; width: 1px; background: #b6c2d2; content: ""; }
.li-score-track > span { display: block; width: var(--li-score); height: 100%; border-radius: inherit; background: var(--li-teal); transition: width 240ms ease; }
.li-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
.li-metric { min-width: 0; padding: 3px 18px 0; border-left: 1px solid var(--li-line); }
.li-metric:first-child { padding-left: 0; border-left: 0; }
.li-metric:last-child { padding-right: 0; }
.li-metric > span { display: block; color: var(--li-muted); font-size: 13px; font-weight: 700; }
.li-metric > strong { display: block; overflow: hidden; margin-top: 7px; color: var(--li-ink); font-size: clamp(22px, 2vw, 30px); letter-spacing: -0.025em; text-overflow: ellipsis; white-space: nowrap; }
.li-metric > small { display: block; margin-top: 5px; color: var(--li-muted); font-size: 12px; line-height: 1.4; }
.li-metric.is-attention > strong { color: var(--li-coral); }
.li-metric.is-positive > strong { color: var(--li-teal); }

.li-review-now { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 3vw, 36px); overflow: hidden; border-color: #274a76; background: var(--li-navy); color: #fff; }
.li-review-now::before { position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: #2ab3a6; content: ""; }
.li-review-now.is-quiet { background: #203d68; }
.li-review-now.is-positive::before { background: #50c5a7; }
.li-review-now .li-kicker { color: #8ce1d8; }
.li-review-now h2 { margin-top: 9px; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; letter-spacing: -0.025em; }
.li-review-now > p:not(.li-kicker) { margin-top: 12px; color: #dce7f5; font-size: 15px; line-height: 1.55; }
.li-review-now .li-bangla-title { color: #dce7f5; }
.li-review-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.li-review-meta span { padding: 6px 9px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 999px; color: #edf4ff; font-size: 12px; font-weight: 700; }
.li-primary-action.d-btn,
.li-secondary-action.d-btn,
.li-more.d-btn,
.li-plan .li-primary-action.d-btn { min-height: 44px; border-radius: 13px; font-size: 14px; font-weight: 800; text-transform: none; }
.li-primary-action.d-btn { gap: 9px; margin-top: 20px; border-color: var(--li-action); background: var(--li-action); color: #fff; }
.li-primary-action.d-btn:hover { border-color: var(--li-action-dark); background: var(--li-action-dark); }
.li-primary-action.d-btn img { width: 16px; height: 16px; object-fit: contain; filter: brightness(0) invert(1); }
.li-review-now .li-primary-action.d-btn { width: 100%; border-color: #fff; background: #fff; color: var(--li-navy); }
.li-review-now .li-primary-action.d-btn:hover { border-color: #e8eff8; background: #e8eff8; }
.li-review-now .li-primary-action.d-btn img { filter: none; }
.li-secondary-action.d-btn,
.li-more.d-btn { border: 1px solid var(--li-line-strong); background: #fff; color: var(--li-navy); box-shadow: none; }

.li-progress-groups { display: grid; grid-template-columns: 1fr 1fr; padding: 0 clamp(20px, 2.7vw, 34px); }
.li-progress-groups > div { min-width: 0; padding: 24px 0 26px; }
.li-progress-groups > div + div { margin-left: 30px; padding-left: 30px; border-left: 1px solid var(--li-line); }
.li-progress-groups header { display: flex; align-items: center; gap: 10px; }
.li-progress-groups header > span { width: 11px; height: 11px; border-radius: 3px; background: var(--li-teal); }
.li-progress-groups .is-review header > span { background: var(--li-coral); }
.li-progress-groups h2 { color: var(--li-navy); font-size: 19px; line-height: 1.2; }
.li-progress-groups ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.li-progress-groups li { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.li-progress-groups li > span { display: grid; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: var(--li-teal-soft); color: var(--li-teal); font-size: 12px; font-weight: 800; place-items: center; }
.li-progress-groups .is-review li > span { background: var(--li-coral-soft); color: var(--li-coral); }
.li-progress-groups li p { min-width: 0; }
.li-progress-groups li strong { display: -webkit-box; overflow: hidden; color: var(--li-ink); font-size: 13px; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.li-progress-groups li small { display: block; margin-top: 4px; color: var(--li-muted); font-size: 11px; line-height: 1.35; }
.li-group-empty { margin-top: 14px; color: var(--li-muted); font-size: 14px; line-height: 1.5; }

.li-chapters { padding: clamp(22px, 3vw, 36px); }
.li-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.li-section-heading h2,
.li-emerging h2,
.li-lens-head h2,
.li-plan h2,
.li-recovered h2 { margin-top: 6px; color: var(--li-navy); font-size: clamp(24px, 2.2vw, 31px); letter-spacing: -0.025em; line-height: 1.15; }
.li-section-heading > div:first-child > p:last-child { margin-top: 9px; color: var(--li-muted); font-size: 14px; line-height: 1.5; }
.li-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 13px; max-width: 560px; }
.li-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--li-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.li-legend span::before { width: 9px; height: 9px; border-radius: 3px; background: #a8b4c4; content: ""; }
.li-legend .is-solido::before { background: var(--li-teal); }
.li-legend .is-in-miglioramento::before { background: var(--li-action); }
.li-legend .is-attenzione::before { background: var(--li-coral); }
.li-legend .is-pochi-dati::before { background: var(--li-amber); }

.li-chapter-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 25px; }
.li-chapter-workspace.is-open { grid-template-columns: minmax(0, 2.2fr) minmax(300px, 0.8fr); align-items: start; }
.li-chapter-matrix { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; min-width: 0; }
.li-chapter-cell { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; width: 100%; min-width: 0; min-height: 94px; padding: 13px 12px; border: 1px solid var(--li-line) !important; border-left-width: 4px !important; border-radius: 14px; background: #fff !important; color: var(--li-ink); box-shadow: none; }
.li-chapter-cell:hover { border-color: #aebdd0 !important; background: #f8faff !important; }
.li-chapter-cell.is-selected { border-color: var(--li-action) !important; background: var(--li-blue-soft) !important; box-shadow: 0 0 0 2px rgba(58, 78, 251, 0.12); }
.li-chapter-cell.is-solido { border-left-color: var(--li-teal) !important; }
.li-chapter-cell.is-in-miglioramento { border-left-color: var(--li-action) !important; }
.li-chapter-cell.is-attenzione { border-left-color: var(--li-coral) !important; }
.li-chapter-cell.is-pochi-dati,
.li-chapter-cell.is-in-pratica { border-left-color: var(--li-amber) !important; }
.li-chapter-cell.is-non-iniziato { border-left-color: #a8b4c4 !important; }
.li-chapter-number { display: grid; width: 32px; height: 32px; border-radius: 9px; background: #edf1f7; color: var(--li-navy); font-size: 12px; font-weight: 800; place-items: center; }
.li-chapter-copy { display: block; min-width: 0; }
.li-chapter-copy strong { display: -webkit-box; overflow: hidden; color: var(--li-ink); font-size: 13px; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.li-chapter-copy small { display: block; margin-top: 6px; color: var(--li-muted); font-size: 11px; font-weight: 700; line-height: 1.25; }
.li-chapter-count { position: absolute; right: 8px; bottom: 8px; display: grid; width: 20px; height: 20px; border-radius: 999px; background: var(--li-coral-soft); color: var(--li-coral); font-size: 10px; font-weight: 800; place-items: center; }
.li-chapter-detail { position: relative; min-width: 0; padding: 22px; border: 1px solid #cdd9e8; border-radius: 18px; background: #f8faff; }
.li-chapter-detail-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: none; width: 38px; height: 38px; border: 1px solid var(--li-line) !important; border-radius: 11px; background: #fff !important; }
.li-chapter-detail-close span::before,
.li-chapter-detail-close span::after { position: absolute; top: 18px; left: 10px; width: 17px; height: 2px; border-radius: 2px; background: var(--li-navy); content: ""; }
.li-chapter-detail-close span::before { transform: rotate(45deg); }
.li-chapter-detail-close span::after { transform: rotate(-45deg); }
.li-detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.li-detail-title small { color: var(--li-muted); font-size: 12px; font-weight: 700; }
.li-chapter-detail h3,
.li-error-detail h3 { margin-top: 11px; color: var(--li-navy); font-size: clamp(21px, 2vw, 27px); line-height: 1.18; letter-spacing: -0.025em; }
.li-bangla-title { margin-top: 7px !important; color: #52637b; font-size: 15px; line-height: 1.45; }
.li-chapter-detail dl { display: grid; grid-template-columns: 1fr 1fr; margin-top: 19px; border-top: 1px solid var(--li-line); border-left: 1px solid var(--li-line); }
.li-chapter-detail dl div { padding: 11px; border-right: 1px solid var(--li-line); border-bottom: 1px solid var(--li-line); }
.li-chapter-detail dt { color: var(--li-muted); font-size: 11px; font-weight: 700; }
.li-chapter-detail dd { margin-top: 4px; color: var(--li-ink); font-size: 18px; font-weight: 800; }
.li-detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.li-detail-actions .d-btn { flex: 1 1 130px; margin-top: 0; }
.li-state { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 4px 8px; border-radius: 999px; background: #edf1f6; color: #5d6d82; font-size: 10px; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.li-state.is-solido { background: var(--li-teal-soft); color: #087268; }
.li-state.is-in-miglioramento { background: var(--li-blue-soft); color: #2c46c7; }
.li-state.is-attenzione { background: var(--li-coral-soft); color: #a83c39; }
.li-state.is-pochi-dati,
.li-state.is-in-pratica { background: var(--li-amber-soft); color: #82500b; }
.li-state.is-recuperato { background: #e8f7ef; color: #16764e; }

.li-errors-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: clamp(22px, 3vw, 34px); }
.li-errors-heading dl { display: grid; grid-template-columns: repeat(3, minmax(105px, 1fr)); min-width: min(440px, 46%); border: 1px solid var(--li-line); border-radius: 16px; overflow: hidden; }
.li-errors-heading dl div { padding: 14px 16px; border-left: 1px solid var(--li-line); }
.li-errors-heading dl div:first-child { border-left: 0; }
.li-errors-heading dt { color: var(--li-muted); font-size: 11px; font-weight: 700; line-height: 1.2; }
.li-errors-heading dd { margin-top: 4px; color: var(--li-navy); font-size: 25px; font-weight: 800; }
.li-emerging { padding: 22px clamp(20px, 2.7vw, 32px); }
.li-emerging > header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.li-emerging > header > p { max-width: 460px; color: var(--li-muted); font-size: 14px; line-height: 1.5; }
.li-emerging.is-quiet { border-style: dashed; box-shadow: none; }
.li-emerging-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 18px; }
.li-emerging-card { display: grid; grid-template-columns: 30px 54px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 11px; border: 1px solid var(--li-line) !important; border-radius: 15px; background: #fff !important; }
.li-emerging-card:hover { border-color: #aebdd0 !important; background: #f8faff !important; }
.li-emerging-rank { color: #9aabc0; font-size: 11px; font-weight: 800; }
.li-emerging-media,
.li-row-media { position: relative; display: grid; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--li-line); border-radius: 10px; background: #eef2f7; place-items: center; }
.li-emerging-media { width: 54px; height: 50px; }
.li-row-media { width: 56px; height: 52px; }
.li-emerging-media img,
.li-row-media img { width: 100%; height: 100%; object-fit: contain; }
.li-emerging-type,
.li-error-index { display: grid; width: 48px; height: 48px; border-radius: 11px; background: var(--li-blue-soft); color: var(--li-action-dark); font-size: 11px; font-weight: 800; place-items: center; }
.li-emerging-copy,
.li-error-copy { display: block; min-width: 0; }
.li-emerging-copy small,
.li-error-copy small { color: var(--li-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.li-emerging-copy strong,
.li-error-copy strong { display: -webkit-box; overflow: hidden; margin-top: 3px; color: var(--li-ink); font-size: 13px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.li-emerging-copy > span,
.li-error-copy > span { display: -webkit-box; overflow: hidden; margin-top: 4px; color: var(--li-muted); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.li-errors-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 0.82fr); gap: 20px; align-items: start; }
.li-error-explorer { min-width: 0; padding: clamp(20px, 2.6vw, 30px); }
.li-lens-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.li-lens-head > span { color: var(--li-muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.li-lenses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 17px; padding: 5px; border: 1px solid var(--li-line); border-radius: 15px; background: #f2f5f9; }
.li-lenses .d-btn { justify-content: space-between; gap: 6px; min-width: 0; min-height: 42px; padding-inline: 11px; border: 0; border-radius: 11px; background: transparent; color: var(--li-muted); box-shadow: none; font-size: 12px; font-weight: 700; text-transform: none; }
.li-lenses .d-btn small { display: grid; flex: 0 0 auto; min-width: 22px; height: 22px; border-radius: 999px; background: #fff; color: var(--li-muted); font-size: 10px; place-items: center; }
.li-lenses .d-btn[aria-selected="true"] { background: var(--li-navy); color: #fff; }
.li-lenses .d-btn[aria-selected="true"] small { color: var(--li-navy); }
.li-explorer-body { display: grid; grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr); min-width: 0; margin-top: 17px; border: 1px solid var(--li-line); border-radius: 17px; overflow: hidden; }
.li-list-pane { min-width: 0; padding: 8px; background: #f7f9fc; }
.li-detail-pane { min-width: 0; border-left: 1px solid var(--li-line); background: #fff; }
.li-error-list { display: grid; gap: 6px; }
.li-error-row > button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 18px; align-items: center; gap: 11px; width: 100%; min-width: 0; min-height: 76px; padding: 10px; border: 1px solid transparent !important; border-radius: 13px; background: transparent !important; }
.li-error-row > button:hover { background: #fff !important; }
.li-error-row.is-selected > button { border-color: #b9c7d9 !important; background: #fff !important; box-shadow: var(--li-shadow-soft); }
.li-disclosure { width: 17px; height: 17px; background: url("../icons/next.png") center / contain no-repeat; opacity: 0.55; }
.li-error-row.is-selected .li-disclosure { transform: rotate(90deg); }
.li-more.d-btn { width: 100%; margin-top: 8px; }
.li-empty-list { display: grid; min-height: 250px; padding: 30px; text-align: center; place-content: center; justify-items: center; }
.li-empty-mark { position: relative; width: 44px; height: 44px; border: 1px solid var(--li-line); border-radius: 13px; background: #fff; }
.li-empty-mark::before,
.li-empty-mark::after { position: absolute; top: 21px; left: 12px; width: 20px; height: 2px; border-radius: 2px; background: var(--li-teal); content: ""; }
.li-empty-mark::after { transform: rotate(90deg); }
.li-empty-list h3 { margin-top: 14px; color: var(--li-navy); font-size: 19px; }
.li-empty-list p { max-width: 410px; margin-top: 7px; color: var(--li-muted); font-size: 13px; line-height: 1.5; }
.li-detail-placeholder { display: grid; min-height: 100%; padding: 40px; text-align: center; place-content: center; justify-items: center; }
.li-placeholder-route { width: 64px; height: 8px; border-radius: 999px; background: #dbe3ee; }
.li-detail-placeholder h3 { margin-top: 17px; color: var(--li-navy); font-size: 20px; }
.li-detail-placeholder p { max-width: 340px; margin-top: 8px; color: var(--li-muted); font-size: 13px; line-height: 1.5; }
.li-error-detail { position: relative; min-width: 0; padding: 22px; }
.li-detail-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 36px; height: 36px; border: 1px solid var(--li-line) !important; border-radius: 11px; background: rgba(255, 255, 255, 0.95) !important; }
.li-detail-close span::before,
.li-detail-close span::after { position: absolute; top: 17px; left: 10px; width: 16px; height: 2px; border-radius: 2px; background: var(--li-navy); content: ""; }
.li-detail-close span::before { transform: rotate(45deg); }
.li-detail-close span::after { transform: rotate(-45deg); }
.li-error-detail figure { margin-bottom: 20px; }
.li-media-frame { position: relative; display: grid; overflow: hidden; width: 100%; height: clamp(190px, 22vw, 300px); border: 1px solid var(--li-line); border-radius: 15px; background: #f0f3f7; place-items: center; }
.li-media-frame img { width: 100%; height: 100%; padding: 12px; object-fit: contain; }
.li-error-detail figcaption { margin-top: 7px; color: var(--li-muted); font-size: 11px; }
.li-media-fallback { display: none; color: var(--li-muted); font-size: 12px; font-weight: 700; }
#learningInsightsScreen .is-unavailable .li-media-fallback { display: block; }
#learningInsightsScreen .is-unavailable img,
#learningInsightsScreen .is-unavailable .li-figure-image { display: none; }
.li-why { margin-top: 17px; padding: 14px; border-left: 4px solid var(--li-coral); border-radius: 0 12px 12px 0; background: var(--li-coral-soft); }
.li-why strong { color: #83312e; font-size: 12px; }
.li-why p { margin-top: 4px; color: #70403d; font-size: 13px; line-height: 1.48; }
.li-simple-copy { margin-top: 13px !important; color: #42536b; font-size: 14px; line-height: 1.55; }
.li-related { margin-top: 18px; }
.li-related h4 { color: var(--li-navy); font-size: 14px; }
.li-related ul { display: grid; gap: 6px; margin-top: 8px; }
.li-related li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; padding: 9px; border-radius: 10px; background: #f4f7fa; }
.li-related li span { color: var(--li-action-dark); font-size: 10px; font-weight: 800; }
.li-related li p { color: #536279; font-size: 12px; line-height: 1.4; }

.li-plan { padding: 24px; border-top: 5px solid var(--li-teal); }
.li-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.li-plan-head > span { display: grid; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; background: var(--li-teal-soft); color: var(--li-teal); font-size: 13px; font-weight: 800; place-items: center; }
.li-plan-intro,
.li-plan > p:not(.li-kicker) { margin-top: 10px; color: var(--li-muted); font-size: 13px; line-height: 1.5; }
.li-plan > ol { display: grid; gap: 16px; margin-top: 20px; }
.li-plan > ol > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-top: 16px; border-top: 1px solid var(--li-line); }
.li-plan-number { display: grid; width: 27px; height: 27px; border-radius: 9px; background: var(--li-navy); color: #fff; font-size: 11px; font-weight: 800; place-items: center; }
.li-plan li strong { display: block; color: var(--li-ink); font-size: 14px; line-height: 1.35; }
.li-plan li small { display: block; margin-top: 4px; color: var(--li-muted); font-size: 12px; line-height: 1.4; }
.li-plan li p { margin-top: 7px; color: var(--li-muted); font-size: 12px; line-height: 1.45; }
.li-plan .li-primary-action.d-btn { width: 100%; margin-top: 11px; }
.li-plan > .li-secondary-action { width: 100%; margin-top: 18px; }
.li-recovered { padding: 24px clamp(20px, 2.7vw, 32px); border-color: #c8e3d7; }
.li-recovered > header { display: flex; align-items: center; gap: 13px; }
.li-recovered-mark { position: relative; display: block; width: 38px; height: 38px; border-radius: 12px; background: #e8f7ef; }
.li-recovered-mark::before { position: absolute; top: 11px; left: 10px; width: 16px; height: 9px; border-bottom: 3px solid #23845b; border-left: 3px solid #23845b; content: ""; transform: rotate(-45deg); }
.li-recovered ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.li-recovered li { display: grid; padding: 14px; border: 1px solid #d6eadf; border-radius: 13px; background: #f5fbf8; }
.li-recovered li small { color: #5d7b6e; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.li-recovered li strong { overflow: hidden; margin-top: 4px; color: #203d34; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.li-recovered li span { margin-top: 7px; color: #23845b; font-size: 11px; font-weight: 800; }

.li-failure { width: min(700px, 100%); margin: 90px auto 0; padding: clamp(26px, 5vw, 48px); border: 1px solid var(--li-line); border-radius: 24px; background: #fff; box-shadow: var(--li-shadow); }
.li-failure-mark { position: relative; display: block; width: 54px; height: 54px; margin-bottom: 22px; border: 1px solid var(--li-line); border-radius: 16px; background: var(--li-coral-soft); }
.li-failure-mark::before { position: absolute; top: 13px; left: 25px; width: 4px; height: 19px; border-radius: 4px; background: var(--li-coral); content: ""; }
.li-failure-mark::after { position: absolute; bottom: 11px; left: 25px; width: 4px; height: 4px; border-radius: 50%; background: var(--li-coral); content: ""; }
.li-failure h1 { margin-top: 7px; color: var(--li-navy); font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -0.035em; }
.li-failure > p:last-of-type { max-width: 570px; margin-top: 12px; color: var(--li-muted); font-size: 15px; line-height: 1.55; }
.li-failure > div:last-child { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.li-failure .d-btn { flex: 1 1 190px; margin-top: 0; }

.li-skeleton-heading { display: grid; gap: 10px; width: min(470px, 75%); }
.li-skeleton-heading span,
.li-skeleton-overview span,
.li-skeleton-action span,
.li-skeleton-matrix span { border-radius: 11px; background: #dfe6ef; animation: li-pulse 1.2s ease-in-out infinite alternate; }
.li-skeleton-heading span:first-child { width: 105px; height: 13px; }
.li-skeleton-heading span:last-child { width: 100%; height: 42px; }
.li-skeleton-top { display: grid; grid-template-columns: 2.15fr 0.85fr; gap: 20px; margin-top: 24px; }
.li-skeleton-overview,
.li-skeleton-action { display: grid; gap: 14px; min-height: 285px; padding: 30px; border: 1px solid var(--li-line); border-radius: 24px; background: #fff; }
.li-skeleton-overview span:first-child { width: 48%; height: 50px; }
.li-skeleton-overview span:nth-child(2) { width: 100%; height: 70px; }
.li-skeleton-overview span:nth-child(3),
.li-skeleton-overview span:nth-child(4) { width: 100%; height: 42px; }
.li-skeleton-action span:first-child { width: 80%; height: 90px; }
.li-skeleton-action span:last-child { align-self: end; width: 100%; height: 44px; }
.li-skeleton-matrix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 20px; padding: 28px; border: 1px solid var(--li-line); border-radius: 24px; background: #fff; }
.li-skeleton-matrix span { height: 90px; }
.li-loading-copy { width: min(1720px, calc(100% - 28px)); margin: -48px auto 30px; color: var(--li-muted); font-size: 13px; text-align: center; }

@media (min-width: 1024px) {
  .li-topbar { padding-inline: clamp(28px, 4vw, 70px); }
  .li-chapter-detail { position: sticky; top: calc(145px + var(--li-safe-top)); }
  .li-plan { position: sticky; top: calc(145px + var(--li-safe-top)); }
}
@media (max-width: 1279px) {
  .li-main { width: min(1180px, calc(100% - 36px)); }
  .li-metric-grid { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .li-metric:nth-child(3) { padding-left: 0; border-left: 0; }
  .li-progress-groups ul { grid-template-columns: 1fr; }
  .li-chapter-workspace.is-open { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.85fr); }
  .li-emerging-card { grid-template-columns: 26px 46px minmax(0, 1fr); }
  .li-emerging-card > .li-state { grid-column: 3; }
  .li-emerging-media { width: 46px; height: 46px; }
}
@media (max-width: 1023px) {
  .li-stat-layout { grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr); }
  .li-recent-score { grid-template-columns: 1fr; gap: 15px; }
  .li-chapter-workspace.is-open { grid-template-columns: 1fr; }
  .li-errors-layout { grid-template-columns: minmax(0, 1fr); }
  .li-plan { position: static; display: grid; grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr); gap: 20px; }
  .li-plan > ol { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .li-plan > .li-secondary-action { align-self: end; }
}
@media (max-width: 800px) {
  .li-stat-layout { grid-template-columns: 1fr; }
  .li-review-now { min-height: 0; }
}
@media (max-width: 767px) {
  #learningInsightsScreen { --li-topbar-height: 60px; scroll-padding-top: calc(132px + var(--li-safe-top)); scrollbar-gutter: auto; }
  .li-topbar { gap: 9px; padding-inline: 12px; }
  .li-main { width: calc(100% - 24px); margin-top: 20px; }
  .li-route-nav { top: calc(var(--li-topbar-height) + var(--li-safe-top) + 8px); margin-top: 12px; }
  .li-stat-layout { grid-template-columns: 1fr; }
  .li-review-now { min-height: 0; }
  .li-progress-groups { grid-template-columns: 1fr; }
  .li-progress-groups > div + div { margin: 0; padding-top: 21px; padding-left: 0; border-top: 1px solid var(--li-line); border-left: 0; }
  .li-progress-groups ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .li-section-heading { display: grid; gap: 17px; }
  .li-legend { justify-content: flex-start; }
  .li-chapter-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .li-chapter-workspace.is-open::before { position: fixed; z-index: 59; inset: 0; background: rgba(10, 28, 54, 0.42); content: ""; }
  .li-chapter-detail { position: fixed; z-index: 60; right: 10px; bottom: max(10px, env(safe-area-inset-bottom, 0px)); left: 10px; max-height: min(76dvh, 680px); overflow-y: auto; padding: 24px 18px; border-radius: 21px; background: #fff; box-shadow: 0 24px 70px rgba(14, 35, 68, 0.3); }
  .li-chapter-detail-close { display: block; }
  .li-chapter-detail-copy { padding-right: 42px; }
  .li-errors-heading { display: grid; }
  .li-errors-heading dl { min-width: 0; width: 100%; }
  .li-emerging > header { display: grid; gap: 7px; }
  .li-emerging-grid { grid-template-columns: 1fr; }
  .li-emerging-card { grid-template-columns: 28px 54px minmax(0, 1fr) auto; }
  .li-emerging-card > .li-state { grid-column: auto; }
  .li-errors-layout { display: flex; flex-direction: column; }
  .li-plan { order: -1; width: 100%; }
  .li-error-explorer { width: 100%; }
  .li-explorer-body { grid-template-columns: 1fr; }
  .li-detail-pane { border-top: 1px solid var(--li-line); border-left: 0; }
  .li-detail-placeholder { display: none; }
  .li-lenses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .li-error-row > button { grid-template-columns: auto minmax(0, 1fr) 18px; }
  .li-error-row .li-state { grid-column: 2; width: fit-content; }
  .li-disclosure { grid-column: 3; grid-row: 1 / span 2; }
  .li-plan { display: block; }
  .li-plan > ol { margin-top: 20px; }
  .li-recovered ul { grid-template-columns: 1fr; }
  .li-skeleton-top { grid-template-columns: 1fr; }
  .li-skeleton-action { min-height: 190px; }
  .li-skeleton-matrix { grid-template-columns: repeat(2, 1fr); padding: 18px; }
}
@media (max-width: 430px) {
  .li-brand > img { width: 30px; height: 30px; }
  .li-brand strong { font-size: 14px; }
  .li-brand small { font-size: 10px; }
  .li-refresh-label { display: none; }
  .li-refresh.d-btn { width: 44px; min-width: 44px; padding: 10px; }
  .li-route-nav { width: calc(100% - 24px); }
  .li-route-nav .d-btn { height: 46px; min-height: 46px; padding-inline: 9px; font-size: 13px; }
  .li-route-nav .d-btn img { width: 21px; height: 21px; }
  .li-main { width: calc(100% - 20px); }
  .li-page-heading h1,
  .li-errors-heading h1 { font-size: clamp(28px, 9vw, 34px); }
  .li-overview,
  .li-review-now,
  .li-chapters,
  .li-errors-heading,
  .li-emerging,
  .li-error-explorer,
  .li-plan,
  .li-recovered { border-radius: 19px; }
  .li-overview,
  .li-chapters,
  .li-error-explorer { padding: 20px 16px; }
  .li-review-now,
  .li-errors-heading,
  .li-emerging,
  .li-plan,
  .li-recovered { padding: 20px; }
  .li-metric-grid { gap: 16px 0; }
  .li-metric { padding-inline: 11px; }
  .li-metric > strong { font-size: 22px; }
  .li-progress-groups { padding-inline: 17px; border-radius: 19px; }
  .li-progress-groups ul { grid-template-columns: 1fr; }
  .li-chapter-cell { grid-template-columns: 29px minmax(0, 1fr); gap: 7px; min-height: 100px; padding: 11px 8px; }
  .li-chapter-number { width: 28px; height: 28px; }
  .li-chapter-copy strong { font-size: 12px; }
  .li-legend { gap: 7px 11px; }
  .li-errors-heading dl { grid-template-columns: 1fr 1fr 1fr; }
  .li-errors-heading dl div { padding: 11px 8px; }
  .li-errors-heading dt { font-size: 9px; }
  .li-errors-heading dd { font-size: 21px; }
  .li-emerging-card { grid-template-columns: 24px 46px minmax(0, 1fr); }
  .li-emerging-card > .li-state { grid-column: 3; }
  .li-emerging-media { width: 46px; height: 46px; }
  .li-lenses .d-btn { padding-inline: 8px; font-size: 11px; }
  .li-error-row > button { gap: 8px; padding: 8px; }
  .li-row-media { width: 48px; height: 48px; }
  .li-error-index { width: 44px; height: 44px; }
  .li-error-detail { padding: 18px 14px; }
  .li-media-frame { height: 210px; }
}
@media (max-width: 360px) {
  .li-topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; padding-inline: 9px; }
  .li-icon-button.d-btn,
  .li-refresh.d-btn { width: 40px; min-width: 40px; min-height: 40px; }
  .li-brand { gap: 7px; }
  .li-brand small { display: none; }
  .li-route-nav { width: calc(100% - 18px); }
  .li-main { width: calc(100% - 16px); }
  .li-lenses { gap: 4px; padding: 4px; }
  .li-lenses .d-btn { min-height: 40px; padding-inline: 6px; }
  .li-lenses .d-btn small { min-width: 19px; height: 19px; }
  .li-chapter-matrix { gap: 7px; }
  .li-chapter-cell { min-height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  #learningInsightsScreen *,
  #learningInsightsScreen *::before,
  #learningInsightsScreen *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
@media (forced-colors: active) {
  .li-route-nav .d-btn[aria-current="page"],
  .li-lenses .d-btn[aria-selected="true"],
  .li-chapter-cell.is-selected { outline: 2px solid CanvasText; }
  .li-state,
  .li-review-meta span { border: 1px solid CanvasText; }
}
@keyframes li-spin { to { transform: rotate(360deg); } }
@keyframes li-pulse { from { opacity: 0.48; } to { opacity: 1; } }

/*
 * Quiet study canvas
 * ------------------
 * The learning routes are information tools, not a stack of nested cards.
 * Keep one surface per section, use rules for grouping, and reserve elevation
 * for the single next-action panel. This makes the same rhythm hold on a
 * narrow phone and on a wide desktop viewport.
 */
#learningInsightsScreen {
  --li-page: #eef3f7;
  --li-line: #d7e1ea;
  --li-line-strong: #c2cfdd;
  --li-shadow: none;
  --li-shadow-soft: 0 5px 18px rgba(25, 47, 83, 0.045);
}

#learningInsightsScreen .li-topbar {
  height: calc(68px + var(--li-safe-top));
  border-bottom-color: #d6e0e9;
  box-shadow: none;
}

#learningInsightsScreen .li-route-nav {
  width: min(560px, calc(100% - 32px));
  margin-top: 12px;
  padding: 3px;
  border: 1px solid var(--li-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

#learningInsightsScreen .li-route-nav .d-btn {
  height: 44px;
  min-height: 44px;
  border-radius: 11px;
  font-size: 14px;
}

#learningInsightsScreen .li-main {
  width: min(1240px, calc(100% - 48px));
  margin-top: 26px;
  margin-bottom: 56px;
}

#learningInsightsScreen .li-main > * + * { margin-top: 16px; }

#learningInsightsScreen .li-overview,
#learningInsightsScreen .li-review-now,
#learningInsightsScreen .li-progress-groups,
#learningInsightsScreen .li-chapters,
#learningInsightsScreen .li-errors-heading,
#learningInsightsScreen .li-emerging,
#learningInsightsScreen .li-error-explorer,
#learningInsightsScreen .li-plan,
#learningInsightsScreen .li-recovered {
  border-radius: 18px;
  box-shadow: none;
}

#learningInsightsScreen .li-overview { padding: 28px; }
#learningInsightsScreen .li-review-now { padding: 28px; }
#learningInsightsScreen .li-progress-groups { padding-inline: 26px; }
#learningInsightsScreen .li-chapters { padding: 28px; }

#learningInsightsScreen .li-chapter-workspace { gap: 14px; margin-top: 20px; }
#learningInsightsScreen .li-chapter-matrix { gap: 8px; }
#learningInsightsScreen .li-chapter-cell {
  min-height: 84px;
  padding: 10px 11px;
  border-left-width: 3px !important;
  border-radius: 12px;
}
#learningInsightsScreen .li-chapter-number { width: 30px; height: 30px; border-radius: 8px; }
#learningInsightsScreen .li-chapter-copy strong { font-size: 12px; line-height: 1.25; }
#learningInsightsScreen .li-chapter-copy small { margin-top: 5px; font-size: 10px; }

#learningInsightsScreen .li-errors-heading { padding: 22px 28px; }
#learningInsightsScreen .li-errors-heading dl {
  min-width: min(420px, 45%);
  border: 0;
  border-radius: 12px;
  background: #f5f8fb;
}
#learningInsightsScreen .li-errors-heading dl div { padding: 12px 15px; }

#learningInsightsScreen .li-emerging { padding: 22px 28px; }
#learningInsightsScreen .li-emerging-grid {
  gap: 0;
  margin-top: 14px;
  border-top: 1px solid var(--li-line);
}
#learningInsightsScreen .li-emerging-card {
  min-height: 70px;
  padding: 12px 0;
  border: 0 !important;
  border-bottom: 1px solid var(--li-line) !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}
#learningInsightsScreen .li-emerging-card:hover { background: #f7fafc !important; }
#learningInsightsScreen .li-emerging-card:last-child { border-bottom: 0 !important; }

#learningInsightsScreen .li-errors-layout { gap: 16px; }
#learningInsightsScreen .li-error-explorer { padding: 22px 28px; }
#learningInsightsScreen .li-lenses {
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: #edf2f6;
}
#learningInsightsScreen .li-lenses .d-btn { min-height: 40px; border-radius: 9px; }
#learningInsightsScreen .li-explorer-body {
  margin-top: 14px;
  border: 0;
  border-top: 1px solid var(--li-line);
  border-radius: 0;
  overflow: visible;
}
#learningInsightsScreen .li-list-pane { padding: 10px 0 0; background: transparent; }
#learningInsightsScreen .li-detail-pane { background: #f7f9fb; }
#learningInsightsScreen .li-error-list { gap: 0; }
#learningInsightsScreen .li-error-row > button {
  min-height: 72px;
  padding: 11px 8px;
  border: 0 !important;
  border-bottom: 1px solid var(--li-line) !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}
#learningInsightsScreen .li-error-row > button:hover { background: #f7fafc !important; }
#learningInsightsScreen .li-error-row:last-child > button { border-bottom: 0 !important; }
#learningInsightsScreen .li-error-row.is-selected > button {
  border-left: 3px solid var(--li-action) !important;
  background: var(--li-blue-soft) !important;
  box-shadow: none;
}
#learningInsightsScreen .li-plan { padding: 22px; border-top-width: 3px; }
#learningInsightsScreen .li-error-detail { padding: 22px; }
#learningInsightsScreen .li-media-frame { height: clamp(170px, 18vw, 240px); border-radius: 12px; }

@media (max-width: 767px) {
  #learningInsightsScreen .li-main { width: calc(100% - 24px); margin-top: 20px; margin-bottom: 40px; }
  #learningInsightsScreen .li-overview,
  #learningInsightsScreen .li-chapters,
  #learningInsightsScreen .li-error-explorer { padding: 20px 16px; }
  #learningInsightsScreen .li-review-now,
  #learningInsightsScreen .li-errors-heading,
  #learningInsightsScreen .li-emerging,
  #learningInsightsScreen .li-plan,
  #learningInsightsScreen .li-recovered { padding: 19px 16px; }
  #learningInsightsScreen .li-errors-heading dl { width: 100%; min-width: 0; }
  #learningInsightsScreen .li-emerging-card { padding: 11px 0; }
  #learningInsightsScreen .li-explorer-body { margin-top: 12px; }
  #learningInsightsScreen .li-detail-pane { border-top: 1px solid var(--li-line); }
  #learningInsightsScreen .li-error-detail { padding: 20px 16px; }
  #learningInsightsScreen .li-media-frame { height: 190px; }
  #learningInsightsScreen .li-chapter-cell { min-height: 82px; padding: 9px 8px; }
}

@media (max-width: 430px) {
  #learningInsightsScreen .li-main { width: calc(100% - 20px); }
  #learningInsightsScreen .li-route-nav { width: calc(100% - 24px); }
  #learningInsightsScreen .li-route-nav .d-btn { height: 44px; min-height: 44px; font-size: 12px; }
  #learningInsightsScreen .li-progress-groups { padding-inline: 16px; }
  #learningInsightsScreen .li-chapter-cell { min-height: 78px; }
  #learningInsightsScreen .li-errors-heading dl div { padding: 10px 7px; }
  #learningInsightsScreen .li-errors-heading dt { font-size: 9px; }
  #learningInsightsScreen .li-errors-heading dd { font-size: 20px; }
}

/* Figure media and learner-facing status language. */
#learningInsightsScreen .li-row-media,
#learningInsightsScreen .li-emerging-media {
  width: 64px;
  height: 58px;
  border-color: #cfdbe7;
  border-radius: 10px;
  background: #fff;
}
#learningInsightsScreen .li-row-media img,
#learningInsightsScreen .li-emerging-media img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}
#learningInsightsScreen .li-emerging-card { grid-template-columns: 28px 64px minmax(0, 1fr) auto; }

#learningInsightsScreen .li-media-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 140px;
  padding: 10px;
  overflow: visible;
  background: #fff;
}
#learningInsightsScreen .li-media-frame .li-figure-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(52vh, 430px);
  padding: 0;
  object-fit: contain;
}

#learningInsightsScreen .li-explanation-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--li-line);
}
#learningInsightsScreen .li-explanation-label {
  color: var(--li-navy);
  font-size: 13px;
  font-weight: 800;
}
#learningInsightsScreen .li-explanation-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--li-line);
  border-radius: 12px;
  background: #fff;
}
#learningInsightsScreen .li-explanation-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(50vh, 420px);
  object-fit: contain;
}

#learningInsightsScreen .li-state { min-height: 26px; padding: 5px 10px; font-size: 11px; letter-spacing: 0.01em; }
#learningInsightsScreen .li-state.is-solido { background: #d9f5ed; color: #0f766e; }
#learningInsightsScreen .li-state.is-in-pratica { background: #dcfce7; color: #15803d; }
#learningInsightsScreen .li-state.is-in-miglioramento { background: #ede9fe; color: #6d28d9; }
#learningInsightsScreen .li-state.is-attenzione { background: #fee4e2; color: #b42318; }
#learningInsightsScreen .li-state.is-pochi-dati { background: #fff0c2; color: #8a4b08; }
#learningInsightsScreen .li-state.is-non-iniziato { background: #e7edf4; color: #44546a; }
#learningInsightsScreen .li-state.is-recuperato { background: #dcfce7; color: #15803d; }
#learningInsightsScreen .li-legend .is-solido::before { background: #0f766e; }
#learningInsightsScreen .li-legend .is-in-pratica::before { background: #15803d; }
#learningInsightsScreen .li-legend .is-in-miglioramento::before { background: #6d28d9; }
#learningInsightsScreen .li-legend .is-attenzione::before { background: #b42318; }
#learningInsightsScreen .li-legend .is-pochi-dati::before { background: #a16207; }
#learningInsightsScreen .li-legend .is-non-iniziato::before { background: #64748b; }
#learningInsightsScreen .li-chapter-cell.is-solido { border-left-color: #0f766e !important; }
#learningInsightsScreen .li-chapter-cell.is-in-pratica { border-left-color: #15803d !important; }
#learningInsightsScreen .li-chapter-cell.is-in-pratica .li-chapter-number { background: #dcfce7; color: #15803d; }
#learningInsightsScreen .li-chapter-cell.is-in-pratica .li-chapter-copy small { color: #15803d; }
#learningInsightsScreen .li-chapter-cell.is-in-miglioramento { border-left-color: #6d28d9 !important; }
#learningInsightsScreen .li-chapter-cell.is-attenzione { border-left-color: #b42318 !important; }
#learningInsightsScreen .li-chapter-cell.is-pochi-dati { border-left-color: #a16207 !important; }
#learningInsightsScreen .li-chapter-cell.is-non-iniziato { border-left-color: #94a3b8 !important; }

@media (max-width: 767px) {
  #learningInsightsScreen .li-media-frame { min-height: 120px; }
  #learningInsightsScreen .li-media-frame .li-figure-image { max-height: min(44vh, 320px); }
  #learningInsightsScreen .li-explanation-image { max-height: min(42vh, 300px); }
  #learningInsightsScreen .li-emerging-card { grid-template-columns: 24px 58px minmax(0, 1fr) auto; }
  #learningInsightsScreen .li-emerging-media { width: 58px; height: 54px; }
}

@media (max-width: 430px) {
  #learningInsightsScreen .li-row-media { width: 58px; height: 54px; }
}

/* Chapter headings keep a clear reading rhythm. */
#learningInsightsScreen .li-chapters .li-section-heading h2 { margin-top: 0; }
#learningInsightsScreen .li-chapters .li-section-heading > div:first-child > p:last-child { margin-top: 12px; }
#learningInsightsScreen .li-progress-groups > div { padding-top: 28px; padding-bottom: 30px; }
#learningInsightsScreen .li-progress-groups ul { margin-top: 22px; }

@media (min-width: 1024px) {
  #learningInsightsScreen .li-route-nav {
    position: fixed;
    z-index: 40;
    top: calc(var(--li-safe-top) + 2px);
    left: 50%;
    width: min(500px, calc(100% - 320px));
    margin: 0;
    transform: translateX(-50%);
  }
}

/* Active navigation is filled; inactive choices stay visibly available. */
#learningInsightsScreen .li-route-nav .d-btn:not([aria-current="page"]) {
  border: 1px dashed #b8c5d6;
  background: #fff;
}
#learningInsightsScreen .li-route-nav .d-btn[aria-current="page"] {
  border: 1px solid var(--li-navy);
  background: var(--li-navy);
  color: #fff;
}

/* The route switcher is only a layout group: its two buttons own the lines. */
#learningInsightsScreen .li-route-nav {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Give adjacent priority items breathing room without adding nested cards. */
#learningInsightsScreen .li-emerging-grid {
  column-gap: 28px;
}

@media (max-width: 1279px) {
  #learningInsightsScreen .li-emerging-grid {
    column-gap: 20px;
  }
}

@media (max-width: 767px) {
  #learningInsightsScreen .li-emerging-grid {
    column-gap: 0;
  }
}
#learningInsightsScreen .li-lenses .d-btn:not([aria-selected="true"]) {
  border: 1px dashed #bdc9d8;
  background: #fff;
}
#learningInsightsScreen .li-lenses .d-btn[aria-selected="true"] {
  border: 1px solid var(--li-navy);
  background: var(--li-navy);
  color: #fff;
}

/* Keep card metadata in its own column at every responsive width. */
#learningInsightsScreen .li-emerging-card {
  grid-template-columns: 28px 64px minmax(0, 1fr) auto;
}
#learningInsightsScreen .li-emerging-card > .li-state {
  grid-column: 4;
  grid-row: 1;
  align-self: center;
}
#learningInsightsScreen .li-error-row > button {
  grid-template-columns: auto minmax(0, 1fr) auto 18px;
  gap: 12px;
}
#learningInsightsScreen .li-error-row > button > .li-state {
  grid-column: 3;
  grid-row: 1;
}
#learningInsightsScreen .li-error-row > button > .li-disclosure {
  grid-column: 4;
  grid-row: 1;
}

@media (min-width: 768px) and (max-width: 1279px) {
  #learningInsightsScreen .li-emerging-card {
    grid-template-columns: 26px 52px minmax(0, 1fr) auto;
  }
  #learningInsightsScreen .li-emerging-card > .li-state {
    grid-column: 4;
    grid-row: 1;
  }
}

@media (max-width: 767px) {
  #learningInsightsScreen .li-emerging-card {
    grid-template-columns: 24px 58px minmax(0, 1fr) auto;
  }
  #learningInsightsScreen .li-emerging-card > .li-state {
    grid-column: 4;
    grid-row: 1;
  }
  #learningInsightsScreen .li-error-row > button {
    grid-template-columns: auto minmax(0, 1fr) 18px;
    grid-template-areas:
      "media copy disclosure"
      "media state disclosure";
    gap: 8px;
  }
  #learningInsightsScreen .li-error-row > button > .li-row-media,
  #learningInsightsScreen .li-error-row > button > .li-error-index { grid-area: media; }
  #learningInsightsScreen .li-error-row > button > .li-error-copy { grid-area: copy; }
  #learningInsightsScreen .li-error-row > button > .li-state { grid-area: state; }
  #learningInsightsScreen .li-error-row > button > .li-disclosure { grid-area: disclosure; }
}

/*
 * Learning workspace contract
 * ----------------------------
 * This is the final scoped layer for the route. Earlier legacy rules keep
 * compatibility with the rest of Magic Book; these tokens make the learning
 * surface predictable: cards 16px, controls 8px, pills 9999px.
 */
#learningInsightsScreen {
  --li-radius-card: 16px;
  --li-radius-control: 8px;
  --li-radius-pill: 9999px;
  --li-green: #178844;
  --li-green-soft: #e6f6ec;
  --li-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: "Inter", Arial, sans-serif;
}

#learningInsightsScreen :where(.li-overview, .li-review-now, .li-progress-groups,
  .li-chapters, .li-errors-heading, .li-emerging, .li-error-explorer,
  .li-plan, .li-recovered, .li-failure) {
  border-radius: var(--li-radius-card);
}

#learningInsightsScreen :where(.li-icon-button.d-btn, .li-refresh.d-btn,
  .li-route-nav .d-btn, .li-lenses .d-btn, .li-primary-action.d-btn,
  .li-secondary-action.d-btn, .li-more.d-btn, .li-plan .d-btn,
  .li-detail-actions .d-btn) {
  border-radius: var(--li-radius-control);
}

#learningInsightsScreen :where(.li-state, .li-review-meta span,
  .li-chapter-count, .li-lenses .d-btn small, .li-score-track,
  .li-placeholder-route) {
  border-radius: var(--li-radius-pill);
}

/* Technical labels are deliberately quieter and easier to scan. */
#learningInsightsScreen :where(.li-kicker, .li-error-copy small,
  .li-emerging-copy small, .li-detail-title small, .li-metric > span,
  .li-errors-heading dt, .li-related li span, .li-plan-intro) {
  font-family: var(--li-mono);
  letter-spacing: 0.035em;
}

/* Center the route switcher in the desktop topbar without moving the brand. */
@media (min-width: 1024px) {
  #learningInsightsScreen .li-route-nav {
    top: calc(var(--li-safe-top) + 8px);
    width: min(620px, calc(100% - 420px));
  }
}

/* Active route is filled; the other route remains a quiet, dashed control. */
#learningInsightsScreen .li-route-nav .d-btn:not([aria-current="page"]) {
  border: 1px dashed #b8c5d6;
  background: #fff;
  color: var(--li-navy);
}
#learningInsightsScreen .li-route-nav .d-btn[aria-current="page"] {
  border: 1px solid var(--li-navy);
  background: var(--li-navy);
  color: #fff;
}

/* Keep error rows readable when a state badge and disclosure share a row. */
#learningInsightsScreen .li-error-row > button {
  grid-template-columns: auto minmax(0, 1fr) max-content 18px;
  gap: 14px;
  overflow: hidden;
}
#learningInsightsScreen .li-error-copy {
  min-width: 0;
  padding-inline: 2px;
}
#learningInsightsScreen .li-error-copy > span,
#learningInsightsScreen .li-error-copy strong {
  overflow-wrap: anywhere;
}
#learningInsightsScreen .li-error-row > button > .li-state {
  justify-self: start;
}

/* Status hierarchy: teal for excellent, clear green for good, amber for
   improving, coral for review, and neutral slate for low/no data. */
#learningInsightsScreen .li-state.is-solido,
#learningInsightsScreen .li-legend .is-solido::before {
  background: #0f8078;
}
#learningInsightsScreen .li-state.is-solido { color: #fff; }
#learningInsightsScreen .li-state.is-in-pratica,
#learningInsightsScreen .li-legend .is-in-pratica::before {
  background: var(--li-green);
}
#learningInsightsScreen .li-state.is-in-pratica { color: #fff; }
#learningInsightsScreen .li-state.is-in-miglioramento,
#learningInsightsScreen .li-legend .is-in-miglioramento::before {
  background: #b7791f;
}
#learningInsightsScreen .li-state.is-in-miglioramento { color: #fff; }
#learningInsightsScreen .li-state.is-attenzione { background: #c84f4b; color: #fff; }
#learningInsightsScreen .li-state.is-pochi-dati { background: #e7edf4; color: #46566c; }
#learningInsightsScreen .li-state.is-non-iniziato { background: #d7e0ea; color: #46566c; }
#learningInsightsScreen .li-state.is-recuperato { background: var(--li-green); color: #fff; }

#learningInsightsScreen .li-chapter-cell.is-in-pratica {
  border-left-color: var(--li-green) !important;
}
#learningInsightsScreen .li-chapter-cell.is-in-pratica .li-chapter-number {
  background: var(--li-green-soft);
  color: var(--li-green);
}
#learningInsightsScreen .li-chapter-cell.is-in-pratica .li-chapter-copy small {
  color: var(--li-green);
}

@media (max-width: 767px) {
  #learningInsightsScreen .li-error-row > button {
    grid-template-columns: auto minmax(0, 1fr) 18px;
    grid-template-areas:
      "media copy disclosure"
      "media state disclosure";
    gap: 8px 10px;
  }
  #learningInsightsScreen .li-error-row > button > .li-row-media,
  #learningInsightsScreen .li-error-row > button > .li-error-index { grid-area: media; }
  #learningInsightsScreen .li-error-row > button > .li-error-copy { grid-area: copy; }
  #learningInsightsScreen .li-error-row > button > .li-state { grid-area: state; }
  #learningInsightsScreen .li-error-row > button > .li-disclosure { grid-area: disclosure; }
}
