:root{--ink:#282c26;--muted:#566155;--line:#c8cbbc;--jade:#145543;--paper:#faf9f2;--gez:Nyala,"Noto Sans Ethiopic","Abyssinica SIL",Ebrima,serif;font-family:Inter,system-ui,sans-serif;color:var(--ink);background:#eaece3}
*{box-sizing:border-box}body{margin:0}header,nav,main,#status{padding:12px clamp(12px,2.5vw,38px)}header,nav,.buttons,.tools,.inspect{display:flex;gap:8px;align-items:center;flex-wrap:wrap}header{background:#192f29;color:#f7f5e8;justify-content:space-between}h1{font:32px Georgia,serif;margin:0}header span,.sub,.caption{font-size:13px}nav{background:#f8f7ef;border-bottom:1px solid var(--line)}label{font-size:13px}button,select,input,textarea{font:inherit}button,select,input:not([type=checkbox]),textarea{border:1px solid #b6beae;border-radius:5px;padding:6px 9px;background:#fffcf3;color:var(--ink)}button,select,summary{cursor:pointer}button:hover,button:focus-visible{background:#dcebe1}button.primary{background:var(--jade);color:#fff;border-color:#39826c}button:disabled{opacity:.5}#status{font-size:13px;min-height:27px;padding-top:5px;padding-bottom:4px;color:var(--jade)}main{display:grid;grid-template-columns:minmax(440px,1.6fr) minmax(330px,1fr);gap:16px;align-items:start;padding-top:0}.imagepane,.detail{background:var(--paper);border:1px solid var(--line);border-radius:8px;min-width:0}.imagepane{position:sticky;top:6px;overflow:hidden}.tools,.caption{padding:8px 10px}.tools{gap:6px}.tools label{display:flex;align-items:center}.board{position:relative;height:69vh;min-height:340px;background:#252c25}.board svg{width:100%;height:100%;touch-action:none}#empty{position:absolute;top:40%;color:#fff;width:100%;padding:20px;text-align:center;pointer-events:none}.detail{padding:14px}h2{font:22px Georgia,serif;margin:0 0 6px}.strip{display:flex;flex-wrap:wrap;gap:1px}.strip button{font:24px/1.45 var(--gez);padding:0 3px;border-color:transparent;background:transparent}.strip button.active{background:var(--jade);color:white}.strip .issue{border-bottom-color:#a44524}.inspect{margin-top:10px}.inspect strong{color:var(--jade);font:44px/1.3 var(--gez);min-width:35px}.sub,.caption{color:var(--muted)}#note{font-size:14px;line-height:1.42;margin:9px 0}.gez,dd{font:21px/1.5 var(--gez);overflow-wrap:anywhere}.fields{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}.fields label select,.fields input,textarea{display:block;width:100%}#newText{font-family:var(--gez)}.detail details{border-top:1px solid var(--line);padding:8px 0}.detail summary{font-weight:600}dl{display:grid;grid-template-columns:100px 1fr;gap:3px;margin:8px 0}dt{font-size:12px;color:var(--muted);padding-top:6px}dd{margin:0}.gez{margin:6px 0}.glyph,.frag,.other,.target,.vertex{vector-effect:non-scaling-stroke}.glyph{stroke:#128d72;stroke-width:1;fill:#99f3cf;fill-opacity:.035;cursor:pointer}.selected{stroke:#b34016;stroke-width:2;fill:#ffe875;fill-opacity:.19}.frag,.other,.target{fill:none;pointer-events:none;stroke:#376fbb;stroke-width:1;stroke-dasharray:4 3}.other{stroke:#b4730a}.target{stroke:#8b43aa;stroke-width:2}.vertex{stroke:#8c3115;fill:white;stroke-width:1;cursor:move}.textline{display:block;text-align:left;width:100%;margin:3px 0}.textline span{font-family:var(--gez);font-size:19px}#memo{margin:4px 0 8px}.warn{color:#874214}@media(max-width:850px){main{grid-template-columns:1fr}.imagepane{position:static}.board{height:52vh}header{align-items:flex-start}.detail{margin-bottom:20px}}

.ocrComparison{border-collapse:collapse;width:100%;table-layout:fixed;margin:9px 0}
.ocrComparison th,.ocrComparison td{padding:5px 6px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
.ocrComparison th{font:600 12px/1.3 system-ui;color:var(--muted)}
.ocrComparison th:first-child{width:72px}
.ocrComparison td,.guideReading{font:19px/1.45 var(--gez);overflow-wrap:anywhere}
.ocrComparison mark{background:#ffdfa2;color:#392400;border-bottom:2px solid #946000}
#changePicker{margin-top:9px}#changePicker:not([hidden]){display:block}

.image-modes{display:flex;align-items:center;flex-wrap:wrap;gap:5px 15px;margin:10px 10px 0;padding:6px 10px 8px;border:1px solid var(--line);border-radius:5px}
.image-modes legend{font-size:13px;font-weight:600;color:var(--ink);padding:0 4px}
.image-modes label{display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.image-modes input[type=radio]{accent-color:var(--jade);padding:0;margin:0}
#photo{display:block;width:100%;height:100%;pointer-events:none}
#photo[hidden]{display:none}
@media(max-width:600px){.tools{gap:4px}.image-modes{gap:6px 10px}.imagepane{position:static}}

.position-bar{display:flex;align-items:center;gap:7px 10px;flex-wrap:wrap;padding:8px 10px 0}
.position-bar label{font-weight:600}
#pixelPosition{font:14px/1.4 ui-monospace,monospace;width:29ch;max-width:100%;padding:4px 7px}
#positionHelp{font-size:12px;color:var(--muted)}
#canvas:focus-visible{outline:2px solid #e7c265;outline-offset:-2px}

#reportPicker:not([hidden]){display:flex;align-items:center;gap:8px;margin:0 0 10px;flex-wrap:wrap}
#reportPoint{max-width:100%}
#newCharacter:not([hidden]){padding:6px 12px 10px;background:#e8f0e9;border-block:1px solid var(--line)}
#newCharacter .fields{grid-template-columns:repeat(auto-fit,minmax(9em,1fr));margin:3px 0 6px}
#drawHelp{font-size:13px;margin:6px 0}.edit-tools{border-top:1px solid var(--line)}
#characterId{font-family:ui-monospace,monospace}.glyph.hit-only{stroke:none;fill:transparent;pointer-events:all}
#canvas.placing{cursor:crosshair}#canvas.placing .glyph{cursor:crosshair}
.sketch{stroke:#fbbd3e;fill:#fdcf5b;fill-opacity:.18;stroke-width:2;vector-effect:non-scaling-stroke}
.sketch-vertex{fill:#ffda75;stroke:#402a05;stroke-width:1;vector-effect:non-scaling-stroke}
#polygonEditor{margin:10px 0;padding:9px 0;border-block:1px solid var(--line)}
#attachBox,#geometryInfo,#ocrResult{margin:6px 0}
#ocrResult{font-size:14px;overflow-wrap:anywhere}
.glyph.role-excluded{stroke:#913f8b;stroke-dasharray:5 3;fill:#a65ca2;fill-opacity:.14;stroke-width:2}
.glyph.role-unassigned,.glyph.role-loose{stroke:#2467a8;stroke-dasharray:2 2;stroke-width:2}
.glyph.selected-part{stroke:#e35c09;stroke-width:3;fill:#ffc86c;fill-opacity:.28}
.glyph.selected-part.role-excluded{stroke:#913f8b;fill:#c972be;fill-opacity:.38}
.strip .strip-excluded{color:#783675}.strip .strip-loose,.strip .strip-unassigned{color:#245b92}
.strip .active.strip-excluded,.strip .active.strip-loose,.strip .active.strip-unassigned{color:white}
.sketch-start{fill:#ffe077;stroke:#583410;stroke-width:2;vector-effect:non-scaling-stroke}

.image-menu {
 position:fixed; z-index:12; width:max-content; max-width:calc(100vw - 12px);
 max-height:calc(100dvh - 12px); overflow:auto; overscroll-behavior:contain;
 padding:4px; border:1px solid #a9b3a5; border-radius:6px;
 background:var(--paper); color:var(--ink); box-shadow:0 4px 18px #192f2940;
}
.image-menu [role=group] + [role=group] {border-top:1px solid var(--line); margin-top:4px; padding-top:4px}
.image-menu .menu-heading {padding:4px 8px; font-size:12px; color:var(--muted); font-weight:600}
.image-menu button {display:block; width:100%; text-align:left; padding:5px 8px; border:0; background:transparent; font-size:14px}
.image-menu button:enabled:hover,.image-menu button:focus-visible {background:#dcebe1}
.image-menu button:focus-visible {outline:2px solid var(--jade); outline-offset:-2px}
.image-menu button:disabled {cursor:default}
.glyph.menu-target {stroke:#e35c09; stroke-width:3; fill:#ffc86c; fill-opacity:.31}
@media print {.image-menu {display:none}}

#stateFilters {gap:4px 12px}
#stateFilters .swatch {width:1rem;border-top:3px solid}
#stateFilters .unassigned {border-color:#2467a8;border-top-style:dotted}
#stateFilters .ambiguous {border-color:#a05c00;border-top-style:dashed}
#stateFilters .confident {border-color:#128d72}
#stateFilters .excluded {border-color:#913f8b;border-top-style:dashed}
#filterStatus:not(:empty) {padding:4px 10px}
.glyph.state-ambiguous {stroke:#a05c00;stroke-dasharray:5 2}
.glyph.state-confident:not(.selected) {stroke:#128d72}
.strip .strip-ambiguous:not(.active) {color:#8a5000}

.image-menu button[hidden] {display:none}
#readingPicker {width:min(60rem,96vw);max-width:96vw;max-height:92dvh;padding:0;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:8px}
#readingPicker[open] {display:flex;flex-direction:column}
#readingPicker::backdrop {background:#17231c70}
.reading-heading,.reading-footer {display:flex;align-items:center;gap:14px;padding:10px 16px}
.reading-heading {border-bottom:1px solid var(--line)}
#readingSpecimen {display:grid;place-items:center;width:6rem;height:5rem;flex:none;background:#eeeae0;border-radius:4px}
#readingSpecimen canvas,.example-frame canvas {display:block;width:100%;height:100%;object-fit:contain;min-width:0;min-height:0}
#readingTarget {font-family:ui-monospace,monospace}
.reading-intro {margin:8px 16px;font-size:.875rem}
#readingOptions {overflow:auto;overscroll-behavior:contain;min-height:0;padding:0 16px}
.reading-row {display:grid;grid-template-columns:7.5rem 1fr;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line)}
.reading-choice {justify-self:start;min-width:6.8rem;text-align:left;white-space:nowrap}
.reading-choice .gez {font-size:1.7rem;vertical-align:middle}
.reading-choice .score {font-size:.8rem}
.reading-examples {display:flex;flex-wrap:wrap;gap:8px}
.reading-examples figure {margin:0;width:5.6rem;max-width:100%}
.reading-examples figcaption {margin-top:2px;font:12px/1.3 ui-monospace,monospace;text-align:center}
.example-frame {height:4rem;display:grid;place-items:center;border-radius:3px;background:#eeeae0;text-align:center;font-size:.75rem;color:var(--muted)}
.reading-footer {flex-wrap:wrap;justify-content:space-between;border-top:1px solid var(--line)}
.reading-footer p {margin:0}
.reading-footer form {margin-left:auto}
#readingPages:not([hidden]) {display:flex;align-items:center;gap:8px}
@media(max-width:620px) {
 .reading-row {grid-template-columns:1fr;gap:6px}
 .reading-heading,.reading-footer {padding:8px 10px;gap:8px}
 #readingOptions {padding:0 10px}
 .reading-intro {margin:6px 10px}
 .reading-examples {gap:6px}
}
.image-modes label[hidden],.tools [hidden],nav [hidden] {display:none}

#ocrInput {width:min(64rem,96vw);max-width:96vw;max-height:92dvh;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:8px}
#ocrInput::backdrop {background:#17231c70}
#ocrInput figure {margin:12px 0}
#ocrInput form {margin-top:14px;text-align:right}
#ocrInput figcaption,#ocrInput summary {font-weight:600;margin:6px 0}
#ocrInput [hidden] {display:none}
#inputMessage:empty {display:none}
.input-scroll {overflow-x:auto}
.input-raster {width:max-content;max-width:100%}
#ocrInput.actual-pixels .input-raster {max-width:none}
.input-raster canvas {display:block;max-width:100%;height:auto}
#inputMarker {display:block;width:100%;fill:var(--jade)}

#lineHelp {margin:.35rem 0}
.line-band,.char-span {fill:none;vector-effect:non-scaling-stroke;stroke-width:1px;pointer-events:stroke}
.line-band {stroke:#1680a5;stroke-width:1.5px;cursor:pointer;pointer-events:all}
.line-band.current {stroke:#05465c;stroke-width:2px}
.band-label {fill:#063848;stroke:#fff4d9;paint-order:stroke;stroke-width:1.5px;font:bold 9px sans-serif;cursor:pointer}
.char-span {stroke:#076985;stroke-dasharray:2 3;pointer-events:none}
.char-span.current {stroke:#702567;stroke-width:2px;stroke-dasharray:none}
#cropHandles circle,#cropHandles rect {fill:#fff6d7;stroke:#03425a;stroke-width:1.7px;vector-effect:non-scaling-stroke}
#cropHandles g {cursor:grab}
#cropHandles g[data-handle="top"],#cropHandles g[data-handle="bottom"] {cursor:ns-resize}
#cropHandles g[data-handle="move"] {cursor:move}
.span-reading {font:9px sans-serif;fill:#03425a;stroke:#fff6d7;stroke-width:1.4px;paint-order:stroke;pointer-events:none}

.line-band.excluded {stroke:#913f8b;stroke-dasharray:6 3;fill:#a65ca2;fill-opacity:.12}
.line-band.menu-target {stroke:#b34813;stroke-width:3px}
