/* Shared course presentation. Downloadable notebooks retain their own styling. */
.study-pilot {
  --ink: #202525;
  --muted: #5e6769;
  --line: #d9dfe0;
  --accent: #14665e;
  --accent-soft: #edf5f2;
  --content-max: 1240px;
  background: #fff;
  --text-viz-caption: 14px;
  --text-viz-label: 14px;
  --measure-prose: 720px;
  --radius-lg: 6px;
  --radius-xl: 6px;
}
.study-pilot [hidden] { display: none !important; }
.study-pilot .hero-copy { max-width: 760px; }
.study-pilot .hero-copy h2 { font-size: 36px; line-height: 1.4; margin-bottom: 16px; }
.study-pilot .hero-copy > p { font-size: 18px; line-height: 1.85; }
.study-pilot .hero-actions { gap: 20px; }
.study-pilot .hero-actions .ghost-button { border: 0; background: none; padding-inline: 0; box-shadow: none; }
.study-pilot .hero-actions .ghost-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.study-pilot .vibe-prompt a:not([class]), .study-pilot .hero-copy p a { color: var(--accent); text-underline-offset: 4px; }
.study-pilot .vibe-cell-pair:not(.vibe-cell-pair--interactive):not(.vibe-cell-pair--text-only) { grid-template-columns: 1fr; }
.study-pilot .vibe-prompt { max-width: 760px; overflow: visible; }
.study-pilot .prompt-body { max-width: 720px; margin: 0; }
.study-pilot .vibe-prompt-text, .study-pilot .prompt-body > p { font-size: 18px; line-height: 1.85; }
.study-pilot .vibe-prompt-text p { margin-block: 0 14px; }
.study-pilot .cell-header:not([hidden]) { margin-bottom: 12px; }
.study-pilot .vibe-output .output-body { padding: 0; }
.study-pilot .vibe-output .output-body:not(:has(.study-player)) { max-width: 960px; }
.study-pilot .vibe-output .arch-slot .arch-figure { background: transparent; border: 0; padding: 0; }
.study-pilot .vibe-output .arch-slot svg { display: block; width: 100%; max-width: 760px; margin-inline: auto; }
.study-pilot .vibe-tip { margin-block: 16px 0; background: none; border-left: 2px solid #b5cdc5; padding: 4px 0 4px 14px; color: var(--muted); font-size: 15px; }
.study-section-number { display: inline-block; color: var(--accent); font-size: 16px; font-weight: 500; min-width: 64px; margin-right: 12px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.study-resources { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin-top: 4px; }
.study-resources summary { cursor: pointer; width: fit-content; min-height: 36px; padding-block: 6px; }
.study-resources summary:hover { color: var(--accent); }
.study-resources .prompt-actions { margin: 4px 0 0; gap: 20px; }
.study-resources .prompt-actions button { background: none; border: 0; box-shadow: none; padding: 4px 0; color: var(--accent); font-weight: 500; min-height: 40px; }
.study-resources .prompt-actions button:hover { text-decoration: underline; text-underline-offset: 4px; }
.study-resources .copy-teach > span { display: none; }
.study-pilot .chapter-section {
  padding: 64px 0 72px;
  border-top: 1px solid #bac8c5;
  border-bottom: 0;
}
.study-pilot .section-header { margin-bottom: 36px; }
.study-pilot .section-header .eyebrow { color: #14665e; font-size: 14px; }
.study-pilot .section-header h2 { font-size: 28px; line-height: 1.45; }
.study-pilot .notebook-header { border: 0; padding: 0 0 16px; max-width: 760px; }
.study-pilot .notebook-subtitle { font-size: 16px; line-height: 1.7; color: var(--muted); }
.study-pilot .algo-notebook + .algo-notebook { margin-top: 64px; }
.study-pilot .vibe-cell, .study-pilot .vibe-cell-pair,
.study-pilot .vibe-notebook, .study-pilot .output-body {
  box-shadow: none;
}
.study-pilot .vibe-cell { border-radius: 0; }
.study-pilot .cell-index { display: none; }
.study-pilot .vibe-notebook-body { overflow: visible; }
.study-pilot .vibe-prompt .cell-label { font-size: 13px; color: var(--muted); }
.study-pilot .vibe-output .cell-label { font-size: 13px; color: var(--muted); }
.study-pilot .vibe-prompt-spec { background: transparent; }
.study-pilot .vibe-prompt-spec-body { max-height: 150px; overflow: auto; }
.study-pilot .study-code { margin-top: 16px; border-top: 1px solid var(--line); padding: 16px 0; font-size: 14px; }
.study-code summary { cursor: pointer; font-weight: 600; }
.study-player.worked-player {
  display: block;
  border: 1px solid #d9dfe0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  overflow-anchor: none;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  scroll-margin-top: calc(var(--header-height, 76px) + 88px);
}
.study-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.study-title { font-size: 16px; line-height: 1.5; }
.study-actions { display: flex; align-items: center; gap: 6px; }
.study-icon { display: block; flex: none; pointer-events: none; }
.study-player button, .study-zoom button {
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
  border: 1px solid #d2dada;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  transition: background-color .15s, border-color .15s;
}
.study-player button:hover:not(:disabled), .study-zoom button:hover { background: #edf5f2; border-color: #14665e; }
.study-player button:focus-visible, .study-player input:focus-visible, .study-zoom button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.study-player button:disabled { opacity: .4; cursor: default; }
.study-actions button { display: grid; place-items: center; width: 40px; min-width: 40px; height: 40px; padding: 0; flex-shrink: 0; border-color: transparent; }
.study-actions .study-play { width: 40px; background: #14665e; color: #fff; border-color: #14665e; }
.study-actions .study-play:hover { color: #14665e; }
.study-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); }
.study-visual { min-width: 0; padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.study-detail { min-width: 0; padding: 24px; border-left: 1px solid var(--line); background: #f8faf9; }
.study-detail h4 { font-size: 19px; margin: 0; line-height: 1.5; }
.study-detail p, .study-detail dl { margin: 0; }
.study-detail .study-kicker { color: #58666a; font-size: 13px; margin: 0 0 8px; }
.study-explanation { line-height: 1.8; font-size: 16px; }
.study-detail-label { display: block; color: #58666a; font-size: 13px; margin-bottom: 8px; }
.study-visited { font-size: 14px; line-height: 1.7; }
.study-detail-block { border-top: 1px solid #d9e2df; padding-top: 12px; }
.study-detail-list { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; margin: 0; padding: 0; list-style: none; }
.study-detail-list li { padding: 4px 8px; font-size: 13px; border: 1px solid #cdd9dd; border-radius: 4px; background: #fff; line-height: 1.5; }
.study-detail-list li.is-next { color: #28548d; border-color: #4875b9; background: #eff5ff; }
.study-detail-list .study-empty { color: #677276; background: transparent; border-color: transparent; }
.study-search-detail { display: grid; grid-template-rows: 46px 116px 120px 92px 40px; gap: 10px; }
.study-search-result { border-top: 1px solid var(--line); padding-top: 10px; color: #14665e; font-size: 13px; line-height: 1.6; }
.study-progress { border-top: 1px solid var(--line); padding: 16px 18px; }
.study-progress label { display: flex; align-items: center; gap: 16px; }
.study-position { flex: 0 0 44px; color: #536165; font-size: 13px; }
.study-progress input { width: 100%; accent-color: #14665e; cursor: pointer; height: 24px; }
.study-stops { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.study-stops button { padding: 7px 4px; min-height: 36px; font-size: 14px; font-weight: 500; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.study-stops button.is-current { color: #0e5d54; border-bottom-color: #14665e; background: transparent; }
.study-stops button.is-done { border-bottom-color: #cadbd5; }
.study-map { display: block; width: 100%; height: auto; max-width: 650px; margin-inline: auto; }
.study-map.is-compact { max-width: 380px; }
.study-pilot .app-shell.study-search-active { display: block; }
.study-search-active .visual-workspace { padding: 0; border: 0; background: transparent; }
.study-search-active .visual-workspace > :not(#algorithmTabs):not(#studySearchLab),
.study-search-active > .inspector { display: none !important; }
.study-search-active #algorithmTabs { margin-bottom: 18px; }
.study-pilot .study-map text { font-family: var(--font-sans); font-size: 16px; fill: #344348; }
.study-map line { stroke: #a9b8bd; stroke-width: 2; }
.study-map line.is-path { stroke: #cf7d20; stroke-width: 3; }
.study-map line.is-final { stroke: #14665e; stroke-width: 3; }
.study-map .study-node rect { fill: #fff; stroke: #9babb1; stroke-width: 1.5; }
.study-map .study-node.is-visited rect { fill: #edf4f1; stroke: #698d81; }
.study-map .study-node.is-frontier rect { fill: #eff5ff; stroke: #4875b9; }
.study-map .study-node.is-current rect { fill: #fff4df; stroke: #bd6b16; stroke-width: 2; }
.study-map .study-node.is-final rect { fill: #e8f4ed; stroke: #14665e; stroke-width: 2; }
.study-map .study-node-name { font-weight: 600; }
.study-pilot .study-map .study-node-id { font-size: 16px; fill: #56676d; }
.study-pilot .study-map .study-metric { font-size: 16px; fill: #14665e; }
.study-map .study-edge-label rect { fill: #fff; }
.study-pilot .study-map .study-edge-label text { font-size: 16px; }
.study-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; color: #526268; font-size: 13px; margin-top: 14px; }
.study-legend span { display: inline-flex; gap: 6px; align-items: center; }
.study-legend i { width: 10px; height: 10px; border-radius: 2px; background: #e1e9e5; border: 1px solid #698d81; }
.study-legend .candidate { background: #eff5ff; border-color: #4875b9; }
.study-legend .current { background: #fff4df; border-color: #bd6b16; }
.study-legend .route { background: #14665e; border-color: #14665e; }
.study-zoom { width: min(1040px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid #ccd5d5; border-radius: 8px; color: #202525; }
.study-zoom::backdrop { background: #18222499; }
.study-zoom-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.study-zoom-head button { padding: 8px 16px; min-height: 44px; }
.study-zoom-visual { max-width: 780px; margin: auto; }
.study-clip { width: 100%; }
.study-clip-flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; }
.study-clip-lane { display: grid; gap: 8px; text-align: center; font-size: 14px; }
.study-clip-input { padding: 10px 6px; border-bottom: 2px solid #5081b7; }
.study-clip-lane:nth-child(2) .study-clip-input { border-color: #bc771f; }
.study-clip-encoder { padding: 10px; border: 1px solid #bacbca; border-radius: 4px; background: #f5f8f8; }
.study-clip-arrow { color: #78858a; height: 20px; line-height: 20px; }
.study-clip-matrix { table-layout: fixed; border-collapse: collapse; width: 100%; text-align: center; font-size: 14px; }
.study-clip-matrix caption { text-align: left; color: #526268; margin: 0 0 12px; font-size: 13px; }
.study-clip-matrix th, .study-clip-matrix td { padding: 10px 4px; height: 44px; border: 1px solid #d6dfe0; }
.study-clip-matrix th { background: #f6f8f8; font-weight: 500; }
.study-clip-matrix td { background: #fff; }
.study-clip-matrix .is-positive { background: #dcefe6; color: #155e4f; font-weight: 700; }
.study-clip-matrix .is-negative { background: #fff0de; color: #86470e; font-weight: 700; }
.study-clip-caption { font-size: 13px; color: #607074; margin: 14px 0 0; line-height: 1.6; }
.study-clip-detail { display: grid; align-content: start; min-height: var(--study-detail-height, 0); gap: 16px; }
.study-clip-equation { color: #245e54; font-size: 15px; line-height: 1.75; }
.study-player--lesson .study-visual { justify-content: flex-start; padding: 20px; }
.study-viz-scroll { max-width: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: #819995 #eef3f2; }
.study-viz-content { width: 100%; min-width: 580px; min-height: var(--study-diagram-height, 0); }
.study-viz-content:not(:has(svg, canvas)), .study-viz-content:has(> .decision-tree) { min-width: 0; }
.study-viz-content .gan-demo-stack:has(.gan-training-view:not([hidden])) { min-height: 520px; }
.study-lesson-detail { display: grid; gap: 14px; align-content: start; min-height: var(--study-detail-height, 0); }
.study-lesson-detail [data-study-slot]:empty { display: none; }
.study-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); align-content: start; gap: 12px; }
.study-fields > div { padding-top: 10px; border-top: 1px solid #d9e2df; }
.study-fields dt { color: #5e6769; font-size: 13px; margin-bottom: 5px; }
.study-fields dd { margin: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; }
.study-viz-content .repr-table, .study-viz-content .logic-panel,
.study-viz-content .chart-canvas-wrap, .study-viz-content .arch-figure,
.study-viz-content .activation-chart-wrap, .study-viz-content .diffusion-step-viz,
.study-viz-content .gan-sample-viz, .study-viz-content .repr-landscape-viz {
  border-radius: 0; box-shadow: none; background: #fff;
}
.study-viz-content .arch-figure { padding: 0; border: 0; }
.study-viz-content svg { max-height: none; }
.study-viz-content .attention-flow-svg text { font-size: 16px; }
.study-viz-content .attention-flow-svg .attention-title { font-size: 18px; }
.study-viz-content .alphafold-detail-svg,
.study-viz-content .alphafold-struct-svg { width: 100%; height: auto; max-width: none; aspect-ratio: 520 / 240; }
.study-pilot .lab-panel { border: 0; padding: 0; background: transparent; }
.study-pilot .vibe-cell-pair + .vibe-cell-pair { margin-top: 32px; padding-top: 24px; border-top: 1px solid #e0e6e5; }
.study-pilot .vibe-prompt-spec, .study-pilot .vibe-tip { border-radius: 4px; }
.study-pilot .notebook-header h3 { font-size: 22px; }
.study-pilot .study-viz-content .output-caption { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 16px 0 0; max-width: 680px; }
.study-viz-content[data-diagram="mcts"] { min-width: 0; }
.study-pilot .mcts-svg { width: 100%; max-width: 520px; display: block; margin-inline: auto; }
.study-pilot .mcts-svg .mcts-node-label { font-size: 16px; font-weight: 600; }
.study-pilot .mcts-svg .mcts-node-meta { font-size: 14px; fill: #526461; }
.study-pilot .mcts-svg .mcts-node-delta { font-size: 14px; fill: #14665e; }
.study-pilot .mcts-svg .mcts-edge { fill: none; stroke: #a9b8b5; stroke-width: 1.5; }
.study-pilot .mcts-svg .mcts-edge.is-active { stroke: #14665e; stroke-width: 2.5; }
.study-pilot .mcts-svg .mcts-node-box { stroke: #afbfbb; fill: #fff; }
.study-pilot .mcts-svg .is-active .mcts-node-box { stroke: #14665e; fill: #edf5f2; }
.mae-image-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 500px; margin: auto; }
.mae-image-comparison figure { margin: 0; min-width: 0; }
.mae-image-comparison figcaption { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.study-pilot .mae-image-comparison .mae-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 4px; }
.study-pilot .mae-image-comparison .mae-patch { min-width: 0; width: 100%; height: auto; aspect-ratio: 1; padding: 3px; border-radius: 3px; }
.study-pilot .mae-image-comparison .mae-pixel-mini { width: 100%; height: auto; flex: 1; min-height: 0; aspect-ratio: 1; }
.study-pilot .mae-image-comparison .mae-mask-block { width: 100%; height: 100%; min-height: 0; font-size: 14px; }
.study-pilot .mae-image-comparison .mae-patch > span { font-size: 14px; }
.study-pilot .mae-image-comparison .mae-patch.is-recon { border-color: #b98431; background: #fff; }
.mae-study-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 0; padding: 0; list-style: none; gap: 12px; }
.mae-study-flow li { border-top: 2px solid #d9dfe0; padding-top: 10px; font-size: 14px; }
.mae-study-flow strong, .mae-study-flow span { display: block; }
.mae-study-flow strong { margin-bottom: 6px; }
.mae-study-flow span { color: var(--muted); }
.mae-study-flow .is-current { border-color: #14665e; color: #14665e; }
.study-zoom .study-viz-content { min-height: 0; }
.study-view-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.study-view-tabs button { min-height: 40px; padding: 7px 12px; font-size: 14px; }
.study-view-tabs [aria-pressed="true"] { background: #eaf4ef; border-color: #14665e; color: #0e5d54; }
.study-viz-content .gan-demo-stack { display: block; min-height: 520px; }
.study-viz-content .gan-canvas-slot { margin-top: 16px; }
.study-lesson-detail [data-study-slot="reason"]:empty { border: 0; padding: 0; }
@media (min-width: 800px) and (max-width: 1199px) {
  .study-search-detail { grid-template-rows: 46px 116px 144px 100px 60px; }
}
@media (max-width: 799px) {
  .study-body { grid-template-columns: 1fr; }
  .study-detail { border-left: 0; border-top: 1px solid var(--line); }
  .study-search-detail { grid-template-rows: 36px 100px 144px 100px 60px; }
  .study-visual { padding: 18px; }
  .study-visual .study-map { max-height: 370px; }
  .study-clip { max-width: 600px; margin: auto; }
}
@media (max-width: 600px) {
  .study-pilot .hero-copy h2 { font-size: 28px; }
  .study-pilot .hero-copy > p, .study-pilot .vibe-prompt-text, .study-pilot .prompt-body > p { font-size: 17px; }
  .study-pilot .hero-actions { gap: 8px 20px; }
  .study-section-number { min-width: 44px; margin-right: 8px; font-size: 14px; }
  .study-pilot .chapter-section { padding: 40px 0; }
  .study-pilot .section-header h2 { font-size: 23px; }
  .study-pilot .algo-notebook + .algo-notebook { margin-top: 44px; }
  .study-pilot .vibe-output .output-body { padding-left: 0; padding-right: 0; }
  .study-toolbar { flex-direction: column; align-items: stretch; padding: 12px; position: sticky; top: calc(var(--header-height, 76px) + 66px); z-index: 5; background: #fff; }
  .study-actions { justify-content: flex-start; gap: 12px; }
  .study-actions button { min-width: 40px; height: 44px; padding: 0 8px; font-size: 14px; }
  .study-visual { padding: 12px 6px 16px; }
  .study-detail { padding: 16px 14px; }
  .study-detail h4 { font-size: 17px; }
  .study-explanation { font-size: 16px; }
  .study-progress { padding: 12px; }
  .study-stops button { min-height: 40px; padding: 6px 8px; }
  .study-clip-flow { gap: 12px; margin-bottom: 16px; }
  .study-clip-lane { font-size: 13px; }
  .study-clip { padding: 0 6px; }
  .study-clip-matrix { font-size: 13px; }
  .study-clip-matrix th, .study-clip-matrix td { padding: 8px 2px; }
  .study-zoom { padding: 12px; }
}
