:root{--ink:#153d35;--muted:#5c6c64;--paper:#faf9f5;--line:#dce3d9;--soft:#edf1e9;--accent:#bd583d;font-size:18px}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}body.large{font-size:1.2em}button,a,textarea{touch-action:manipulation}button{font:inherit;cursor:pointer}button:disabled{opacity:.45;cursor:default}a{color:inherit}button:focus-visible,a:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:4px}[hidden]{display:none!important}header{max-width:860px;padding:24px 28px;margin:auto;display:flex;align-items:center;justify-content:space-between}.brand{font:bold 42px Georgia,serif;letter-spacing:-3px;text-decoration:none}.brand span{color:var(--accent)}.textsize{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:30px;background:white;padding:11px 16px;color:var(--ink);font-weight:600}.textsize span{font-size:14px}main{max-width:570px;margin:auto;padding:12px 25px 45px}.progress{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px 0 42px;font-size:13px;color:#64756b}.progress span{display:flex;align-items:center;gap:6px;white-space:nowrap}.progress b{font-weight:500}.progress .active{color:var(--ink);font-weight:700}.progress .active b{font-weight:700}.progress i{height:1px;flex:1;max-width:40px;background:var(--line)}.screen{text-align:center}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:var(--muted);margin:0 0 18px}h1{font-size:clamp(35px,8vw,47px);line-height:1.12;letter-spacing:-1.8px;font-weight:550;margin:0 0 20px}.lead{font-size:1.1em;line-height:1.65;color:var(--muted);margin:0 0 24px}.camera-art{background:var(--soft);border-radius:26px;min-height:205px;margin:28px 0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:15px}.camera-art svg{color:#376052}.camera-art span{font-size:.9em;line-height:1.55;color:var(--muted)}.primary,.secondary{width:100%;min-height:62px;display:flex;align-items:center;justify-content:center;gap:15px;border-radius:18px;padding:17px 19px;font-size:1.05em;font-weight:600;text-decoration:none;border:0}.primary{color:white;background:var(--ink);box-shadow:0 5px 12px #153d3510}.primary:hover{background:#28584b}.primary span{font-size:23px}.secondary{background:white;border:1px solid var(--line);color:var(--ink);margin-top:12px}.secondary:hover{background:var(--soft)}.hint{color:var(--muted);font-size:.82em;line-height:1.6;margin:16px 0}.quiet{display:inline-block;font-size:.88em;text-underline-offset:5px;background:none;border:0;text-decoration:underline;padding:13px 5px;cursor:pointer;color:var(--muted)}.preview{width:100%;max-height:330px;object-fit:contain;background:var(--soft);border-radius:22px;margin:8px 0 23px}.pulse{display:grid;place-items:center;width:110px;height:110px;border-radius:30px;background:var(--soft);font:bold 45px Georgia,serif;margin:55px auto 40px;animation:breathe 2s infinite}.check{display:grid;place-items:center;width:100px;height:100px;border-radius:50%;background:var(--soft);font-size:48px;margin:45px auto 30px}.reading{background:white;border:1px solid var(--line);border-radius:22px;padding:25px;text-align:left;margin:20px 0}.readinghead{font-size:12px;letter-spacing:.5px;color:var(--muted);margin-bottom:18px}#words{font-size:1.28em;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere}.audio{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:14px 0}.pill{min-height:44px;background:var(--soft);color:var(--ink);border:0;border-radius:30px;padding:10px 17px;font-size:.86em}.pagecontrols{display:flex;gap:12px}.pagecontrols button{font-size:.9em}form{text-align:left;margin-top:30px;border-top:1px solid var(--line);padding-top:27px}label{display:block;font-weight:600;font-size:1.08em}textarea{resize:vertical;width:100%;font:inherit;color:var(--ink);border:1px solid #c8d4c7;background:white;border-radius:17px;padding:17px;min-height:95px;line-height:1.5}.askactions{display:flex;gap:10px;align-items:stretch;margin-top:10px}.askactions .secondary{margin:0;font-size:.9em}.askactions .primary{font-size:.95em}.chat{display:grid;gap:13px;text-align:left;margin-top:20px}.chatbox{padding:20px;border-radius:18px;background:var(--soft);line-height:1.7;overflow-wrap:anywhere;white-space:pre-wrap}.chatbox.user{margin-left:35px;background:#fff;border:1px solid var(--line)}.chatbox small{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:8px}.finish{margin:35px 0 0;padding-top:20px;border-top:1px solid var(--line)}.finish p{font-size:.9em;color:var(--muted)}#error{background:#fff1e9;border:1px solid #e7c7b5;padding:20px;border-radius:20px;margin-top:20px;line-height:1.6}#error p{margin:0}footer{text-align:center;padding:15px 25px 30px;color:var(--muted);font-size:14px;line-height:1.9}footer small{font-size:12px}@keyframes breathe{50%{opacity:.55;transform:scale(.96)}}@media(min-width:800px){body{background:linear-gradient(110deg,#eef1e9 0%,#faf9f5 30%,#faf9f5 70%,#eef1e9 100%)}main{padding-top:22px}}@media(max-width:380px){main{padding-left:18px;padding-right:18px}.progress{gap:6px}.progress i{max-width:20px}.askactions{flex-direction:column}}@media(prefers-reduced-motion:reduce){*{animation:none!important}}

.saveguide{max-width:570px;margin:0 auto 25px;padding:0 25px}.saveguide details{border:1px solid var(--line);background:white;border-radius:18px;padding:20px}.saveguide summary{cursor:pointer;font-weight:600;min-height:30px}.saveguide p,.saveguide li{font-size:17px;line-height:1.7;color:var(--muted)}.saveguide h2{font-size:21px;margin-top:25px}.saveguide li{padding:5px 0}.saveguide ol{padding-left:23px}

/* The picture leads. Controls stay within reach. */
body.readermode{background:#f5f4ef;padding-bottom:110px}body.readermode header{max-width:1100px;padding:16px 22px;background:#faf9f5}body.readermode main{max-width:1100px;padding:0 0 25px}body.readermode #reader>h1{font-size:23px;letter-spacing:-.5px;margin:6px 22px 15px;text-align:left}body.readermode #reader>.eyebrow{display:none}#photoViewport{width:100%;overflow:auto;max-height:72svh;background:#e5e3da;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom}#reference{display:block;width:100%;height:auto;max-height:none;border-radius:0;margin:0;cursor:zoom-in;transition:width .15s}#reference.zoomed{width:180%;max-width:none;cursor:zoom-out}.reading{margin:0;border:0;border-radius:0;padding:30px clamp(22px,7vw,90px);background:#fffefa;min-height:50svh}#words{font-size:1.2em;line-height:1.9}.readerToolbar{position:fixed;bottom:0;left:0;right:0;z-index:20;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:12px max(10px,env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));background:#fffffff2;backdrop-filter:blur(22px);border-top:1px solid #dce3d9;box-shadow:0 -8px 35px #153d3508}.readerToolbar button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;min-height:64px;color:var(--ink);background:none;border:0;border-radius:15px;font-size:13px;font-weight:600}.readerToolbar button:hover{background:var(--soft)}.readerToolbar #playButton{background:var(--ink);color:white}.readerToolbar #playButton:hover{background:#28584b}.readerToolbar button:disabled{opacity:.5}body.readermode #save,body.readermode footer{display:none}body.readermode .audio{margin:18px 20px}body.readermode #simplify{width:calc(100% - 44px);max-width:530px;margin:12px auto}#questionPanel{margin:25px 22px;text-align:left;scroll-margin-bottom:130px}#questionPanel summary{font-size:20px;padding:15px 0;cursor:pointer}#questionPanel form{margin:0;padding:15px 0;border:0}.chat{margin:20px 22px}.finish{margin:18px 22px;padding:0}.finish p{padding:10px}body.readermode #error{margin:22px}.pagecontrols{display:none}.progress{display:none}@media(min-width:800px){.readerToolbar{left:50%;right:auto;width:600px;transform:translateX(-50%);border:1px solid #dce3d9;border-radius:24px 24px 0 0}.readerToolbar button{font-size:14px}#photoViewport{max-height:75svh}#reference{max-width:none}.reading{min-height:65svh}#questionPanel{max-width:650px;margin:25px auto}.chat{max-width:650px;margin:20px auto}}

/* Camera-first capture: the scene stays inside Pip. */
body.cameramode{background:#141b18;color:#faf9f5;min-height:100svh}body.cameramode header{max-width:1100px;width:100%;padding:12px 20px;background:#141b18;position:relative;z-index:3}body.cameramode .brand{color:#faf9f5;font-size:34px}body.cameramode .textsize{color:#faf9f5;background:#ffffff0d;border-color:#ffffff26;padding:9px 13px}body.cameramode main{max-width:1100px;padding:0;margin:auto}body.cameramode #save,body.cameramode footer{display:none}.camera-title{position:absolute;z-index:2;top:16px;left:0;right:0;font-size:20px;font-weight:500;letter-spacing:0;color:white;text-shadow:0 1px 8px #000;background:linear-gradient(#0005,transparent);margin:0;padding:12px}#start{position:relative}.viewfinder{position:relative;width:100%;height:calc(100svh - 265px);min-height:250px;background:radial-gradient(ellipse at center,#33413a,#17201b);overflow:hidden}#liveCamera{display:block;width:100%;height:100%;object-fit:contain}#cameraWelcome{position:absolute;inset:45px 30px 20px;display:flex;align-items:center;justify-content:center;flex-direction:column;z-index:2;color:#eef2e9}#cameraWelcome>p{font-size:20px;line-height:1.5}#cameraWelcome .primary{max-width:260px;background:#faf9f5;color:#153d35;min-height:55px;border-radius:30px}#cameraWelcome .camera-help{font-size:14px;max-width:300px;color:#d1dcd3;margin-top:16px}.frame-guide{position:absolute;inset:65px 23px 25px;border:1px solid #ffffff25;border-radius:14px;pointer-events:none}.camera-bottom{background:#141b18;padding:8px 20px max(12px,env(safe-area-inset-bottom));color:#f8faf5}.camera-bottom>p{font-size:15px;margin:8px 0 12px;color:#e2e9e0}.camera-controls{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;justify-items:center;max-width:500px;margin:auto}.shutter{width:78px;height:78px;border:3px solid white;border-radius:50%;background:transparent;padding:5px;box-shadow:0 0 0 1px #ffffff25}.shutter span{display:block;background:#fff;width:100%;height:100%;border-radius:50%}.shutter:disabled{opacity:.35}.shutter:not(:disabled):active span{background:#c8d5c9;transform:scale(.93)}.camera-side{border:0;background:none;color:#f8faf5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;font-size:12px;min-height:65px;padding:10px}.camera-side span{max-width:90px}.camera-bottom .camera-privacy{font-size:11px;color:#9aada0;margin:10px 0 0}body.cameramode #confirm{position:relative}body.cameramode #preview{display:block;object-fit:contain;width:100%;height:calc(100svh - 285px);min-height:260px;max-height:none;margin:0;background:#101612;border-radius:0}.capture-actions{padding:16px 22px max(12px,env(safe-area-inset-bottom));max-width:570px;margin:auto}.capture-actions .primary{background:#f8faf5;color:#153d35}.capture-actions .secondary{background:none;border-color:#ffffff55;color:white;min-height:48px;padding:10px;margin-top:10px}.capture-actions .hint{color:#b6c4b9;font-size:12px;margin:10px 0}body.cameramode #working{position:relative;min-height:calc(100svh - 85px);overflow:hidden;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:35px 25px;background:#141b18}#workingPhoto{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:.32;pointer-events:none}body.cameramode #working> :not(#workingPhoto){position:relative;z-index:1}body.cameramode #working .pulse{margin:20px auto 30px;color:#153d35}body.cameramode #working h1{font-size:32px;max-width:420px}body.cameramode #working .lead{color:#e5eee6}body.cameramode #working #cancel{max-width:320px}body.cameramode #error{margin:16px 22px;color:#153d35}body.large .camera-side{font-size:15px}@media(min-width:800px){.viewfinder{height:calc(100svh - 280px);min-height:350px}.camera-title{font-size:23px}.frame-guide{inset:65px 15% 25px}.camera-bottom{padding-bottom:18px}body.cameramode #start,body.cameramode #confirm{max-width:760px;margin:auto}body.cameramode #working{max-width:760px;margin:auto}} 
body.cameramode #save:target{display:block;color:#153d35;background:#faf9f5;margin:0 auto;padding-top:25px;padding-bottom:25px}body.cameramode #save:target summary{color:#153d35}

/* Use the available screen for the picture, not page furniture. */
body.readermode,body.cameramode{height:100dvh;min-height:0;overflow:hidden;padding:0;background:#111713}
body.readermode header,body.cameramode header{position:fixed;top:0;left:0;right:0;max-width:none;height:48px;padding:6px 12px;background:linear-gradient(#0009,transparent);z-index:25;pointer-events:none}
body.readermode .brand,body.cameramode .brand{font-size:25px;letter-spacing:-1.5px;color:white;pointer-events:auto}
body.readermode .textsize,body.cameramode .textsize{pointer-events:auto;min-height:38px;padding:6px 12px;color:white;background:#14221bd9;border:1px solid #ffffff36}
body.readermode .textsize span,body.cameramode .textsize span{display:none}
body.readermode main,body.cameramode main{height:100dvh;width:100%;max-width:none;padding:0;margin:0}
body.readermode #reader{height:100%;position:relative;padding:0 0 calc(76px + env(safe-area-inset-bottom));overflow:hidden}
body.readermode #reader>h1{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
body.readermode #photoViewport{width:100%;height:100%;max-height:none;overflow:auto;display:flex;align-items:center;background:#111713;touch-action:pan-x pan-y pinch-zoom}
body.readermode #reference{width:100%;height:auto;max-height:none;object-fit:contain;flex-shrink:0}
body.readermode #reference.zoomed{width:200%;align-self:flex-start}
body.readermode .reading{height:100%;min-height:0;overflow:auto;padding:64px 22px 25px;background:#fffdf7}
body.readermode #sampleNotice{position:absolute;top:50px;left:12px;z-index:4;padding:5px 10px;border-radius:15px;margin:0;color:white;background:#111a13c9;font-size:11px}
.readerToolbar{height:calc(76px + env(safe-area-inset-bottom));padding:6px 8px calc(6px + env(safe-area-inset-bottom));gap:5px;background:#fbfcf9f7;border:0;border-top:1px solid #dce3d9;box-shadow:none}
.readerToolbar button{min-height:60px;gap:5px;font-size:12px;border-radius:13px}.readerToolbar svg{width:24px;height:24px}
.readerOptions{position:absolute;right:10px;top:55px;z-index:10;text-align:right}
.readerOptions>summary{display:inline-flex;gap:6px;align-items:center;justify-content:center;list-style:none;cursor:pointer;min-height:44px;padding:7px 12px;border-radius:24px;color:white;background:#14221be8;font-size:14px}
.readerOptions>summary::-webkit-details-marker{display:none}
.readerOptions[open]{max-width:calc(100% - 20px);width:310px;padding:10px;border-radius:20px;color:#153d35;background:#fffffff7;box-shadow:0 5px 30px #0003}
body.readermode .readerOptions .audio{margin:12px 0}
body.readermode .readerOptions #simplify{margin:10px 0 0;width:100%;min-height:48px;font-size:16px;padding:10px}
body.readermode #questionPanel{position:absolute;z-index:12;bottom:calc(82px + env(safe-area-inset-bottom));left:8px;right:8px;max-height:65%;overflow:auto;background:#fffefa;color:#153d35;border-radius:22px;padding:0 18px;margin:0;box-shadow:0 5px 30px #0002}
body.readermode #questionPanel:not([open]){display:none}
body.readermode #questionPanel summary{font-size:18px}
body.readermode .chat{position:absolute;z-index:11;bottom:calc(84px + env(safe-area-inset-bottom));left:8px;right:8px;max-height:55%;overflow:auto;margin:0;background:#fffefa;border-radius:20px;color:#153d35}
body.readermode .chat:empty{display:none}
body.readermode .finish{display:none}
body.readermode #error,body.cameramode #error{position:fixed;bottom:calc(90px + env(safe-area-inset-bottom));left:10px;right:10px;margin:0;z-index:40;max-height:50dvh;overflow:auto}
body.cameramode #start,body.cameramode #confirm,body.cameramode #working{position:relative;height:100%;width:100%;max-width:none;margin:0;min-height:0}
body.cameramode .viewfinder{height:calc(100% - 132px - env(safe-area-inset-bottom));min-height:0}
body.cameramode .camera-title{top:48px;font-size:16px;padding:8px;margin:0;background:none}
body.cameramode #cameraWelcome{inset:90px 25px 20px}
body.cameramode .frame-guide{inset:95px 18px 18px}
body.cameramode .camera-bottom{position:absolute;bottom:0;left:0;right:0;height:calc(132px + env(safe-area-inset-bottom));padding:4px 12px calc(8px + env(safe-area-inset-bottom));background:#111713}
body.cameramode .camera-bottom>p{font-size:12px;margin:4px 0 6px}.camera-bottom .camera-privacy{display:none}
body.cameramode .shutter{width:66px;height:66px}.camera-controls{height:82px}.camera-side{font-size:11px;min-height:60px;gap:4px}
body.cameramode #preview{height:100%;width:100%;min-height:0;max-height:none;object-fit:contain;margin:0;padding-bottom:0;background:#111713}
body.cameramode .capture-actions{position:absolute;bottom:0;left:0;right:0;width:100%;max-width:none;margin:0;display:grid;grid-template-columns:1fr 1.4fr;gap:10px;padding:14px 16px calc(12px + env(safe-area-inset-bottom));background:linear-gradient(transparent,#111713ed 30%)}
.capture-actions #retake{grid-row:1;grid-column:1}.capture-actions #read{grid-row:1;grid-column:2}
body.cameramode .capture-actions button{min-height:52px;padding:12px;margin:0;border-radius:16px;font-size:17px}
body.cameramode .capture-actions .hint{grid-column:1/-1;margin:0;text-align:center;font-size:11px}
body.cameramode #working{padding:80px 22px 30px}
@media(min-width:800px){.readerToolbar{width:540px;left:50%;transform:translateX(-50%);border-radius:20px 20px 0 0}body.readermode #photoViewport{justify-content:center}body.readermode #reference{width:auto;max-width:100%;max-height:100%;height:auto}body.readermode #reference.zoomed{width:150%;max-width:none;max-height:none}.readerOptions{right:20px}body.cameramode .capture-actions{max-width:650px;left:50%;right:auto;transform:translateX(-50%)}body.readermode #questionPanel,body.readermode .chat{left:50%;right:auto;width:min(650px,90%);transform:translateX(-50%)}}
body.cameramode:has(#save:target){height:auto;overflow:auto}body.cameramode:has(#save:target) main{display:none}body.cameramode:has(#save:target) header{position:relative}

/* Edge-to-edge preview; capture uses the same centered cover crop. */
#liveCamera{object-fit:cover;object-position:center center}
body.cameramode #preview{height:calc(100% - 132px - env(safe-area-inset-bottom));object-fit:contain;object-position:center center}

body.cameramode .capture-actions{grid-template-columns:.65fr 1fr 1.2fr;gap:7px}.capture-actions #retake{grid-column:1}.capture-actions #read{grid-column:2}.capture-actions #findOpen{grid-row:1;grid-column:3;background:#f8faf5;color:#153d35}.capture-actions .hint{grid-column:1/-1}.captureQuestion{position:fixed;z-index:45;bottom:10px;left:10px;right:10px;margin:auto;max-width:570px;max-height:75dvh;overflow:auto;background:#fffdf7;color:#153d35;padding:14px 20px 22px;border:1px solid #dce3d9;border-radius:24px;box-shadow:0 0 0 100vmax #0005}.captureQuestion form{margin:0;padding:5px 0 0;border:0}.captureQuestion label{margin:8px 0 15px}.captureQuestion textarea{font-size:18px}.findExamples{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0 18px}.captureQuestion .quiet{float:right;min-height:44px}.captureQuestion form{clear:both}@media(max-width:380px){body.cameramode .capture-actions button{font-size:14px;padding:10px 7px}}

/* Translation uses the existing camera and picture. */

#translationSheet select,#translateFocus{width:100%;font:inherit;color:var(--ink);background:white;border:1px solid #c8d4c7;border-radius:17px;padding:14px;min-height:52px;margin:0 0 16px}#translationSheet select:focus-visible,#translateFocus:focus-visible{outline:3px solid var(--accent);outline-offset:3px}#originalText{margin:20px 0;font-size:1em;line-height:1.7}#originalText summary{cursor:pointer;min-height:44px;padding:10px 0;font-weight:600}#originalWords{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}#translationNote{margin:16px 0}
body.cameramode .capture-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.capture-actions #retake{grid-column:1}.capture-actions #read{grid-column:2}.capture-actions #findOpen{grid-column:3}.capture-actions #translateOpen{grid-column:4;grid-row:1;background:#f8faf5;color:#153d35}body.cameramode .capture-actions button{font-size:15px;padding:10px 5px;gap:4px}body.cameramode .capture-actions #read span{display:none}
/* Reader answers flow with the document, so they cannot cover Options. */
body.readermode #reader{overflow-y:auto;overscroll-behavior:contain;scroll-padding-top:112px;-webkit-overflow-scrolling:touch}body.readermode .reading{height:auto;min-height:calc(100dvh - 76px - env(safe-area-inset-bottom));overflow:visible;padding-top:112px}body.readermode #photoViewport{height:calc(100dvh - 76px - env(safe-area-inset-bottom))}body.readermode .chat{position:relative;left:auto;right:auto;bottom:auto;transform:none;max-height:none;overflow:visible;margin:0 12px 24px;width:auto;max-width:none;background:#fffefa;padding:10px;border:1px solid var(--line)}body.readermode .chat[hidden],body.readermode .chat:empty{display:none}body.readermode .chat>.quiet{display:block;margin-left:auto;min-height:44px}.chatbox{color:var(--ink)}
body.readermode .readerOptions{position:fixed;top:calc(54px + env(safe-area-inset-top));right:10px;z-index:35;max-height:calc(100dvh - 160px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.readerOptions[open]{background:#fffdf7;box-shadow:0 5px 30px #0004}.readerOptions[open]>summary{position:sticky;top:0;z-index:1}.readerOptions[open]>button{font-size:16px;min-height:48px;padding:10px;margin-top:10px}.readerOptions .hint{font-size:14px}
body.readermode #questionPanel{position:fixed;z-index:36;width:auto;max-width:650px;left:8px;right:8px;transform:none;margin:auto;max-height:calc(100dvh - 155px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}.captureQuestion{max-height:calc(100dvh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom));bottom:calc(10px + env(safe-area-inset-bottom))}body.readermode header{padding-top:calc(6px + env(safe-area-inset-top));height:calc(48px + env(safe-area-inset-top));background:#fffdf7}body.readermode .brand{color:var(--ink)}body.readermode #reader{padding-top:env(safe-area-inset-top)}

/* Reserve a real controls row above scrolling text: padding alone still lets words pass behind Options. */
body.readermode:has(#textView:not([hidden])) header::after{content:"";position:absolute;left:0;right:0;top:100%;height:var(--reader-controls-space,56px);background:#fffdf7;pointer-events:none}
body.readermode:has(#textView:not([hidden])) #reader{position:fixed;top:calc(48px + var(--reader-controls-space,56px) + env(safe-area-inset-top));bottom:calc(76px + env(safe-area-inset-bottom));left:0;right:0;height:auto;padding:0;scroll-padding-top:16px}
body.readermode:has(#textView:not([hidden])) .reading{min-height:calc(100dvh - 124px - var(--reader-controls-space,56px) - env(safe-area-inset-top) - env(safe-area-inset-bottom));padding-top:16px}
#incompleteMessage{margin-top:10px!important}#incompleteNotice .quiet{min-height:44px;padding-bottom:0}

body.readermode:has(#textView:not([hidden])) .readerOptions{max-height:max(44px,calc(100dvh - 256px - env(safe-area-inset-top) - env(safe-area-inset-bottom)))}

body:not(.readermode) .readerOptions{display:none}

/* Warnings take space in the reader rather than covering Listen or text. */
body.readermode #error{position:relative;inset:auto;z-index:auto;margin:12px 16px;max-height:none;overflow:visible;color:var(--ink)}
#error>#dismissIncomplete{display:block;margin:0 0 8px auto;min-height:44px;padding:8px 12px}
/* On the photo screen keep the warning above the bottom capture controls. */
body.cameramode #error{top:calc(52px + env(safe-area-inset-top));bottom:auto;max-height:calc(100dvh - 300px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}

body.readermode:has(#textView:not([hidden])) #reader{background:#fffdf7}

#thanks h1{font-size:2.1em;line-height:1.2}.thanks-steps{font-size:1.45em;line-height:1.5;padding-left:1.3em;margin:20px 0}.thanks-steps li{margin:14px 0}#thanks .lead{font-size:1.3em}#thanks .primary{max-width:none;width:100%;min-height:64px;font-size:1.2em}
