/* 2026-10-12: editable overlays; all original raster assets remain external and unchanged. */
/* 短い補足だけを余白に縦書き。人物別背景は使わず、文字の影で可読性を補う。 */
html.unified .layout-panel .layout-stage>.vertical-description{position:absolute!important;z-index:4!important;display:block!important;writing-mode:vertical-rl!important;text-orientation:mixed!important;inset:auto!important;left:var(--vertical-left,auto)!important;right:var(--vertical-right,auto)!important;top:var(--vertical-top,6%)!important;bottom:auto!important;transform:none!important;width:max-content!important;max-width:28%!important;height:var(--vertical-height,82%)!important;max-height:none!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;outline:none!important;border-radius:0!important;box-shadow:none!important;color:#fff9ef!important;font-family:"Yu Gothic",Meiryo,sans-serif!important;font-size:clamp(14px,2.1cqw,18px)!important;font-weight:500!important;line-height:1.65!important;letter-spacing:.03em!important;text-align:start!important;text-shadow:0 1px 3px #000,1px 0 2px #000,-1px 0 2px #000,0 -1px 2px #000!important;overflow:visible!important}
html.unified .vertical-description :is(.prose,p){font:inherit!important;color:inherit!important;line-height:inherit!important;letter-spacing:inherit!important;margin:0!important;padding:0!important}

/* 情景・動作の説明は画像下の本文。セリフ・心情とは分け、画像上に載せない。 */
html.unified .layout-panel>.scene-copy{position:static!important;margin:8px 3% 0!important;padding:0!important;max-width:none!important}
html.unified .layout-panel>.scene-copy>.scene-description{position:static!important;display:block!important;inset:auto!important;transform:none!important;width:auto!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;outline:none!important;box-shadow:none!important;color:#e0d5ca!important;text-shadow:none!important;font-family:"Yu Gothic",Meiryo,sans-serif!important;font-size:clamp(16px,2.2vw,19px)!important;font-weight:400!important;line-height:1.7!important;text-align:left!important;letter-spacing:0!important}
html.unified .layout-panel>.scene-copy>.scene-description+.scene-description{margin-top:.4em!important}
html.unified .scene-copy .prose{font:inherit!important;color:inherit!important}
html.unified .scene-copy .scene-description p{margin:0!important;font:inherit!important}
html.unified .scene-copy .scene-description p+p{margin-top:.35em!important}

/* A案：人物別の暗い半透明背景。白文字・配置・画像は維持し、色付き枠線は外す。 */
html.unified:not([data-sample-mode]) .layout-stage>.layout-caption[data-speaker-color]{background:var(--speaker-fill)!important;outline:none!important}
.layout-caption[data-speaker-color="misa"]{--speaker-fill:rgba(88,42,38,.82)}
.layout-caption[data-speaker-color="father"]{--speaker-fill:rgba(24,39,62,.82)}
.layout-caption[data-speaker-color="kana"]{--speaker-fill:rgba(20,49,44,.82)}
.layout-caption[data-speaker-color="yuki"]{--speaker-fill:rgba(57,39,30,.82)}
.layout-caption[data-speaker-color="shuhei"]{--speaker-fill:rgba(46,45,27,.82)}
.layout-caption[data-speaker-color="tomoya"]{--speaker-fill:rgba(41,32,56,.82)}
.layout-caption[data-speaker-color="masataka"]{--speaker-fill:rgba(50,39,23,.82)}
html.unified .layout-panel{margin-top:calc(var(--reading-gap,28px) + var(--caption-head,0px))!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important;scroll-margin-top:28px}
html.unified .layout-panel.layout-pause{--reading-gap:48px}
html.unified .layout-panel.layout-scene-start{--reading-gap:38px}
html.unified .layout-stage{position:relative!important;overflow:visible!important;isolation:isolate;container-type:inline-size}
html.unified .layout-stage>.layout-caption{position:absolute!important;z-index:5!important;box-sizing:border-box!important;margin:0!important;inset:auto!important;transform:none!important;float:none!important;align-self:auto!important;width:max-content!important;max-width:var(--lc-w,88%)!important;padding:9px 12px!important;font-family:"Yu Gothic",Meiryo,sans-serif!important;font-size:clamp(16px,2.65cqw,22px)!important;line-height:1.6!important;font-weight:500!important;text-align:left!important;letter-spacing:0!important;overflow-wrap:anywhere!important;background:rgba(0,0,0,.72)!important;border:0!important;border-radius:4px!important;box-shadow:none!important;color:#fff!important;text-shadow:0 1px 2px #0004!important;left:var(--lc-x,3%)!important;top:var(--lc-y,auto)!important;bottom:var(--lc-b,3%)!important}
html.unified .layout-stage>.layout-caption .speaker{font-size:11px!important;line-height:1.3!important;margin:0 0 3px!important;display:block!important;font-weight:500!important}
html.unified .layout-caption :is(p,.spoken,.words,.prose){font:inherit!important;line-height:inherit!important;letter-spacing:inherit!important;margin:0!important;color:inherit!important}
html.unified .layout-caption p+p{margin-top:.35em!important}
html.unified .layout-stage>.layout-caption[data-side="right"]{left:auto!important;right:var(--lc-x,3%)!important}
html.unified .layout-stage>.layout-caption[data-side="center"]{left:50%!important;right:auto!important;transform:translateX(-50%)!important}
html.unified :is(.speech-bridge,.dock,.edge,.supplement):empty{display:none!important}
html.unified .layout-panel :is(.art,.visual,.canvas,.frame){margin-top:0!important;margin-bottom:0!important}
html.unified .layout-panel .layout-stage{margin-bottom:var(--caption-tail,0px)!important}
html.unified .layout-caption .utterance{margin-top:.3em!important}
html.unified .layout-panel[id^="SIDE13-"]>figcaption{display:none}
html.unified .show-ids .layout-panel[id^="SIDE13-"]>figcaption{display:block}
html.unified .layout-panel .cut-id,html.unified .layout-panel .panel-id,html.unified .layout-panel .panel-number{z-index:8}
/* Scene containers must not add legacy padding/margins to each panel gap. */
html.unified section.scene:has(.layout-panel){display:flow-root;margin-block:0!important;padding-block:0!important}
html.unified section.scene:has(.layout-panel)>:is(h2,.scene-title){margin-block:36px 0!important;padding-block:0!important}
/* Standalone scene headings keep a deliberate, compact transition. */
html.unified section.scene:not(:has(.layout-panel)){margin-block:0!important;padding-top:32px!important;padding-bottom:8px!important}
html.unified section.scene:not(:has(.layout-panel)) h2{margin-block:8px!important}
html.unified main>.bridge,html.unified main>.branch{margin-bottom:28px!important}
html.unified main>.scene-note{margin-bottom:28px!important}
html.unified header.scene{margin-block:0!important;padding-top:32px!important;padding-bottom:8px!important}
html.unified header.scene h2{margin-block:8px!important}
html.unified main .branch{margin-bottom:28px!important}
html.unified #story>.panel.diagram{margin-block:28px!important}
html.unified #story>.lesson{margin-bottom:28px!important}
html.unified #story>.scene-note{margin-bottom:28px!important}
html.unified .layout-panel>.recall:last-child{margin-bottom:0!important}
html.unified .layout-panel :is(.readout,.paper-note,.document-panel,.document-excerpt){margin-top:18px}
@media(max-width:600px){
html.unified .layout-panel{--reading-gap:22px}
html.unified .layout-panel.layout-pause{--reading-gap:40px}
html.unified .layout-panel.layout-scene-start{--reading-gap:30px}
html.unified .layout-stage>.layout-caption{padding:7px 9px!important;line-height:1.5!important}
}



/* Reader narrative hierarchy */
html.unified .layout-panel .layout-stage>.vertical-description{box-sizing:border-box!important;height:auto!important;max-height:var(--vertical-height,82%)!important;padding:.75em .6em!important;background:rgba(24,18,15,.7)!important;border:1px solid rgba(255,244,223,.24)!important;border-radius:12px!important;box-shadow:0 8px 22px rgba(0,0,0,.2)!important;font-size:clamp(15px,2.15cqw,19px)!important;font-weight:600!important;letter-spacing:.045em!important;text-shadow:0 1px 4px #000,1px 0 3px #000,-1px 0 3px #000,0 -1px 3px #000!important}
html.unified .layout-panel>.scene-copy>.scene-description.key-narration{font-size:clamp(19px,2.65vw,23px)!important;font-weight:650!important;line-height:1.75!important;color:#fff4df!important;padding:.8em 1em!important;border-left:3px solid #d5ae73!important;background:linear-gradient(90deg,rgba(86,52,31,.78),rgba(86,52,31,.16))!important;border-radius:0 10px 10px 0!important}
html.unified a.episode-next{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:44px!important;padding:.68em 1.05em!important;border:1px solid rgba(213,174,115,.9)!important;border-radius:999px!important;background:rgba(92,55,32,.88)!important;color:#fff4df!important;font-weight:700!important;text-decoration:none!important;box-shadow:0 8px 22px rgba(25,14,8,.2)!important}
html.unified a.episode-next:hover,html.unified a.episode-next:focus-visible{background:#704329!important;color:#fff!important;transform:translateY(-1px)}

/* q10-mobile-caption-dock: phone dialogue remains attached to an image edge without hiding faces or screens. */
@media(max-width:600px){
html.unified .layout-stage.mobile-caption-stack{display:flex!important;flex-direction:column!important;align-items:stretch!important;overflow:visible!important}
html.unified .layout-stage.mobile-caption-stack>.mobile-caption-docked{box-sizing:border-box!important;position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;width:calc(100% - 18px)!important;max-width:none!important;min-height:0!important;padding:9px 11px!important;font-size:16px!important;line-height:1.58!important;overflow:visible!important}
html.unified .layout-stage.mobile-caption-stack>.mobile-caption-docked[data-mobile-dock="top"]{order:-1!important;margin:0 9px -10px!important}
html.unified .layout-stage.mobile-caption-stack>.mobile-caption-docked[data-mobile-dock="bottom"]{order:20!important;margin:-10px 9px 0!important}
html.unified .layout-stage.mobile-caption-stack>.mobile-caption-docked.mobile-caption-follow{margin-top:7px!important}
html.unified .layout-stage.mobile-caption-stack>.mobile-caption-docked .speaker{font-size:12px!important;margin-bottom:3px!important}
}