:root { color-scheme: light; font: 16px/1.5 system-ui, sans-serif; color: #202724; background: #f4f5f3; scroll-padding-bottom: 6rem; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { max-width: 48rem; margin: auto; padding: .75rem 1rem; }
header.shell { padding-bottom: 0; }
main.shell { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
.context { overflow-wrap: anywhere; }
h1 { display: inline; font-size: 1.1rem; margin: 0; }
h2 { font-size: 1rem; margin-bottom: .25rem; }
button, select, .open, summary { font: inherit; }
button, select, .open { min-height: 44px; border: 1px solid #c3cac5; border-radius: .5rem; background: #fff; color: inherit; padding: .5rem .75rem; }
button, .open, summary { cursor: pointer; }
button:disabled, select:disabled { opacity: .5; cursor: default; }
button[aria-pressed="true"], button[aria-current="true"] { background: #243d32; color: white; }
:focus-visible { outline: 3px solid #377859; outline-offset: 3px; }
.open { position: relative; overflow: hidden; }
.open input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.open:focus-within { outline: 3px solid #377859; }
#error:empty { display: none; }
#error, .missing { color: #9a2525; }
#breadcrumb { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-top: .5rem; }
#breadcrumb button { border: 0; background: transparent; color: inherit; padding: .25rem; }
details { margin: .25rem 0; }
summary { min-height: 44px; padding: .5rem 0; overflow-wrap: anywhere; }
details[open] { padding-bottom: .5rem; border-bottom: 1px solid #d9dfda; }
label { display: block; }
select { max-width: 100%; width: 100%; }
.viewbar { margin-bottom: 1rem; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }
#panels { display: flex; flex-direction: column; gap: 1rem; }
.card { border-radius: .75rem; overflow: hidden; background: #fff; border: 1px solid #d9dfda; }
.panel-stage { min-height: 15rem; background: #e9ece8; display: flex; align-items: center; justify-content: center; }
.panel-stage img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.panel-stage .note { width: 100%; font-size: 1.4rem; line-height: 1.65; padding: 1.5rem; margin: 0; }
.panel-stage .message { padding: 1.5rem; overflow-wrap: anywhere; }
#reader-controls { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1; max-width: 48rem; margin: auto; display: flex; justify-content: space-around; gap: .5rem; padding: .5rem .5rem calc(.5rem + env(safe-area-inset-bottom)); background: #f4f5f3; border-top: 1px solid #c3cac5; }
#reader-controls [role="group"] { display: flex; gap: .25rem; }
#reader-controls button { padding: .5rem; }
body.reader-open { overflow: hidden; }
#zoom { inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #e9ece8; }
#zoom[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
#zoom-close { position: absolute; top: calc(.5rem + env(safe-area-inset-top)); right: calc(.5rem + env(safe-area-inset-right)); z-index: 1; font-size: 1.5rem; line-height: 1; }
#fullscreen-controls { display: flex; justify-content: space-around; gap: 1rem; padding: .5rem 1rem calc(.5rem + env(safe-area-inset-bottom)); background: #f4f5f3; }
#fullscreen-controls button { min-width: 64px; }
#zoom-viewport { min-height: 0; overflow: auto; cursor: grab; touch-action: none; }
#zoom-canvas { display: flex; align-items: center; justify-content: center; }
#zoom-image { display: block; max-width: none; }
#zoom-note { min-height: 0; overflow-y: auto; padding: calc(4rem + env(safe-area-inset-top)) 1.5rem 1.5rem; font-size: 1.4rem; line-height: 1.65; }
@media (min-width: 48rem) { .panel-stage { min-height: 20rem; } }
