.algorithm-plate { max-width: 48rem; margin-inline: auto; }
.algorithm-plate table { width: 100%; border-collapse: collapse; background: var(--white); text-align: center; font-size: .875rem; }
.algorithm-plate :is(th,td) { border: 1px solid var(--line); padding: 4px 3px; }
.algorithm-plate thead { background: var(--mint); }
.algorithm-plate .table-highlight { background: var(--yellow); font-weight: 750; }
.algorithm-plate .settled { background: var(--mint); }
.algorithm-plate .last-item { background: var(--pink); font-weight: 750; }
.algorithm-plate .small-label { font-size: .8125rem; }
.algorithm-plate .table-route { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 8px 0 0; }
.table-route span { display: inline-block; font-weight: 650; font-size: .875rem; }
.prime-traces { max-width: 54rem; }
.prime-traces table { font-size: .9375rem; }
.prime-traces caption { padding-bottom: 6px; font-weight: 700; text-align: left; }
.prime-traces :is(th, td) { padding: 7px 5px; }
.prime-traces tr > :first-child { width: 13%; }
.prime-traces tr > :nth-child(2) { width: 23%; }
.prime-traces tr > :last-child { width: 17%; }
.prime-traces span:not(.prime-forward) { display: block; }
.prime-traces .prime-forward { color: var(--teal); font-weight: 750; }
.prime-traces .prime-stop { background: var(--pink); }
.prime-traces strong.prime-stop { padding: 1px 3px; }
.prime-traces tbody td:last-child { font-weight: 700; }
.polygon-composition { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; align-items: center; max-width: 48rem; margin-inline: auto; }
.hex-card { padding: 16px 0 10px; background: var(--mint); }
.hex-path { --edge-color: #753343; position: relative; width: min(68%, 224px); aspect-ratio: 1 / .8660254; margin: 15px auto 22px; }
.hex-edge { position: absolute; left: var(--x); top: var(--y); width: 50%; height: 3px; background: var(--edge-color); transform-origin: 0 50%; transform: translateY(-50%) rotate(var(--turn)); }
.hex-edge::after { content: ""; position: absolute; right: 45%; top: -3px; width: 7px; height: 7px; border: solid var(--edge-color); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.hex-start { position: absolute; z-index: 1; top: -16px; left: 25%; transform: translateX(-50%); background: var(--yellow); padding: 1px 4px; font-size: .8125rem; border: 1px solid var(--ink); white-space: nowrap; }
.hex-distance { position: absolute; top: .4rem; left: 50%; transform: translateX(-50%); font-size: .875rem; }
.hex-caption { position: absolute; top: 40%; inset-inline: 15%; text-align: center; font-size: .9375rem; }
.hex-turn { position: absolute; left: 67%; top: 17%; width: 75px; padding: 1px 3px; background: var(--white); text-align: center; border: 1px solid var(--wine); white-space: nowrap; font-weight: 750; font-size: .875rem; }
.hex-turn-guide { position: absolute; left: 75%; top: 0; width: 24%; border-top: 1px dashed var(--wine); }
.hex-angle { position: absolute; left: 75%; top: 0; width: 31px; height: 31px; transform: translate(-50%, -50%); border-radius: 50%; background: conic-gradient(from 90deg, var(--wine) 60deg, transparent 60deg); mask-image: radial-gradient(circle, transparent 56%, black 61%); }
.hex-routine { margin: 0; list-style: none; padding: 0; counter-reset: routine; }
.hex-routine li { padding: 5px 4px; border-top: 1px solid var(--line); font-size: .875rem; }
.hex-routine li::before { counter-increment: routine; content: counter(routine) "　"; color: var(--teal); font-weight: 750; }
.hex-routine li:last-child { background: var(--yellow); border-top-color: var(--wine); }
.deduction-fig { display: grid; grid-template-columns: 1.2fr .8fr; gap: 9px; max-width: 47rem; margin-inline: auto; align-items: center; }
.deduction-set { display: grid; padding: 8px; border: 2px solid var(--teal); border-radius: 42% / 28%; background: var(--mint); text-align: center; font-size: .875rem; }
.deduction-set div { margin: 5px auto 2px; width: 72%; padding: 5px 3px; background: var(--yellow); border: 1px solid var(--ink); border-radius: 45% / 28%; }
.deduction-set img { display: block; width: clamp(45px, 10vw, 82px); height: auto; margin-inline: auto; }
.deduction-answers { padding: 6px 10px; font-size: .875rem; border-left: 3px solid var(--teal); }
.deduction-answers p { margin: 4px 0; }
.deduction-answers p span { padding-inline: 3px; background: var(--mint); font-weight: 700; }
.deduction-answers .deduction-down { display: block; margin-inline-start: 9px; color: var(--teal); }
.deduction-answers p:last-child { padding: 4px 0; background: var(--yellow); }
.deduction-answers p:last-child span { background: transparent; }
.scale-demo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-width: 50rem; margin-inline: auto; }
.scale-demo section { min-width: 0; background: var(--white); padding: 8px 11px; border-top: 2px solid var(--teal); }
.scale-demo h3 { margin: 0; font-size: 1rem; }
.scale-demo p { margin: 2px 0; font-size: .875rem; }
.scale-marks { display: flex; align-items: center; gap: 5px; padding: 6px 2px 4px; min-height: 2.2rem; font-weight: 700; font-size: .875rem; }
.scale-marks .choice-tag { border: 1px solid var(--line); background: var(--cyan); padding: 2px 4px; white-space: nowrap; }
.scale-marks .choice-tag + .choice-tag { background: #dbe9b5; }
.scale-time { justify-content: space-between; gap: 3px; padding-top: 1.35rem; }
.scale-time i { position: relative; flex: 1; border-top: 2px solid var(--teal); font-style: normal; }
.scale-time i span { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); font-size: .81rem; white-space: nowrap; }
.scale-lengths { display: grid; grid-template-columns: max-content 1fr; gap: 6px; align-items: center; }
.scale-lengths i { height: 5px; width: var(--length); background: var(--teal); }
.scale-lengths .scale-zero { width: 2px; height: .9rem; }
@media (max-width: 640px) {
  .polygon-composition { grid-template-columns: 1fr; gap: 6px; }
  .hex-path { width: min(65%, 168px); margin-top: 9px; margin-bottom: 6px; }
  .hex-turn { left: 64%; }
  .scale-demo { grid-template-columns: 1fr; max-width: 28rem; }
}
