/* Contextual learning information: stays quiet until a parent or learner asks. */
.home-core-subject-row { position: relative; }
.home-core-subject-row .home-core-subject-copy { row-gap: 0; }
.home-core-subject-open { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.home-core-subject-open:focus-visible { outline: 3px solid var(--subject); outline-offset: 3px; }
.home-core-subject-row > .home-core-subject-metrics { position: relative; z-index: 2; justify-content: flex-end; min-width: 64px; min-height: 48px; padding: 5px; margin: -5px; background: transparent; border: 0; border-radius: 8px; font: inherit; cursor: help; }
.home-core-subject-metrics small { text-decoration: underline dotted; text-underline-offset: 4px; }
.home-core-subject-metrics:hover, .home-core-subject-metrics[aria-expanded="true"] { background: var(--subject-soft); }
.main:has(.today-topbar--calm) .home-core-subject-metrics small { font-size: 11px; line-height: 1.5; }
.home-exam-weight, .home-exam-context { justify-self: start; width: fit-content; color: var(--muted, #536171); font: 400 12px/1.5 'Be Vietnam Pro', sans-serif; }
.home-exam-weight { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 -5px; padding: 10px 5px; background: transparent; border: 0; border-radius: 6px; text-align: left; cursor: help; }
.home-exam-weight strong { font-weight: 600; color: var(--text, #182335); }
.home-exam-weight:hover, .home-exam-weight[aria-expanded="true"] { text-decoration: underline dotted; text-underline-offset: 4px; }
[data-learning-info]:focus-visible { outline: 3px solid var(--subject, #3157d5); outline-offset: 2px; }
.learning-info-popover { position: fixed; z-index: 10000; width: min(392px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; box-sizing: border-box; padding: 24px; border: 1px solid #dce3ee; border-radius: 16px; background: var(--surface, #fff); color: var(--text, #182335); font: 400 14px/1.65 'Be Vietnam Pro', sans-serif; box-shadow: 0 12px 36px rgba(24,35,53,.14); text-align: left; }
.learning-info-popover *, .learning-info-popover *::before, .learning-info-popover *::after { box-sizing: border-box; }
.learning-info-popover:focus { outline: none; }
.learning-info-popover h2 { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 8px 0 12px; padding-right: 28px; }
.learning-info-popover p { margin: 0 0 14px; }
.learning-info-popover .learning-info-kicker { padding-right: 40px; margin: 0; font-size: 10px; letter-spacing: .06em; font-weight: 600; color: var(--muted, #536171); }
.learning-info-close { position: absolute; top: 7px; right: 10px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #536171); font: 500 12px 'Be Vietnam Pro', sans-serif; cursor: pointer; }
.learning-info-formula { padding: 12px 14px; margin: 0 0 14px; border-radius: 10px; background: var(--surface-soft, #f1f3f8); }
.learning-info-formula p, .learning-info-formula div { display: flex; flex-direction: column; gap: 0; margin: 0; }
.learning-info-formula p + p, .learning-info-formula div + div { margin-top: 10px; }
.learning-info-formula strong { font-size: 12px; font-weight: 600; }
.learning-info-formula span { font-size: 13px; color: var(--muted, #536171); }
dl.learning-info-formula div { flex-direction: row; justify-content: space-between; gap: 12px; }
.learning-info-formula dt { font-size: 13px; }
.learning-info-formula dd { flex-shrink: 0; margin: 0; font-weight: 600; }
.learning-info-popover .learning-info-note { color: var(--muted, #536171); font-size: 13px; }
.learning-info-state { font-size: 12px; color: var(--muted, #536171); border-left: 2px solid var(--line, #dce3ee); padding-left: 10px; }
.learning-info-action { width: 100%; min-height: 44px; margin: 0 0 14px; border: 1px solid var(--line, #dce3ee); border-radius: 8px; background: var(--surface, #fff); color: var(--text, #182335); font: 600 13px 'Be Vietnam Pro', sans-serif; cursor: pointer; }
.learning-info-action:hover { background: var(--surface-soft, #f1f3f8); }
.learning-info-sources { border-top: 1px solid var(--line, #dce3ee); padding-top: 12px; }
.learning-info-sources > strong { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.learning-info-sources > div { display: flex; flex-direction: column; align-items: flex-start; }
.learning-info-sources a { display: inline-flex; align-items: center; min-height: 36px; color: var(--blue, #3157d5); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.learning-info-sources p { margin: 8px 0 0; font-size: 11px; color: var(--muted, #536171); }
.learning-info-levels { display: grid; gap: 12px; list-style: none; padding: 0; margin: 0 0 16px; }
.learning-info-levels li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.learning-info-levels strong { color: var(--blue, #3157d5); font-size: 16px; font-weight: 700; }
.learning-info-popover :focus-visible { outline: 3px solid var(--blue, #3157d5); outline-offset: 2px; }
html[data-theme="dark"] .learning-info-popover { border-color: var(--line); }
@media (max-width: 430px) {
  .learning-info-popover { padding: 20px; }
  .home-exam-weight, .home-exam-context { font-size: 11px; }
  .main:has(.today-topbar--calm) .home-core-subject-row { column-gap: 10px; }
}

/* Trên mobile, tap vào thẻ môn học đi thẳng vào môn; không mở popover giải thích. */
@media (max-width: 860px) {
  .home-core-subject-row > .home-core-subject-metrics,
  .home-core-subject-row .home-exam-weight {
    pointer-events: none;
  }
  .home-core-subject-row .home-core-subject-metrics small {
    text-decoration: none;
  }
}
