:root{--bg: #f6f6f7;--panel: #fcfcfd;--surface: #ffffff;--border: #e6e6ea;--border-strong: #d6d6db;--text: #18181b;--text-soft: #52525b;--muted: #7a7a83;--accent: #0d99ff;--accent-hover: #0a86e0;--danger: #d92d20;--radius: 10px;--radius-sm: 8px;--drag-text: "Отпустите, чтобы открыть новую книгу";font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased}*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;height:100%}body{background:var(--bg);color:var(--text);font-size:13px;line-height:1.45}#app{display:flex;flex-direction:column;height:100vh;height:100dvh}.topbar{display:flex;align-items:center;gap:10px;height:52px;padding:0 18px;background:var(--surface);border-bottom:1px solid var(--border);flex:0 0 auto}.brand{display:flex;align-items:center;gap:8px}.brand-mark{width:18px;height:18px;border-radius:5px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2341c8ff'/%3E%3Cstop offset='1' stop-color='%230a63c9'/%3E%3C/linearGradient%3E%3ClinearGradient id='sky' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd25b'/%3E%3Cstop offset='1' stop-color='%23ff7a59'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='64' height='64' rx='14' fill='url(%23bg)'/%3E%3Crect x='15' y='10' width='34' height='44' rx='4' fill='%23fff'/%3E%3Crect x='19' y='14' width='26' height='36' rx='2' fill='url(%23sky)'/%3E%3Ccircle cx='39' cy='21' r='4.5' fill='%23fff'/%3E%3Cpath d='M19 50 L28 34 L35 44 L42 30 L45 50 Z' fill='%230a4d8f'/%3E%3C/svg%3E") center / contain no-repeat}.brand-name{font-weight:600;font-size:14px;letter-spacing:-.01em}.topbar-spacer{flex:1}.workspace{flex:1;display:flex;min-height:0}.stage{position:relative;flex:1;min-width:0;display:flex;align-items:center;justify-content:center;padding:32px;background-image:radial-gradient(circle,#e2e2e6 1px,transparent 1px);background-size:22px 22px}#app.dragging .stage:after{content:var(--drag-text);position:absolute;inset:12px;z-index:6;border:2px dashed var(--accent);border-radius:var(--radius);background:#f2f9ffd9;display:grid;place-items:center;font-size:15px;font-weight:600;pointer-events:none}.dropzone{width:100%;max-width:520px;aspect-ratio:4 / 3;border:1.5px dashed var(--border-strong);border-radius:14px;background:#ffffffb3;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:border-color .15s ease,background .15s ease}.dropzone:hover{border-color:var(--accent);background:#f2f9ff}.dropzone-inner{text-align:center}.dropzone-title{font-size:15px;font-weight:600}.dropzone-sub{color:var(--muted);margin-top:4px}.viewer{width:100%;max-width:640px;height:100%;min-height:0;display:flex;flex-direction:column}.viewer-frame{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.ba{position:relative;overflow:hidden;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);box-shadow:0 8px 30px #14142814;width:0;height:0;max-height:100%;max-width:100%;touch-action:none;cursor:pointer}.ba:has(.ba-handle:not([hidden])){cursor:default}.ba-img{position:absolute;inset:0;width:100%;height:100%;display:block;user-select:none;-webkit-user-drag:none}.ba-img.after{clip-path:inset(0 calc(100% - var(--pos, 50%)) 0 0)}.ba-handle{position:absolute;top:0;bottom:0;left:var(--pos, 50%);width:2px;margin-left:-1px;background:var(--accent);cursor:ew-resize}.ba-handle span{position:absolute;top:50%;left:50%;width:30px;height:30px;transform:translate(-50%,-50%);border-radius:50%;background:var(--surface);border:1.5px solid var(--accent);box-shadow:0 2px 8px #0000002e}.ba-handle span:before,.ba-handle span:after{content:"";position:absolute;top:50%;width:2px;height:8px;margin-top:-4px;background:var(--accent);border-radius:1px}.ba-handle span:before{left:9px}.ba-handle span:after{right:9px}.viewer-tools{display:flex;justify-content:center}.viewer-tools .segmented{width:min(240px,100%)}.viewer-tools .seg-btn{height:26px;font-size:11px}.visually-hidden{visibility:hidden}.ba.view-before .ba-img.after,.ba.view-before .ba-handle,.ba.view-after .ba-img.before,.ba.view-after .ba-handle{display:none}.ba.view-after .ba-img.after{clip-path:none}.viewer-caption{margin-top:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:38px;color:var(--muted);font-variant-numeric:tabular-nums}.add-book{margin-top:12px;width:32px;height:32px;aspect-ratio:1 / 1;flex-shrink:0;display:grid;place-items:center;border:0;border-radius:999px;background:transparent;color:var(--muted);cursor:pointer;transition:color .15s ease,background .15s ease,transform .18s ease}.add-book:hover{color:var(--text-soft);background:#14142812;transform:translateY(-2px)}.add-book:focus-visible{outline:none;box-shadow:0 0 0 3px #0d99ff40}.panel{flex:0 0 320px;width:320px;background:var(--panel);border-left:1px solid var(--border);padding:16px 16px 0;overflow-y:auto;display:flex;flex-direction:column;gap:14px}.panel-section{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:13px 14px 15px}.panel-section>h2{margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid var(--border);font-size:12.5px;font-weight:650;letter-spacing:.01em;text-transform:none;color:var(--text)}.section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:18px;margin-bottom:8px}.section-head h3{margin:0;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--text-soft)}.icon-btn{flex:0 0 auto;width:24px;height:24px;padding:0;display:grid;place-items:center;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--muted);cursor:pointer;transition:color .15s ease,border-color .15s ease,background .15s ease}.icon-btn:hover:not(:disabled){color:var(--text);border-color:var(--accent);background:#f2f9ff}.icon-btn:disabled{opacity:.45;cursor:default}.field,.dropdown-trigger{width:100%;height:34px;padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:inherit;font-size:13px;outline:none}.field:focus,.dropdown-trigger:focus-visible{border-color:var(--accent);box-shadow:0 0 0 3px #0d99ff26}.hint{margin-top:8px;font-size:12px;color:var(--muted)}.row-between .hint:first-child{margin-top:6px;font-size:12px;font-weight:500;color:var(--text)}.row-between .hint:last-child{margin-top:6px;color:var(--muted);font-variant-numeric:tabular-nums}.range{--val: 50%;width:100%;height:20px;margin:0;padding:0;background:transparent;appearance:none;-webkit-appearance:none;cursor:pointer}.range:disabled{cursor:default;opacity:.5}.range::-webkit-slider-runnable-track{height:6px;border-radius:999px;background:linear-gradient(to right,var(--accent) var(--val),var(--border-strong) var(--val))}.range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-top:-5px;border-radius:50%;background:#fff;border:2px solid var(--accent);box-shadow:0 1px 3px #0003;transition:transform .12s ease}.range:not(:disabled)::-webkit-slider-thumb:hover,.range:not(:disabled):active::-webkit-slider-thumb{transform:scale(1.15)}.range::-moz-range-track{height:6px;border-radius:999px;background:var(--border-strong)}.range::-moz-range-progress{height:6px;border-radius:999px;background:var(--accent)}.range::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#fff;border:2px solid var(--accent);box-shadow:0 1px 3px #0003}.segmented{display:flex;gap:4px;padding:4px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius-sm)}.seg-btn{flex:1;height:30px;padding:0 8px;border:none;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:12px;cursor:pointer;transition:background .15s ease,color .15s ease,box-shadow .15s ease}.seg-btn:hover{color:var(--text)}.seg-btn.active{background:var(--surface);color:var(--text);font-weight:600;box-shadow:0 1px 2px #00000014}.res-row{display:flex;align-items:center;gap:8px;margin-top:8px}.res-input{flex:1;min-width:0;text-align:center;background-image:none;padding-right:10px;-moz-appearance:textfield;appearance:textfield}.res-input::-webkit-inner-spin-button,.res-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.res-x{color:var(--muted);font-size:12px}.row-between{display:flex;align-items:center;justify-content:space-between}.row-between .hint{margin-top:4px}#fill-switch,#model-picker,#color-picker{margin-top:12px}#color-picker{display:flex;align-items:center;gap:10px}.link-btn{flex:0 0 auto;width:26px;height:26px;padding:0;display:grid;place-items:center;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer;transition:color .15s ease,background .15s ease}.link-btn:hover{color:var(--text);background:#0000000f}.link-btn.active{color:var(--accent)}.link-btn.active:hover{background:#0d99ff1f}.link-btn:focus-visible{outline:none;box-shadow:0 0 0 3px #0d99ff40}.swatch{flex:1 1 0;min-width:0;height:34px;padding:0;border:1px solid var(--border-strong);border-radius:8px;background:var(--surface);box-shadow:0 1px 2px #1414280f;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.swatch:hover{border-color:var(--accent)}.swatch:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px #0d99ff26}.swatch::-webkit-color-swatch-wrapper{padding:3px}.swatch::-webkit-color-swatch{border:none;border-radius:6px}.swatch::-moz-color-swatch{border:none;border-radius:6px}.swatch:disabled{cursor:default;opacity:.5}.panel-actions{margin-top:auto;display:flex;flex-direction:column;gap:8px;position:sticky;bottom:0;z-index:5;margin-left:-16px;margin-right:-16px;padding:12px 16px 14px;background:var(--panel);border-top:1px solid var(--border);pointer-events:auto}.btn{height:38px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:inherit;font-weight:500;cursor:pointer;transition:background .12s ease,border-color .12s ease,opacity .12s ease}.btn:hover:not(:disabled){border-color:var(--accent)}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover)}.btn:disabled{opacity:.45;cursor:default}.btn.small{height:30px;padding:0 12px;font-size:12px;border-radius:7px}.status{min-height:18px;font-size:12px;color:var(--muted);text-align:center}.status[data-kind=error]{color:var(--danger)}.status-msg{overflow-wrap:anywhere}.comfy-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:46vw;padding:3px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font:inherit;font-size:11.5px;user-select:none}.settings-btn{width:32px;height:32px;border-color:transparent;background:transparent;border-radius:50%}.settings-btn:hover:not(:disabled){border-color:transparent;background:#14142812}.settings-btn[aria-expanded=true]{background:#1414281c}.comfy-dot{flex:0 0 auto;width:7px;height:7px;border-radius:50%;background:var(--border-strong)}[data-state=searching] .comfy-dot{background:var(--accent);animation:comfy-pulse 1.1s ease-in-out infinite}[data-state=online] .comfy-dot{background:#16a34a}[data-state=unverified] .comfy-dot{background:#d97706}.comfy-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes comfy-pulse{50%{opacity:.3}}.modal-backdrop{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px;background:#14161c8c;animation:backdrop-in .12s ease-out}body.modal-open{overflow:hidden}@keyframes backdrop-in{0%{opacity:0}}.modal{width:100%;max-width:460px;max-height:calc(100dvh - 48px);display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:0 18px 48px #10121a47;text-align:left;animation:modal-in .14s ease-out}@keyframes modal-in{0%{opacity:0;transform:translateY(6px) scale(.985)}}.modal:focus{outline:none}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid var(--border)}.modal-head h2{margin:0;font-size:15px;font-weight:650;color:var(--text)}.modal-body{padding:18px;overflow-y:auto}.settings-subtitle{margin:0 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--text-soft)}.settings-group+.settings-group{margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}.dropdown{position:relative}.dropdown-trigger{display:flex;align-items:center;gap:8px;cursor:pointer;text-align:left;transition:border-color .12s ease,box-shadow .12s ease}.dropdown-trigger:hover{border-color:var(--accent)}.dropdown-trigger[aria-expanded=true]{border-color:var(--accent);box-shadow:0 0 0 3px #0d99ff26}.dropdown-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.dropdown-caret{flex:0 0 auto;color:var(--muted);transition:transform .15s ease}.dropdown-trigger[aria-expanded=true] .dropdown-caret{transform:rotate(180deg)}.dropdown-menu{position:absolute;top:calc(100% + 6px);left:0;right:0;z-index:30;margin:0;padding:5px;list-style:none;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);box-shadow:0 10px 30px #10121a29;max-height:min(320px,45dvh);overflow-y:auto}.dropdown-option{width:100%;height:34px;display:flex;align-items:center;gap:10px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:var(--text);font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background .1s ease,color .1s ease}.dropdown-option:hover{background:var(--panel)}.dropdown-option:focus-visible{outline:none;background:var(--panel)}.dropdown-option[aria-selected=true]{background:#eef6ff;color:var(--accent-hover);font-weight:600}.comfy-label{display:block;margin-bottom:6px;font-size:12px;font-weight:500;color:var(--text-soft)}.comfy-actions{display:flex;gap:8px;margin-top:8px}.comfy-actions .btn{flex:1}.comfy-download{margin-top:12px;padding:10px;border:1px dashed var(--border-strong);border-radius:var(--radius-sm);background:var(--panel)}.comfy-download-link{display:inline-block;margin-top:6px;font-size:12.5px;font-weight:600;color:var(--accent)}.comfy-download-link:hover{text-decoration:underline}.flux-status{margin-bottom:8px;font-size:12.5px;line-height:1.4}.flux-status[data-kind=ok]{color:#1a7f37}.flux-status[data-kind=warn]{color:var(--text-soft)}.flux-progress{margin:8px 0}.flux-bar{height:6px;border-radius:3px;background:var(--border);overflow:hidden}.flux-bar-fill{height:100%;width:0;border-radius:3px;background:var(--accent);transition:width .3s ease}.flux-bar-fill.indeterminate{width:100%;opacity:.35}.flux-progress .hint{margin-top:6px}.flux-manual{margin-top:10px}.flux-manual-list{margin:6px 0 0;padding-left:18px}.flux-manual-list li{margin:2px 0}.flux-manual-list a{font-size:12px;font-weight:600;color:var(--accent);word-break:break-all}.flux-manual-list a:hover{text-decoration:underline}@media (max-width: 820px){.workspace{flex-direction:column}.stage{flex:1 1 0;min-height:max(240px,56dvh);padding:8px}.dropzone{width:100%;height:100%;aspect-ratio:unset;min-height:0}.viewer{max-width:100%}.panel{flex:0 1 auto;width:auto;border-left:0;border-top:1px solid var(--border);padding:14px 14px 0;gap:12px;overscroll-behavior:contain}.panel-section{padding:12px 12px 14px}.panel-actions{margin-top:0;margin-left:-14px;margin-right:-14px;padding:10px 14px 12px}.res-row{gap:6px;margin-top:8px}}@media (max-width: 820px) or (pointer: coarse){#app{-webkit-tap-highlight-color:transparent}.topbar{height:48px;padding:0 12px}.seg-btn{height:40px}.field,.res-input,.dropdown-trigger{height:44px}.modal{max-width:100%}.modal-backdrop{padding:12px}.comfy-chip{height:34px;padding:0 10px}.settings-btn,.icon-btn{width:36px;height:36px}.link-btn{width:40px;height:40px}.swatch,.range{height:44px}.range::-webkit-slider-thumb{width:22px;height:22px;margin-top:-8px}.range::-moz-range-thumb{width:18px;height:18px}.btn{height:46px}.btn.small{height:36px;padding:0 14px}.ba-handle span{width:42px;height:42px}.ba-handle span:before,.ba-handle span:after{height:10px;margin-top:-5px}.ba-handle span:before{left:10px}.ba-handle span:after{right:10px}.dropzone-title{font-size:16px}.dropzone-sub{font-size:14px}}
