.deduction-route { margin: 22px 0; }
.deduction-route ol { display: grid; gap: 13px; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: route; }
.deduction-route li { position: relative; display: grid; min-height: 132px; gap: 7px; padding: 18px 16px 15px 50px; box-sizing: border-box; align-content: center; border: 2px solid #d9e4eb; border-radius: 15px; background: #fff; }
.deduction-route li::before { position: absolute; top: 18px; left: 15px; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #116e93; color: #fff; content: counter(route); counter-increment: route; font-size: .78rem; font-weight: 700; }
.deduction-route li:last-child { border-color: #d99a20; background: #fff8df; }
.deduction-route li:last-child::before { background: #b86821; }
.deduction-route span { color: #52666f; font-size: .75rem; font-weight: 700; }
.deduction-route strong { color: #09539d; font: 700 .96rem/1.25 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.deduction-route small { color: #41535c; font-size: .76rem; line-height: 1.4; }

.relation-rule { display: grid; gap: 9px; margin: 22px 0; text-align: center; }
.relation-rule p { margin: 0; }
.relation-rule .rule-card__statement { display: flex; gap: 12px; align-items: center; justify-content: center; color: #173849; font: 700 1rem/1.35 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.relation-rule .rule-card__statement strong { color: #b86821; font-size: 1.3rem; }

.related-fact-scene { position: relative; min-height: 530px; margin: 24px 0 8px; overflow-anchor: none; }
.related-fact-scene.is-ready { height: var(--scene-height); min-height: var(--scene-min-height); }
.related-fact-scene__sticky { position: absolute; inset: 0 0 auto; display: grid; height: min(660px, calc(100vh - 76px)); min-height: 530px; box-sizing: border-box; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; border: 2px solid #c9dce8; border-radius: 22px; background: linear-gradient(180deg, #fbfdff, #f2f8fc); box-shadow: 0 12px 30px rgba(20, 57, 78, .14); contain: layout paint; overflow-anchor: none; will-change: transform; }
.related-fact-scene__sticky.is-pinned { position: fixed; right: auto; z-index: 900; transform-origin: top left; }
.related-fact-scene__heading { margin: 0; padding: 16px 24px 9px; color: #173849; font: 700 1.28rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-align: center; }
.related-fact-stage { display: grid; min-height: 0; padding: 13px 24px; place-items: center; overflow: hidden; background: linear-gradient(rgba(93, 145, 176, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(93, 145, 176, .07) 1px, transparent 1px), #eaf3f8; background-size: 26px 26px; }

.related-board { position: relative; display: grid; width: min(620px, 100%); min-height: 340px; box-sizing: border-box; gap: 2px; padding: 15px 27px 13px; align-content: center; border-radius: 18px; background: #fff; box-shadow: 0 7px 20px rgba(23, 56, 73, .12); color: #173849; font-variant-numeric: tabular-nums; }
.related-board__labels { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1.2fr; padding: 0 5px 5px; color: #71848d; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-align: center; text-transform: uppercase; opacity: 0; }
.related-board__labels span:nth-child(1) { grid-column: 1; }
.related-board__labels span:nth-child(2) { grid-column: 3; }
.related-board__labels span:nth-child(3) { grid-column: 5; }
.related-board__row { position: relative; z-index: 3; display: grid; min-height: 42px; grid-template-columns: 1fr 28px 1fr 28px 1.2fr; align-items: center; padding: 0 5px; font: 700 1.18rem/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-align: center; }
.related-board__cell,
.related-board__sign { position: relative; z-index: 3; display: grid; min-height: 36px; place-items: center; opacity: 0; will-change: opacity, transform; }
.related-board__sign { color: #b86821; font-size: 1.04rem; }
.related-board__lane { position: relative; z-index: 4; display: grid; height: 36px; grid-template-columns: 1fr 28px 1fr 28px 1.2fr; padding: 0 5px; align-items: center; }
.related-board__change { position: relative; display: grid; height: 31px; place-items: center; color: #52666f; opacity: 0; }
.related-board__change::before { position: absolute; top: -1px; bottom: 2px; left: 50%; border-left: 2px solid #82a5b6; content: ""; transform: scaleY(var(--line, 0)); transform-origin: top; }
.related-board__change::after { position: absolute; bottom: 1px; left: calc(50% - 4px); width: 7px; height: 7px; border-right: 2px solid #82a5b6; border-bottom: 2px solid #82a5b6; content: ""; transform: rotate(45deg); }
.related-board__change span { position: relative; z-index: 2; margin-left: 64px; padding: 3px 7px; border: 1px solid #c8dae4; border-radius: 7px; background: #f7fbfd; font-size: .67rem; font-weight: 700; white-space: nowrap; }
.related-board__combined { position: relative; z-index: 3; display: flex; min-height: 34px; gap: 9px; align-items: center; justify-content: center; border-top: 2px solid #d7e3e9; color: #52666f; font-size: .76rem; opacity: 0; will-change: opacity, transform; }
.related-board__combined strong { color: #80540f; }
.related-board__cursor { position: absolute; z-index: 1; box-sizing: border-box; border: 2px solid #d99a20; border-radius: 12px; background: #fff2c9; opacity: 0; pointer-events: none; will-change: left, top, width, height, opacity; }

.related-fact-scene__caption { display: grid; height: 7.7em; box-sizing: border-box; padding: 12px 28px 6px; align-content: center; text-align: center; }
.related-fact-scene__caption h2 { margin: 0 0 5px; color: #09539d; font-size: 1.08rem; }
.related-fact-scene__caption p { max-width: 680px; margin: 0 auto; color: #344b56; font-size: .92rem; line-height: 1.45; }
.related-fact-scene__progress { display: flex; gap: 7px; padding: 0 20px 14px; justify-content: center; }
.related-fact-scene__dot { width: 8px; height: 8px; border-radius: 50%; background: #c6d4dc; transition: width .2s ease, border-radius .2s ease, background-color .2s ease; }
.related-fact-scene__dot.is-current { width: 25px; border-radius: 999px; background: #116e93; }
.related-fact-scene__dot.is-past { background: #6c9bb0; }

.scale-ledger { display: grid; gap: 11px; grid-template-columns: 1fr 24px 1fr 24px 1.12fr; margin: 24px 0; align-items: stretch; }
.scale-ledger article { display: grid; min-height: 92px; gap: 4px; padding: 13px 12px; box-sizing: border-box; place-items: center; border: 2px solid #d9e4eb; border-radius: 13px; background: #fff; text-align: center; }
.scale-ledger article span { color: #41535c; font: 700 .79rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.scale-ledger article strong { color: #09539d; font-size: 1.08rem; }
.scale-ledger article small { color: #71848d; font-size: .7rem; }
.scale-ledger > i { display: grid; place-items: center; color: #b86821; font-style: normal; font-weight: 700; }
.scale-ledger .scale-ledger__result { border-color: #d99a20; background: #fff8df; }
.scale-ledger .scale-ledger__result strong { color: #80540f; }

.fact-family { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.fact-family article { display: grid; gap: 8px; padding: 15px 12px; border: 2px solid #d9e4eb; border-radius: 13px; background: #fff; text-align: center; }
.fact-family span { color: #71848d; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fact-family strong { color: #173849; font: 700 .86rem/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.inverse-reading { margin: 23px 0; padding: 18px 22px 20px; border: 2px solid #c9dce8; border-radius: 15px; background: #f8fbfd; }
.inverse-reading > p { display: grid; gap: 6px; margin: 0; padding: 4px 12px 15px; place-items: center; }
.inverse-reading span { color: #71848d; font-size: .69rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.inverse-reading strong { color: #173849; font: 700 .96rem/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.inverse-reading__facts { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.inverse-reading__facts > div { display: grid; gap: 6px; padding: 13px 12px; place-items: center; border: 2px solid #d9e4eb; border-radius: 12px; background: #fff; text-align: center; }
.inverse-reading__facts > div:last-child { border-color: #e3c77f; background: #fffaf0; }

.deduction-pair,
.checking-pair { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin: 24px 0; }
.deduction-pair article,
.checking-pair article { padding: 18px 20px; border: 2px solid #d9e4eb; border-left: 5px solid #5d91b0; border-radius: 14px; background: #fff; }
.deduction-pair article:nth-child(2),
.checking-pair article:nth-child(2) { border-left-color: #d99a20; }
.deduction-pair h2,
.checking-pair h2 { margin: 0 0 9px; color: #173849; font-size: 1.04rem; }
.deduction-pair p,
.checking-pair p { margin: 0 0 9px; color: #41535c; font-size: .88rem; line-height: 1.5; }
.deduction-pair p:last-child,
.checking-pair p:last-child { margin-bottom: 0; }
.deduction-pair .deduction-pair__answer { padding-top: 9px; border-top: 1px solid #d9e4eb; color: #09539d; font: .91rem/1.35 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.deduction-example { margin: 28px 0 40px; }
.deduction-example:last-child { margin-bottom: 0; }
.deduction-example > h2 { margin: 0 0 6px; color: #09539d; font-size: 1.18rem; }
.deduction-example > p:not(.worked__answer) { margin: 0 0 14px; color: #41535c; }
.deduction-scene { position: relative; min-height: 530px; margin: 18px 0 8px; overflow-anchor: none; }
.deduction-scene.is-ready { height: var(--scene-height); min-height: var(--scene-min-height); }
.deduction-scene__sticky { position: absolute; inset: 0 0 auto; display: grid; height: min(650px, calc(100vh - 76px)); min-height: 530px; box-sizing: border-box; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; border: 2px solid #c9dce8; border-radius: 22px; background: linear-gradient(180deg, #fbfdff, #f2f8fc); box-shadow: 0 12px 30px rgba(20, 57, 78, .14); contain: layout paint; overflow-anchor: none; will-change: transform; }
.deduction-scene__sticky.is-pinned { position: fixed; right: auto; z-index: 900; transform-origin: top left; }
.deduction-scene__heading { margin: 0; padding: 16px 24px 9px; color: #173849; font: 700 1.2rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-align: center; }
.deduction-stage { display: grid; min-height: 0; padding: 13px 24px; place-items: center; overflow: hidden; background: linear-gradient(rgba(93, 145, 176, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(93, 145, 176, .07) 1px, transparent 1px), #eaf3f8; background-size: 26px 26px; }
.deduction-board { position: relative; display: grid; width: min(620px, 100%); min-height: 335px; box-sizing: border-box; gap: 0; padding: 14px 30px; align-content: center; border-radius: 18px; background: #fff; box-shadow: 0 7px 20px rgba(23, 56, 73, .12); color: #173849; font-variant-numeric: tabular-nums; }
.deduction-board__row { position: relative; z-index: 3; display: flex; min-height: 39px; gap: 9px; align-items: center; justify-content: center; font: 700 1.02rem/1.1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.deduction-board__token { position: relative; z-index: 3; display: inline-grid; min-height: 30px; place-items: center; opacity: 0; will-change: opacity, transform; }
.deduction-board__token.is-operation { color: #b86821; }
.deduction-board__transition { position: relative; z-index: 4; display: flex; height: 27px; gap: 8px; align-items: center; justify-content: center; color: #60747d; opacity: 0; will-change: opacity, transform; }
.deduction-board__transition b { color: #82a5b6; font-size: 1rem; line-height: 1; }
.deduction-board__transition span { padding: 3px 8px; border: 1px solid #c8dae4; border-radius: 7px; background: #f7fbfd; font-size: .67rem; font-weight: 700; }
.deduction-board__cursor { position: absolute; z-index: 1; box-sizing: border-box; border: 2px solid #d99a20; border-radius: 12px; background: #fff2c9; opacity: 0; pointer-events: none; will-change: left, top, width, height, opacity; }
.deduction-scene__caption { display: grid; height: 7.7em; box-sizing: border-box; padding: 12px 28px 6px; align-content: center; text-align: center; }
.deduction-scene__caption h3 { margin: 0 0 5px; color: #09539d; font-size: 1.05rem; }
.deduction-scene__caption p { max-width: 680px; margin: 0 auto; color: #344b56; font-size: .9rem; line-height: 1.45; }
.deduction-scene__progress { display: flex; gap: 7px; padding: 0 20px 14px; justify-content: center; }
.deduction-scene__dot { width: 8px; height: 8px; border-radius: 50%; background: #c6d4dc; transition: width .2s ease, border-radius .2s ease, background-color .2s ease; }
.deduction-scene__dot.is-current { width: 25px; border-radius: 999px; background: #116e93; }
.deduction-scene__dot.is-past { background: #6c9bb0; }

.fact-explorer { min-height: 480px; margin: 24px 0; padding: 21px 24px; box-sizing: border-box; border: 2px solid #c9dce8; border-radius: 18px; background: linear-gradient(180deg, #fbfdff, #f1f7fb); box-shadow: 0 8px 22px rgba(20, 57, 78, .1); overflow-anchor: none; }
.fact-explorer__given { display: flex; gap: 12px; margin: 0 0 17px; align-items: center; justify-content: center; }
.fact-explorer__given span { padding: 4px 8px; border-radius: 7px; background: #e5f0f6; color: #116e93; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fact-explorer__given strong { color: #173849; font: 700 1.05rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.fact-explorer__values { display: grid; gap: 13px; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; border: 0; }
.fact-explorer__values legend { width: 100%; margin-bottom: 8px; color: #41535c; font-size: .76rem; font-weight: 700; letter-spacing: .035em; text-align: center; }
.fact-explorer__values > div { display: grid; gap: 10px; padding: 13px; border: 2px solid #d7e3e9; border-radius: 13px; background: #fff; transition: border-color .2s ease, background-color .2s ease; }
.fact-explorer__values > div.is-result { border-color: #d99a20; background: #fff8df; }
.fact-explorer__result-choice { position: relative; cursor: pointer; }
.fact-explorer__result-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fact-explorer__result-choice > span { display: grid; gap: 3px; padding: 6px 8px; border: 2px solid transparent; border-radius: 9px; place-items: center; }
.fact-explorer__result-choice small { color: #71848d; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.fact-explorer__result-choice strong { color: #173849; font: 700 1rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.fact-explorer__result-choice input:checked + span { border-color: #d99a20; background: #fff2c9; }
.fact-explorer__result-choice input:focus-visible + span { outline: 3px solid rgba(17, 110, 147, .25); outline-offset: 2px; }
.fact-explorer__scale { display: grid; gap: 4px; }
.fact-explorer__scale > span { color: #52666f; font-size: .68rem; font-weight: 700; text-align: center; }
.fact-explorer select { width: 100%; box-sizing: border-box; padding: 9px 30px 9px 12px; border: 2px solid #b8cbd7; border-radius: 10px; outline: none; background: #fff; color: #173849; font: 700 .95rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.fact-explorer select:focus { border-color: #116e93; box-shadow: 0 0 0 4px rgba(17, 110, 147, .12); }
.fact-explorer select:disabled { border-color: #e3c77f; background: #fffdf5; color: #80540f; opacity: 1; }
.fact-explorer__working { display: grid; min-height: 112px; gap: 12px; padding-top: 16px; align-content: center; text-align: center; }
.fact-explorer__scales { display: flex; gap: 10px; align-items: center; justify-content: center; color: #52666f; font-size: .74rem; }
.fact-explorer__scales span,
.fact-explorer__scales strong { min-width: 76px; padding: 4px 7px; border-radius: 7px; background: #fff; }
.fact-explorer__scales i { color: #b86821; font-style: normal; font-weight: 700; }
.fact-explorer__scales strong { border: 1px solid #d99a20; background: #fff2c9; color: #80540f; }
.fact-explorer__equation { margin: 0; color: #09539d; font: 700 1.35rem/1.25 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.fact-explorer__status { min-height: 3.2em; margin: 0; color: #41535c; font-size: .84rem; line-height: 1.45; text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .related-fact-scene__dot,
    .deduction-scene__dot { transition: none; }
}
