@font-face{font-family:Plex;src:url('/static/fonts/plex-regular.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}@font-face{font-family:Plex;src:url('/static/fonts/plex-semibold.ttf') format('truetype');font-style:normal;font-weight:600 800;font-display:swap}
:root{font-family:Plex,system-ui,sans-serif;color:#242724;background:#efefeb;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-width:320px}button,select,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed}.shell{max-width:1660px;margin:auto;padding:24px 36px 32px}.toolbar{display:flex;align-items:center;gap:10px;margin-bottom:18px}.toolbar-spacer{flex:1}.filename{color:#747b76;font-size:13px;max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload-action,.device-select,.primary{height:42px;border-radius:3px;padding:0 15px;font-size:13px}.upload-action{border:1px solid #c9cdc7;background:#f8f9f6;color:#303b34;font-weight:600}.upload-action:hover{background:#fff;border-color:#777e77}.device-select{border:1px solid #c9cdc7;background:#f8f9f6;color:#414a43}.primary{border:1px solid #263a31;background:#263a31;color:#fff;font-weight:600;min-width:135px}.primary:hover:not(:disabled){background:#385947}.primary:disabled{background:#9da79e;border-color:#9da79e;opacity:.7}.error{background:#fff2eb;color:#9c3d2c;border-left:3px solid #bf4e34;padding:11px 14px;margin:0 0 14px;font-size:13px}.progress-card{margin-bottom:16px}.progress-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px;gap:12px}.progress-title strong{font-size:13px;font-weight:600;color:#343f37}.progress-meta{font-size:12px;color:#778077}.stage-list{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.stage{display:flex;align-items:center;gap:9px;min-width:0;background:transparent;color:#7c827b;border:0;border-top:3px solid #cdd2ca;padding:10px 8px;text-align:left;font-size:13px}.stage:disabled{opacity:.7}.stage-dot{font-variant-numeric:tabular-nums;color:#9aa399;font-size:11px;min-width:17px}.stage.done{color:#3e5946;border-top-color:#859888}.stage.done .stage-dot{color:#5c8260}.stage.running{color:#aa4e31;border-top-color:#bd6649;font-weight:600}.stage.running .stage-dot{color:#aa4e31}.stage.selected{background:#e3e7df}.stage-spinner{width:11px;height:11px;border:2px solid #e4d4ca;border-top-color:#b85f40;border-radius:50%;animation:spin .8s linear infinite;margin-left:auto}@keyframes spin{to{transform:rotate(360deg)}}.panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1px;background:#c9cfc8;border:1px solid #c9cfc8;overflow:hidden}.panel{background:#fafbf8;min-width:0;height:clamp(520px,69vh,850px);display:flex;flex-direction:column;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:62px;padding:12px 17px;border-bottom:1px solid #e3e6e0}.panel-head h2{font-size:14px;font-weight:600;margin:0;color:#303b34}.line-count{font-size:12px;color:#9ba39b;font-weight:400;margin-left:8px}.controls{display:flex;align-items:center;gap:4px;white-space:nowrap}.controls button{background:transparent;border:1px solid transparent;color:#4f6154;padding:6px 8px;min-width:29px;font-size:12px;border-radius:3px}.controls button:hover:not(:disabled){border-color:#c9d2c8;background:#eff2ec}.controls button:disabled{opacity:.35}.controls span{color:#778278;font-size:11px;min-width:36px;text-align:center;font-variant-numeric:tabular-nums}.controls .fit-button{margin-left:5px;border-left:1px solid #dce2d9;border-radius:0;padding-left:13px}.image-scroll,.text-scroll{flex:1;min-height:0;overflow:auto}.image-scroll{background:#dedfd8;padding:18px;display:flex;align-items:flex-start;justify-content:safe center}.image-scroll.dragging{outline:2px dashed #ad6848;outline-offset:-7px;background:#eae3d9}.image-wrap{position:relative;flex:none;min-width:0;box-shadow:0 3px 15px #1d241c24;margin:0 auto}.image-wrap img{display:block;width:100%;height:auto}.image-wrap svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.mark{fill:#c7723b2e;stroke:#a65831;stroke-width:2;vector-effect:non-scaling-stroke}.mark.line{fill:#68a17220;stroke:#4b8556}.mark.order{fill:#6d86a92a;stroke:#577697}.mark.recognition{fill:#957aae24;stroke:#7b6397}.mark.selected{fill:#e76f3444;stroke:#c7461e;stroke-width:3}.animate-mark{animation:reveal .45s both}@keyframes reveal{from{opacity:0}to{opacity:1}}.empty-upload,.empty-text{margin:auto;text-align:center;color:#8b938a;font-size:13px;padding:30px 12px;line-height:1.6}.empty-upload strong,.empty-text strong{display:block;color:#434e45;font-size:14px;font-weight:600}.empty-upload p,.empty-text p{margin:7px 0 0}.upload-icon,.empty-icon{display:grid;place-items:center;margin:0 auto 16px;width:43px;height:43px;border:1px solid #b7c0b4;color:#536c57;font-size:23px}.upload-button{border:1px solid #405b46;background:transparent;color:#405b46;padding:9px 14px;font-size:12px;font-weight:600;margin-top:17px}.upload-button:hover{background:#e6ebe2}.empty-upload small{display:block;font-size:11px;margin-top:12px}.hidden{display:none}.text-scroll{background:#fff;display:flex}.line-list{width:100%;padding:20px 12px}.text-line{display:flex;gap:13px;width:100%;background:transparent;border:0;border-radius:2px;text-align:left;padding:6px 8px;color:#303731;line-height:1.7;font-size:inherit}.text-line:hover{background:#f3f4ee}.text-line.active{background:#eaf0e7;box-shadow:inset 2px 0 #6a8e70}.line-number{font-variant-numeric:tabular-nums;font-size:10px;color:#adb5ac;flex:0 0 28px;padding-top:6px;user-select:none}.panel-footer{min-height:42px;padding:9px 17px;border-top:1px solid #e3e6e0;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#919c91;font-size:11px}.panel-footer>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.downloads{display:flex;align-items:center;gap:14px;white-space:nowrap}.downloads a,.downloads button{border:0;background:none;padding:0;color:#496c51;text-decoration:none;font-weight:600;font-size:12px}.downloads a:hover,.downloads button:hover{text-decoration:underline}.dashboard{margin-top:16px;padding:14px 2px 0;border-top:1px solid #cfd4cc}.mini-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.mini-metric{display:flex;align-items:baseline;gap:9px;padding:0 18px;border-right:1px solid #d8ddd5;min-width:0}.mini-metric:first-child{padding-left:0}.mini-metric:last-child{border:0}.mini-name{font-size:12px;color:#747e74;white-space:nowrap}.mini-metric strong{font-size:14px;font-weight:600;color:#354f3a;white-space:nowrap;font-variant-numeric:tabular-nums}.mini-metric small{font-size:11px;color:#929c91;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history{margin-top:15px;border-top:1px solid #d9ded6;padding-top:12px;color:#657b68;font-size:12px}.history summary{cursor:pointer;font-weight:600}.history summary span{color:#9da99d;font-weight:400}.history-list{max-height:220px;overflow:auto;margin-top:10px}.history-row{display:flex;width:100%;align-items:center;gap:12px;border:0;border-top:1px solid #dfe4dc;background:transparent;text-align:left;padding:10px 4px;color:#556356;font-size:12px}.history-row:hover,.history-row.active{background:#e4eae1}.history-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-status{font-size:11px;color:#8b968a}.history-status.done{color:#5a825f}.history-status.running{color:#a05d3c}.history-status.error{color:#b54d3d}@media(max-width:1050px){.shell{padding:20px 22px}.mini-grid{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:12px}.mini-metric:nth-child(2){border:0}.mini-metric:nth-child(3){padding-left:0}}@media(max-width:700px){.shell{padding:14px 14px 24px}.toolbar{flex-wrap:wrap}.filename{max-width:40vw}.toolbar-spacer{min-width:0}.upload-action,.device-select,.primary{height:39px;font-size:12px}.primary{min-width:100px}.stage-list{grid-template-columns:repeat(2,1fr);row-gap:3px}.stage{padding:9px 6px}.panels{grid-template-columns:1fr}.panel{height:min(65vh,620px);min-height:400px}.panel-head{min-height:57px}.controls .fit-button{display:none}.progress-title strong{font-size:12px}.mini-grid{grid-template-columns:1fr 1fr}.mini-metric{padding:0 8px;flex-wrap:wrap}.mini-metric small{width:100%}.panel-footer>span{max-width:35%}.downloads{gap:9px}}
/* Тёплая бумага и холодные чернила: акцент только у действий и активного этапа. */
:root{color:#252d35;background:#f3f1ed}.upload-action,.device-select{background:#faf9f6;border-color:#d5d0c9;color:#34414a}.upload-action:hover{border-color:#7b8791}.primary{background:#26394a;border-color:#26394a}.primary:hover:not(:disabled){background:#3c5971}.primary:disabled{background:#a6adb2;border-color:#a6adb2}.filename,.progress-meta{color:#747e86}.progress-title strong{color:#2b3943}.stage{border-top-color:#d5d1ca;color:#737c82}.stage-dot{color:#8a969e}.stage.done{color:#435e70;border-top-color:#839aad}.stage.done .stage-dot{color:#557b93}.stage.running{color:#ad513a;border-top-color:#c5684d}.stage.running .stage-dot{color:#ad513a}.stage.selected{background:#e6e9e8}.panels{background:#ccc8c1;border-color:#ccc8c1}.panel{background:#fbfaf7}.panel-head{border-bottom-color:#e5e2dc}.panel-head h2{color:#2d3941}.image-scroll{background:#e1ddd5}.image-scroll.dragging{background:#eee6dc;outline-color:#bd6b51}.image-wrap{box-shadow:0 4px 18px #2e292324}.controls button{color:#536b7b}.controls button:hover:not(:disabled){border-color:#cdd3d4;background:#f0f2f1}.controls span{color:#7d8990}.empty-upload,.empty-text{color:#909896}.empty-upload strong,.empty-text strong{color:#45525a}.upload-icon,.empty-icon{border-color:#bec6c5;color:#536d7d}.upload-button{border-color:#49677b;color:#3f5d72}.upload-button:hover{background:#e7edef}.text-line{color:#28343c}.text-line:hover{background:#f6f5f2}.text-line.active{background:#e9eef0;box-shadow:inset 2px 0 #587f97}.line-number{color:#9ca6a7}.panel-footer{border-top-color:#e5e2dc}.downloads a,.downloads button{color:#446a82}.dashboard{border-top-color:#d5d1ca}.mini-metric{border-right-color:#dcd8d1}.mini-name{color:#6f7b81}.mini-metric strong{color:#344d5b}.mini-metric small{color:#8c9699}.history{border-top-color:#ddd8d1;color:#596f79}.history-row:hover,.history-row.active{background:#e8eceb}.history-status.done{color:#5c7d70}.history-status.running{color:#a36449}
.mode-note{font-size:12px;color:#956448;background:#f5ece5;border-left:2px solid #c57b59;padding:9px 12px;margin:0 0 12px}.precision-select{min-width:140px}@media(max-width:700px){.precision-select{min-width:0;flex:1}}
@media(max-width:700px){.toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px}.toolbar .upload-action{grid-column:1}.toolbar .filename{grid-column:2;max-width:none}.toolbar-spacer{display:none}.toolbar .device-select{width:100%;min-width:0}.toolbar .primary{grid-column:1/-1;width:100%}}
.playback{display:flex;gap:12px;align-items:center;min-width:0}.playback button{border:0;background:transparent;padding:0;color:#55778a;font-size:12px;font-weight:600;white-space:nowrap}.playback button:hover{text-decoration:underline}@media(max-width:500px){.panel-footer{flex-wrap:wrap}.playback{gap:8px}.playback button,.downloads a,.downloads button{font-size:11px}.downloads{gap:8px}}
.progress-rail{height:5px;position:relative;overflow:hidden;background:#e3e1dc;margin:10px 0 5px}.progress-fill{position:absolute;left:0;top:0;bottom:0;background:#587788;transition:width .7s ease}.progress-motion{position:absolute;top:0;bottom:0;width:18%;background:linear-gradient(90deg,transparent,#c0795f,transparent);animation:progress-sweep 2.2s ease-in-out infinite;opacity:.85}@keyframes progress-sweep{0%{transform:translateX(-110%)}100%{transform:translateX(660%)}}@media(prefers-reduced-motion:reduce){.progress-motion{animation:none;left:0}.animate-mark{animation:none}.progress-fill{transition:none}}
.image-scroll.space-held{cursor:grab;user-select:none}.image-scroll.panning{cursor:grabbing;user-select:none}.image-scroll:focus-visible{outline:2px solid #617f90;outline-offset:-2px}
/* Выбор документа — первое действие перед загрузкой страницы. */
.preset-section{margin:0 0 22px}.preset-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:16px}.preset-heading h1{margin:0;font-size:23px;letter-spacing:-.035em;font-weight:600;line-height:1.2;color:#182b3e}.preset-heading p{margin:6px 0 0;font-size:13px;color:#687988}.preset-caption{font-size:12px;font-weight:600;color:#697f90;white-space:nowrap}.preset-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.preset-option{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:7px;min-height:112px;padding:15px;border:1px solid #d8e0e7;border-radius:8px;background:#fff;color:#253c4e;transition:border-color .15s,background .15s;cursor:pointer}.preset-option:hover:not(:disabled){border-color:#879fb3;background:#f8fbfd}.preset-option.is-selected{border-color:#315d80;background:#edf4f9;box-shadow:inset 0 0 0 1px #315d80}.preset-option:focus-visible{outline:3px solid #80a9c6;outline-offset:2px}.preset-option:disabled:not(.is-selected){opacity:.52;cursor:not-allowed}.preset-name{font-size:13px;font-weight:600;line-height:1.3}.preset-description{font-size:11px;color:#6c7c89;line-height:1.35}.preset-model{margin-top:auto;font-size:10px;color:#87949e}.toolbar{margin-top:0}.primary{border-radius:6px}.upload-action{border-radius:6px}@media(max-width:950px){.preset-options{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:600px){.preset-options{grid-template-columns:repeat(2,minmax(0,1fr))}.preset-heading h1{font-size:19px}.preset-option{min-height:104px;padding:12px}.preset-caption{display:none}}

/* Документ и текст — главные элементы интерфейса. */
:root{color:#223348;background:#f2f5f7}
.shell{max-width:1600px;padding-top:30px}
.preset-section{margin-bottom:20px}
.preset-heading h1{color:#1c3244;letter-spacing:-.025em}
.preset-heading p{color:#65788a}
.preset-caption{color:#81909d;font-weight:400}
.preset-options{gap:0;border:1px solid #dce3e8;border-radius:9px;overflow:hidden;background:#fff}
.preset-option{min-height:104px;border:0;border-right:1px solid #e5ebef;border-radius:0;background:transparent;box-shadow:none;transition:background-color .16s ease}
.preset-option:last-child{border-right:0}
.preset-option.is-selected{border:0;border-right:1px solid #dce5eb;box-shadow:inset 0 -3px #3e6c87;background:#edf5f9}
.preset-option:hover:not(:disabled){background:#f3f8fa}
.preset-name{color:#243c4d;font-size:13px}
.preset-description{color:#607483}
.preset-model{color:#687f8e;font-size:10px}
.toolbar{margin-bottom:20px}
.upload-action{background:#fff;border-color:#c9d6df;color:#344f62;border-radius:7px}
.primary{background:#315d77;border-color:#315d77;border-radius:7px}
.primary:hover:not(:disabled){background:#24495f}
.progress-card{margin:0 0 22px;padding:16px 18px 9px;background:#fff;border:1px solid #dce5ea;border-radius:9px}
.progress-title{margin:0 0 12px}
.progress-title strong{font-size:13px;color:#253c4d}
.progress-meta{font-size:12px;color:#657b89;font-variant-numeric:tabular-nums}
.progress-rail{height:6px;border-radius:9px;background:#e7eef2;margin:0;overflow:hidden}
.progress-fill{border-radius:9px;background:#3e7998;transition:width .65s cubic-bezier(.2,.7,.2,1)}
.progress-fill.is-running{background:#3e7998}
.stage-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:9px -5px 0}
.stage,.stage.done,.stage.running{border:0;color:#6e8290;border-radius:5px;padding:7px 5px;font-size:12px;font-weight:400}
.stage:disabled{opacity:1}
.stage.done{color:#3f667b}
.stage.running{color:#285d79;font-weight:600}
.stage.selected{background:#edf5f8}
.stage-dot{display:grid;place-items:center;min-width:18px;width:18px;height:18px;border:1px solid #d0dde5;border-radius:50%;font-size:10px;color:#7d94a2}
.stage.done .stage-dot{border-color:#aac7d4;color:#3f7187}
.stage.running .stage-dot{border-color:#4a829d;color:#2e6a88}
.stage-spinner{width:10px;height:10px;border-color:#dbe8ee;border-top-color:#397590}
.panels{border:1px solid #d8e2e7;border-radius:9px;background:#d8e2e7}
.panel{background:#fff}
.panel-head{border-color:#e6edf1}
.panel-head h2{font-size:14px;color:#243c4d}
.image-scroll{background:#e8edef}
.image-wrap{box-shadow:0 4px 20px #263f501c}
.mark{fill:#4785a122;stroke:#4882a0}.mark.line{fill:#509e9b20;stroke:#478e8c}.mark.order{fill:#7188b520;stroke:#6d80a5}.mark.recognition{fill:#4e8aaf20;stroke:#4180a2}.mark.selected{fill:#edac5544;stroke:#c78327}
.animate-mark{animation:reveal .25s ease-out both}
.text-line{color:#263b49;border-radius:4px}.text-line:hover{background:#f4f8fa}.text-line.active{background:#e9f3f7;box-shadow:inset 3px 0 #4984a0}
.panel-footer{border-color:#e6edf1}
.downloads a,.downloads button,.playback button{color:#3c718d}
.dashboard{border-color:#dbe3e8}
.mini-metric{border-color:#dbe3e8}.mini-name{color:#637b8b}.mini-metric strong{color:#284d60}.mini-metric small{color:#6f8591}
.history{border-color:#dbe3e8;color:#4d6c7b}.history-row:hover,.history-row.active{background:#e9f1f4}
@media(max-width:950px){.preset-options{grid-template-columns:repeat(3,minmax(0,1fr))}.preset-option{border-bottom:1px solid #e5ebef}.preset-option:nth-child(3){border-right:0}.preset-option:nth-last-child(-n+2){border-bottom:0}}
@media(max-width:700px){.shell{padding-top:18px}.progress-card{padding:14px 13px 8px}.stage-list{grid-template-columns:repeat(4,minmax(0,1fr))}.stage{gap:4px;padding:7px 3px;font-size:11px}.stage-dot{width:16px;height:16px;min-width:16px}.stage-spinner{display:none}.panels{border-radius:8px}}
@media(max-width:600px){.preset-options{grid-template-columns:repeat(2,minmax(0,1fr))}.preset-option:nth-child(3){border-right:1px solid #e5ebef}.preset-option:nth-child(even){border-right:0}.preset-option:nth-last-child(2){border-bottom:1px solid #e5ebef}.preset-option:last-child{grid-column:1/-1;min-height:80px}.stage{font-size:10px}.stage-dot{display:none}}
@media(prefers-reduced-motion:reduce){.progress-fill{transition:none}.animate-mark,.stage-spinner{animation:none}}
.progress-fill.is-running{overflow:hidden}
.progress-fill.is-running::after{content:'';position:absolute;inset:0;width:25%;background:linear-gradient(90deg,transparent,#ffffff55,transparent);animation:line-glint 2.4s ease-in-out infinite}
@keyframes line-glint{from{transform:translateX(-120%)}to{transform:translateX(420%)}}
@media(prefers-reduced-motion:reduce){.progress-fill.is-running::after{animation:none;display:none}}
.progress-action{display:flex;align-items:center;gap:16px}
.progress-action .progress-rail{flex:1;min-width:0}
.progress-action .primary{height:38px;min-width:132px;flex:none}
.progress-card .stage-list{margin-top:4px;margin-right:148px}
.controls .replace-image{margin-right:8px;color:#3d7089;font-weight:600}
@media(max-width:700px){.progress-action{gap:10px}.progress-action .primary{height:36px;min-width:110px;font-size:12px}.progress-card .stage-list{margin-right:120px}.controls .replace-image{margin-right:2px}}
@media(max-width:480px){.progress-card .stage-list{margin-right:0}.progress-action .primary{min-width:104px}.controls .replace-image{font-size:11px}}
.controls .replace-image{border:1px solid #c9d9e2;background:#f4f9fb;border-radius:6px;padding:7px 10px;color:#315f77;white-space:nowrap}
.controls .replace-image:hover:not(:disabled){background:#e7f2f6;border-color:#91b0c0}
@media(max-width:480px){.controls .replace-image{font-size:11px;padding:6px}}
/* Manrope: локальный шрифт интерфейса с кириллицей. */
@font-face{font-family:Manrope;src:url('/static/fonts/manrope-variable.ttf') format('truetype');font-style:normal;font-weight:200 800;font-display:swap}
:root{font-family:Manrope,Plex,system-ui,sans-serif}
.preset-option{min-height:58px;justify-content:center;padding:12px 15px}
.preset-name{font-size:13px;line-height:1.35}
@media(max-width:600px){.preset-option,.preset-option:last-child{min-height:54px;padding:10px 12px}.preset-name{font-size:12px}}
/* Единая шкала: названия находятся на самой полосе. */
.progress-card{padding:14px 16px 16px}.progress-title{margin-bottom:10px}
.progress-action{gap:12px}.progress-track{position:relative;flex:1;min-width:0;height:42px;overflow:hidden;border-radius:7px;background:#eaf0f3}
.progress-track .progress-rail{position:absolute;inset:0;width:100%;height:100%;margin:0;background:transparent;border-radius:0}
.progress-track .progress-fill{background:#c5dde8;border-radius:0;transition:width 1.1s linear}
.progress-track .progress-fill.is-running{background:#c5dde8}
.progress-track .stage-list{position:relative;z-index:1;height:100%;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0}
.progress-track .stage{height:100%;padding:0 12px;border-radius:0;color:#526d7d;font-size:12px;background:transparent}
.progress-track .stage.running{color:#183d54;font-weight:600}
.progress-track .stage.selected{background:#ffffff44}
.progress-track .stage-dot{background:#ffffffac;border-color:#b5ccd6;color:#527080}
.progress-track .stage.done .stage-dot{background:#6e9db3;border-color:#6e9db3;color:white}
.progress-action .primary{height:42px}
.view-switch{display:flex;gap:3px;padding:7px 16px;border-bottom:1px solid #e6edf1;background:#fbfcfd}
.view-option{border:0;background:transparent;border-radius:5px;padding:6px 10px;color:#687f8d;font-size:12px;font-weight:600}
.view-option:hover{background:#eef4f6;color:#2c5870}.view-option.active{background:#e2eff4;color:#285a73}
.text-scroll{scrollbar-width:thin;scrollbar-color:#b7c7d0 transparent}
.result-body{width:100%;padding:20px 22px;line-height:1.8;color:#263b49;overflow-wrap:anywhere}
.result-block{margin:0 0 1.15em}.result-block.is-heading{font-weight:600}
.inline-line{display:inline;vertical-align:baseline;text-align:left;padding:0;border:0;background:transparent;border-radius:3px;color:inherit;line-height:inherit;font:inherit;white-space:pre-wrap}
.inline-line:hover{background:#eef5f8}.inline-line.active{background:#dcecf3;box-shadow:0 0 0 3px #dcecf3}
.markdown-body{font-family:ui-monospace,'DejaVu Sans Mono',monospace;font-size:.9em;line-height:1.8}
.markdown-marker{color:#56819a;font-weight:600}
@media(max-width:700px){.progress-card{padding:12px}.progress-action{gap:8px}.progress-track{height:38px}.progress-track .stage{padding:0 6px;gap:4px;font-size:11px}.progress-action .primary{height:38px}.view-switch{padding:6px 12px}}
@media(max-width:480px){.progress-track .stage{justify-content:center;font-size:10px;padding:0 3px}.progress-track .stage-dot{display:none}.progress-action .primary{min-width:98px}.result-body{padding:16px}}
@media(prefers-reduced-motion:reduce){.progress-track .progress-fill{transition:none}}
.progress-rail.pending::after{content:'';position:absolute;top:0;bottom:0;left:0;width:22%;background:linear-gradient(90deg,transparent,#bed9e5,transparent);animation:waiting-glide 2.4s ease-in-out infinite}
@keyframes waiting-glide{from{transform:translateX(-110%)}to{transform:translateX(470%)}}
@media(prefers-reduced-motion:reduce){.progress-rail.pending::after{display:none;animation:none}}
@font-face{font-family:DocumentSerif;src:url('/static/fonts/noto-serif-regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
.model-notice{margin:0 0 14px;color:#735f42;background:#f8f2e7;border:1px solid #ebdfca;border-radius:6px;padding:10px 14px;font-size:12px}
.editor{width:100%;padding:20px 22px}.editor-block{position:relative;display:flex;align-items:start;border-left:2px solid transparent;margin:0 0 12px;padding:2px 3px 2px 10px}.editor-block:focus-within,.editor-block.active{border-left-color:#6091a7;background:#f4f8fa}.editor-block textarea{display:block;flex:1;min-width:0;width:100%;padding:4px 0;border:0;outline:0;resize:none;overflow:hidden;background:transparent;color:#263b49;font-family:DocumentSerif,serif;font-size:inherit;line-height:1.8}.editor-anchor{position:absolute;top:0}.remove-block{opacity:0;background:transparent;border:0;color:#708793;font-size:20px;line-height:1;padding:6px;transition:opacity .15s}.editor-block:hover .remove-block,.editor-block:focus-within .remove-block,.remove-block:focus-visible{opacity:1}.add-block{border:1px solid #d8e3e8;border-radius:5px;background:#fff;color:#426f83;font-size:12px;padding:9px 12px}.add-block:hover{background:#f3f8fa}.save-status{font-size:11px;color:#728895;white-space:nowrap}@media(max-width:700px){.editor{padding:16px}.remove-block{opacity:1}}
/* Общая геометрия: крупные поверхности и компактные элементы управления. */
:root{--radius-s:8px;--radius-l:12px}
.progress-card,.panels{border-radius:var(--radius-l)}
.progress-track,.primary,.upload-action,.controls button,.controls .replace-image,.upload-button,.add-block,.model-notice,.error{border-radius:var(--radius-s)}
.empty-icon,.upload-icon{border-radius:var(--radius-l)}
.editor-block{border-radius:var(--radius-s)}
.remove-block{border-radius:var(--radius-s)}
button:focus-visible,a:focus-visible,textarea:focus-visible{outline:2px solid #4d83a0;outline-offset:2px}
.editor-block textarea:focus-visible{outline:none}
@media(max-width:700px){.panels{border-radius:var(--radius-l)}}

.llm-setting{display:flex;align-items:center;gap:16px;margin:0 0 14px;padding:2px 1px;flex-wrap:wrap}.llm-label{display:flex;align-items:center;gap:9px;color:#2d4c5e;font-size:13px;font-weight:600;cursor:pointer}.llm-label input{position:absolute;opacity:0;width:1px;height:1px}.llm-switch{width:38px;height:22px;border-radius:11px;background:#c5d1d7;position:relative;transition:background .18s}.llm-switch:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .18s}.llm-label input:checked+.llm-switch{background:#397590}.llm-label input:checked+.llm-switch:after{transform:translateX(16px)}.llm-label input:focus-visible+.llm-switch{outline:2px solid #4d83a0;outline-offset:3px}.llm-label input:disabled+.llm-switch{opacity:.55}.llm-note{font-size:12px;color:#6b7f8a}

.document-editor{display:block;flex:1;width:100%;min-width:0;min-height:100%;padding:22px;border:0;outline:0;resize:none;background:#fff;color:#263b49;font-family:DocumentSerif,serif;font-size:inherit;line-height:1.8;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}.document-editor:focus-visible{outline:2px solid #77a3b7;outline-offset:-2px}@media(max-width:700px){.document-editor{padding:16px}}

.typing-result{width:100%;padding:22px;color:#263b49;font-family:DocumentSerif,serif;font-size:inherit;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}.typing-caret{display:inline-block;width:2px;height:1.05em;margin-left:2px;background:#4d83a0;vertical-align:-.15em;animation:typing-blink 1s steps(2,start) infinite}@keyframes typing-blink{50%{opacity:0}}@media(max-width:700px){.typing-result{padding:16px}}@media(prefers-reduced-motion:reduce){.typing-caret{animation:none}}

.order-legend{font-size:11px;color:#708793;white-space:nowrap;margin-left:auto}

.controls .markup-toggle{border:1px solid #d4e0e6;background:#fff;border-radius:8px;padding:7px 10px;color:#5c7582;font-weight:600}.controls .markup-toggle.is-on{background:#edf5f8;border-color:#bcd3de;color:#315f77}.new-document-bar{display:flex;justify-content:center;padding:18px 0 0}.new-document{border:1px solid #b9cdd7;border-radius:8px;background:#fff;color:#315f77;padding:10px 17px;font-weight:600;font-size:13px}.new-document:hover:not(:disabled){background:#edf5f8}.new-document:disabled{opacity:.5}.region-outline{fill:transparent;stroke:#718b98;stroke-width:2;stroke-dasharray:6 4}.mark.recognition{fill:#4e8aaf0c;stroke:#8eaab5;stroke-width:1.3}.mark.recognition.recognized{fill:#4e8aaf30;stroke:#4180a2}.mark.recognition.active-word{fill:#edac5566;stroke:#ba711d;stroke-width:3;animation:word-pulse .5s ease-out both}@keyframes word-pulse{0%{fill:#edac55aa}100%{fill:#edac5566}}@media(prefers-reduced-motion:reduce){.mark.recognition.active-word{animation:none}}@media(max-width:600px){.controls .markup-toggle{font-size:10px;padding:6px}.new-document-bar{padding-top:12px}}

/* Result actions and a quiet, color-preserving recognition highlight. */
.result-footer{justify-content:flex-end;min-height:52px}.result-footer .downloads{gap:6px}.result-footer .downloads a,.result-footer .downloads button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid transparent;border-radius:8px;color:#4d7183;background:transparent;text-decoration:none;transition:background-color .18s,border-color .18s,color .18s}.result-footer .downloads a:hover,.result-footer .downloads button:hover{background:#edf5f8;border-color:#d5e5ec;color:#285a71;text-decoration:none}.result-footer .downloads a:focus-visible,.result-footer .downloads button:focus-visible{outline:2px solid #4a819a;outline-offset:2px}.mark.recognition,.mark.recognition.recognized,.mark.recognition.active-word{stroke-width:1.6;transition:fill .28s ease,stroke .28s ease,stroke-width .28s ease}.mark.recognition.active-word{stroke-width:2.5;animation:none}.error button{margin-left:12px;border:0;background:transparent;color:inherit;text-decoration:underline}.typing-caret{transition:opacity .2s ease}@media(prefers-reduced-motion:reduce){.mark.recognition,.mark.recognition.recognized,.mark.recognition.active-word{transition:none}}

.document-editor:focus-visible{outline:none}

/* A single, continuous track with four readable stages. */
.progress-card{padding:16px 18px 18px;background:#fff;border:1px solid #dce6eb}
.progress-title{margin-bottom:12px}.progress-title strong{font-size:13px;color:#294759}.progress-meta{font-size:12px;color:#718996}
.progress-action{align-items:stretch;gap:10px}.progress-track{height:46px;background:#edf3f5;border:1px solid #dbe8ed;border-radius:8px}
.progress-track .progress-rail{inset:0;height:100%;overflow:hidden}
.progress-track .progress-fill,.progress-track .progress-fill.is-running{background:linear-gradient(90deg,#dceef3,#b8d9e6);transition:width 1.1s linear}
.progress-track .stage-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.progress-track .stage{position:relative;justify-content:center;gap:0;border:0;border-right:1px solid #b9d0da78;padding:0 8px;background:transparent;color:#7b909a;font-size:12px;font-weight:500;transition:color .2s,background-color .2s}
.progress-track .stage:last-child{border-right:0}.progress-track .stage:disabled{opacity:1}.progress-track .stage.done{color:#456c7d}.progress-track .stage.running{color:#173f54;font-weight:700}
.progress-track .stage.running::after{content:'';position:absolute;bottom:5px;left:calc(50% - 10px);width:20px;height:2px;border-radius:2px;background:#3d809d}
.progress-track .stage.selected{background:#ffffff42;color:#234e63}.progress-track .stage:not(:disabled):hover{background:#ffffff70}.progress-track .stage:focus-visible{outline:2px solid #4d83a0;outline-offset:-3px}
.progress-action .primary{height:46px;min-width:140px}
.image-wrap img{user-select:none;-webkit-user-drag:none}
@media(max-width:700px){.progress-card{padding:13px}.progress-track{height:42px}.progress-track .stage{font-size:11px;padding:0 3px}.progress-action .primary{height:42px;min-width:110px}}
@media(max-width:480px){.progress-action{flex-direction:column}.progress-track{flex:none;width:100%;height:44px}.progress-track .stage{font-size:10px}.progress-action .primary{width:100%;height:40px}}
@media(prefers-reduced-motion:reduce){.progress-track .progress-fill{transition:none}.progress-track .stage{transition:none}}
@media(max-width:700px){.progress-action{flex-direction:column}.progress-track{flex:none;width:100%;height:44px}.progress-track .stage{font-size:10px}.progress-action .primary{width:100%;height:40px}}

.mark.line,.mark.order{transition:fill .45s ease,stroke .45s ease}
@media(prefers-reduced-motion:reduce){.mark.line,.mark.order{transition:none!important}}

/* Larger controls and one even progress fill, including the optional LLM step. */
.llm-setting{justify-content:flex-end;margin-bottom:17px}.llm-label{font-size:15px;gap:11px}.llm-switch{width:44px;height:25px;border-radius:13px}.llm-switch:after{width:19px;height:19px}.llm-label input:checked+.llm-switch:after{transform:translateX(19px)}
.progress-card{padding:19px 21px 21px}.progress-title{margin-bottom:14px}.progress-title strong{font-size:15px}.progress-meta{font-size:14px}.progress-track{height:54px}.progress-track .progress-fill,.progress-track .progress-fill.is-running{background:#bddce8}.progress-track .stage{font-size:14px}.progress-track .stage.selected{background:transparent;box-shadow:inset 0 -3px #568da3}.progress-track .stage:not(:disabled):hover{background:#ffffff2b}.progress-track .stage:last-child{animation:stage-enter .25s ease-out both}@keyframes stage-enter{from{opacity:0}to{opacity:1}}.progress-action .primary{height:54px;min-width:158px;font-size:15px}
.panel-head{min-height:72px;padding:14px 20px}.panel-head h2{font-size:17px}.controls button{font-size:14px;padding:7px 10px}.controls span{font-size:13px}.controls .markup-toggle{font-size:14px;padding:8px 12px}.panel-footer{min-height:50px;padding:10px 20px;font-size:13px}.result-footer .downloads a,.result-footer .downloads button{width:42px;height:42px}.new-document{font-size:15px;padding:12px 20px}.empty-upload,.empty-text{font-size:15px}.empty-upload strong,.empty-text strong{font-size:17px}.upload-button{font-size:14px;padding:11px 17px}
.image-scroll{scrollbar-width:thin;scrollbar-color:#b7c7d0 transparent}.image-scroll::-webkit-scrollbar,.text-scroll::-webkit-scrollbar{width:8px;height:8px}.image-scroll::-webkit-scrollbar-thumb,.text-scroll::-webkit-scrollbar-thumb{background:#b7c7d0;border:2px solid transparent;border-radius:8px;background-clip:padding-box}.image-scroll::-webkit-scrollbar-track,.text-scroll::-webkit-scrollbar-track{background:transparent}
@media(max-width:700px){.progress-card{padding:15px}.progress-track{height:48px}.progress-track .stage{font-size:11px;padding:0 2px}.progress-action .primary{height:46px}.panel-head{min-height:65px;padding:12px 14px}.panel-head h2{font-size:15px}.controls .markup-toggle{font-size:11px;padding:7px}.llm-label{font-size:13px}}
@media(prefers-reduced-motion:reduce){.progress-track .stage:last-child{animation:none}}
@media(max-width:700px){.progress-track .stage-label{overflow-wrap:anywhere;line-height:1.2;text-align:center}}

.progress-track .stage.selected{box-shadow:none}.progress-track .stage.running::after{display:none}.progress-track .stage.selected .stage-label{color:#163f53;font-weight:700;animation:stage-pulse 2.6s ease-in-out infinite}@keyframes stage-pulse{0%,100%{opacity:1}50%{opacity:.58}}
.text-morph{display:grid;width:100%;padding:22px;color:#263b49;font-family:DocumentSerif,serif;font-size:inherit;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}.morph-old,.morph-new{grid-area:1/1;min-width:0}.morph-old{animation:ocr-old-fade .85s ease forwards}.morph-new{animation:ocr-new-fade .85s ease forwards}@keyframes ocr-old-fade{0%,15%{opacity:1}70%,100%{opacity:0}}@keyframes ocr-new-fade{0%,25%{opacity:0}100%{opacity:1}}@media(max-width:700px){.text-morph{padding:16px}}@media(prefers-reduced-motion:reduce){.progress-track .stage.selected .stage-label,.morph-old,.morph-new{animation:none}}
.progress-track .stage::after{display:none}

/* Matching empty states and clear, generous result actions. */
.empty-upload,.empty-text{max-width:320px;color:#77909d}.empty-upload strong,.empty-text strong{color:#294b5d;letter-spacing:-.015em}.empty-upload p,.empty-text p,.empty-upload small{color:#7b929d;font-size:13px}
.upload-icon,.empty-icon{display:grid;place-items:center;width:76px;height:76px;margin:0 auto 20px;border:1px solid #d2e2e9;border-radius:18px;background:#f6fafb;color:#5b91a8}.upload-icon svg,.empty-icon svg{display:block}
.upload-button{margin-top:18px;border:1px solid #b6d1dd;border-radius:8px;background:#fff;color:#356b83;font-weight:650}.upload-button:hover{background:#eaf4f7;border-color:#88b0c1}
.controls .fit-button{display:inline-flex;align-items:center;margin-left:5px;padding:7px 10px;border:1px solid #d4e0e6;border-radius:8px;background:#fff;color:#4d7183;font-weight:600}.controls .fit-button:hover:not(:disabled){background:#edf5f8;border-color:#b8d1dd}.controls .fit-button:disabled{opacity:.4}
.result-footer{min-height:102px}.result-footer .downloads{gap:10px}.result-footer .downloads button{width:84px;height:84px;border-radius:12px}.result-footer .downloads svg{width:40px;height:40px}
@media(max-width:700px){.panel-head .controls{flex-wrap:wrap;justify-content:flex-end;min-width:0;row-gap:3px}.controls .fit-button{display:inline-flex;font-size:11px;padding:6px 8px}.result-footer{min-height:92px}.result-footer .downloads button{width:76px;height:76px}.result-footer .downloads svg{width:36px;height:36px}}

.result-footer{min-height:50px}.panels.has-result .panel-footer{min-height:102px}@media(max-width:700px){.panels.has-result .panel-footer{min-height:92px}}

/* Compact labelled actions, with feedback after interaction. */
.panels.has-result .panel-footer{min-height:64px}.result-footer .downloads{gap:8px}.result-footer .downloads button{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:auto;height:44px;padding:0 13px;border:1px solid #d9e6ec;border-radius:8px;background:#fff;color:#416d80;font-size:13px;font-weight:650;transition:transform .15s ease,background-color .2s,border-color .2s,color .2s}.result-footer .downloads svg{width:19px;height:19px;flex:none}.result-footer .downloads button:hover{background:#edf5f8;border-color:#b8d1dd}.result-footer .downloads button:active{transform:scale(.96)}.result-footer .downloads button.is-confirmed{background:#e4f2f3;border-color:#a6d1cd;color:#276e69;animation:action-confirm .35s ease-out}@keyframes action-confirm{0%{transform:scale(.96)}70%{transform:scale(1.025)}100%{transform:scale(1)}}
@media(max-width:700px){.panels.has-result .panel-footer{min-height:62px}.result-footer .downloads button{width:auto;height:42px;padding:0 11px}.result-footer .downloads svg{width:19px;height:19px}}
@media(prefers-reduced-motion:reduce){.result-footer .downloads button{transition:none}.result-footer .downloads button.is-confirmed{animation:none}}
/* Show both processing and the stage selected for inspection. */
.progress-track .stage.selected{box-shadow:inset 0 -3px #397e9a}
.progress-track .stage.running:not(.selected)::after{display:block;bottom:0;left:calc(50% - 11px);width:22px;height:3px;background:#397e9a}
/* One centered indicator grows smoothly when a stage becomes selected. */
.progress-track .stage.selected{box-shadow:none}
.progress-track .stage::after,.progress-track .stage.running::after,.progress-track .stage.running:not(.selected)::after{content:'';display:block;position:absolute;left:0;right:0;bottom:0;width:100%;height:3px;border-radius:3px;background:#397e9a;opacity:0;transform:scaleX(0);transform-origin:center;transition:transform .35s ease,opacity .2s ease}
.progress-track .stage.running:not(.selected)::after{opacity:1;transform:scaleX(.16)}
.progress-track .stage.selected::after,.progress-track .stage.running.selected::after{opacity:1;transform:scaleX(1)}
@media(prefers-reduced-motion:reduce){.progress-track .stage::after,.progress-track .stage.running::after,.progress-track .stage.running:not(.selected)::after{transition:none}}

/* Interface tokens: ink, paper and restrained blue actions. */
:root{
  --ui-canvas:#f2f5f7;--ui-surface:#fff;--ui-image:#e8edef;
  --ui-ink:#243c4d;--ui-muted:#526b78;--ui-accent:#315f77;--ui-accent-hover:#244f64;
  --ui-fill:#bddce8;--ui-track:#edf3f5;--ui-border:#d5e3e9;--ui-focus:#245d76;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;
  --control-height:44px;--control-radius:8px;--surface-radius:12px;
}
:root{color:var(--ui-ink);background:var(--ui-canvas)}
.shell{padding:var(--space-6) 36px 32px}.llm-setting{gap:var(--space-4);margin-bottom:var(--space-4)}
.progress-card{background:var(--ui-surface);border-color:var(--ui-border);border-radius:var(--surface-radius);padding:var(--space-5);margin-bottom:var(--space-5)}
.progress-title{margin-bottom:var(--space-3)}.progress-title strong,.panel-head h2{color:var(--ui-ink)}.progress-meta,.controls span,.panel-footer,.order-legend{color:var(--ui-muted)}
.progress-action{gap:var(--space-3)}.progress-track{background:var(--ui-track);border-color:var(--ui-border);border-radius:var(--control-radius)}
.progress-track .progress-fill,.progress-track .progress-fill.is-running{background:var(--ui-fill)}
.progress-track .stage{color:#355b6d}.progress-track .stage.done{color:#355b6d}.progress-track .stage.running,.progress-track .stage.selected{color:#244f64}
.progress-track .stage.selected .stage-label{color:#163f53;animation:stage-ink 2.6s ease-in-out infinite}
@keyframes stage-ink{0%,100%{color:#163f53}50%{color:#355b6d}}
.progress-track .stage::after,.progress-track .stage.running::after,.progress-track .stage.running:not(.selected)::after{background:var(--ui-accent)}
.progress-track .stage:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}
.document-editor:focus-visible{outline:none;box-shadow:inset 0 -3px var(--ui-focus)}
.primary{background:var(--ui-accent);border-color:var(--ui-accent);color:#fff;border-radius:var(--control-radius)}.primary:hover:not(:disabled){background:var(--ui-accent-hover);border-color:var(--ui-accent-hover)}
.panel,.progress-card{background:var(--ui-surface)}.panels{border-color:var(--ui-border);background:var(--ui-border);border-radius:var(--surface-radius)}.panel-head{border-color:#e2ebef;padding:var(--space-3) var(--space-5);gap:var(--space-3)}.panel-footer{border-color:#e2ebef;padding:var(--space-2) var(--space-5);gap:var(--space-2)}
.image-scroll{background:var(--ui-image)}.text-scroll,.document-editor{background:var(--ui-surface)}
.controls{gap:var(--space-1)}.controls button{min-height:40px;min-width:36px;color:#315f77;border-radius:var(--control-radius)}
.controls .markup-toggle,.controls .fit-button,.upload-button,.new-document,.result-footer .downloads button{border-radius:var(--control-radius);color:var(--ui-accent)}
.controls .markup-toggle{min-height:40px}.controls .markup-toggle.is-on{color:#244f64;background:#e8f3f7;border-color:#a3c6d4}
.upload-button,.new-document{min-height:var(--control-height)}.new-document-bar{padding-top:var(--space-5)}
.result-footer .downloads{gap:var(--space-2)}.result-footer .downloads button{min-height:var(--control-height);color:var(--ui-accent)}.result-footer .downloads button.is-confirmed{color:#245c5a}
.empty-upload p,.empty-text p,.empty-upload small{color:var(--ui-muted)}.empty-text p{margin-top:var(--space-2)}
.llm-label{color:var(--ui-ink);gap:var(--space-2)}.llm-switch{background:#547482}.llm-label input:checked+.llm-switch{background:var(--ui-accent)}
.llm-switch:after{content:'–';display:grid;place-items:center;color:#355b6d;font-size:12px;font-weight:700;line-height:1}
.llm-label input:checked+.llm-switch:after{content:'✓';color:#244f64}
.llm-label input:focus-visible+.llm-switch{outline:2px solid var(--ui-focus);outline-offset:3px}
.image-scroll:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
@media(max-width:700px){.shell{padding:var(--space-4)}.progress-card{padding:var(--space-4)}.panel-head{padding:var(--space-3)}.panel-footer{padding:var(--space-2) var(--space-3)}.controls button,.controls .markup-toggle{min-height:40px}}
@media(prefers-reduced-motion:reduce){.progress-track .stage.selected .stage-label{animation:none}}
.image-scroll,.text-scroll{scrollbar-color:#5d7b89 transparent}
.image-scroll::-webkit-scrollbar-thumb,.text-scroll::-webkit-scrollbar-thumb{background-color:#5d7b89}
/* Administrative workspace uses the same spacing, ink and blue action tokens. */
.admin-shell{max-width:1660px;margin:auto;padding:24px 36px 0}.admin-shell>.shell{padding:0 0 32px}.admin-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px;border-bottom:1px solid var(--ui-border)}.admin-tabs,.admin-header-actions{display:flex;align-items:center;gap:8px}.admin-tabs button,.admin-header-actions button,.admin-header-actions a{min-height:44px;padding:0 14px;border:0;border-radius:8px;background:transparent;color:var(--ui-muted);font-size:14px;font-weight:650;text-decoration:none;display:inline-flex;align-items:center}.admin-tabs button.is-selected{color:var(--ui-accent);background:#e4f0f5;box-shadow:inset 0 -3px var(--ui-accent)}.admin-tabs button:hover,.admin-header-actions button:hover,.admin-header-actions a:hover{background:#eaf3f7;color:var(--ui-accent)}
.admin-dashboard{margin-bottom:20px}.admin-dashboard-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 12px}.admin-dashboard-heading h1{margin:0;color:var(--ui-ink);font-size:19px;letter-spacing:-.02em}.admin-dashboard-heading span,.admin-loading{font-size:12px;color:var(--ui-muted)}.admin-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.admin-metric{display:flex;flex-direction:column;gap:8px;min-width:0;padding:16px;background:#fff;border:1px solid var(--ui-border);border-radius:12px}.admin-metric>span{font-size:12px;color:var(--ui-muted);font-weight:650}.admin-metric strong{font-size:26px;line-height:1;color:var(--ui-ink);font-variant-numeric:tabular-nums}.admin-metric small{color:var(--ui-muted);font-size:11px;line-height:1.4}.admin-mode-row{display:flex;align-items:center;gap:12px;margin-bottom:16px}.admin-mode-label{font-size:13px;font-weight:650;color:var(--ui-ink)}.admin-mode-switch{display:flex;gap:4px;background:#e9f1f4;border:1px solid var(--ui-border);border-radius:9px;padding:4px}.admin-mode-switch button{min-height:36px;padding:0 13px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--ui-muted);font-size:13px;font-weight:650}.admin-mode-switch button.is-selected{background:#fff;border-color:#bed4de;color:var(--ui-accent);box-shadow:0 1px 3px #244f6412}.admin-mode-switch button:disabled{opacity:.7}
.admin-auth{min-height:100vh;display:grid;place-items:center;padding:24px}.admin-login{display:flex;flex-direction:column;width:min(100%,420px);gap:12px;padding:28px;background:#fff;border:1px solid var(--ui-border);border-radius:12px}.admin-login-icon{display:grid;place-items:center;width:44px;height:44px;border:1px solid #cfe1e8;border-radius:12px;background:#edf6f9;color:var(--ui-accent);font-size:22px}.admin-login h1{margin:0;color:var(--ui-ink);font-size:22px;letter-spacing:-.025em}.admin-login p{margin:0 0 8px;color:var(--ui-muted);font-size:14px;line-height:1.5}.admin-login label{font-size:13px;color:var(--ui-ink);font-weight:650}.admin-login input{width:100%;height:46px;padding:0 12px;border:1px solid #aec9d5;border-radius:8px;color:var(--ui-ink);font:inherit}.admin-login input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.admin-login .primary{height:46px}.admin-login>a{align-self:center;padding:8px;color:var(--ui-accent);font-size:13px;text-decoration:none}.admin-login>a:hover{text-decoration:underline}.admin-login .error{margin:0}
@media(max-width:1000px){.admin-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:700px){.admin-shell{padding:16px 16px 0}.admin-header{align-items:flex-start;flex-wrap:wrap;margin-bottom:20px}.admin-header-actions{margin-left:auto}.admin-tabs button,.admin-header-actions button,.admin-header-actions a{padding:0 9px;font-size:12px}.admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-dashboard-heading{align-items:flex-start;flex-direction:column;gap:4px}.admin-metric{padding:13px}.admin-metric strong{font-size:23px}.admin-mode-row{flex-wrap:wrap}}

.original-footer{justify-content:flex-start;min-width:0}.original-footer .markup-toggle{flex:none;min-height:40px;padding:7px 12px;border:1px solid #b8d1dd;border-radius:var(--control-radius);background:#fff;color:var(--ui-accent);font-size:13px;font-weight:650}.original-footer .markup-toggle.is-on{background:#e8f3f7;border-color:#a3c6d4;color:#244f64}.original-footer .markup-toggle:hover{background:#e1f0f6}.original-footer .original-filename{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ui-muted)}@media(max-width:700px){.original-footer .markup-toggle{font-size:12px;padding:7px 10px}}

.original-footer .markup-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 13px;border-color:#d9e6ec;background:#fff;color:var(--ui-accent);transition:transform .15s ease,background-color .2s,border-color .2s,color .2s}.original-footer .markup-toggle svg{width:19px;height:19px;flex:none}.original-footer .markup-toggle.is-on{background:#e8f3f7;border-color:#a3c6d4;color:#244f64}.original-footer .markup-toggle:hover{background:#edf5f8;border-color:#b8d1dd}.original-footer .markup-toggle:active{transform:scale(.96)}@media(max-width:700px){.original-footer .markup-toggle{min-height:42px;padding:0 11px}}@media(prefers-reduced-motion:reduce){.original-footer .markup-toggle{transition:none}}
.original-footer .original-filename{order:0;flex:1}
.original-footer .markup-toggle{order:1;margin-left:auto}

/* Keep the initial reveal animation unchanged while recognition highlights move. */
.mark.recognition.active-word{animation:reveal .25s ease-out both}
@media(prefers-reduced-motion:reduce){.mark.recognition.active-word{animation:none}}

.new-document{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--ui-accent);border-color:var(--ui-accent);color:#fff;transition:background-color .2s,transform .15s}.new-document svg{width:19px;height:19px;flex:none}.new-document:hover:not(:disabled){background:var(--ui-accent-hover);border-color:var(--ui-accent-hover);color:#fff}.new-document:active:not(:disabled){transform:scale(.98)}@media(prefers-reduced-motion:reduce){.new-document{transition:none}}
/* Action feedback uses the same blue as the markup control. */
.result-footer .downloads button.is-confirmed,.result-footer .downloads button.is-confirmed:hover{background:#edf5f8;border-color:#b8d1dd;color:var(--ui-accent)}
/* The image viewport and the editable text use the same scrollbar. */
.image-scroll,.text-scroll,.document-editor{scrollbar-width:thin;scrollbar-color:#5d7b89 transparent}
.image-scroll::-webkit-scrollbar,.text-scroll::-webkit-scrollbar,.document-editor::-webkit-scrollbar{width:8px;height:8px}
.image-scroll::-webkit-scrollbar-thumb,.text-scroll::-webkit-scrollbar-thumb,.document-editor::-webkit-scrollbar-thumb{background:#5d7b89;border:2px solid transparent;border-radius:8px;background-clip:padding-box}
.image-scroll::-webkit-scrollbar-track,.text-scroll::-webkit-scrollbar-track,.document-editor::-webkit-scrollbar-track{background:transparent}
.image-scroll,.text-scroll,.document-editor{scrollbar-width:auto}
.image-scroll::-webkit-scrollbar,.text-scroll::-webkit-scrollbar,.document-editor::-webkit-scrollbar{width:14px;height:14px}

/* The workspace fills the available screen; its two panels share a height. */
.shell{min-height:100dvh;display:flex;flex-direction:column}.shell>main{display:flex;flex-direction:column;flex:1;min-height:0}.panels{flex:1;min-height:420px;align-items:stretch}.panel{height:auto;min-height:0}.admin-shell>.shell{min-height:0}.admin-shell .panels{min-height:520px}
.document-editor:focus-visible{outline:none;box-shadow:none}
.original-footer{justify-content:flex-end;gap:8px}.original-footer .original-filename{order:0;flex:1 1 0;min-width:0}.original-footer .new-document{order:1;flex:none;min-height:44px;padding:0 13px;font-size:13px}.original-footer .markup-toggle{order:2;margin-left:0}
@media(max-width:1100px) and (min-width:701px){.original-footer{flex-wrap:wrap}.original-footer .original-filename{flex-basis:100%;order:0}.original-footer .new-document{order:1}.original-footer .markup-toggle{order:2}}
@media(max-width:700px){.shell{min-height:100dvh}.panels{flex:none;min-height:0}.panel{height:min(65vh,620px);min-height:400px}.original-footer{flex-wrap:wrap}.original-footer .original-filename{flex-basis:100%;order:0}.original-footer .new-document{order:1;min-height:42px;padding:0 11px;font-size:12px}.original-footer .markup-toggle{order:2}.admin-shell>.shell{min-height:0}.admin-shell .panels{min-height:0}}
@media(max-width:390px){.original-footer .new-document{flex:1;min-width:0;line-height:1.25}.original-footer .markup-toggle{flex:0 0 auto}}
@media(min-width:701px){.shell{height:100dvh}.panels{grid-template-rows:minmax(0,1fr)}.admin-shell>.shell{height:auto}}
@media(max-width:700px){.panels{grid-template-rows:none}}
@media(max-width:1100px){.original-footer{align-items:stretch}.original-footer .original-filename{align-self:center}.original-footer .new-document{flex:1 1 0;min-width:0;line-height:1.2;padding:5px 8px;white-space:normal}.original-footer .markup-toggle{flex:0 0 auto}}
.shell{padding-bottom:48px}.admin-shell>.shell{padding-bottom:48px}
@media(max-width:1100px){.original-footer .original-filename{max-width:none}}
@media(max-width:700px){.shell{padding-bottom:32px}.admin-shell>.shell{padding-bottom:32px}}
.original-footer .markup-toggle{order:1}.original-footer .new-document{order:2}

/* Place the optional enhancement beside the progress status. */
.progress-title{gap:12px;align-items:center}.progress-heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:18px}.progress-meta{white-space:nowrap}.progress-title .llm-label{min-height:42px;padding:7px 11px;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#f7fafb;font-size:13px;transition:background-color .18s,border-color .18s}.progress-title .llm-label:hover{background:#edf5f8;border-color:#b8d1dd}.progress-title .llm-label:has(input:disabled){cursor:not-allowed;opacity:.7}.progress-title .llm-switch{flex:none}
@media(max-width:700px){.progress-title{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.progress-heading-actions{display:contents}.progress-title .llm-label{grid-column:1/-1;justify-content:space-between;flex-direction:row-reverse}.progress-title .llm-label span:last-child{flex:1}}
@media(prefers-reduced-motion:reduce){.progress-title .llm-label{transition:none}}

/* Compact touch workspace and service-wide LLM control. */
.mobile-panel-tabs,.camera-button{display:none}.admin-setting{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:12px;padding:16px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:var(--surface-radius)}.admin-setting strong{font-size:14px;color:var(--ui-ink)}.admin-setting p{margin:4px 0 0;font-size:12px;color:var(--ui-muted)}.admin-llm-label{min-height:44px;white-space:nowrap}.admin-llm-label:has(input:disabled){opacity:.6;cursor:not-allowed}
@media(max-width:700px){.shell{padding:12px 12px max(20px,env(safe-area-inset-bottom))}.progress-card{margin-bottom:12px}.mobile-panel-tabs{display:flex;gap:4px;padding:4px;margin-bottom:8px;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#e9f1f4}.mobile-panel-tabs button{flex:1;min-height:42px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ui-muted);font-weight:650}.mobile-panel-tabs button.is-selected{background:#fff;color:var(--ui-accent);border-color:#bed4de}.mobile-show-original>.panel:nth-child(2),.mobile-show-result>.panel:first-child{display:none}.panels .panel{height:clamp(380px,62dvh,650px);min-height:0}.panels:not(.has-result) .panel{min-height:380px}.camera-button{display:block;width:100%;min-height:46px;margin-top:8px;border:1px solid #b8d1dd;border-radius:var(--surface-radius);background:#f7fafb;color:var(--ui-accent);font-weight:650}.empty-upload .upload-button{min-height:46px}.panel-head .controls button{min-width:40px}.admin-setting{padding:14px}.admin-setting p{max-width:180px}.result-footer .downloads button{min-height:44px}}

/* On small screens the tabs name the view; keep only the essential actions. */
.mobile-new-document{display:none}
@media(max-width:700px){.progress-track,.panels .panel-head,.panels .panel-footer{display:none}.progress-action .primary{width:100%}.progress-title{margin-bottom:10px}.mobile-new-document{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:46px;margin:0 0 10px;padding:8px 14px;border:1px solid var(--ui-accent);border-radius:var(--control-radius);background:var(--ui-accent);color:#fff;font-weight:650}.mobile-new-document svg{width:19px;height:19px}.mobile-new-document:disabled{opacity:.55}.panels .panel{height:clamp(380px,65dvh,700px)}.image-wrap{width:100%!important}.text-scroll{font-size:18px!important}}

/* Fit the mobile workspace to the browser's currently visible viewport. */
@media(max-width:700px){
  .shell{height:100dvh;min-height:0}
  .shell>main{min-height:0}
  .panels{flex:1 1 0;min-height:0;grid-template-rows:minmax(0,1fr)}
  .panels .panel,.panels:not(.has-result) .panel{height:100%;min-height:0}
  .admin-shell>.shell{height:100dvh;min-height:0}
}

@media(max-width:700px){
  .mobile-new-document{flex:none;margin:10px 0 0}
  .image-scroll.is-processing .image-wrap img{animation:mobile-scan-pulse 2.8s ease-in-out infinite}
  @keyframes mobile-scan-pulse{0%,100%{filter:brightness(1)}50%{filter:brightness(.92)}}
}
@media(max-width:700px) and (prefers-reduced-motion:reduce){.image-scroll.is-processing .image-wrap img{animation:none}}

.mobile-recognize{display:none}
@media(max-width:700px){.progress-action{display:none}.mobile-new-document{margin:0 0 10px}.mobile-recognize{display:block;flex:none;width:100%;min-height:46px;margin-top:10px}}

/* Mobile keeps the optional LLM control without the status header. */
@media(max-width:700px){
  .progress-title>strong,.progress-title .progress-meta{display:none}
  .progress-card:not(:has(.llm-label)){display:none}
  .progress-title{margin:0}
}

/* Native-style image source chooser for the mobile workspace. */
.image-menu-backdrop{position:fixed;z-index:100;inset:0;display:flex;align-items:flex-end;justify-content:center;background:#102c3b66}.image-menu{width:100%;max-width:700px;padding:10px 16px max(16px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0;background:var(--ui-surface);box-shadow:0 -8px 32px #17364824}.image-menu-handle{width:36px;height:4px;margin:0 auto 14px;border-radius:4px;background:#c0d0d7}.image-menu h2{margin:0 0 12px;color:var(--ui-ink);font-size:17px}.image-menu-choice{display:flex;align-items:center;gap:13px;width:100%;min-height:58px;padding:8px 4px;border:0;border-bottom:1px solid var(--ui-border);background:transparent;color:var(--ui-ink);font-weight:650;text-align:left}.image-menu-icon{display:grid;place-items:center;width:40px;height:40px;flex:none;border-radius:10px;background:#eaf3f7;color:var(--ui-accent)}.image-menu-icon svg{width:23px;height:23px}.image-menu-cancel{width:100%;min-height:46px;margin-top:12px;border:1px solid var(--ui-border);border-radius:var(--control-radius);background:#f7fafb;color:var(--ui-ink);font-weight:650}
@media(max-width:700px){.mobile-recognize{font-family:inherit;font-size:15px;font-weight:650}}

/* Consistent touch controls and icon weight on mobile. */
@media(max-width:700px){
  .mobile-new-document,.mobile-recognize,.mobile-panel-tabs button,.camera-button,.empty-upload .upload-button,.image-menu-choice,.image-menu-cancel{font-family:inherit;font-size:15px;font-weight:650;line-height:1.3}
  .progress-title .llm-label{font-size:14px}
  .mobile-new-document svg,.image-menu-icon svg{width:20px;height:20px;flex:none}
}

/* Touch scrolling remains available without desktop-style scrollbar gutters. */
@media(max-width:700px){
  .image-scroll,.text-scroll,.document-editor{scrollbar-width:none;-ms-overflow-style:none}
  .image-scroll::-webkit-scrollbar,.text-scroll::-webkit-scrollbar,.document-editor::-webkit-scrollbar{display:none;width:0;height:0}
}

/* Workshop: shared transcription table and administrator scorecards. */
.workshop-page{max-width:1660px;margin:0 auto;padding:28px 36px 56px}.workshop-heading{display:flex;justify-content:space-between;gap:24px;align-items:end;margin-bottom:24px}.workshop-heading h1,.workshop-admin h1{margin:10px 0 6px;color:var(--ui-ink);font-size:26px;letter-spacing:-.025em}.workshop-heading p,.workshop-admin-heading p{margin:0;color:var(--ui-muted);font-size:14px;line-height:1.55;max-width:680px}.workshop-back,.workshop-table-link{color:var(--ui-accent);font-size:13px;font-weight:700;text-decoration:none}.workshop-back:hover,.workshop-table-link:hover{text-decoration:underline}.workshop-count{white-space:nowrap;color:var(--ui-muted);font-size:13px}.workshop-table-wrap,.workshop-metrics-wrap{overflow:auto;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff}.workshop-table,.workshop-metrics{width:100%;border-collapse:collapse;table-layout:fixed}.workshop-table th,.workshop-table td,.workshop-metrics th,.workshop-metrics td{border-bottom:1px solid #e4edf1;padding:14px;text-align:left;vertical-align:top}.workshop-table thead th,.workshop-metrics thead th{background:#f5f9fb;color:var(--ui-ink);font-size:13px}.workshop-table thead th:first-child{width:58px}.workshop-table thead th:nth-child(2){width:140px}.workshop-number{color:var(--ui-muted);font-size:13px;font-variant-numeric:tabular-nums}.workshop-image-cell a{display:flex;align-items:flex-start;flex-direction:column;gap:7px;color:var(--ui-accent);font-size:12px;font-weight:700;text-decoration:none}.workshop-image-cell img{width:100%;max-width:110px;height:96px;object-fit:contain;object-position:center;background:#e9f0f3;border-radius:7px}.workshop-cell textarea{width:100%;min-height:116px;resize:vertical;border:1px solid #c8dce5;border-radius:8px;padding:10px;color:var(--ui-ink);font:400 14px/1.5 Manrope,system-ui,sans-serif;background:#fff}.workshop-cell textarea:focus{outline:2px solid var(--ui-focus);outline-offset:1px}.workshop-cell textarea::placeholder{color:#78909a}.workshop-cell-status{min-height:17px;margin-top:5px;color:var(--ui-muted);font-size:11px;line-height:1.4}.workshop-cell-status button{border:0;background:none;padding:0;margin-left:5px;color:var(--ui-accent);font-size:inherit;text-decoration:underline}.workshop-admin{max-width:1500px;margin:0 auto;padding:6px 0 48px}.workshop-admin-heading{display:flex;align-items:end;justify-content:space-between;gap:20px}.workshop-admin-heading .primary{flex:none;min-height:46px}.workshop-table-link{display:inline-block;margin:16px 0 0}.workshop-note{margin:20px 0 14px;color:var(--ui-muted);font-size:13px;line-height:1.5}.workshop-scorecards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.workshop-scorecard{padding:18px;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff}.workshop-scorecard h2{margin:0 0 16px;color:var(--ui-ink);font-size:15px}.workshop-scores{display:flex;gap:28px}.workshop-scores div{display:flex;flex-direction:column;gap:4px}.workshop-scores span{color:var(--ui-muted);font-size:12px}.workshop-scores strong{color:var(--ui-ink);font-size:25px;font-variant-numeric:tabular-nums}.workshop-scorecard p{margin:14px 0 0;color:var(--ui-muted);font-size:12px}.workshop-metrics td strong,.workshop-metrics td span,.workshop-metrics th small{display:block;font-size:12px}.workshop-metrics td span,.workshop-metrics th small{margin-top:4px;color:var(--ui-muted);font-weight:400}.workshop-metrics td{font-size:12px;color:var(--ui-muted)}.workshop-loading{color:var(--ui-muted)}
@media(max-width:700px){.workshop-page{padding:20px 12px 32px}.workshop-heading{align-items:flex-start;flex-direction:column;gap:8px}.workshop-heading h1,.workshop-admin h1{font-size:22px}.workshop-table-wrap{border:0;background:transparent;overflow:visible}.workshop-table,.workshop-table tbody{display:block}.workshop-table thead{display:none}.workshop-table tr{display:grid;grid-template-columns:50px 1fr;margin-bottom:12px;overflow:hidden;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff}.workshop-table th,.workshop-table td{border:0;padding:12px}.workshop-table .workshop-number{padding-right:0;font-size:14px}.workshop-table .workshop-image-cell{padding-left:0}.workshop-image-cell a{flex-direction:row;align-items:center;gap:12px}.workshop-image-cell img{width:76px;height:70px}.workshop-table td[data-team]{grid-column:1/-1;padding:10px 12px 12px;border-top:1px solid #e4edf1}.workshop-table td[data-team]::before{content:attr(data-team);display:block;margin-bottom:7px;color:var(--ui-ink);font-size:13px;font-weight:700}.workshop-cell textarea{min-height:90px;font-size:16px}.workshop-admin-heading{align-items:stretch;flex-direction:column}.workshop-scorecards{grid-template-columns:1fr}.workshop-admin{padding:0 0 32px}.workshop-metrics{min-width:520px}.admin-tabs{flex-wrap:wrap}}

.workshop-admin-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.workshop-clear{min-height:46px;padding:0 16px;border:1px solid var(--ui-border);border-radius:var(--control-radius);background:#fff;color:var(--ui-ink);font-size:13px;font-weight:650}.workshop-clear:hover:not(:disabled){background:#f2f7f9}.workshop-clear:disabled{opacity:.55}.workshop-notice{color:var(--ui-accent);font-size:13px;margin:14px 0}
@media(max-width:700px){.workshop-admin-actions>*{flex:1 1 auto}}

.workshop-scope{min-height:46px;padding:0 12px;border:1px solid var(--ui-border);border-radius:var(--control-radius);background:#fff;color:var(--ui-ink);font-size:13px;font-weight:650}

/* Page comparison uses CER; ties are shown together. */
.workshop-cell.is-best textarea{background:#eaf5fb;border-color:#88b9cf}.workshop-best-label{display:inline-block;margin-right:8px;color:#285e79;font-weight:700}.workshop-metrics td.is-best{background:#eaf5fb}.workshop-metrics td.is-best strong{color:#285e79}

/* Contact details sit below the workspace and use the same quiet blue palette. */
.site-footer{padding:0 36px 32px;color:var(--ui-ink)}.site-footer-inner{max-width:1588px;margin:0 auto;padding:24px 0 8px;border-top:1px solid var(--ui-border);display:grid;grid-template-columns:minmax(160px,1fr) minmax(0,2fr);gap:32px}.site-footer-heading span{color:var(--ui-accent);font-size:12px;font-weight:700;letter-spacing:.02em}.site-footer-heading h2{margin:6px 0 0;font-size:18px;line-height:1.3;letter-spacing:-.02em}.site-footer-contacts{font-style:normal;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.footer-contact{min-width:0;display:flex;flex-direction:column;gap:7px}.footer-contact span{color:var(--ui-muted);font-size:12px}.footer-contact strong,.footer-contact a{font-size:14px;font-weight:650;color:var(--ui-ink);text-decoration:none;overflow-wrap:anywhere}.footer-contact a:hover{color:var(--ui-accent);text-decoration:underline;text-underline-offset:3px}.admin-contacts{margin-top:12px;padding:16px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:var(--surface-radius)}.admin-contacts-title{display:flex;justify-content:space-between;align-items:center;gap:16px}.admin-contacts-title h2{margin:0;color:var(--ui-ink);font-size:14px}.admin-contacts-title p{margin:4px 0 0;color:var(--ui-muted);font-size:12px}.admin-contacts-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.admin-contacts-fields label{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--ui-muted);font-size:12px;font-weight:650}.admin-contacts-fields input{width:100%;min-width:0;min-height:42px;padding:8px 10px;border:1px solid #c8dce5;border-radius:var(--control-radius);color:var(--ui-ink);background:#fff;font-size:14px;font-weight:500}.admin-contacts-fields input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.admin-contacts-save{min-height:42px;padding:0 16px;border:1px solid var(--ui-accent);border-radius:var(--control-radius);background:var(--ui-accent);color:#fff;font-size:13px;font-weight:650}.admin-contacts-save:hover:not(:disabled){background:var(--ui-accent-hover)}.admin-contacts-save:disabled{opacity:.55}.admin-contacts-message,.admin-contacts-error{margin:10px 0 0;font-size:12px}.admin-contacts-message{color:var(--ui-accent)}.admin-contacts-error{color:#9c3d2c}
@media(max-width:700px){.site-footer{padding:0 12px max(24px,env(safe-area-inset-bottom))}.site-footer-inner{grid-template-columns:1fr;gap:18px;padding-top:20px}.site-footer-contacts{grid-template-columns:1fr 1fr;gap:18px 12px}.footer-contact:first-child{grid-column:1/-1}.admin-contacts-fields{grid-template-columns:1fr;gap:10px}.admin-contacts-title{align-items:flex-start}.admin-contacts-title p{max-width:200px}.admin-contacts-save{min-height:44px}.admin-contacts-fields input{min-height:44px;font-size:16px}}
@media(max-width:350px){.site-footer-contacts{grid-template-columns:1fr}.footer-contact:first-child{grid-column:auto}}

/* A single, compact line for contact details. */
.site-footer-inner{display:block;padding:20px 0 0}.site-footer-contacts{display:flex;align-items:baseline;justify-content:space-between;gap:12px}.site-footer-contacts .footer-contact{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ui-ink);font-size:14px;line-height:1.4;font-weight:650;text-decoration:none}.site-footer-contacts .footer-name,.site-footer-contacts .footer-email{flex:1 1 0}.site-footer-contacts .footer-phone{flex:none}.site-footer-contacts .footer-email{text-align:right}.site-footer-contacts a:hover{color:var(--ui-accent);text-decoration:underline;text-underline-offset:3px}
@media(max-width:700px){.site-footer{padding-bottom:max(28px,env(safe-area-inset-bottom))}.site-footer-inner{padding-top:16px}.site-footer-contacts{gap:7px}.site-footer-contacts .footer-contact{font-size:clamp(11px,2.8vw,14px)}}

.site-footer-contacts .footer-contact{display:inline-flex;align-items:center;gap:6px}.site-footer-contacts .footer-contact svg{width:16px;height:16px;flex:none;color:var(--ui-accent)}.site-footer-contacts .footer-contact>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:inherit;font-size:inherit}.site-footer-contacts .footer-email{justify-content:flex-end}
@media(max-width:700px){.site-footer-contacts .footer-contact{gap:3px}.site-footer-contacts .footer-contact svg{width:clamp(10px,3.4vw,15px);height:clamp(10px,3.4vw,15px)}}

/* The public workspace and footer share the visible viewport. */
#root:has(>.shell+.site-footer){height:100vh;height:100dvh;display:flex;flex-direction:column}
#root>.shell:has(+.site-footer){height:auto;min-height:0;flex:1 1 0;padding-bottom:16px}
#root>.shell:has(+.site-footer) .panels{min-height:0}
#root>.site-footer{flex:none;padding-bottom:24px}
@media(max-width:700px){#root>.shell:has(+.site-footer){padding-bottom:12px}#root>.site-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}}
.site-footer-contacts .footer-contact{flex-direction:row}
.site-footer-contacts .footer-name,.site-footer-contacts .footer-email{flex:0 1 auto}
#root>.shell:has(+.site-footer),#root>.site-footer{width:100%}

/* Keep the contact group together; let the role wrap on small screens. */
.site-footer-inner{border-top:0}.site-footer-contacts{justify-content:center;gap:clamp(14px,2.5vw,32px)}.site-footer-contacts .footer-name{align-items:flex-start}.site-footer-contacts .footer-name-copy{display:flex;align-items:baseline;gap:7px;white-space:normal;overflow:visible}.footer-role{color:var(--ui-muted);font-size:12px;font-weight:500;white-space:normal}.admin-contacts-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:700px){.site-footer-contacts{gap:7px}.site-footer-contacts .footer-name-copy{display:block;min-width:0}.footer-name-text{display:block;white-space:nowrap}.footer-role{display:block;font-size:10px;line-height:1.25;overflow-wrap:anywhere}.admin-contacts-fields{grid-template-columns:1fr}}
.site-footer-contacts .footer-name>.footer-name-copy{display:flex;align-items:baseline;gap:7px;white-space:normal;overflow:visible}.site-footer-contacts .footer-role{color:var(--ui-muted);font-size:12px;font-weight:500;white-space:normal}
@media(max-width:700px){.site-footer-contacts .footer-name>.footer-name-copy{display:block}.site-footer-contacts .footer-role{display:block;font-size:10px;line-height:1.25}}
@media(max-width:700px){.site-footer-contacts .footer-name{flex:1 1 0}.site-footer-contacts .footer-phone,.site-footer-contacts .footer-email{flex:0 0 auto}}
@media(max-width:360px){.site-footer-contacts{gap:4px}.site-footer-contacts .footer-contact{font-size:10px;gap:2px}.site-footer-contacts .footer-contact svg{width:10px;height:10px}}

.site-footer-contacts .footer-telegram{flex:0 0 auto}.admin-contacts-fields{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1000px) and (min-width:701px){.admin-contacts-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.admin-contacts-fields{grid-template-columns:1fr}.site-footer-contacts .footer-telegram{min-width:24px;min-height:28px;justify-content:center}.site-footer-contacts .footer-telegram>span{display:none}.site-footer-contacts .footer-telegram svg{width:16px;height:16px}}
.site-footer-contacts .footer-role{font-family:inherit;font-size:inherit;font-weight:inherit}
@media(max-width:700px){.site-footer-contacts .footer-role{font-size:inherit}}
@media(max-width:360px){.site-footer-contacts{gap:2px}.site-footer-contacts .footer-telegram{min-width:16px}.site-footer-contacts .footer-telegram svg{width:14px;height:14px}}
.site-footer-contacts{align-items:center}

/* Match contact typography and balance the space around the footer. */
.site-footer-contacts .footer-contact span{font-family:inherit;font-size:inherit;font-weight:inherit;color:inherit}
.site-footer-contacts .footer-contact svg{color:inherit}
#root>.shell:has(+.site-footer){padding-bottom:24px}
#root>.site-footer .site-footer-inner{padding-top:0}
#root>.site-footer{padding-bottom:24px}
@media(max-width:700px){#root>.shell:has(+.site-footer){padding-bottom:16px}#root>.site-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}}
.site-footer-contacts .footer-contact>span{opacity:.8}

/* Non-interactive contact details use one consistent text treatment. */
.site-footer-contacts .footer-telegram>span{display:inline}
@media(max-width:700px){.site-footer-contacts{flex-wrap:wrap;justify-content:center;gap:6px 10px}.site-footer-contacts .footer-name{flex:0 1 100%;justify-content:center}.site-footer-contacts .footer-name>.footer-name-copy{display:flex;gap:5px}.site-footer-contacts .footer-name-text,.site-footer-contacts .footer-role{display:inline;white-space:normal}.site-footer-contacts .footer-telegram{min-height:0;min-width:0}.site-footer-contacts .footer-telegram>span{display:inline}.site-footer-contacts .footer-telegram svg{width:clamp(10px,3.4vw,15px);height:clamp(10px,3.4vw,15px)}}

/* The admin workspace has a fixed viewport, independent of image zoom. */
@media(min-width:701px){.admin-shell .panels{height:clamp(420px,60dvh,760px);min-height:0;flex:none;grid-template-rows:minmax(0,1fr)}}

/* A matching navigation tile connects the OCR workspace and the table. */
.workspace-bar{display:flex;align-items:stretch;gap:12px;margin-bottom:var(--space-5);flex:none;min-width:0}.workspace-bar .progress-card{flex:1;min-width:0;margin:0}.workspace-nav{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;flex:0 0 132px;min-height:112px;padding:12px;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:var(--ui-surface);color:var(--ui-accent);font-size:13px;font-weight:700;line-height:1.25;text-align:center;text-decoration:none;transition:background-color .18s,border-color .18s}.workspace-nav svg{width:24px;height:24px;flex:none}.workspace-nav:hover{background:#edf6f9;border-color:#a9cad9}.workspace-nav:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.workshop-heading{align-items:stretch;justify-content:flex-start}.workshop-heading-copy{flex:1;align-self:center;min-width:0}.workshop-heading-copy h1{margin-top:0}.workshop-heading .workshop-count{align-self:end}.workshop-nav{min-height:100px}
@media(max-width:700px){.workspace-bar{gap:8px;margin-bottom:12px}.workspace-bar .progress-card{flex:1;min-width:0;margin:0}.workspace-nav{flex:0 0 76px;min-height:60px;padding:8px 4px;gap:5px;font-size:11px}.workspace-nav svg{width:20px;height:20px}.workshop-heading{flex-direction:row;align-items:stretch;gap:12px;flex-wrap:wrap}.workshop-heading-copy{flex:1;min-width:0}.workshop-heading .workshop-count{flex-basis:100%;margin-left:88px}.workshop-nav{min-height:76px}.workshop-heading h1{font-size:20px}.workshop-heading p{font-size:13px}}
@media(prefers-reduced-motion:reduce){.workspace-nav{transition:none}}

/* Просмотр изображений мастер-класса */
.workshop-image-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.workshop-preview-button{display:block;width:110px;max-width:100%;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;overflow:hidden}.workshop-image-cell .workshop-preview-button img{display:block;width:100%;height:96px;max-width:none;border-radius:7px}.workshop-preview-button:hover{border-color:#88b0c1}.workshop-preview-button:focus-visible,.workshop-download:focus-visible,.workshop-preview-close:focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}.workshop-image-cell .workshop-download{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:0 10px;border:1px solid #c8dce5;border-radius:8px;background:#fff;color:var(--ui-accent);font-size:12px;font-weight:700;text-decoration:none}.workshop-image-cell .workshop-download:hover{background:#edf5f8;border-color:#a9cad9}.workshop-preview{width:min(1000px,calc(100% - 32px));max-width:none;max-height:calc(100% - 32px);padding:0;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff;color:var(--ui-ink);overflow:hidden;box-shadow:0 20px 70px #18394a45}.workshop-preview::backdrop{background:rgba(23,43,54,.62)}.workshop-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid var(--ui-border);font-size:15px}.workshop-preview-close{display:grid;place-items:center;width:40px;height:40px;border:1px solid #d9e6ec;border-radius:8px;background:#fff;color:#416d80}.workshop-preview-close:hover{background:#edf5f8}.workshop-preview-content{display:flex;align-items:center;justify-content:center;height:min(75vh,800px);padding:12px;background:#e9f0f3}.workshop-preview-content img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.workshop-preview-content p{color:var(--ui-muted);font-size:14px}@media(max-width:700px){.workshop-image-actions{flex-direction:row;align-items:center;gap:12px}.workshop-preview-button{width:76px;flex:none}.workshop-image-cell .workshop-preview-button img{height:70px}.workshop-preview{width:calc(100% - 20px);max-height:calc(100% - 20px)}.workshop-preview-content{height: min(70dvh,800px);padding:8px}.workshop-image-cell .workshop-download{min-height:40px}}

.workshop-image-actions{width:110px;max-width:100%;align-items:stretch}.workshop-preview-button,.workshop-image-cell .workshop-download{width:100%}@media(max-width:700px){.workshop-image-actions{flex-direction:column;align-items:stretch;gap:8px}.workshop-preview-button{width:100%}}

/* Итоги команд на странице мастер-класса */
.workshop-public-dashboard{flex:0 1 520px;align-self:center;min-width:0}.workshop-public-summary{margin:0 0 7px!important;color:var(--ui-muted);font-size:11px!important;line-height:1.3!important}.workshop-public-scores{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-width:0}.workshop-public-score{min-width:0;padding:12px 14px;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff}.workshop-public-team{display:block;color:var(--ui-ink);font-size:13px}.workshop-public-values{display:flex;gap:18px;margin-top:9px}.workshop-public-values div{display:flex;flex-direction:column;gap:2px;min-width:0}.workshop-public-values span,.workshop-public-score small{color:var(--ui-muted);font-size:11px}.workshop-public-values strong{color:var(--ui-accent);font-size:17px;font-variant-numeric:tabular-nums}.workshop-public-score small{display:block;margin-top:7px;white-space:nowrap}@media(max-width:1200px){.workshop-heading{flex-wrap:wrap}.workshop-public-dashboard{flex:1 0 100%}}@media(max-width:700px){.workshop-public-scores{gap:6px}.workshop-public-score{padding:10px 8px}.workshop-public-team{font-size:12px}.workshop-public-values{gap:8px}.workshop-public-values strong{font-size:14px}.workshop-public-values span,.workshop-public-score small{font-size:10px}}

.workshop-public-count{color:var(--ui-muted);font-size:11px;font-weight:600;white-space:nowrap}

.workshop-cell.is-tied textarea{background:#fff8df;border-color:#d6bd76}

.workshop-services-link{padding:0;border:0;background:none;color:var(--ui-accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;text-align:left}.workshop-services-link:hover{color:var(--ui-accent-hover)}.workshop-services-link:focus-visible,.service-editor-add:focus-visible,.service-editor-remove:focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}.workshop-mobile-team{display:none}.workshop-services-dialog{width:min(520px,calc(100% - 32px));max-width:none;max-height:calc(100% - 32px);padding:0;border:1px solid var(--ui-border);border-radius:var(--surface-radius);background:#fff;color:var(--ui-ink);overflow:auto;box-shadow:0 20px 70px #18394a45}.workshop-services-dialog::backdrop{background:rgba(23,43,54,.62)}.workshop-services-content{padding:16px}.workshop-services-content p{margin:0;color:var(--ui-muted);font-size:14px}.workshop-services-content ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}.workshop-services-content a{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:48px;padding:12px 14px;border:1px solid var(--ui-border);border-radius:var(--control-radius);background:#f8fbfc;color:var(--ui-accent);font-size:14px;font-weight:650;text-decoration:none;overflow-wrap:anywhere}.workshop-services-content a:hover{background:#edf5f8;border-color:#a9cad9}.workshop-services-settings{margin:20px 0 0}.service-editor-list{display:grid;gap:10px;margin-top:14px}.service-editor-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto;gap:10px;align-items:end}.service-editor-row label{display:flex;flex-direction:column;gap:6px;min-width:0;color:var(--ui-muted);font-size:12px;font-weight:650}.service-editor-row input{width:100%;min-width:0;min-height:42px;padding:8px 10px;border:1px solid #c8dce5;border-radius:var(--control-radius);color:var(--ui-ink);background:#fff;font-size:14px}.service-editor-row input:focus-visible{outline:2px solid var(--ui-focus);outline-offset:1px}.service-editor-add,.service-editor-remove{min-height:42px;padding:0 12px;border:1px solid #c8dce5;border-radius:var(--control-radius);background:#fff;color:var(--ui-accent);font-size:13px;font-weight:650}.service-editor-add{margin-top:12px}.service-editor-add:hover:not(:disabled),.service-editor-remove:hover:not(:disabled){background:#edf5f8}.service-editor-add:disabled,.service-editor-remove:disabled{opacity:.5}@media(max-width:700px){.workshop-table td[data-team]::before{content:none}.workshop-mobile-team{display:block;margin-bottom:7px;color:var(--ui-ink);font-size:13px;font-weight:700}.workshop-services-link{font-size:12px}.service-editor-row{grid-template-columns:1fr 1fr}.service-editor-row label{grid-column:1/-1}.service-editor-row input{font-size:16px;min-height:44px}.service-editor-remove{grid-column:2;justify-self:end}.workshop-services-dialog{width:calc(100% - 20px);max-height:calc(100% - 20px)}}
