/* Isolated document workspace. The conversion website keeps its own layout. */
body.hk-document-editor { min-width: 0; }
.hk-document-editor .editor-topbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:14px 24px; border-bottom:1px solid var(--border-color); background:var(--bg-card); }
.editor-topbar .brand { flex:none; text-decoration:none; }
.editor-topbar .brand img { width:36px; height:36px; }
.editor-title { display:flex; flex:1 1 180px; flex-direction:column; min-width:0; gap:3px; }
.editor-title input { width:100%; min-width:0; border:1px solid transparent; border-radius:8px; padding:5px 8px; color:var(--text-main); background:transparent; font:inherit; font-weight:650; }
.editor-title input:hover,.editor-title input:focus { border-color:var(--border-color); background:var(--bg-main); }
.editor-status { margin:0; padding-left:8px; font-size:.75rem; color:var(--text-muted); }
.editor-file-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.hk-document-editor .editor-file-actions button { min-height:44px; padding:10px 14px; font-size:.82rem; }
.editor-workspace { width:100%; max-width:none; margin:0; padding:0 0 100px; display:block; }
.editor-toolbar { position:sticky; top:calc(var(--editor-header-height, 80px) + 8px); z-index:12; display:flex; flex-wrap:wrap; align-items:center; gap:5px; padding:10px 18px; margin:16px 24px; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-card); }
.editor-toolbar button { min-height:40px; min-width:40px; display:inline-flex; justify-content:center; align-items:center; gap:4px; border:0; border-radius:10px; background:transparent; color:var(--text-main); font:inherit; padding:8px; cursor:pointer; }
.editor-toolbar button:hover { background:var(--bg-hover); }
.editor-toolbar button[aria-pressed="true"] { background:var(--bg-hover); box-shadow:inset 0 0 0 1px var(--border-color); }
.editor-toolbar button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.editor-toolbar select { max-width:150px; min-width:0; min-height:40px; padding:6px 24px 6px 10px; border:1px solid var(--border-color); border-radius:10px; color:var(--text-main); background:var(--bg-card); font:inherit; font-size:.82rem; }
.editor-toolbar button:focus-visible,.editor-toolbar select:focus-visible,.editor-title input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.editor-toolbar button:disabled,.editor-file-actions button:disabled { opacity:.45; cursor:wait; }
.editor-toolbar-separator { width:1px; height:24px; background:var(--border-color); margin:0 4px; }
.editor-info { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin:0 24px 16px; color:var(--text-muted); font-size:.75rem; }
.editor-local { display:inline-flex; align-items:center; gap:7px; }
.editor-local svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; }
.editor-ocr-label { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.editor-ocr-label select { max-width:150px; min-height:36px; padding:4px 8px; border:1px solid var(--border-color); border-radius:9px; color:var(--text-main); background:var(--bg-card); font:inherit; }
.editor-scan-hint { flex-basis:100%; margin:0; font-size:.72rem; }
.editor-notice,.editor-error { max-width:794px; margin:12px auto; padding:12px 16px; border:1px solid var(--border-color); border-radius:14px; font-size:.82rem; line-height:1.55; }
.editor-notice { background:var(--bg-card); color:var(--text-muted); }
.editor-error { color:var(--danger); background:var(--bg-card); }
.editor-canvas { position:relative; max-width:794px; margin:0 auto; }
.editor-paper { --editor-sheet-height:1123px; display:flex; flex-direction:column; gap:28px; width:100%; margin-inline:auto; padding:0; border:0; outline:none; color:#202124; font:12pt/1.6 Arial,"Noto Sans JP","Yu Gothic",sans-serif; overflow-wrap:anywhere; }
.editor-paper[data-editor-empty="true"] { min-height:64px; }
.editor-projects { margin:0 24px 16px; color:var(--text-main); }
.editor-project-actions,.editor-project-item-actions { display:flex; flex-wrap:wrap; gap:8px; }
.editor-projects button { min-height:44px; padding:9px 14px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); color:var(--text-main); font:inherit; font-size:.8rem; cursor:pointer; }
.editor-projects button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.editor-projects button:disabled { opacity:.5; cursor:wait; }
.editor-projects .editor-project-save { background:var(--accent); color:var(--bg-main); font-weight:650; }
.editor-project-status { font-size:.8rem; margin:8px 0 0; overflow-wrap:anywhere; }
.editor-project-status:empty { display:none; }
.editor-project-status[data-error="true"] { color:var(--danger); }
.editor-project-panel { margin-top:12px; padding:16px; border:1px solid var(--border-color); border-radius:18px; background:var(--bg-card); }
.editor-project-panel h2 { margin:0 0 8px; font-size:1rem; }
.editor-project-panel p { color:var(--text-muted); font-size:.8rem; line-height:1.5; }
.editor-project-auto { display:flex; align-items:center; gap:10px; min-height:44px; font-size:.83rem; }
.editor-project-auto input { flex:none; width:20px; height:20px; accent-color:var(--accent); }
.editor-project-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:12px; padding:0; margin:12px 0; list-style:none; }
.editor-project-item { display:flex; flex-direction:column; min-width:0; gap:8px; padding:14px; border:1px solid var(--border-color); border-radius:14px; }
.editor-project-item strong { overflow-wrap:anywhere; font-size:.9rem; }
.editor-project-item>span { color:var(--text-muted); font-size:.75rem; }
.editor-project-item-actions { margin-top:auto; }
@media(max-width:767px) { .editor-projects { margin:0 12px 12px; } .editor-project-panel { padding:12px; } .editor-project-actions>button { flex:1 1 auto; } .editor-project-item-actions>button { flex:1 1 44%; } }
@media print { .editor-projects { display:none!important; } }
.editor-page { display:flow-root; flex:none; width:100%; min-height:var(--editor-sheet-height); padding:64px 68px; border:1px solid #dadce0; border-radius:6px; box-shadow:0 2px 10px #0000000a; background:#fff; }
.editor-paper:focus .editor-page { border-color:#a9b2bf; }
.editor-paper .editor-page[data-editor-positioned="true"] { position:relative; align-self:center; min-height:0; padding:0; border:0; outline:1px solid #dadce0; }
.editor-paper:focus .editor-page[data-editor-positioned="true"] { outline-color:#a9b2bf; }
.editor-page-content { position:absolute; top:0; left:0; width:var(--editor-native-width); height:var(--editor-native-height); transform:scale(var(--editor-page-scale,1)); transform-origin:0 0; isolation:isolate; }
.editor-page-flow { position:relative; z-index:1; width:100%; min-height:100%; }
.editor-page-content > [data-editor-anchor] { position:absolute; display:block; margin:0; padding:0; border:0; overflow:visible; }
.editor-page-content > [data-editor-anchor="image"][data-editor-behind="true"] { pointer-events:none; user-select:none; }
.editor-page-content > [data-editor-anchor] > img { display:block; width:100%; height:100%; max-width:none; }
.editor-page-content [data-editor-text-fit="true"] { display:block; width:max-content; max-width:none; transform-origin:0 0; white-space:pre; overflow-wrap:normal; }
.editor-paper p { margin:0 0 10pt; }
.editor-paper h1,.editor-paper h2,.editor-paper h3 { color:inherit; line-height:1.25; text-align:start; letter-spacing:normal; margin:14pt 0 8pt; }
.editor-paper h1 { font-size:24pt; } .editor-paper h2 { font-size:19pt; } .editor-paper h3 { font-size:15pt; }
.editor-paper img { max-width:100%; height:auto; }
.editor-paper ul,.editor-paper ol { padding-left:24px; }
.editor-paper table { width:100%; table-layout:fixed; border-collapse:collapse; margin:12pt 0; }
.editor-paper td,.editor-paper th { border:1px solid #adb3bc; padding:7px; min-width:25px; vertical-align:top; }
.editor-paper .editor-page[data-page-break] { margin:0; }
.editor-paper [data-page-break]:not(.editor-page) { break-before:page; }
.editor-welcome { position:absolute; top:58px; left:68px; right:68px; color:#747981; pointer-events:none; }
.editor-welcome h1 { font-size:1.4rem; margin:0 0 10px; color:#3b4049; line-height:1.4; }
.editor-welcome p { font-size:.92rem; line-height:1.65; }
.editor-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; max-width:794px; margin:12px auto; color:var(--text-muted); font-size:.75rem; }
.hk-document-editor.dark-mode .editor-page { box-shadow:0 4px 20px #0002; }
@media(max-width:767px) {
 .hk-document-editor .site-header { position:static; }
 .hk-document-editor .editor-topbar { padding:12px; gap:10px; }
 .editor-topbar .brand span { display:none; }
 .editor-title { flex:1 1 160px; }
 .editor-file-actions { width:100%; }
 .hk-document-editor .editor-file-actions button { flex:1 1 auto; font-size:.75rem; padding:9px; }
 .editor-toolbar { top:8px; margin:12px; padding:8px; gap:3px; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; }
 .editor-toolbar > * { flex-shrink:0; }
 .editor-toolbar select { max-width:116px; font-size:.75rem; }
 .editor-toolbar button { min-width:42px; min-height:44px; }
 .editor-info { margin:0 12px 12px; }
 .editor-canvas,.editor-notice,.editor-error,.editor-footer { margin-left:12px; margin-right:12px; }
 .editor-paper { gap:20px; }
 .editor-page { padding:32px 22px; }
 .editor-welcome { top:32px; left:23px; right:23px; }
 .editor-welcome h1 { font-size:1.15rem; }
 .editor-welcome p { font-size:.82rem; }
}
@media print {
 @page { size:A4; margin:18mm; }
 html,body.hk-document-editor { background:white !important; padding:0 !important; margin:0 !important; }
 .hk-document-editor .site-header,.editor-toolbar,.editor-info,.editor-notice,.editor-error,.editor-footer,.editor-welcome,.hk-document-editor .fnav,.hk-document-editor #hk-news-panel,.hk-document-editor .site-footer { display:none !important; }
 .editor-workspace,.editor-canvas,.editor-paper,.editor-page { display:block !important; width:auto !important; max-width:none !important; min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; }
 .editor-paper,.editor-page { color:#000 !important; background:#fff !important; }
 .editor-page[data-page-break="true"] { break-before:page; }
 .editor-paper .editor-page[data-editor-positioned="true"] { width:var(--editor-native-width) !important; height:var(--editor-native-height) !important; min-height:var(--editor-native-height) !important; position:relative !important; outline:0; break-inside:avoid; }
 .editor-page[data-editor-positioned="true"] > .editor-page-content { display:block !important; width:var(--editor-native-width) !important; height:var(--editor-native-height) !important; transform:none !important; }
 .editor-paper [data-page-break] { border:0; margin:0; }
 .editor-paper tr,img { break-inside:avoid; }
}
