:root { color-scheme: light; font-family: system-ui, sans-serif; color: #18252b; background: #fff; line-height: 1.6; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#workspace { position: fixed; top: var(--viewport-top, 0px); left: 0; right: 0; height: var(--viewport-height, 100dvh); max-width: 48rem; margin: auto; display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: .75rem; padding: .25rem .75rem; border-bottom: 1px solid #dce4df; flex: none; }
h1 { font-size: 1.25rem; margin: 0; }
#saved-state { font-size: .75rem; color: #765000; }
#file-menu { margin-left: auto; }
button, input, textarea, summary { font: inherit; }
button, summary { min-height: 48px; min-width: 48px; padding: .6rem .75rem; border: 1px solid #b7c9c1; border-radius: .5rem; background: white; color: #153d32; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, textarea:focus-visible, summary:focus-visible, .content:focus-visible { outline: 3px solid #005ca9; outline-offset: -3px; }
summary { list-style: none; text-align: center; border: 0; font-size: 1.25rem; }
summary::-webkit-details-marker { display: none; }
details { position: relative; }
.menu { position: absolute; z-index: 3; width: min(19rem, calc(100vw - 2rem)); padding: .75rem; max-height: calc(var(--viewport-height, 100dvh) - 80px); overflow-y: auto; background: #fff; border: 1px solid #b7c9c1; border-radius: .75rem; box-shadow: 0 4px 20px #18252b22; }
.menu button { display: block; width: 100%; text-align: left; margin: .25rem 0; }
.menu p { margin: .5rem 0; overflow-wrap: anywhere; }
#file-menu .menu { top: 100%; right: 0; }
#add-menu .menu { bottom: calc(100% + .5rem); left: 0; }
#reader { flex: 1; min-height: 0; overflow-y: auto; padding: .5rem 1rem 1.5rem; scroll-padding: 1rem; }
.hint { font-size: .8rem; color: #53685e; }
#entries { list-style: none; margin: 0; padding: 0; }
.entry { border-bottom: 1px solid #dce4df; padding: .75rem 0; overflow-wrap: anywhere; }
.entry.section { border-bottom: 0; padding-top: 1.5rem; }
.content { cursor: pointer; min-height: 48px; border-radius: .25rem; }
.content p, .content h3 { white-space: pre-wrap; margin: .75rem 0; }
.content h3 { font-size: 1.5rem; }
.content img { display: block; width: 100%; height: auto; }
.entry.selected { background: #f0f6f3; }
.context { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem 0; }
#authoring { flex: none; border-top: 1px solid #b7c9c1; background: #f5f8f6; padding: .5rem .5rem max(.5rem, env(safe-area-inset-bottom)); }
.composer-row { display: flex; align-items: flex-end; gap: .25rem; }
.composer-row textarea { flex: 1; min-width: 0; width: 100%; min-height: 48px; max-height: 120px; padding: .6rem; border: 1px solid #b7c9c1; border-radius: .5rem; resize: none; font-size: 1rem; }
.composer-row button, .composer-row summary { flex: none; }
#save, #capture { background: #15553f; color: white; }
.composer-hint { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.composer-hint span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#attachment { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
#preview { display: block; max-height: min(120px, 20dvh); max-width: calc(100% - 56px); width: auto; object-fit: contain; }
#section-mode + #attachment { margin-top: .25rem; }
#camera-panel { position: fixed; border: 0; max-height: none; z-index: 5; top: var(--viewport-top, 0px); height: var(--viewport-height, 100dvh); width: 100%; max-width: 48rem; left: 0; right: 0; margin: auto; overflow: auto; background: #e8f0ec; padding: 1rem; }
.camera-frame { aspect-ratio: 4 / 3; width: 100%; background: #101817; overflow: hidden; outline: 3px solid #15553f; outline-offset: -3px; }
video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }
#status { position: fixed; z-index: 6; top: calc(var(--viewport-top, 0px) + 64px); left: 1rem; right: 1rem; max-width: 44rem; margin: 0 auto; padding: .75rem; border: 1px solid #b7c9c1; border-radius: .5rem; background: #fff; box-shadow: 0 4px 12px #18252b22; overflow-wrap: anywhere; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
