/* Shared presentation for the applied ML, retrieval, and optimization notes. */
.learning-note { min-width: 0; }
.learning-note h1 { max-width: 24ch; text-wrap: balance; }
.learning-note p, .learning-note li { line-height: 1.85; overflow-wrap: anywhere; }
.learning-note h2 { margin-top: 2.4rem; scroll-margin-top: 6rem; }
.learning-note a { text-underline-offset: .18em; }
.note-prerequisites { padding: .9rem 1.1rem; border-left: 3px solid var(--brand); background: var(--card); color: var(--ink-muted); font-size: .92rem; }
.note-equation { overflow-x: auto; padding: .3rem .15rem; max-width: 100%; }
.learning-note .katex-display { margin: .7em 0; }
.note-figure { margin: 1.7rem 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 5px 20px rgba(25,50,45,.035); }
.note-figure figcaption { margin-top: 1rem; color: var(--ink-muted); font-size: .87rem; line-height: 1.65; }
.note-flow { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: .8rem; }
.note-flow > div { position: relative; display: flex; flex-direction: column; gap: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .85rem; background: var(--bg, #fff); }
.note-flow strong { line-height: 1.4; }
.note-flow > div > span:last-child { color: var(--ink-muted); font-size: .85rem; line-height: 1.55; }
.note-number { color: var(--brand); font-size: .7rem; letter-spacing: .12em; font-weight: 800; }
.note-table { width: 100%; max-width: 100%; overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: 10px; }
.note-table table { width: 100%; border-collapse: collapse; margin: 0; font-size: .88rem; }
.note-table caption { text-align: left; padding: .85rem; background: var(--card); color: var(--ink-muted); line-height: 1.55; caption-side: bottom; }
.note-table th, .note-table td { padding: .75rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
.note-table thead { background: var(--card); }
.note-table tbody th { font-weight: 600; }
.note-callout { border-left: 3px solid var(--brand); background: var(--card); border-radius: 0 10px 10px 0; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.note-callout p { margin-bottom: 0; margin-top: .45rem; }
.note-check { margin: 1.7rem 0; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.note-check summary { cursor: pointer; font-weight: 700; line-height: 1.65; min-height: 44px; align-content: center; }
.note-check p { border-top: 1px solid var(--line); padding-top: .8rem; }
.note-chapters { display: grid; gap: .8rem; }
.note-chapters > a { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--card); color: var(--ink); }
.note-chapters > a > span { font-size: .78rem; color: var(--brand); font-weight: 800; padding-top: .15rem; }
.note-chapters strong { line-height: 1.55; }
.note-chapters p { margin: .4rem 0 0; font-size: .88rem; color: var(--ink-muted); }
.note-sources { font-size: .9rem; }
.note-live:empty { display: none; }
.note-lab.is-ready .note-fallback { display: none; }
.note-controls { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: .8rem 0; }
.note-controls label { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; width: 100%; font-size: .87rem; font-weight: 700; }
.note-controls input[type=range] { min-height: 44px; width: min(250px,100%); accent-color: var(--brand); }
.note-controls button, .note-live button { min-height: 44px; min-width: 44px; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg,#fff); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; }
.note-live button[aria-pressed=true] { color: #fff; background: #165d4c; border-color: #165d4c; }
.note-live button:disabled { opacity: .35; cursor: default; }
.note-live button:focus-visible, .note-check summary:focus-visible, .note-chapters a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.note-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(105px,1fr)); gap: .5rem; margin: .8rem 0; }
.note-result { padding: .75rem; border-radius: 8px; background: var(--bg,#fff); border: 1px solid var(--line); }
.note-result span { display: block; font-size: .72rem; color: var(--ink-muted); line-height: 1.4; }
.note-result strong { display: block; font-size: 1.15rem; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.note-status { display: block; padding: .8rem 0; font-size: .88rem; line-height: 1.7; min-height: 3rem; }
.note-ranking { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .4rem; }
.note-ranking li { display: flex; gap: .4rem; align-items: center; padding: .55rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg,#fff); }
.note-ranking li.outside { border-style: dashed; background: var(--card); }
.note-ranking .note-doc { flex: 1; font-size: .85rem; line-height: 1.45; }
.note-ranking .note-rank { font-size: .75rem; color: var(--ink-muted); min-width: 1.1rem; }
.note-live svg { display: block; width: 100%; height: auto; overflow: hidden; }
.note-live svg text { font-family: Manrope,sans-serif; fill: var(--ink); }
.note-live .note-table { margin: .8rem 0; }
.note-live .note-selected { background: rgba(30,125,99,.12); font-weight: 800; }
.note-bar-row { display: grid; grid-template-columns: 75px 1fr 65px; gap: .5rem; align-items: center; font-size: .8rem; margin: .6rem 0; }
.note-bar { height: 14px; border-radius: 4px; background: var(--line); overflow: hidden; }
.note-bar > span { display: block; height: 100%; background: #25856b; border-radius: 4px; transition: width .2s ease; }
.note-token-context { box-shadow: inset 0 -4px 0 #d79e31; }
@media (max-width: 600px) {
  .note-figure { padding: .85rem; border-radius: 10px; }
  .note-flow { grid-template-columns: 1fr; }
  .note-flow > div { padding: .75rem; }
  .note-table th,.note-table td { padding: .55rem .65rem; }
  .note-ranking li { flex-wrap: wrap; }
  .note-ranking .note-doc { min-width: 75px; }
  .note-controls { gap: .4rem; }
  .note-results { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .note-bar-row { grid-template-columns: 55px 1fr 55px; }
}
@media (prefers-reduced-motion: reduce) { .note-bar > span { transition: none; } }
