@charset "UTF-8";

body.algorithm-guide-active .site-shell { width: min(1560px, calc(100% - 64px)); max-width: none; }
.algorithm-layout { --guide-orange: #c15d2d; --guide-green: #39805b; --guide-red: #b64746; --guide-blue: #376f9c; width: 100%; margin-inline: auto; padding: 12px 0; }
.algorithm-layout :where(button, select) { font: inherit; }
.algorithm-layout :where(button, select, summary):focus-visible { outline: 3px solid var(--guide-orange); outline-offset: 4px; }
.algorithm-layout :where(h1, h2, h4)[tabindex]:focus { outline: none; }
.algorithm-layout button:disabled { cursor: not-allowed; opacity: .45; }
.algorithm-layout :where(p, h2, h3, h4, dd) { overflow-wrap: anywhere; }
.algorithm-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.algorithm-topline { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.algorithm-back { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 7px 0; border: 0; border-radius: 4px; background: none; color: #74634f; font-size: 14px !important; }
.algorithm-back > span { font-size: 20px; transition: transform .2s; }
.algorithm-back:hover { color: var(--guide-orange); }
.algorithm-back:hover > span { transform: translateX(-3px); }
.algorithm-edition { color: #8b775d; font-size: 10px; letter-spacing: 1.25px; text-align: right; }
.algorithm-edition > span { margin-inline: 10px; color: #b39b7d; }
.algorithm-hero { display: grid; grid-template-columns: minmax(0, 1fr) 230px; align-items: center; gap: 28px; padding: 8px 0 23px; }
.algorithm-kicker { display: flex; align-items: center; gap: 8px; color: #8d6944; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; line-height: 1.5; }
.algorithm-kicker > span { color: #bd8f52; font-size: 20px; line-height: 1; }
.algorithm-hero h1 { margin: 9px 0 11px; font: 750 clamp(28px, 2.6vw, 40px)/1.12 var(--font-display); letter-spacing: -1.2px; }
.algorithm-hero h1 em { color: #b7572c; font: italic 1.04em/1.15 Georgia, serif; font-weight: 400; letter-spacing: -1.4px; }
.algorithm-hero__copy > p:last-of-type { max-width: 850px; color: #776953; font-size: 15px; line-height: 1.6; }
.algorithm-hero__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 20px; margin-top: 11px; color: #7d6d57; font-size: 12px; }
.algorithm-hero__tags > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.algorithm-hero__tags i { display: inline-block; flex: 0 0 5px; height: 5px; border-radius: 50%; background: var(--guide-green); }
.algorithm-hero__tags > span:last-child { color: #a18159; font: italic 13px Georgia, serif; }
.algorithm-scene { position: relative; width: 100%; max-width: 230px; margin: 0; pointer-events: none; }
.algorithm-scene > svg { width: 100%; height: auto; overflow: visible; }
.algorithm-scene figcaption { margin: -2px 0 0; color: #9a7c57; font: italic 11px Georgia, serif; text-align: center; transform: rotate(-3deg); }
.algorithm-scene__fox { animation: algorithm-fox-breathe 5s ease-in-out infinite; transform-origin: 239px 240px; }
.algorithm-scene__card { animation: algorithm-card-float 7s ease-in-out infinite; }
.algorithm-scene__formula { animation: algorithm-formula-float 6s ease-in-out infinite; }
.algorithm-scene__spark { animation: algorithm-spark 5s ease-in-out infinite; }
.algorithm-scene__beads { animation: algorithm-beads 8s ease-in-out infinite; }
.algorithm-scene__eyes { animation: algorithm-blink 7s ease-in-out infinite; transform-origin: 239px 120px; }

.algorithm-workspace { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 22px; align-items: start; }
.algorithm-index { position: sticky; top: 18px; padding: 10px 0 0; }
.algorithm-index__heading { padding: 0 8px 13px; }
.algorithm-index__heading .algorithm-kicker { font-size: 9px; letter-spacing: 1.3px; }
.algorithm-index h2 { margin: 7px 0; font: 650 20px/1.25 var(--font-display); letter-spacing: -.5px; }
.algorithm-index__heading > p:last-child { color: #84745f; font-size: 13px; line-height: 1.55; }
.algorithm-chapters { display: grid; gap: 3px; }
.algorithm-chapter { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #796850; font-size: 14px !important; text-align: left; transition: background .18s, border-color .18s; }
.algorithm-chapter__number { flex-shrink: 0; width: 19px; color: #9c8668; font: italic 14px Georgia, serif; }
.algorithm-chapter__state { margin-left: auto; color: #ad9677; font-size: 15px; opacity: 0; }
.algorithm-chapter:hover { border-color: #e1d2bd; background: #f9f3e8; }
.algorithm-chapter:hover .algorithm-chapter__state, .algorithm-chapter[aria-current] .algorithm-chapter__state, .algorithm-chapter.is-complete .algorithm-chapter__state { opacity: 1; }
.algorithm-chapter[aria-current] { border-color: #dbac86; background: #f9e5d4; color: #964516; font-weight: 700 !important; box-shadow: inset 3px 0 0 var(--guide-orange); }
.algorithm-chapter[aria-current] .algorithm-chapter__number { color: #a5582d; }
.algorithm-chapter.is-complete .algorithm-chapter__state { color: var(--guide-green); }
.algorithm-index__foot { display: flex; align-items: flex-start; gap: 8px; margin: 15px 8px 0; padding-top: 12px; border-top: 1px solid #dfd3c0; }
.algorithm-index__foot > span { color: #b58d5a; font: italic 25px Georgia, serif; line-height: 1; }
.algorithm-index__foot p { color: #8e7b61; font-size: 12px; line-height: 1.65; }
.algorithm-chapter-select, .algorithm-mobile-label { display: none; }

.algorithm-notebook { position: relative; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; scroll-margin-top: 20px; }
.algorithm-reference, .algorithm-example { border: 1px solid #d9c6a9; border-radius: 16px; background: #fffcf5; box-shadow: 0 4px 0 -1px #eadeca, 0 13px 35px -25px #65503638; }
.algorithm-reference { position: relative; padding: 0 24px; }
.algorithm-reference-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 55px; padding: 13px 0; color: #735436; font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; }
.algorithm-reference-summary::-webkit-details-marker { display: none; }
.algorithm-reference-summary > span:last-child { color: #9b7853; font-size: 13px; font-weight: 400; }
.algorithm-reference-summary i { display: inline-block; margin-left: 8px; font-size: 18px; font-style: normal; transition: transform .2s; }
.algorithm-reference[open] .algorithm-reference-summary i { transform: rotate(180deg); }
.algorithm-reference[open] .algorithm-reference-summary { margin-bottom: 17px; border-bottom: 1px solid #e6d8c4; }
.algorithm-reference::before { content: ""; position: absolute; top: -8px; right: 35px; width: 57px; height: 16px; background: #d4c2966e; transform: rotate(4deg); border-inline: 2px dashed #f6ebd088; }
.algorithm-notebook__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.algorithm-notebook__top .algorithm-kicker { font-size: 10px; letter-spacing: 1px; }
.algorithm-chapter-count { flex-shrink: 0; color: #9c8262; font: italic 13px Georgia, serif; }
.algorithm-chapter-heading { padding: 10px 0 18px; }
.algorithm-chapter-heading h2 { margin: 0 0 8px; color: #493b2c; font: 650 clamp(23px, 2vw, 30px)/1.2 var(--font-display); letter-spacing: -.6px; }
.algorithm-chapter-heading > p { max-width: 1060px; color: #7b6a53; font-size: 15px; line-height: 1.65; }
.algorithm-notebook h3 { display: flex; align-items: center; gap: 9px; margin: 0; color: #5a4731; font-size: 15px; font-weight: 700; line-height: 1.4; }
.algorithm-section-marker { display: inline-grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; border: 1px solid #e5b991; border-radius: 7px; color: #a85e2e; background: #f9e8d6; font: italic 12px Georgia, serif; }
.algorithm-reference-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr); gap: 22px; align-items: start; padding-bottom: 2px; }
.algorithm-rule { min-width: 0; padding: 0; }
.algorithm-formula { margin-top: 12px; padding: 14px 16px; border-left: 4px solid var(--guide-orange); border-radius: 0 9px 9px 0; background: #fbeddc; color: #85502c; font: 21px/1.65 Georgia, serif; white-space: pre-line; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.algorithm-formula-line { display: block; }
.algorithm-formula-answer { padding: 1px 5px; border-radius: 5px; background: #d4ecd8; color: #245d3e; box-decoration-break: clone; -webkit-box-decoration-break: clone; font-weight: 700; }
.algorithm-formula-line[data-bound="lower"] .algorithm-formula-answer { background: #f1dfc3; color: #784c20; }
.algorithm-formula-line[data-bound="upper"] .algorithm-formula-answer, .algorithm-formula-answer[data-tone="warning"] { background: #dceaf8; color: #285f89; }
.algorithm-rule__explanation { margin-top: 10px; color: #7f6b51; font-size: 14px; line-height: 1.65; }
.algorithm-legend { min-width: 0; padding: 14px 17px; border: 1px solid #e1d9c6; border-radius: 10px; background: #f4f2e8; }
.algorithm-section-intro { margin-top: 6px; color: #8a755a; font-size: 13px; line-height: 1.5; }
.algorithm-legend dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0 0; }
.algorithm-legend dl > div { display: flex; align-items: baseline; gap: 12px; }
.algorithm-legend dt { flex-shrink: 0; min-width: 30px; color: #4d7350; font: italic 19px/1.3 Georgia, serif; }
.algorithm-legend dd { margin: 0; color: #726850; font-size: 14px; line-height: 1.5; }
.algorithm-notes { margin-top: 16px; border-top: 1px dashed #dfceb3; }
.algorithm-notes summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 10px 0; color: #87643f; font-size: 14px; cursor: pointer; list-style: none; }
.algorithm-notes summary::-webkit-details-marker { display: none; }
.algorithm-notes summary > span { color: #a4855d; font-size: 18px; transition: transform .2s; }
.algorithm-notes[open] summary > span { transform: rotate(45deg); }
.algorithm-notes ul { display: grid; gap: 7px; margin: 0; padding: 0 0 16px 17px; color: #806c53; font-size: 14px; line-height: 1.65; }
.algorithm-notes li::marker { color: #b69a71; }

.algorithm-example { margin-top: 23px; overflow: clip; scroll-margin-top: 18px; }
.algorithm-example__heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 24px; border-bottom: 1px solid #e5d4be; background: #fff8eb; }
.algorithm-example-badge { padding: 5px 8px; border: 1px dashed #cca979; border-radius: 4px; color: #936b3e; font-size: 10px; letter-spacing: 1.3px; transform: rotate(-3deg); }
.algorithm-example-launch { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 24px; background: radial-gradient(ellipse at 100% 50%, #f7e2bd78, transparent 55%); }
.algorithm-example-launch > div { min-width: 0; }
.algorithm-example-launch h4 { margin: 0 0 8px; color: #58442d; font: 650 21px/1.3 var(--font-display); letter-spacing: -.3px; }
.algorithm-example-launch p { max-width: 680px; color: #806c50; font-size: 15px; line-height: 1.65; }
.algorithm-example-launch [data-guide-start] { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 11px; min-height: 48px; padding: 13px 21px; border: 1px solid #a54a24; border-radius: 10px; background: #c15d2d; color: #fff8ec; font-size: 15px; font-weight: 650; box-shadow: 0 3px 0 #98461f; transition: background .2s, transform .2s; }
.algorithm-example-launch [data-guide-start]:hover { background: #ad4c21; transform: translateY(-2px); }
.algorithm-example-launch [data-guide-start] > span { font-size: 19px; }
.algorithm-color-key { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 700; }
.algorithm-color-key > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 2px solid; border-radius: 7px; line-height: 1.4; }
.algorithm-color-key [data-tone="good"] { color: #185636; background: #d9efdf; border-color: #367c50; }
.algorithm-color-key [data-tone="bad"] { color: #8d272e; background: #fbe0df; border-color: #bd464f; }
.algorithm-color-key [data-tone="warning"] { color: #1b5184; background: #dcecfb; border-color: #397cb1; border-style: dashed; }
.algorithm-example-context { grid-column: 1 / -1; min-width: 0; padding: 15px 24px 18px; border-bottom: 1px solid #dfd2bd; background: #fcf8ee; }
.algorithm-example-context--preview { border-bottom: 0; border-top: 1px solid #e5d4be; }
.algorithm-comparison { width: 100%; border-collapse: collapse; table-layout: fixed; color: #514431; font-size: 14px; line-height: 1.5; }
.algorithm-comparison caption { padding: 0 0 10px; color: #6b4b2b; font-size: 15px; font-weight: 700; text-align: left; }
.algorithm-comparison :where(th, td) { padding: 8px 12px; border: 1px solid #dfd2bd; overflow-wrap: anywhere; vertical-align: top; text-align: left; }
.algorithm-comparison thead th { background: #efe5d3; font-size: 13px; color: #755b3b; }
.algorithm-comparison thead th:first-child { width: 19%; }
.algorithm-comparison tbody th { background: #f5ecdc; font-weight: 650; }
.algorithm-comparison td { background: #fffdf7; }
.algorithm-comparison td:last-child { position: relative; padding-left: 43px; }
.algorithm-fact-symbol { position: absolute; top: 8px; left: 12px; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #e5dccb; font-size: 15px; font-weight: 800; }
.algorithm-comparison [data-tone="good"] td:last-child, .algorithm-comparison [data-tone="green"] td:last-child { color: #185636; background: #e5f2e7; }
.algorithm-comparison [data-tone="good"] .algorithm-fact-symbol, .algorithm-comparison [data-tone="green"] .algorithm-fact-symbol { background: #28673e; color: #fff; }
.algorithm-comparison [data-tone="bad"] td:last-child { color: #8d272e; background: #fce8e5; }
.algorithm-comparison [data-tone="bad"] .algorithm-fact-symbol { background: #a3343e; color: #fff; }
.algorithm-comparison [data-tone="warning"] td:last-child { color: #1b5184; background: #e4effb; }
.algorithm-comparison [data-tone="warning"] .algorithm-fact-symbol { background: #245e94; color: #fff; border-radius: 50%; }
.algorithm-example-body { animation: algorithm-stage-enter .25s ease-out; }
.algorithm-steps { display: flex; align-items: stretch; gap: 7px; padding: 14px 24px; border-bottom: 1px solid #e6d8c2; background: #faf6ee; }
.algorithm-step { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1 1 0; min-width: 0; min-height: 44px; padding: 7px 9px; border: 1px solid #e0d4c0; border-radius: 8px; background: #fffaf1; color: #8e785b; font-size: 14px !important; line-height: 1.35; text-align: left; transition: background .2s, border-color .2s; }
.algorithm-step > span:first-child { display: grid; place-items: center; flex: 0 0 23px; height: 23px; border: 1px solid #d9c7ab; border-radius: 50%; color: #9b805e; font-size: 13px; }
.algorithm-step > span:last-child { overflow-wrap: anywhere; }
.algorithm-step:hover { border-color: #c9b18d; background: #f4ead9; }
.algorithm-step[aria-current] { border-color: #d39661; background: #ffe0b9; color: #85421b; font-weight: 700 !important; }
.algorithm-step[aria-current] > span:first-child { border-color: #ad5425; background: #bd5d2c; color: #fff5e8; }
.algorithm-step.is-past > span:first-child { background: #ddecdb; border-color: #a1c49f; color: #3d7653; }
.algorithm-stage-grid { display: grid; grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr); align-items: stretch; scroll-margin-top: 18px; }
.algorithm-stage-grid:focus { outline: none; }
.algorithm-explanation { min-width: 0; padding: 22px 24px; }
.algorithm-step-heading { padding: 0; scroll-margin-top: 20px; }
.algorithm-step-heading > span { color: #a06b37; font-size: 10px; font-weight: 650; letter-spacing: 1.2px; }
.algorithm-step-heading h4 { margin: 7px 0 10px; color: #52412d; font: 650 23px/1.25 var(--font-display); letter-spacing: -.5px; }
.algorithm-step-heading p { color: #77654e; font-size: 16px; line-height: 1.65; }
.algorithm-step-formula { margin-top: 17px; padding: 14px 16px; border: 1px solid #e0b67b; border-radius: 9px; background: #fff0d6; color: #915025; font: 22px/1.75 Georgia, serif; font-variant-numeric: tabular-nums; white-space: pre-line; overflow-wrap: anywhere; }
.algorithm-calculation { margin-top: 14px; }
.algorithm-rows { display: grid; gap: 7px; min-width: 0; margin: 15px 0 0; }
.algorithm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 12px; border: 1px solid #e7ddcd; border-radius: 8px; background: #fdf9f1; }
.algorithm-row dt { color: #766147; font-size: 14px; line-height: 1.5; }
.algorithm-row dd { margin: 0; color: #65513a; text-align: right; }
.algorithm-row strong { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.algorithm-row small { display: block; margin-top: 3px; color: #796446; font-size: 13px; line-height: 1.5; }
.algorithm-row[data-tone="good"], .algorithm-row[data-tone="green"] { border-color: #b2d4b9; background: #eaf4e9; }
.algorithm-row[data-tone="good"] :where(dt, strong), .algorithm-row[data-tone="green"] :where(dt, strong) { color: #326b48; }
.algorithm-row[data-tone="bad"] { border-color: #e0b0aa; background: #fbeae5; }
.algorithm-row[data-tone="bad"] :where(dt, strong) { color: #a53f3d; }
.algorithm-row[data-tone="warning"] { border-color: #a9c5db; background: #eaf2fa; }
.algorithm-row[data-tone="warning"] :where(dt, strong) { color: #306c97; }
.algorithm-row[data-tone="muted"] { background: #f4f0e8; }
.algorithm-row.is-highlighted { border-color: #d38a3c; outline: 2px solid #edbd6c; outline-offset: 1px; box-shadow: inset 4px 0 0 #d17b2d; animation: algorithm-highlight .4s ease-out; }
.algorithm-row.is-highlighted:not([data-tone="good"]):not([data-tone="bad"]):not([data-tone="warning"]) { background: #fff0cf; }
.algorithm-visuals { display: grid; align-content: start; gap: 14px; min-width: 0; margin: 0; padding: 22px; border-left: 1px solid #e6d8c2; background: #f7f4e9; }
.algorithm-visuals > figure { margin: 0; }
.algorithm-result { display: flex; align-items: center; gap: 13px; margin-top: 17px; padding: 13px 15px; border: 1px solid #acd0b5; border-radius: 9px; background: #e6f1e3; }
.algorithm-result__check { color: #5c9062; font: italic 27px Georgia, serif; }
.algorithm-result p { color: #446d48; font-size: 13px; line-height: 1.5; }
.algorithm-result strong { display: block; margin-top: 2px; color: #28603f; font: 700 24px/1.3 var(--font-display); letter-spacing: -.4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.algorithm-result small { display: block; margin-top: 4px; color: #557559; font-size: 13px; line-height: 1.5; }
.algorithm-result[data-tone="warning"] { background: #e4effb; border: 2px dashed #397cb1; }
.algorithm-result[data-tone="warning"] :where(p, strong, small, .algorithm-result__check) { color: #1b5184; }
.algorithm-controls { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding: 14px 24px; border-top: 1px solid #e7dcc8; background: #fff9ed; box-shadow: 0 -6px 18px -12px #69543665; }
.algorithm-controls > div { display: flex; align-items: center; gap: 8px; }
.algorithm-restart { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 0; border: 0; border-radius: 4px; background: none; color: #876b48; font-size: 14px !important; }
.algorithm-restart > span { font-size: 20px; }
.algorithm-restart:hover:not(:disabled) { color: #a7592b; }
.algorithm-control { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 15px; border: 1px solid #d6c2a4; border-radius: 8px; background: #f9f0e2; color: #8a6d47; font-size: 14px !important; transition: background .2s, transform .2s; }
.algorithm-control > span[aria-hidden] { font-size: 17px; }
.algorithm-control:hover:not(:disabled) { background: #f1e2cc; transform: translateY(-1px); }
.algorithm-control--next { border-color: #a54a24; background: #bf5a2a; color: #fff7ea; box-shadow: 0 2px 0 #944621; }
.algorithm-control--next:hover:not(:disabled) { background: #a64f25; }
.algorithm-finish { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding: 18px 22px; border: 1px solid #d5c094; border-radius: 12px; background: #f8ecd5; }
.algorithm-finish > span { color: #b0803d; font-size: 30px; }
.algorithm-finish strong { color: #816235; font-size: 16px; }
.algorithm-finish p { margin-top: 5px; color: #8f7855; font-size: 14px; line-height: 1.6; }
.algorithm-finish button { min-height: 44px; margin-left: auto; padding: 8px 0; border: 0; background: transparent; color: #a65b2a; font-size: 14px !important; }
.algorithm-finish button > span { margin-left: 8px; }
.algorithm-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 12px; }
.algorithm-bottom > p { display: flex; align-items: center; gap: 8px; color: #9b805d; font-size: 12px; }
.algorithm-bottom > p > span { color: #b38b55; font-size: 18px; }
.algorithm-bottom button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: none; color: #937a57; font-size: 14px !important; }
.algorithm-bottom button:hover { color: #a65b2a; }
.algorithm-motion-paused *, .algorithm-motion-paused *::before, .algorithm-motion-paused *::after { animation-play-state: paused !important; transition: none !important; }

@keyframes algorithm-fox-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.987); } }
@keyframes algorithm-card-float { 0%, 100% { transform: translateY(0) rotate(-9deg); transform-origin: 97px 153px; } 50% { transform: translateY(-5px) rotate(-7deg); transform-origin: 97px 153px; } }
@keyframes algorithm-formula-float { 0%, 100% { transform: translateY(0) rotate(-8deg); transform-origin: 180px 42px; } 50% { transform: translateY(-5px) rotate(-3deg); transform-origin: 180px 42px; } }
@keyframes algorithm-spark { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes algorithm-beads { 0%, 42%, 100% { transform: translateX(0); } 50%, 90% { transform: translateX(6px); } }
@keyframes algorithm-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.08); } }
@keyframes algorithm-stage-enter { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes algorithm-highlight { from { outline-color: #e29431; background-color: #ffe0a3; } to { outline-color: #edbd6c; } }

@media (min-width: 1500px) {
    .algorithm-reference-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .algorithm-legend dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
}
@media (max-width: 1150px) {
    body.algorithm-guide-active .site-shell { width: calc(100% - 44px); }
    .algorithm-workspace { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; }
    .algorithm-index h2 { font-size: 18px; }
    .algorithm-index__heading > p:last-child { display: none; }
    .algorithm-chapter { gap: 6px; padding-inline: 7px; }
    .algorithm-reference { padding-inline: 20px; }
    .algorithm-reference-grid { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(250px, .95fr); }
    .algorithm-step > span:last-child { display: none; }
    .algorithm-explanation, .algorithm-visuals { padding: 20px; }
    .algorithm-step-formula { font-size: 20px; padding: 12px; }
    .algorithm-row { flex-direction: column; gap: 4px; }
    .algorithm-row dd { text-align: left; }
}
@media (max-width: 940px) {
    .algorithm-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .algorithm-index { position: static; display: flex; align-items: center; gap: 16px; padding: 0; }
    .algorithm-index__heading { padding: 0; }
    .algorithm-index__heading .algorithm-kicker, .algorithm-index__heading h2, .algorithm-index__foot, .algorithm-chapters { display: none; }
    .algorithm-mobile-label { display: block; flex-shrink: 0; color: #8f7654; font-size: 14px; }
    .algorithm-chapter-select { display: block; width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #d7c2a3; border-radius: 8px; background: #f9f1e3; color: #785332; font-size: 16px !important; }
    .algorithm-hero { grid-template-columns: minmax(0, 1fr) 160px; gap: 18px; }
    .algorithm-hero h1 { font-size: 31px; }
    .algorithm-scene figcaption { font-size: 10px; line-height: 1.5; }
    .algorithm-hero__tags > span:last-child { display: none; }
}
@media (max-width: 700px) {
    body.algorithm-guide-active .site-shell { width: calc(100% - 32px); }
    .algorithm-reference-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .algorithm-legend dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
    .algorithm-stage-grid { grid-template-columns: minmax(0, 1fr); }
    .algorithm-visuals { border-left: 0; border-top: 1px solid #e6d8c2; }
    .algorithm-row { flex-direction: row; gap: 12px; }
    .algorithm-row dd { text-align: right; }
    .algorithm-example-launch { gap: 18px; flex-wrap: wrap; }
    .algorithm-example-launch [data-guide-start] { width: 100%; }
    .algorithm-edition { max-width: 185px; font-size: 8px; line-height: 1.7; letter-spacing: 1px; }
    .algorithm-edition > span { display: none; }
    .algorithm-hero { grid-template-columns: minmax(0, 1fr) 110px; gap: 10px; }
    .algorithm-hero h1 { font-size: 29px; letter-spacing: -.8px; }
    .algorithm-hero h1 em { letter-spacing: -.8px; }
    .algorithm-hero .algorithm-kicker { font-size: 8px; }
    .algorithm-hero__copy > p:last-of-type { font-size: 14px; }
    .algorithm-hero__tags { font-size: 11px; }
    .algorithm-scene figcaption { display: none; }
    .algorithm-index { gap: 8px; }
    .algorithm-notebook__top .algorithm-kicker { max-width: 66%; font-size: 9px; }
    .algorithm-chapter-count { font-size: 12px; }
    .algorithm-formula { font-size: 20px; }
    .algorithm-chapter-heading h2 { font-size: 25px; }
    .algorithm-chapter-heading > p { font-size: 15px; }
}
@media (max-width: 480px) {
    body.algorithm-guide-active .site-shell { width: calc(100% - 28px); }
    .algorithm-layout { padding-top: 6px; }
    .algorithm-hero { grid-template-columns: minmax(0, 1fr); position: relative; padding-block: 5px 18px; }
    .algorithm-hero__copy { position: relative; z-index: 1; }
    .algorithm-hero .algorithm-kicker, .algorithm-hero h1 { max-width: calc(100% - 64px); }
    .algorithm-hero h1 { font-size: 28px; line-height: 1.15; }
    .algorithm-scene { position: absolute; top: 13px; right: 0; width: 80px; opacity: .85; }
    .algorithm-hero__copy > p:last-of-type { font-size: 14px; }
    .algorithm-index { display: block; }
    .algorithm-mobile-label { margin-bottom: 7px; }
    .algorithm-reference { padding: 0 16px; }
    .algorithm-reference-summary { gap: 12px; font-size: 14px; }
    .algorithm-reference-summary > span:last-child { font-size: 13px; }
    .algorithm-reference::before { right: 25px; }
    .algorithm-reference-grid { gap: 16px; }
    .algorithm-legend { padding: 13px; }
    .algorithm-legend dl { grid-template-columns: minmax(0, 1fr); }
    .algorithm-legend dt { min-width: 35px; }
    .algorithm-example__heading, .algorithm-example-launch, .algorithm-explanation, .algorithm-visuals { padding: 17px 16px; }
    .algorithm-example-context { padding: 14px 16px; }
    .algorithm-comparison { font-size: 14px; }
    .algorithm-comparison :where(th, td) { padding: 7px; }
    .algorithm-comparison thead th:first-child { width: 26%; }
    .algorithm-comparison td:last-child { padding-left: 7px; }
    .algorithm-fact-symbol { position: static; width: 18px; height: 18px; margin: 0 4px 2px 0; font-size: 13px; }
    .algorithm-example__heading h3 { font-size: 14px; }
    .algorithm-example-badge { font-size: 8px; }
    .algorithm-steps { padding: 12px 16px; gap: 6px; }
    .algorithm-step { min-height: 42px; padding-inline: 5px; }
    .algorithm-step-heading h4 { font-size: 22px; }
    .algorithm-step-formula { font-size: 20px; }
    .algorithm-row { gap: 10px; }
    .algorithm-result strong { font-size: 23px; }
    .algorithm-controls { padding: 12px 16px; gap: 8px; }
    .algorithm-controls > div { gap: 6px; }
    .algorithm-control { padding: 10px 11px; gap: 6px; font-size: 14px !important; }
    .algorithm-restart { gap: 4px; font-size: 14px !important; }
    .algorithm-bottom { flex-direction: column; gap: 0; padding-top: 14px; }
    .algorithm-bottom > p { font-size: 11px; }
}
@media (max-width: 365px) {
    .algorithm-row { flex-direction: column; gap: 4px; }
    .algorithm-row dd { text-align: left; }
    .algorithm-controls { justify-content: flex-end; }
    .algorithm-controls > div { width: 100%; }
    .algorithm-control--next { flex: 1; }
    .algorithm-restart { min-height: 35px; }
}
@media (prefers-reduced-motion: reduce) {
    .algorithm-layout *, .algorithm-layout *::before, .algorithm-layout *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (min-width: 941px) and (max-height: 850px) {
    .algorithm-index { position: static; }
}
