:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --bg:#100d1d; --surface:#1a152b; --line:#ffffff22; --text:#f8f3ff; --muted:#beb3cd; --pink:#f1bce6; --mint:#9ce1d4; --gold:#f5d597; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--text); background: radial-gradient(circle at 66% 9%, #49315b80, transparent 31%), radial-gradient(circle at 3% 79%, #244c6070, transparent 39%), var(--bg); }
button, select, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; z-index: 99; top: -80px; left: 15px; padding: .7rem 1rem; color: #101020; background: white; border-radius: 8px; }
.skip:focus { top: 15px; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.math-app { min-height: 100dvh; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 80px; padding: .8rem clamp(16px, 3vw, 45px); border-bottom: 1px solid #f5e7ff19; background: #100d1bcc; backdrop-filter: blur(22px); }
.brand { display: inline-flex; align-items: center; gap: .72rem; min-width: 178px; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 43px; height: 43px; border: 1px solid #e8c1f16e; border-radius: 14px; color: #2c163f; background: linear-gradient(135deg, #f8d8e9, #aacff3); font: 700 1.35rem Georgia, serif; box-shadow: 0 7px 25px #efacec38; }
.brand strong { display: block; font: 700 1.15rem Georgia, serif; letter-spacing: -.035em; }
.brand small { display: block; margin-top: .13rem; color: #bfb2c9; font-size: .57rem; font-weight: 700; letter-spacing: .05em; }
.app-header__center { color: #c6b7d1; font-size: .65rem; font-weight: 800; letter-spacing: .2em; text-align: center; }
.app-header__center span { color: #f1bce6; }
.app-header__actions { display: flex; align-items: center; gap: .55rem; }
.icon-button, .presentation-link { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 38px; padding: .5rem .78rem; border: 1px solid #c6aed252; border-radius: 11px; color: #e9dce9; background: #ffffff0c; font-size: .75rem; font-weight: 750; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .2s; }
.icon-button:hover, .presentation-link:hover { color: white; border-color: #e1bfef8f; background: #ffffff1c; transform: translateY(-1px); }
.icon-button[aria-pressed="true"] { color: #211532; border-color: var(--pink); background: var(--pink); }
.app-layout { display: grid; grid-template-columns: minmax(264px, 318px) minmax(0, 1fr); gap: clamp(14px, 1.6vw, 26px); max-width: 1810px; min-height: calc(100dvh - 80px); margin: 0 auto; padding: clamp(14px, 1.65vw, 25px); }
.app-sidebar { display: flex; flex-direction: column; gap: 18px; align-self: start; padding: clamp(16px, 1.4vw, 23px); border: 1px solid #eacdfa24; border-radius: 25px; background: linear-gradient(160deg, #241a35ee, #161326f5); box-shadow: 0 24px 55px #08061861; }
.math-control-stack { display: grid; }
.math-controls-toggle { display: none; }
.eyebrow { color: var(--pink); font-size: .62rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.sidebar-intro h2 { margin: .65rem 0 .42rem; font: 700 1.47rem/1.13 Georgia, serif; letter-spacing: -.04em; }
.sidebar-intro p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.lab-nav { display: grid; gap: 7px; }
.lab-nav__button { display: grid; grid-template-columns: 19px 30px 1fr; align-items: center; gap: 9px; width: 100%; min-height: 55px; padding: .55rem .65rem; border: 1px solid transparent; border-radius: 14px; color: #cbbdd7; background: transparent; text-align: left; transition: background .2s, border-color .2s, transform .2s; }
.lab-nav__button:hover { background: #ffffff0c; transform: translateX(2px); }
.lab-nav__button.is-active { border-color: #e8bbeb6d; color: white; background: linear-gradient(100deg, #7c497f75, #694b9770); box-shadow: inset 3px 0 #f4c4e6; }
.lab-nav__number { color: #aa9cba; font-size: .65rem; font-weight: 800; }
.lab-nav__icon { display: grid; place-items: center; color: #f3cbe5; font-size: 1.55rem; line-height: 1; }
.lab-nav__button strong, .lab-nav__button small { display: block; }
.lab-nav__button strong { font-size: .85rem; }
.lab-nav__button small { margin-top: 2px; color: #bbabc9; font-size: .67rem; }
.control-panel { display: grid; gap: 11px; padding: 15px; border: 1px solid #ead5fa2a; border-radius: 17px; background: #0e0c1c78; }
.panel-title h3 { margin: .32rem 0 .25rem; font: 700 1.12rem Georgia, serif; }
.control-label, .field-label { display: block; margin: .4rem 0 0; color: #dfd4e7; font-size: .72rem; font-weight: 750; }
.zoom-controls { display: grid; grid-template-columns: 43px 1fr 43px; gap: 6px; }
.zoom-controls button, .preset-list button, .panel-action { min-height: 39px; border: 1px solid #c9acd447; border-radius: 10px; color: #f1e9f5; background: #ffffff0d; font-size: .72rem; font-weight: 750; }
.zoom-controls button:hover, .preset-list button:hover, .panel-action:hover { border-color: #f1c7ecb3; background: #ffffff22; }
.zoom-controls button:first-child, .zoom-controls button:last-child { font-size: 1.35rem; }
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-list button { min-height: 40px; padding: .45rem .5rem; font-size: .66rem; }
.preset-list button.is-active { color: #2a1738; background: var(--pink); border-color: var(--pink); }
.palette-list { display: flex; gap: 11px; }
.palette { width: 30px; height: 30px; border: 2px solid transparent; border-radius: 50%; box-shadow: 0 0 0 1px #ffffff5c; }
.palette.is-active { box-shadow: 0 0 0 2px #1b1430, 0 0 0 4px #f9dafa; }
.palette--aurora { background: linear-gradient(135deg, #e9b8e5 10%, #8665ca 48%, #83d5c7); }
.palette--ember { background: linear-gradient(135deg, #ffe2a3, #f69b65 45%, #78336d); }
.palette--ocean { background: linear-gradient(135deg, #ace8ef, #56a7c6 45%, #283a87); }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #e7d9eb; font-size: .72rem; font-weight: 700; }
.range-label output { color: var(--mint); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin: 0 0 5px; accent-color: #edb7eb; cursor: pointer; }
select { width: 100%; min-height: 39px; padding: .5rem .65rem; border: 1px solid #c6add14a; border-radius: 10px; color: #f5ecf8; background: #302341; }
.panel-action { width: 100%; padding: .55rem .7rem; }
.panel-action--primary { color: #231331; border-color: #ebbbe5; background: #ebbbe5; }
.panel-action--primary:hover { color: #231331; background: #f5d2ef; }
.control-copy { margin: 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.probability-actions { display: grid; grid-template-columns: 1.4fr .8fr; gap: 7px; }
.sidebar-tip { margin: 0; color: #bdb0cb; font-size: .69rem; line-height: 1.5; }
.sidebar-tip span { color: var(--gold); }
.app-main { display: flex; flex-direction: column; min-width: 0; gap: 15px; }
.stage-top { display: flex; align-items: end; justify-content: space-between; gap: 15px; min-height: 120px; padding: 6px 7px 0; }
.stage-top h1 { margin: .38rem 0 .42rem; font: 700 clamp(1.75rem, 3vw, 2.9rem)/1.04 Georgia, serif; letter-spacing: -.06em; }
.stage-top p { max-width: 750px; margin: 0; color: #cfc3d8; font-size: clamp(.75rem, .9vw, .88rem); line-height: 1.5; }
.stage-index { align-self: start; padding: .4rem .6rem; border: 1px solid #d6c2e54a; border-radius: 9px; color: #d7c9e3; font-size: .67rem; font-weight: 900; white-space: nowrap; }
.canvas-shell { display: flex; flex-direction: column; overflow: hidden; min-height: min(63vh, 630px); border: 1px solid #d6b9ee4d; border-radius: 23px; background: #111124; box-shadow: 0 24px 75px #0302108a, inset 0 0 0 1px #ffffff11; }
.canvas-toolbar, .canvas-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: .5rem clamp(13px, 1.3vw, 20px); color: #d6cce1; background: #151126ef; font-size: .61rem; font-weight: 800; letter-spacing: .13em; }
.canvas-toolbar { border-bottom: 1px solid #ffffff1d; }
.canvas-toolbar__live { display: flex; align-items: center; gap: 7px; color: #b6e9dd; white-space: nowrap; }
.canvas-toolbar__live span { width: 7px; height: 7px; border-radius: 50%; background: #9ee3d4; box-shadow: 0 0 12px #9ee3d4; }
.canvas-toolbar > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-toolbar button { min-height: 27px; padding: .2rem .5rem; border: 1px solid #cab6d557; border-radius: 7px; color: #f5e8f8; background: #ffffff13; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.canvas-toolbar button:hover { border-color: #f7dcf4; background: #ffffff25; }
.canvas-stage { position: relative; flex: 1; min-height: 430px; overflow: hidden; background: radial-gradient(circle at 50% 50%, #30234a, #101126 65%); touch-action: none; }
.canvas-stage canvas { display: block; width: 100%; height: 100%; min-height: 430px; cursor: crosshair; }
.canvas-stage.is-fractal canvas { cursor: grab; }
.canvas-stage.is-dragging canvas { cursor: grabbing; }
.canvas-stage .zoom-ghost { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; pointer-events: none; transition: transform .38s cubic-bezier(.16,.82,.26,1), opacity .38s ease; opacity: .92; cursor: default; }
.canvas-reticle { display: none; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; border: 1px solid #f6e3fa78; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: .55; }
.canvas-stage.is-fractal .canvas-reticle { display: block; }
.canvas-reticle::before, .canvas-reticle::after { content: ""; position: absolute; background: #f6e3fa87; }
.canvas-reticle::before { top: 13px; left: -7px; width: 40px; height: 1px; }
.canvas-reticle::after { top: -7px; left: 13px; width: 1px; height: 40px; }
.canvas-caption { position: absolute; right: 14px; bottom: 14px; left: 14px; width: fit-content; max-width: calc(100% - 28px); padding: .5rem .7rem; border: 1px solid #eddcf754; border-radius: 8px; color: #f7f0fb; background: #1b142acc; backdrop-filter: blur(12px); font-size: .68rem; font-weight: 650; pointer-events: none; }
.canvas-bottom { min-height: 42px; border-top: 1px solid #ffffff1d; font-variant-numeric: tabular-nums; }
.canvas-bottom span:last-child { color: var(--mint); white-space: nowrap; }
.insight { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 110px; padding: 17px 19px; border: 1px solid #dcc8e839; border-radius: 19px; background: linear-gradient(115deg, #24182dcf, #172334b8); }
.insight__icon { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid #f6d8fa7a; border-radius: 12px; color: #f1c8e9; font-size: 1.35rem; }
.insight h2 { margin: .22rem 0 .24rem; font: 700 1.05rem Georgia, serif; }
.insight p { max-width: 870px; margin: 0; color: #c9bfd2; font-size: .74rem; line-height: 1.5; }
.insight__formula { padding: .7rem .8rem; border: 1px solid #d3bbdf4d; border-radius: 10px; color: #f7dbed; background: #ffffff0e; font: 700 1rem Georgia, serif; white-space: nowrap; }
@media (max-width: 1100px) { .app-header__center { display: none; } .app-layout { grid-template-columns: 265px minmax(0, 1fr); } .canvas-stage, .canvas-stage canvas { min-height: 390px; } .insight { grid-template-columns: 37px 1fr; } .insight__formula { grid-column: 2; justify-self: start; } }
@media (max-width: 760px) { .app-header { min-height: 68px; } .brand { min-width: 0; } .app-layout { display: flex; flex-direction: column; padding: 11px; } .app-sidebar { gap: 12px; padding: 13px; border-radius: 19px; } .sidebar-intro { display: none; } .lab-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; } .lab-nav__button { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 58px; padding: .35rem .15rem; text-align: center; } .lab-nav__number, .lab-nav__button small { display: none; } .lab-nav__icon { font-size: 1.18rem; } .lab-nav__button strong { font-size: .65rem; } .control-panel { gap: 8px; padding: 11px; } .panel-title { display: none; } .preset-list { grid-template-columns: repeat(4, 1fr); } .preset-list button { font-size: .58rem; } .sidebar-tip { display: none; } .stage-top { min-height: 92px; padding: 4px; } .canvas-shell { min-height: 490px; } .canvas-stage, .canvas-stage canvas { min-height: 410px; } .insight { padding: 13px; } }
@media (max-width: 480px) { .brand small, .presentation-link { display: none; } .brand strong { font-size: 1rem; } .icon-button { min-height: 34px; } .stage-top h1 { font-size: 1.65rem; } .stage-index { display: none; } .canvas-shell { min-height: 450px; border-radius: 16px; } .canvas-stage, .canvas-stage canvas { min-height: 370px; } .canvas-toolbar > span:nth-child(2) { display: none; } .canvas-caption { font-size: .61rem; } .canvas-bottom { font-size: .55rem; letter-spacing: .03em; } .insight__formula { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Exploration controls and live mathematical measurements */
#julia-controls { display: grid; gap: 7px; }
#mandelbrot-presets .control-label { margin: 2px 0 9px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: #ded2e8; font-size: .72rem; line-height: 1.4; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--pink); }
.math-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.math-metrics > div { min-width: 0; padding: 13px 16px; border: 1px solid #d9c7e541; border-radius: 14px; background: linear-gradient(125deg, #211a34e8, #162639b8); }
.math-metrics span, .math-metrics strong { display: block; overflow-wrap: anywhere; }
.math-metrics span { color: #c5b7d5; font-size: .68rem; font-weight: 700; }
.math-metrics strong { margin-top: 5px; color: #f7e5f4; font-size: clamp(.95rem, 1.5vw, 1.25rem); font-variant-numeric: tabular-nums; }
.convergence { display: grid; grid-template-columns: minmax(170px, .6fr) minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 15px 18px; border: 1px solid #d9c7e541; border-radius: 16px; background: #16182ce8; }
.convergence p { margin: 7px 0 0; color: #c9bed4; font-size: .74rem; line-height: 1.5; }
.convergence canvas { display: block; width: 100%; height: auto; max-height: 140px; }
.math-challenge { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border: 1px solid #f0cfb84d; border-radius: 18px; background: linear-gradient(115deg, #30203ad9, #242536bb); }
.math-challenge h2 { margin: 5px 0; font: 700 1.05rem Georgia, serif; }
.math-challenge p { margin: 0; color: #d0c4d5; font-size: .74rem; line-height: 1.5; }
.math-challenge #challenge-answer { margin-top: 9px; color: #b5e7db; }
.math-challenge .panel-action { flex: 0 0 auto; width: auto; min-width: 150px; }
button:disabled { cursor: wait; opacity: .55; }
@media (max-width: 760px) { .math-metrics { gap: 6px; } .math-metrics > div { padding: 10px; } .math-metrics span { font-size: .6rem; } .math-metrics strong { font-size: .85rem; } .convergence { grid-template-columns: 1fr; } .math-challenge { align-items: stretch; flex-direction: column; gap: 12px; } .math-challenge .panel-action { width: 100%; } }
@media (max-width: 480px) { .app-header__actions { gap: 4px; } .app-header__actions .icon-button span { display: none; } .app-header__actions .icon-button { width: 35px; padding: 0; font-size: 1rem; } .math-metrics strong { font-size: .77rem; } }
#bulb-controls { display: grid; gap: 7px; }
#bulb-controls .control-copy { margin-bottom: 2px; }
.canvas-stage #math-3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; cursor: grab; touch-action: none; }
.canvas-stage #math-3d-canvas.is-dragging { cursor: grabbing; }
.fractal-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fractal-tools button { min-height: 39px; padding: .45rem; border: 1px solid #c9acd447; border-radius: 10px; color: #f1e9f5; background: #ffffff0d; font-size: .7rem; font-weight: 750; }
.fractal-tools button:hover { border-color: #f1c7ecb3; }
.fractal-tools button.is-active { color: #281733; border-color: var(--mint); background: var(--mint); }
.canvas-stage.is-inspecting canvas { cursor: crosshair; }
.canvas-stage.is-inspecting.is-dragging canvas { cursor: crosshair; }
.canvas-stage.is-inspecting .canvas-reticle { display: none; }
.orbit-marker { position: absolute; z-index: 2; width: 18px; height: 18px; border: 2px solid #fff8fc; border-radius: 50%; background: #ed7ac8ad; box-shadow: 0 0 0 5px #f0a5d54d, 0 0 24px #f1bce6; transform: translate(-50%, -50%); pointer-events: none; }
.math-detail-chart { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 20px; padding: 17px 20px; border: 1px solid #d9c7e541; border-radius: 17px; background: linear-gradient(115deg, #23182ee8, #142339e8); }
.math-detail-chart__copy h2 { margin: 6px 0; font: 700 1.06rem Georgia, serif; }
.math-detail-chart__copy p, .math-detail-chart__copy li { color: #d0c4d8; font-size: .73rem; line-height: 1.5; }
.math-detail-chart__copy p { margin: 6px 0; }
.math-detail-chart__copy ol { display: grid; gap: 2px; margin: 8px 0 12px; padding-left: 23px; font-variant-numeric: tabular-nums; }
.math-detail-chart__copy .panel-action { max-width: 280px; }
.math-detail-chart canvas { display: block; width: 100%; height: auto; max-height: 280px; border: 1px solid #ffffff24; border-radius: 10px; }
.sequence-presets { grid-template-columns: repeat(3, 1fr); }
.sequence-legend { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 12px; color: #ded5e5; font-size: .69rem; font-weight: 700; }
.sequence-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sequence-legend i { display: inline-block; width: 15px; height: 3px; border-radius: 5px; }
.sequence-legend__first { background: #9ce1d4; }
.sequence-legend__second { background: #f5d597; }
#sequence-comparison-summary { color: #f5dfa9; font-variant-numeric: tabular-nums; }
#bifurcation-chart { cursor: crosshair; touch-action: manipulation; }
#bifurcation-chart:focus-visible { outline-offset: 4px; }
.canvas-stage { flex: 0 0 auto; height: clamp(390px, 54vh, 620px); min-height: 0; }
.canvas-stage > #math-canvas { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; }
@media (max-width: 760px) { .canvas-stage { height: clamp(340px, 43vh, 480px); min-height: 0; } }
@media (max-width: 760px) { .lab-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); } .math-detail-chart { grid-template-columns: 1fr; gap: 12px; } .math-detail-chart canvas { max-height: 240px; } .sequence-presets { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .lab-nav__button strong { font-size: .59rem; } .lab-nav__icon { font-size: 1.05rem; } }
.learning-path { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr) minmax(215px, .5fr); align-items: center; gap: clamp(14px, 2vw, 30px); padding: 17px 21px; border: 1px solid #e0c6ef52; border-radius: 20px; background: linear-gradient(110deg, #2b1b3bdc, #17283ad9); box-shadow: 0 16px 40px #09071a40; }
.learning-path__lesson, .learning-path__route { min-width: 0; }
.learning-path__lesson h2 { margin: 5px 0 7px; font: 700 clamp(1.04rem, 1.4vw, 1.28rem)/1.2 Georgia, serif; }
.learning-path__lesson p { margin: 3px 0; color: #ded1e5; font-size: .73rem; line-height: 1.45; }
.learning-path__lesson p strong { margin-right: 5px; color: var(--mint); white-space: nowrap; }
.learning-path__explain-toggle { display: none; }
.learning-path__count { color: #f4c3e7; font-size: .68rem; font-weight: 800; }
.learning-path__steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 8px 0 5px; padding: 0; list-style: none; }
.learning-path__steps li { min-width: 0; padding: 5px 2px; border: 1px solid #ffffff27; border-radius: 9px; color: #c9bed4; background: #ffffff09; text-align: center; }
.learning-path__steps li span { display: grid; place-items: center; width: 22px; height: 22px; margin: 0 auto 2px; border-radius: 50%; color: #d4c7e0; background: #ffffff19; font-size: .64rem; font-weight: 900; }
.learning-path__steps li small { display: block; overflow: hidden; font-size: .6rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.learning-path__steps li.is-visited { border-color: #9ce1d45c; }
.learning-path__steps li.is-visited span { color: #142b2c; background: var(--mint); }
.learning-path__steps li.is-current { border-color: #f1bce6bd; color: #fff; background: #f1bce629; }
.learning-path__steps li.is-current span { color: #291637; background: var(--pink); }
.learning-path__bridge { margin: 0; color: #c9bed4; font-size: .67rem; line-height: 1.4; }
.learning-path__bridge span:first-child { color: var(--gold); font-weight: 800; }
.learning-path__actions { display: grid; gap: 7px; }
.learning-path__actions button { min-height: 38px; padding: .48rem .6rem; border: 1px solid #d9c1e052; border-radius: 9px; color: #eee4f3; background: #ffffff0e; font-size: .7rem; font-weight: 800; }
.learning-path__actions button:hover:not(:disabled) { border-color: #efd5f2; background: #ffffff20; }
.learning-path__actions .learning-path__try { border-color: var(--mint); color: #172b2d; background: var(--mint); }
.learning-path__actions .learning-path__try:hover { color: #172b2d; background: #baf3e8; }
.learning-path__pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.learning-path__actions button:disabled { cursor: default; opacity: .45; }
.learning-path__actions .learning-path__restart { min-height: 24px; padding: 2px; border: 0; color: #c7b9d4; background: transparent; font-size: .65rem; text-decoration: underline; text-underline-offset: 2px; }
.lab-nav__button.is-visited:not(.is-active) { border-color: #9ce1d430; background: #9ce1d408; }
@media (max-width: 1100px) { .learning-path { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); } .learning-path__actions { grid-column: 1 / -1; grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.2fr) auto; align-items: center; } }
@media (max-width: 760px) {
    .learning-path { grid-template-columns: 1fr; gap: 10px; padding: 13px 15px; }
    .learning-path__lesson h2 { margin: 4px 0; }
    .learning-path__explain-toggle { display: inline-block; margin-top: 5px; padding: 0; border: 0; color: var(--mint); background: transparent; font-size: .7rem; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
    .learning-path__explanation { display: none; margin-top: 7px; }
    .learning-path__explanation.is-open { display: block; }
    .learning-path__route { display: flex; align-items: center; gap: 10px; }
    .learning-path__count { flex: 0 0 auto; max-width: 110px; line-height: 1.3; }
    .learning-path__steps { flex: 1; margin: 0; }
    .learning-path__steps li { padding: 3px 1px; }
    .learning-path__steps li span { margin-bottom: 0; }
    .learning-path__steps li small { display: none; }
    .learning-path__actions { grid-column: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .learning-path__pager { display: contents; }
    .learning-path__actions button { min-height: 38px; padding: .35rem .3rem; font-size: .64rem; }
    .learning-path__actions #guide-previous { order: 1; }
    .learning-path__actions #guide-try { order: 2; }
    .learning-path__actions #guide-next { order: 3; }
    .learning-path__actions .learning-path__restart { grid-column: 1 / -1; order: 4; justify-self: start; }
}
.math-app.has-guide-dock { padding-bottom: 70px; }
.guide-dock { position: fixed; z-index: 30; right: clamp(12px, 2vw, 28px); bottom: 15px; display: flex; align-items: center; gap: 7px; max-width: calc(100vw - 20px); padding: 7px; border: 1px solid #f1d6ef8f; border-radius: 13px; color: #fbf5ff; background: #171329f0; box-shadow: 0 12px 40px #060716aa; backdrop-filter: blur(18px); }
.guide-dock span { min-width: 112px; padding: 0 6px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.guide-dock button { min-width: 37px; min-height: 37px; padding: .4rem .55rem; border: 1px solid #d6bee057; border-radius: 8px; color: #f5eaf8; background: #ffffff12; font-size: .69rem; font-weight: 800; }
.guide-dock button:hover:not(:disabled) { border-color: #edd5f1; background: #ffffff28; }
.guide-dock button:disabled { cursor: default; opacity: .4; }
@media (max-width: 760px) { .guide-dock { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; justify-content: space-between; } .guide-dock span { flex: 1; min-width: 0; padding: 0 3px; font-size: .65rem; } .guide-dock button { min-height: 42px; } }

/* Sur téléphone, l'image et l'idée précèdent les réglages détaillés. */
@media (max-width: 760px) {
    .lab-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lab-nav__button { min-height: 64px; }
    .lab-nav__button strong { font-size: .61rem; overflow-wrap: anywhere; }
    .math-controls-toggle {
        display: flex;
        width: 100%;
        min-height: 46px;
        padding: .65rem .8rem;
        align-items: center;
        justify-content: space-between;
        border: 1px solid #e6c9ed70;
        border-radius: 11px;
        color: #f8e9fa;
        background: #ffffff10;
        font-size: .8rem;
        font-weight: 800;
        text-align: left;
    }
    .math-controls-toggle span:last-child { color: var(--mint); font-size: 1.35rem; line-height: 1; transition: transform .18s ease; }
    .app-sidebar.is-controls-open .math-controls-toggle span:last-child { transform: rotate(180deg); }
    .math-control-stack { display: none; }
    .app-sidebar.is-controls-open .math-control-stack { display: grid; }
}

@media (min-width: 761px) {
    .app-layout { grid-template-columns: minmax(294px, 330px) minmax(0, 1fr); }
    .lab-nav__button { min-height: 60px; }
    .lab-nav__button strong { font-size: .89rem; }
    .lab-nav__button small { font-size: .72rem; }
    .sidebar-intro p, .control-copy { font-size: .81rem; }
    .control-label, .field-label, .range-label { font-size: .79rem; }
    .zoom-controls button, .preset-list button, .panel-action, .fractal-tools button { font-size: .78rem; }
    .control-panel select { font-size: .82rem; }
}

@media (min-width: 761px) and (max-width: 1100px) {
    .app-layout { grid-template-columns: 265px minmax(0, 1fr); }
}

.math-value-table { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(0, 1.28fr); gap: 1.25rem; align-items: center; padding: 1.1rem 1.25rem; border: 1px solid #d9c7e541; border-radius: 17px; background: linear-gradient(115deg, #23182ee8, #142339e8); }
.math-value-table h2 { margin: .35rem 0; font: 700 1.14rem Georgia, serif; }
.math-value-table p { max-width: 36ch; margin: 0; color: #d0c4d8; font-size: .77rem; line-height: 1.5; }
.math-value-table__scroll { min-width: 0; overflow-x: auto; }
.math-value-table table { width: 100%; min-width: 300px; border-collapse: collapse; color: #f8f3ff; font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; }
.math-value-table th, .math-value-table td { padding: .55rem .7rem; border-bottom: 1px solid #ffffff22; }
.math-value-table th { color: #c5b7d5; font-size: .68rem; font-weight: 800; }
.math-value-table tbody tr.is-current { color: #102725; background: var(--mint); font-weight: 850; }
.math-value-table tbody tr.is-current th { color: #102725; }
.math-value-table tbody tr.is-current td { border-bottom-color: transparent; }
@media (max-width: 760px) { .math-value-table { grid-template-columns: 1fr; gap: .85rem; padding: 1rem; } .math-value-table p { max-width: none; } }

.math-theorems { padding: 1.2rem; border: 1px solid #d9c7e55c; border-radius: 18px; background: linear-gradient(120deg, #201830ed, #142a35e8); }
.math-theorems > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.math-theorems h2 { margin: .25rem 0; font: 700 clamp(1.15rem, 1.7vw, 1.45rem) Georgia, serif; }
.math-theorems > header p { margin: 0; color: #d0c4d8; font-size: .76rem; }
.math-theorems > header > span { flex: 0 0 auto; padding: .4rem .65rem; border-radius: 999px; color: #17312e; background: var(--mint); font-size: .66rem; font-weight: 850; }
.math-theorems__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.math-theorems__grid article { min-width: 0; padding: 1rem; border: 1px solid #ffffff24; border-radius: 13px; background: #ffffff0a; }
.math-theorems__number { color: var(--mint); font-size: .67rem; font-weight: 900; }
.math-theorems__grid h3 { margin: .35rem 0 .7rem; font-size: .88rem; line-height: 1.3; }
.math-theorems__grid p { margin: .55rem 0 0; color: #d9cfe0; font-size: .73rem; line-height: 1.5; }
.math-theorems__grid .math-theorems__formula { padding: .65rem .7rem; border-radius: 8px; color: #bdf0e4; background: #071d27b8; font-size: .79rem; font-weight: 800; overflow-wrap: anywhere; }
.math-theorems__grid .math-theorems__example { color: #f0cce5; }
.math-challenge > div:first-child { min-width: 0; flex: 1; }
.math-challenge__actions { display: grid; gap: .55rem; flex: 0 0 180px; }
.math-challenge__actions .panel-action { width: 100%; }
.math-quiz { margin: .9rem 0 0; padding: 0; border: 0; }
.math-quiz legend { margin-bottom: .45rem; color: #fff1f9; font-size: .78rem; font-weight: 800; }
.math-quiz > div { display: grid; gap: .4rem; }
.math-quiz label { display: flex; align-items: center; gap: .55rem; padding: .52rem .65rem; border: 1px solid #ffffff2b; border-radius: 9px; color: #e7dfea; cursor: pointer; font-size: .73rem; }
.math-quiz label:has(input:checked) { border-color: var(--mint); background: #9ce1d41a; }
.math-quiz input { flex: 0 0 auto; accent-color: var(--mint); }
.math-challenge .math-quiz__feedback { min-height: 1.3em; margin: .65rem 0 0; font-weight: 800; }
.math-quiz__feedback[data-result="correct"] { color: #a4efd9; }
.math-quiz__feedback[data-result="incorrect"], .math-quiz__feedback[data-result="missing"] { color: #ffd1aa; }
.math-graph-link { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .75rem; border: 1px solid #9ce1d48c; border-radius: 13px; color: #e8fbf5; background: linear-gradient(110deg, #164344a8, #323052aa); text-decoration: none; }
.math-graph-link:hover, .math-graph-link:focus-visible { border-color: #baf4e8; color: #fff; background: linear-gradient(110deg, #215957c8, #433b6bc8); }
.math-graph-link > span:first-child { color: var(--mint); font-size: 1.65rem; line-height: 1; }
.math-graph-link strong, .math-graph-link small { display: block; }
.math-graph-link strong { font-size: .82rem; }
.math-graph-link small { margin-top: .1rem; color: #c2e6dd; font-size: .66rem; }
@media (max-width: 1100px) { .math-theorems__grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .math-theorems { padding: 1rem; } .math-theorems > header { flex-wrap: wrap; } .math-challenge__actions { width: 100%; flex-basis: auto; } }
