/* Each topic's background includes its heading, explanation and board. */
/* Use the same board and held-piece base size as /play/. */
.anaguma-page {--cell:calc((min(100vw,430px) - 22px) / 9)}
.anaguma-page .tk2 .tit.study-section {
 margin:0 -16px;padding:20px 16px;border:0;
}
.anaguma-page .tk2 .tit.study-section .kcard {
 margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;
}
.anaguma-page .study-section + .study-section {
 border-top:0;
}
.anaguma-page .study-section h2,
.anaguma-page .tk2 .study-section h2.tlabel {
 margin-top:0;margin-bottom:20px;
}
.anaguma-page .kz.tk2 .tit.study-section .kcard > p.ti {
 position:relative;clear:both;text-indent:0;
 padding:0 16px 0 calc(16px + 1.1em);
}
.anaguma-page .kz.tk2 .tit.study-section .kcard > p.ti::before {
 position:absolute;left:16px;top:0;
}
.anaguma-page .study-section .ti > b.item-name {
 white-space:nowrap;
}
/* Playback progress is quiet and compact; evaluation colours stay unchanged. */
.anaguma-page .kz .kplayer[data-study-ui="1"] .kp-ctl {margin-top:0}
.anaguma-page .kz .kplayer[data-study-ui="1"] .sbwrap {margin-bottom:0}
.anaguma-page .kz .kplayer[data-study-ui="1"] .kp-hand-s.on {margin-bottom:3px}
/* A cue is shown only when there is an authored explanation for this frame. */
.anaguma-page .kplayer[data-reason-demo="1"] .sbwrap {position:relative}
.anaguma-page .study-cue {
 box-sizing:border-box;width:var(--study-board-width,100%);min-height:20px;
 margin:0 auto;padding:0 8px;display:flex;align-items:center;
 color:#e1e9f2;font-size:14px;line-height:20px;font-weight:600;
 text-align:left;overflow:visible;
}
.anaguma-page .study-cue-overlay {
 position:absolute;z-index:3;pointer-events:none;overflow:visible;
}
/* 2026-09-08: a castle is an area, including the pawn cover, not five pieces. */
.anaguma-page #yurai .name-origin {margin:6px 16px 0;padding:0;border:0;background:none}
.anaguma-page #yurai .name-origin p {margin:0;padding:0 0 8px;background:var(--study-tone-b)}
.anaguma-page #yurai,.anaguma-page #yurai .kcard {margin-bottom:0}
.anaguma-page #yurai + #katachi {margin-top:16px}
.anaguma-page .kz .kcard:has(.sb) > .study-topic {margin:0;padding:20px 0}
.anaguma-page .kz .kcard:has(.sb) > .study-topic:first-child:not(:has(> h2)) {padding-top:0}
.anaguma-page .kz .kcard:has(.sb) > .study-topic:last-child {padding-bottom:0}
.anaguma-page .study-topic > .type-condition {padding-left:16px;padding-right:16px}
.anaguma-page .study-topic + .study-topic {border-top:0}
.anaguma-page .kz.tk2 .tit.study-section .kcard .study-topic > p.ti {
 position:relative;clear:both;text-indent:0;padding:0 16px 0 calc(16px + 1.1em);
}
.anaguma-page .kz.tk2 .tit.study-section .kcard .study-topic > p.ti::before {position:absolute;left:16px;top:0}
.anaguma-page .study-type-notes {width:100%;padding:4px 16px 8px;text-align:left;font-size:13px}
.anaguma-page .study-type-notes p {display:flex;align-items:center;gap:8px;height:48px;margin:0;padding:0!important;line-height:20px;font-size:13px}
.anaguma-page .study-type-notes b {flex:0 0 6em;white-space:nowrap;color:#dbe6f5}
.anaguma-page .study-type-notes span {min-width:0}
.anaguma-page .study-type-example {height:44px;display:flex;align-items:center}
.anaguma-page .study-type-example a {color:#b8cede;text-decoration:underline;line-height:44px}
.anaguma-page .study-type-example a[hidden] {display:none}
.anaguma-page .kplayer {scroll-margin-top:64px}
/* Compact the lesson controls while preserving piece sizes and stable geometry. */
.anaguma-page .kz .kplayer[data-study-ui="1"] .kp-ctl {height:44px}
.anaguma-page .kz .kplayer[data-study-ui="1"] .kp-b {height:44px;min-height:44px;padding-top:0;padding-bottom:0}
.anaguma-page .kz .kplayer .anaguma-evaluation .graphwrap {height:100px}
.anaguma-page .kplayer[data-cpu-eval="1"] .anaguma-evaluation {margin-top:4px}
.anaguma-page .kplayer[data-cpu-eval="1"] .anaguma-evaluation .kp-play {margin-top:4px}
.anaguma-page details.board-comparison {margin:8px -16px;padding:4px 0;border:0;box-shadow:inset 0 0 0 1px #ffffff22}
.anaguma-page .kz details.board-comparison .kcard {margin:12px 0 16px;padding:0}
.anaguma-page details.board-comparison summary,
.anaguma-page details.board-comparison h3 {margin-left:16px;margin-right:16px}
.anaguma-page details.board-comparison .sb {margin-left:auto;margin-right:auto}
.anaguma-page .kplayer[data-static-position="1"] .kp-routes,
.anaguma-page .kplayer[data-static-position="1"] .kp-ctl,
.anaguma-page .kplayer[data-static-position="1"] .kp-bar {display:none}

/* 2026-09-08: keep the gap inside its lesson background, without a stray band. */
.anaguma-page .tk2 .tit.study-section:has(#ana-p00) {padding-bottom:0}
.anaguma-page .kz .kcard > .study-topic:has(#ana-lance-compare) {padding-bottom:20px}
.anaguma-page .tk2 .tit.study-section:has(#ana-p01) {padding-top:0}
.anaguma-page .kz .kcard > .study-topic:has(#ana-p01) {padding-top:20px}
.anaguma-page .tk2 .tit.study-section:has(#ana-p01) {padding-bottom:0}
.anaguma-page .kz .kcard > .study-topic:has(#ana-type-gokigen) {padding-bottom:20px}
.anaguma-page #ana-p00 .kp-rt {word-break:keep-all;overflow-wrap:normal}

/* Empty explanations and absent example links occupy no space. */
.anaguma-page .study-cue[hidden] {display:none}
.anaguma-page .study-cue:not([hidden]) {margin-top:4px}
.anaguma-page .study-type-example:not(:has(a:not([hidden]))) {display:none}
.anaguma-page #tocPanel .toc-subtopic {padding-left:24px}

/* Location hints use the approved translucent red, behind shared pieces. */
/* Keep gaps inside the adjacent lesson instead of exposing the parent background. */
.anaguma-page .kz.tk2 > .kz:has(> .lesson-block) {margin-top:0;margin-bottom:0}
.anaguma-page .kz .kcard:has(+ .lesson-block) {margin-bottom:0}
.anaguma-page .kz .kcard > .kplayer:has(+ .study-topic) {margin-bottom:0}
.anaguma-page .kz .kcard:has(+ .lesson-block) > .kplayer:last-child {margin-bottom:0}
.anaguma-page :is(h3,h4)[id] {scroll-margin-top:56px}
.anaguma-page #katachi {margin-bottom:0}
.anaguma-page .kz.tk2 {margin-top:0;margin-bottom:0}
.anaguma-page .kz > .kcard:has(> .study-topic) {margin-top:0;margin-bottom:0}
.anaguma-page .study-topic:has(> h2:first-child) {padding-top:20px}
.anaguma-page .study-topic > h2 {margin-top:0;margin-bottom:20px}
.anaguma-page .kz:has(+ .kz > .lesson-block) > .kcard:last-child,.anaguma-page .kz:has(+ .kz > .lesson-block) > .kcard:last-child > .kplayer:last-child {margin-bottom:0}
.anaguma-page .kz:has(+ .kz > .kcard > .study-topic) > .kcard:last-child,.anaguma-page .kz:has(+ .kz > .kcard > .study-topic) > .kcard:last-child > .kplayer:last-child {margin-bottom:0}
.anaguma-page .study-topic > h2 {margin-left:16px;margin-right:16px}

/* Brief overview requested below the collapsed name origin. */
.anaguma-page #yurai .castle-overview {margin:0 16px;padding:0;text-align:left;font-size:14px;line-height:1.55}
.anaguma-page #yurai .castle-overview p {margin:0;padding:0;font-size:14px;line-height:1.55}
.anaguma-page #yurai .castle-overview p + p {margin-top:3px}
.anaguma-page #yurai .castle-overview b {white-space:nowrap}

/* The same merit content is partially previewed and then expanded. */
.anaguma-page #yurai .castle-overview {overflow-anchor:none}
.anaguma-page #yurai .overview-excerpt {margin-top:8px}
.anaguma-page #yurai .castle-overview.is-collapsed .overview-topic + .overview-topic,
.anaguma-page #yurai .castle-overview.is-collapsed .overview-use {display:none}
.anaguma-page #yurai .castle-overview.is-collapsed .overview-topic:first-child li + li {max-height:14px;overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,#000,transparent);mask-image:linear-gradient(to bottom,#000,transparent)}
.anaguma-page #yurai .overview-topic h3 {margin:0 0 6px;padding:0;border:0;font-size:16px;line-height:24px;color:inherit}
.anaguma-page #yurai .overview-topic ul {margin:0;padding:0 0 0 1.2em;font-size:14px;line-height:1.65}
.anaguma-page #yurai .overview-topic li + li {margin-top:6px}
.anaguma-page #yurai .overview-topic + .overview-topic {margin-top:12px}
.anaguma-page #yurai .castle-overview .overview-use {margin-top:12px}
.anaguma-page #yurai .overview-toggle {display:flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;width:100%;min-height:44px;margin:6px 0 0;padding:8px 16px;border:1px solid rgba(195,212,237,.32);border-radius:24px;background:none;color:inherit;font:inherit;font-weight:700;line-height:1.4;cursor:pointer}
.anaguma-page #yurai .overview-toggle[hidden] {display:none}
.anaguma-page #yurai .overview-toggle::after {content:"";display:block;width:8px;height:8px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg);flex:none}
.anaguma-page #yurai .overview-toggle[aria-expanded="true"]::after {transform:translateY(2px) rotate(225deg)}
.anaguma-page #yurai .overview-toggle:focus-visible {outline:2px solid #ffd23f;outline-offset:2px}


/* Empty in-page anchors occupy no text line and remain below the fixed header. */
.anaguma-page .kcard > span[id]:empty {display:block;scroll-margin-top:56px}
