.chart-panel { min-width: 0; overflow: hidden; border: 1px solid #424c4d; border-radius: 9px; background: #151d1f; }
.chart-header, .chart-tools, .replay-controls, .chart-foot { padding-inline: 20px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 15px; }
.chart-instrument { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 14px; }
.chart-instrument strong { color: #f6ede2; font-size: 18px; font-weight: 710; letter-spacing: -.035em; }
.chart-instrument span, .chart-tools, .timeline-heading, .chart-foot { color: #bdc4bd; font-size: 12px; }
.scale-controls { display: flex; padding: 3px; border: 1px solid #4d595a; }
.scale-controls button, .replay-actions button, .fork-switch {
  min-height: 38px; border: 1px solid transparent; padding: 6px 11px;
  color: #f0e9dc; background: transparent; font-size: 13px; font-weight: 630;
}
.scale-controls button { min-width: 52px; }
.scale-controls button[aria-pressed="true"], .replay-actions .replay-primary { background: #edb58e; color: #221913; }
.scale-controls button:hover:not([aria-pressed="true"]), .replay-actions button:hover:not(:disabled):not(.replay-primary), .fork-switch:hover { background: #273132; }
.chart-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #303b3c; }
.chart-cases button {
  display: grid; gap: 4px; padding: 12px 20px; text-align: left;
  border: 0; background: #1c2527; color: #f0e9dc;
}
.chart-cases button + button { border-left: 1px solid #303b3c; }
.chart-cases button:hover { background: #293435; }
.chart-cases button:focus-visible { outline-offset: -3px; }
.chart-cases span { color: #f3b081; font: 650 11px/1.3 "IBM Plex Mono", Consolas, monospace; letter-spacing: .04em; }
.chart-cases strong { font-size: 13px; line-height: 1.35; }
.chart-tools {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 3px 15px;
  padding-block: 5px; border-top: 1px solid #303b3c;
}
.fork-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 6px; margin-left: -6px; }
.fork-switch[aria-pressed="false"] { color: #bdc4bd; }
.legend-line { display: block; width: 17px; border-top: 2px solid #edb58e; }
.fork-switch[aria-pressed="false"] .legend-line { border-top-color: #7d8a89; }
#price-chart { display: block; width: 100%; height: clamp(320px, 42vw, 490px); cursor: crosshair; touch-action: pan-y; }
#price-chart:focus-visible { outline-offset: -3px; }
.replay-controls {
  display: grid; grid-template-columns: max-content minmax(120px, 1fr); align-items: center;
  gap: 12px 24px; padding-block: 14px; border-top: 1px solid #303b3c;
}
.replay-actions { display: flex; gap: 6px; }
.replay-actions button { border-color: #4d595a; }
.replay-actions .replay-primary { min-width: 94px; }
.replay-actions .replay-primary:hover { background: #f8cba9; }
.replay-actions button:disabled { cursor: default; opacity: .52; }
.timeline-heading { display: flex; justify-content: space-between; gap: 10px; }
#replay-date { color: #f3c49f; font-variant-numeric: tabular-nums; }
#replay-week { display: block; width: 100%; height: 18px; margin: 4px 0 0; accent-color: #edb58e; cursor: pointer; }
#replay-week:focus-visible { outline: 2px solid #f3b081; outline-offset: 4px; }
.chart-anchors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid #303b3c; }
.chart-anchors button {
  display: flex; text-align: left; align-items: center; gap: 10px; padding: 12px 20px;
  border: 0; background: transparent; color: #f0e9dc; font-size: 13px;
}
.chart-anchors button + button { border-left: 1px solid #303b3c; }
.chart-anchors button:hover, .chart-anchors button[aria-pressed="true"] { background: #273132; }
.chart-anchors button:focus-visible { outline-offset: -2px; }
.chart-anchors small { display: block; color: #bdc4bd; font-size: 12px; margin-top: 2px; }
.anchor-price { white-space: nowrap; }
.anchor-price::before { content: " · "; }
.anchor-letter {
  display: grid; place-items: center; flex: 0 0 24px; height: 24px;
  color: #f3b081; border: 1px solid #9c735b; border-radius: 50%; font-weight: 700;
}
.chart-anchors button[aria-pressed="true"] .anchor-letter { color: #221913; background: #f3b081; }
.chart-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-block: 12px; line-height: 1.5; }
.chart-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #f3c49f; text-decoration: underline; text-underline-offset: 3px; }
.lesson { padding-block: 78px; }
.lesson-intro { align-items: end; gap: 24px; margin-bottom: 25px; }
.lesson-intro .topics, .membership-copy .topics { margin-bottom: 14px; }
.lesson-intro > p { flex-basis: 35ch; font-size: 15px; }
#fib-title span { white-space: nowrap; }
.lesson-grid { display: grid; grid-template-columns: 1.16fr .84fr; gap: clamp(25px, 4vw, 65px); align-items: start; }
.lesson-demo { min-width: 0; overflow: hidden; color: var(--light); background: #172123; border: 1px solid #3d4948; border-radius: 9px; }
.lesson-demo-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 15px 16px; }
.lesson-demo-header span { font-size: 12px; color: #c1c8be; align-self: center; }
.lesson-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid #3d4948; }
.lesson-stages button, .membership-periods button { font-size: 13px; font-weight: 660; }
.lesson-stages button { border: 0; background: #1c2829; min-height: 42px; color: #e9e1d5; padding: 8px 7px; }
.lesson-stages button + button { border-left: 1px solid #3d4948; }
.lesson-stages button:hover, .lesson-stages button[aria-pressed="true"] { background: #374343; color: #ffd3b2; }
.lesson-stages button:focus-visible { outline-offset: -3px; }
#fib-plot { display: block; width: 100%; height: clamp(215px, 32vw, 310px); }
#fib-stage-note { border-top: 1px solid #3d4948; padding: 12px 16px; font-size: 13px; line-height: 1.5; color: #e0d8cd; min-height: 65px; }
.lesson-steps { padding: 0; margin: 0; list-style-position: inside; }
.lesson-steps li { padding-block: 16px 19px; border-bottom: 1px solid var(--line); }
.lesson-steps li:first-child { padding-top: 0; }
.lesson-steps li::marker { font-weight: 700; color: var(--copper); }
.lesson-steps h3 { display: inline; font-size: 18px; letter-spacing: -.025em; }
.lesson-steps p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.data-import { border-top: 1px solid #303b3c; padding: 9px 20px; color: #bdc4bd; font-size: 13px; line-height: 1.5; }
.data-import summary { width: fit-content; min-height: 32px; padding-block: 6px; color: #e7d4c0; cursor: pointer; }
.data-import summary:focus-visible { outline: 2px solid #f3b081; outline-offset: 3px; }
.data-import-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.data-import-actions button, .file-button {
  min-height: 37px; padding: 8px 11px; border: 1px solid #4d595a;
  background: #202a2b; color: #f0e9dc; font-size: 13px; font-weight: 630; cursor: pointer;
}
.data-import-actions button:hover, .file-button:hover { background: #303d3d; }
.data-import-actions input { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); }
.data-import-actions:has(input:focus-visible) .file-button { outline: 2px solid #f3b081; outline-offset: 3px; }
#weekly-file-result:not(:empty) { margin-bottom: 5px; color: #f4c7a7; }
.lab-section { padding-top: clamp(46px, 7vw, 100px); }
.lab-heading { margin: 0 0 23px; display: grid; grid-template-columns: 1fr .65fr; align-items: end; gap: 16px; }
.lab-heading h2, .lesson-intro h2 { margin-top: 12px; font-size: clamp(38px, 5.5vw, 68px); line-height: 1.03; letter-spacing: -.077em; }
.lab-heading > p, .lesson-intro > p { color: var(--muted); max-width: 47ch; }
.lab-after { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 12px; }
.section-intro { display: flex; justify-content: space-between; gap: 20px; }
.topics { font-size: 11px; text-transform: uppercase; color: var(--accent); letter-spacing: .13em; font-weight: 700; }
.lesson h2 span { color: var(--accent); }
:root { --light:#f6f3ea; --copper:var(--accent); }
.lab-section button, .lesson button { cursor: pointer; }
.lab-section button:disabled { cursor: default; }
.scale-controls, .chart-cases button, .replay-actions button { border-radius: 5px; }
#price-chart, #fib-plot { min-width: 0; }
@media (max-width: 830px) {
  .lab-heading { grid-template-columns: 1fr; }
  .replay-controls { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .replay-actions { flex-wrap: wrap; }
  .replay-timeline { width: 100%; }
  .lesson-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .chart-header, .chart-tools, .replay-controls, .chart-foot, .data-import { padding-inline: 11px; }
  .chart-cases button, .chart-anchors button { padding-inline: 10px; }
  .scale-controls button, .replay-actions button, .fork-switch { min-height: 44px; }
  .replay-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .replay-actions .replay-primary { min-width: 0; }
  #replay-week { height: 26px; }
  .chart-tools { align-items: flex-start; }
  #chart-readout { overflow-wrap: anywhere; }
  #price-chart { height: 295px; }
  .chart-anchors { grid-template-columns: 1fr; }
  .chart-anchors button + button { border-left: 0; border-top: 1px solid #303b3c; }
  .lesson { padding-block: 46px; }
  .section-intro { flex-direction: column; gap: 12px; }
  .lesson-intro > p { flex-basis: auto; }
}
