/* Editor layout (uses design-system tokens from app.css) */
.editor-main { flex: 1; display: flex; min-height: 0; }
.editor-page .site-footer { display: none; }
.editor { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 61px); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; padding: var(--sp-2) var(--sp-3);
  background: var(--surface); border-block-end: 1px solid var(--border); }
.tb-sep { width: 1px; align-self: stretch; background: var(--border); margin-inline: var(--sp-1); }
.zoomv { min-width: 48px; text-align: center; font-size: var(--fs-sm); }
.statusbar { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-1) var(--sp-3); background: var(--surface-2); min-height: 32px; }
.progress { height: 4px; background: var(--surface-2); }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.progress.indeterminate > span { width: 30%; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { from { margin-inline-start: -30%; } to { margin-inline-start: 100%; } }
.workspace { flex: 1; display: flex; min-height: 0; }
.thumbs { width: 170px; flex: none; overflow-y: auto; padding: var(--sp-3); background: var(--surface); border-inline-end: 1px solid var(--border); }
.thumb { position: relative; margin-block-end: var(--sp-3); border: 2px solid transparent; border-radius: var(--radius-sm); padding: 3px; cursor: pointer; background: var(--surface-2); }
.thumb.current { border-color: var(--primary); }
.thumb.dragover { border-style: dashed; border-color: var(--primary); }
.thumb canvas { width: 100%; display: block; background: #fff; box-shadow: var(--shadow); }
.thumb .num { text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.thumb input { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 18px; height: 18px; }
.viewer { flex: 1; overflow: auto; padding: var(--sp-5); display: flex; justify-content: center; align-items: flex-start; }
.empty { margin: auto; max-width: 520px; width: 100%; }
.pagebox { position: relative; background: #fff; box-shadow: var(--shadow); user-select: none; }
.pagebox canvas { display: block; }
.overlay { position: absolute; inset: 0; }
.mode-text .overlay, .mode-image .overlay, .mode-sign .overlay { cursor: crosshair; }
.span-box { position: absolute; border: 1px dashed rgb(37 99 235 / .55); background: rgb(37 99 235 / .08); cursor: text; }
.span-box:hover, .span-box:focus { background: rgb(37 99 235 / .22); border-style: solid; outline: none; }
.drawrect { position: absolute; border: 2px dashed var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); display: none; pointer-events: none; }
.sigpad { width: 100%; height: 180px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }
#wOp { width: 100%; }
@media (max-width: 760px) {
  .thumbs { width: 96px; padding: var(--sp-2); }
  .viewer { padding: var(--sp-2); }
}
#compatBtn[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
#compatNote { margin: 0; border-radius: 0; }
/* PDF pages are drawn in absolute coordinates: never inherit the RTL page direction
   (canvas fillText would align/reorder every glyph right-to-left). See editor.js. */
#editor canvas, .pagebox, .thumbs canvas { direction: ltr; }
.unit-toggle { display: inline-flex; gap: 0; }
.unit-toggle .btn { border-radius: 0; }
.unit-toggle .btn:first-child { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.unit-toggle .btn:last-child { border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.unit-toggle .btn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.span-box.unit-block { border-style: dotted; }
#tUncertain { margin: 0 0 var(--sp-3); }
