.chapter-transition{box-sizing:border-box;width:min(100%,760px);margin-inline:auto;min-height:min(620px,calc(100svh - 40px));padding:20px 24px 36px;display:flex;flex-direction:column;gap:16px;color:var(--ink,#33312b);background:var(--paper,#fffbed)}
.chapter-transition header p,.chapter-transition header h1,.chapter-transition h2{margin:0}.chapter-transition header p{font-size:16px;margin-bottom:8px}.chapter-transition h1{font-size:26px;line-height:1.25}.chapter-transition h2{font-size:20px;line-height:1.3}
.chapter-award-art{display:flex;align-items:center;justify-content:center;gap:36px;flex:1;min-height:200px}.chapter-award-art>div{display:grid;justify-items:center;gap:16px}.chapter-leader{width:144px;height:144px;object-fit:contain;image-rendering:pixelated}.chapter-badge{width:64px;height:64px;object-fit:contain;image-rendering:pixelated}
.chapter-dialogue{border:solid transparent;border-width:16px 24px;border-image:url('assets/dialogue-frame.png') 16 24 repeat;padding:0 6px;line-height:1.6;font-size:18px;background:#fff;background-clip:padding-box}
.chapter-transition footer{min-height:52px;display:flex;align-items:center;justify-content:flex-end;margin-top:auto}.chapter-transition footer button{min-height:48px;padding:8px 12px;display:flex;align-items:center;gap:12px;background:transparent;color:inherit;border:0;border-radius:0;box-shadow:none;font:inherit;font-size:18px;cursor:pointer}.chapter-transition footer button:focus-visible{outline:2px dashed #705c40;outline-offset:2px}.chapter-transition footer button>span{font-size:10px;width:12px}.chapter-moving-status{padding:8px 12px;font-size:18px}
.chapter-map{width:min(100%,480px);aspect-ratio:4/3;align-self:center;overflow:hidden}.chapter-map>svg{display:block;width:100%;height:100%;image-rendering:pixelated}.chapter-travel-note{margin:0;font-size:13px;line-height:1.4;text-align:center;color:#625b4c}.chapter-destination{display:flex;align-items:center;justify-content:center;gap:12px}.chapter-node-list{list-style:none;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));padding:0;margin:0;gap:4px}.chapter-node-list li{display:flex;align-items:center;flex-direction:column;gap:8px;min-width:0;font-size:14px;white-space:nowrap}.chapter-node-list img{width:32px;height:32px;object-fit:contain;image-rendering:pixelated}.chapter-transition[data-chapter-stage="moving"] .chapter-city-marker{animation:chapter-city-travel 1.4s ease-in-out both;transform-box:view-box;transform-origin:0 0}
@keyframes chapter-city-travel{from{transform:translate(var(--from-x),var(--from-y))}to{transform:translate(var(--to-x),var(--to-y))}}
@media(max-width:600px){.chapter-transition{padding:14px 12px max(36px,env(safe-area-inset-bottom));gap:12px;min-height:calc(100svh - 28px)}.chapter-transition h1{font-size:22px}.chapter-transition h2{font-size:18px}.chapter-leader{width:120px;height:120px}.chapter-award-art{gap:20px;min-height:180px}.chapter-node-list li{font-size:12px}.chapter-map{max-height:none}.chapter-dialogue{font-size:16px}.chapter-transition footer button{font-size:18px}.chapter-travel-note{font-size:12px}}
@media(prefers-reduced-motion:reduce){.chapter-transition[data-chapter-stage="moving"] .chapter-city-marker{animation:none;transform:translate(var(--to-x),var(--to-y))}}

.chapter-walk-sheet{transform:translateX(var(--walk-stand));image-rendering:pixelated}
.chapter-walker.is-walking .chapter-walk-sheet{animation:chapter-walk-steps .56s steps(1,end) infinite}
@keyframes chapter-walk-steps{0%,100%{transform:translateX(var(--walk-a))}25%,75%{transform:translateX(var(--walk-b))}50%{transform:translateX(var(--walk-c))}}
@media(prefers-reduced-motion:reduce){.chapter-walker.is-walking .chapter-walk-sheet{animation:none;transform:translateX(var(--walk-stand))}}

.chapter-continue{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:64px;text-align:left;color:inherit;cursor:pointer;margin-top:auto;border-radius:0}.chapter-continue i{font-size:10px;font-style:normal;flex:none}.chapter-continue:focus-visible{outline:2px dashed #705c40;outline-offset:3px}

/* Scoped approved square frame; do not replace unrelated dialogue materials. */
.chapter-dialogue{border:8px solid transparent;border-image:url('assets/choice-frame.png') 8 repeat;border-radius:0;padding:8px 12px;background:#fff;background-clip:padding-box;image-rendering:pixelated}
.chapter-transition[data-resource-ready=false] .chapter-award-art,
.chapter-transition[data-resource-ready=false] .chapter-map,
.chapter-transition[data-resource-ready=false] .chapter-node-list{opacity:0}
.chapter-transition[data-resource-ready=true] .chapter-award-art,
.chapter-transition[data-resource-ready=true] .chapter-map,
.chapter-transition[data-resource-ready=true] .chapter-node-list{opacity:1;transition:opacity .12s ease-out}
.chapter-transition[data-resource-ready=false] .chapter-city-marker,
.chapter-transition[data-resource-ready=false] .chapter-walk-sheet{animation-play-state:paused!important}
.chapter-resource-status{font-size:14px;line-height:22px;text-align:center;margin:0}
.chapter-resource-status button{font:inherit;min-height:44px;padding:8px;background:transparent;border:0;color:inherit}
@media(prefers-reduced-motion:reduce){.chapter-transition[data-resource-ready=true] .chapter-award-art,.chapter-transition[data-resource-ready=true] .chapter-map,.chapter-transition[data-resource-ready=true] .chapter-node-list{transition:none}}
/* Chapter headings share the same right-hand utility slot as journey pages. */
.chapter-transition>header:has(.storage-global-entry){display:grid;grid-template-columns:minmax(0,1fr) 56px;column-gap:8px;align-items:center}
.chapter-transition>header:has(.storage-global-entry)>p{grid-column:1;grid-row:1}
.chapter-transition>header:has(.storage-global-entry)>h1{grid-column:1;grid-row:2;min-width:0;overflow-wrap:break-word}
.chapter-transition>header .storage-global-entry{grid-column:2;grid-row:1/3;align-self:center;justify-self:end;margin-left:0;min-height:44px}
/* The top-right prototype control occupies y=8..52. Use the existing chapter
   label row for that clearance; keep the warehouse beside the actual title. */
.chapter-transition>header:has(.storage-global-entry){grid-template-rows:minmax(44px,auto) auto}
.chapter-transition>header:has(.storage-global-entry)>p{align-self:center;margin-bottom:0;padding-right:12px}
.chapter-transition>header .storage-global-entry{grid-row:2;align-self:start}
