*{box-sizing:border-box} :root{--ink:#30253b;--muted:#746b7d;--purple:#68517f;--purple-dark:#4a365e;--paper:#faf7f1;--line:#e1d9e6;--wash:#ede7f2;--gold:#e7cb77;font-family:"Malgun Gothic",Arial,sans-serif;color:var(--ink);background:var(--paper)}body{margin:0;padding-bottom:42px}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:white;color:var(--ink);border-radius:8px;padding:9px 13px;font-size:13px;font-weight:600;transition:background .15s}button:hover{background:var(--wash)}button:disabled{opacity:.42;cursor:default}button.primary{background:var(--purple);border-color:var(--purple);color:white}button.primary:hover{background:var(--purple-dark)}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #ae91c8;outline-offset:3px}input[type=text],input[type=password],input:not([type]),textarea,select{width:100%;border:1px solid #cfc3d8;border-radius:8px;padding:11px 12px;background:white;color:var(--ink)}input[type=checkbox],input[type=radio]{accent-color:var(--purple)}input[type=number]{width:64px;padding:5px;border:1px solid var(--line);border-radius:5px}textarea{resize:vertical;line-height:1.65;min-height:92px}header{height:72px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 32px;background:#fffcf8;position:sticky;top:0;z-index:5}.brand{text-decoration:none;color:var(--ink);font-size:21px;font-weight:bold;letter-spacing:-1px}.brand span{font-weight:400}.header-right{display:flex;align-items:center;gap:10px}#saved{font-size:12px;color:var(--muted);margin-right:8px}button.quiet{background:transparent}.start{max-width:1140px;margin:65px auto 40px;padding:0 28px;display:grid;grid-template-columns:1fr 1.05fr;gap:76px;align-items:center}.eyebrow{color:var(--purple);font-size:14px;font-weight:bold;margin-bottom:22px}.intro h1{font-size:42px;line-height:1.38;letter-spacing:-2px;margin:0 0 26px}.intro>p:last-child{color:var(--muted);font-size:16px;line-height:1.85}.setup{padding:34px;background:#fffdf9;border:1px solid var(--line);border-radius:18px}.field-label{font-size:13px;font-weight:700;display:block;margin:0 0 9px}.translation-toggle{display:flex;align-items:flex-start;gap:10px;padding:25px 0 18px;cursor:pointer}.translation-toggle input{margin-top:5px;width:17px;height:17px}.translation-toggle strong{font-size:15px}.translation-toggle small{display:block;font-size:12px;color:var(--muted);line-height:1.6;margin-top:6px}.method-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 23px}.method-choices label{cursor:pointer;position:relative}.method-choices input{position:absolute;top:13px;left:12px}.method-card{display:block;border:1px solid var(--line);border-radius:10px;padding:15px 12px 15px 34px;height:100%}.method-card strong{font-size:14px}.method-card small{display:block;color:var(--muted);font-size:11px;line-height:1.7;margin-top:9px}.method-choices input:checked+.method-card{border-color:var(--purple);background:#f0eaf5}.large{width:100%;min-height:48px;font-size:15px}.resume{width:100%;margin-top:10px}.fine{color:var(--muted);font-size:11px;line-height:1.8}.setup>.fine{margin:18px 0 0}.workspace{display:grid;grid-template-columns:195px minmax(0,1fr);min-height:calc(100vh - 114px)}.filmstrip{background:#f0eaf2;border-right:1px solid var(--line);padding:18px 13px;position:sticky;top:72px;height:calc(100vh - 114px);overflow:auto}.strip-heading{display:flex;align-items:center;justify-content:space-between;font-size:13px;margin-bottom:14px}.strip-heading button{padding:5px 8px;font-size:11px}.photo-item{border:2px solid transparent;border-radius:9px;margin-bottom:12px;padding:7px;background:#fffcf9}.photo-item.selected{border-color:var(--purple)}.photo-item>button{display:block;width:100%;padding:0;border:0;background:none;text-align:left}.photo-item img{display:block;width:100%;height:92px;object-fit:contain;background:#2b2332;border-radius:4px}.photo-item .photo-name{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;margin-top:6px}.photo-item .photo-label{font-size:11px;margin-top:5px;display:block;color:var(--muted)}.photo-actions{display:flex;justify-content:flex-end;gap:3px;margin-top:6px}.photo-actions button{padding:2px 6px;font-size:10px}.editor{padding:23px 30px;min-width:0;max-width:1600px;width:100%;margin:auto}.editor-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;gap:16px}h2{font-size:22px;margin:0 0 5px}.text-button{background:none;border:0;padding:0;font-size:12px;color:var(--muted);text-decoration:underline}.export-actions{display:flex;gap:8px}.stage-tools{display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:14px}.tabs{display:flex;gap:5px;margin-right:auto}.tabs button{border:0;background:transparent;color:var(--muted)}.tabs button.active{background:var(--wash);color:var(--purple-dark)}#page-label{font-size:12px}.page-buttons{display:flex;gap:4px}.page-buttons button{padding:5px 10px}.crop-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.crop-tools label{font-size:12px;margin:0 6px}.hint{font-size:12px;color:var(--muted);line-height:1.7}.crop-wrap{background:#272130;border-radius:10px;min-height:320px;display:grid;place-items:center;padding:14px;max-height:65vh}.crop-wrap canvas{max-width:100%;max-height:60vh;display:block;touch-action:none}.crop-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:14px;font-size:12px;color:var(--muted)}details{font-size:12px;color:var(--muted);margin-top:12px}#corner-inputs{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}#corner-inputs label{display:flex;gap:4px;align-items:center}.text-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:8px 0 18px;font-size:13px}.text-toolbar p{font-size:12px;color:var(--muted);margin:5px 0}.book-preview-wrap{background:#272130;border-radius:10px;padding:18px;overflow:hidden}#book-preview{position:relative;width:max-content;margin:auto;max-width:100%;line-height:0}#book-preview>img{display:block;max-width:100%;max-height:62vh}.preview-caption{position:absolute;line-height:1.16;font-family:Arial,sans-serif;font-weight:700;display:flex;align-items:center;padding:4px 7px;cursor:move;white-space:pre-line;touch-action:none;outline:1px dashed #68517f99;overflow:hidden}.preview-caption.selected{outline:3px solid #dfbe63}.preview-caption.overlap{outline:3px solid #ca503e}.source-box{position:absolute;border:1px dashed #c16f4e;pointer-events:none;background:#c16f4e09}.caption-heading{display:flex;align-items:center;justify-content:space-between;margin:24px 0 12px}h3{font-size:16px;margin:0}.caption-edit{border-top:1px solid var(--line);padding:18px 0}.caption-edit-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}.caption-edit-head span{color:#a44d34;font-size:11px}.caption-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.caption-fields label{font-size:12px;font-weight:700}.caption-fields textarea{margin-top:7px;font-size:14px;font-weight:400}.caption-options{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px;font-size:11px}.caption-options select{width:122px;padding:6px}.caption-options input[type=color]{padding:0;border:0;width:28px;height:26px}.caption-options button{font-size:11px;padding:6px 9px}.below-caption{padding:12px 18px;background:#fff4df;margin-top:5px;color:#30253b;font:700 20px/1.4 Arial,sans-serif}.below-caption small{font-size:11px;color:var(--muted);display:block;margin-bottom:4px}#analysis-note{color:#9a513d;font-size:12px;margin:12px 0}#no-translation{padding:20px;background:#f0eaf2;border-radius:8px;font-size:14px}.statusbar{position:fixed;bottom:0;left:0;right:0;height:42px;z-index:8;background:#30253b;color:#faf7f1;display:flex;align-items:center;justify-content:space-between;padding:0 24px;font-size:12px;gap:15px}.statusbar button{padding:3px 8px;font-size:11px}.statusbar .error{color:#ffd0ad}#model-info{font-size:10px;color:#cfc2d9;white-space:nowrap}dialog{width:min(540px,92vw);padding:25px;border:1px solid var(--line);border-radius:16px;color:var(--ink);background:var(--paper)}dialog::backdrop{background:#211a2a77}dialog p{font-size:13px;line-height:1.8}.dialog-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.dialog-heading h2{font-size:18px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}[hidden]{display:none!important}.busy{cursor:progress}.busy .workspace button:not(#cancel-batch){pointer-events:none;opacity:.55}
@media(max-width:1000px){.start{gap:30px;margin-top:35px}.intro h1{font-size:32px}.setup{padding:23px}.editor{padding:18px}.workspace{grid-template-columns:155px minmax(0,1fr)}.filmstrip{padding:14px 8px}.editor-heading{align-items:flex-start}.export-actions{flex-wrap:wrap;justify-content:flex-end}.crop-tools button{padding:7px 8px;font-size:11px}}
@media(max-width:700px){header{padding:0 14px;height:62px}.brand{font-size:17px}#saved{display:none}.header-right{gap:4px}.header-right button{padding:7px;font-size:11px}.start{display:block;margin-top:30px}.intro{margin-bottom:30px}.intro h1{font-size:29px}.intro br{display:none}.intro>p:last-child{font-size:14px}.workspace{display:block}.filmstrip{position:relative;top:0;height:auto;max-height:175px;overflow:auto;border-right:0;border-bottom:1px solid var(--line)}#photo-list{display:flex;gap:10px}.photo-item{min-width:120px;width:120px;margin:0}.photo-item img{height:54px}.photo-actions{display:none}.strip-heading{margin-bottom:6px}.editor-heading h2{font-size:18px}.editor{padding:14px}.caption-fields{grid-template-columns:1fr}.text-toolbar{align-items:flex-start}.text-toolbar>button{font-size:11px}.crop-wrap{min-height:220px;padding:6px}.stage-tools{gap:5px}.tabs button{font-size:11px;padding:7px}.statusbar{padding:0 12px;font-size:11px}#model-info{display:none}.crop-bottom{align-items:flex-start;gap:8px}.crop-bottom button{font-size:11px}.book-preview-wrap{padding:10px}}

.access-panel{border:0;border-bottom:1px solid var(--line);padding:0 0 20px;margin:0 0 22px}.access-panel legend{font-size:17px;font-weight:700;margin-bottom:13px}.access-panel>label{display:flex;gap:10px;align-items:flex-start;margin:10px 0;padding:10px;border:1px solid var(--line);border-radius:8px;cursor:pointer}.access-panel>label:has(input:checked){background:var(--wash);border-color:var(--purple)}.access-panel input[type=radio]{margin-top:4px}.access-panel strong{font-size:13px}.access-panel small{display:block;font-size:11px;color:var(--muted);line-height:1.6;margin-top:4px}.access-panel>div{margin:14px 0 10px}#access-connect{width:100%}#access-status{font-size:11px;color:var(--muted);line-height:1.6;margin-bottom:0}.translation-toggle:has(input:disabled){opacity:.55}.start{align-items:start;margin-top:35px}.intro{padding-top:55px}
.upload-actions{display:grid;gap:9px}.strip-heading{flex-wrap:wrap;gap:8px}.strip-actions{display:flex;gap:5px}#local-note{padding:12px;background:var(--wash);border-radius:8px}.busy .upload-actions button{pointer-events:none;opacity:.55}
#book-title+.upload-actions{margin-top:18px}#ai-options{border-top:1px solid var(--line);padding-top:16px;margin-top:20px}#ai-options summary{font-size:14px;font-weight:bold;cursor:pointer}#ai-options .access-panel{border:0;margin:18px 0 0;padding:0}#ai-options .access-panel legend{display:none}.intro h1{word-break:keep-all}
@media(max-width:700px){.intro{padding-top:0;margin-bottom:24px}.start{padding:0 16px;margin-top:24px}.setup{padding:20px}.photo-actions{display:flex}.filmstrip{max-height:205px}.strip-heading button{min-height:38px;padding:6px 12px;font-size:12px}.photo-actions button{min-height:30px;min-width:30px}.editor-heading{flex-wrap:wrap}.statusbar{height:auto;min-height:48px;padding:8px 12px;padding-bottom:max(8px,env(safe-area-inset-bottom));line-height:1.5}body{padding-bottom:75px}input[type=text],input[type=password],input:not([type]),textarea,select{font-size:16px}.stage-tools{flex-wrap:wrap}.intro h1{font-size:28px}.brand span{display:none}.crop-bottom{flex-wrap:wrap}}
@media(max-width:700px){.intro h1 br{display:initial}}
