/* Editor styles — extracted from the desktop app (tools/extract-editor-css.mjs). Site styles: site.css */
.nav { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; flex: 0 1 auto; }
.seg-b { transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s; }
.seg-b:active { transform: scale(.96); }
.btn { transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .btn,
.seg-b { transition: none; }
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.upload { grid-area: upload; border: 2px dashed var(--line-2); box-shadow: none; background: var(--soft-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 16px; text-align: center; gap: 4px; transition: background .15s, border-color .15s; }
.upload.hover { border-color: var(--blue); background: var(--blue-soft); }
.up-cloud { width: 46px; height: 46px; color: var(--blue); }
.upload h2 { font-size: 19px; }
.upload p { margin: 0; color: var(--muted); }
.upload .btn { min-width: 190px; justify-content: center; margin: 4px 0; }
.how { display: none; grid-area: how; padding: 14px 16px; background: var(--blue-soft); border-color: var(--line); }
.files { grid-area: files; display: flex; flex-direction: column; min-height: 0; }
.thumb { width: 80px; height: 54px; border-radius: 6px; border: 1px solid var(--line); background: var(--well); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; padding: 0; }
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
button.thumb { cursor: pointer; }
button.thumb:hover { border-color: var(--blue); }
.thumb.working img { opacity: .4; }
.spinner { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .12); border-top-color: var(--blue); animation: spin .9s linear infinite; }
.spinner { position: static; width: 36px; height: 36px; border-width: 4px; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: var(--blue-d); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-d); }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.pe-sig { margin: 0 14px 8px; align-items: center; }
.pe-sig .es-tx { flex: 1; }
.pe-sig .btn { flex: none; }
.btn-danger-outline { background: var(--surface); color: var(--red); border-color: #f1a8a8; }
.btn-danger-outline:hover:not(:disabled) { background: var(--red-soft); }
.btn-outline { background: var(--surface); border-color: var(--line-2); }
.btn-outline:hover:not(:disabled) { border-color: #6b7280; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--well); color: var(--text); }
.crop { grid-area: crop; display: flex; flex-direction: column; min-height: 0; }
.pager { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.btn-page { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 20px; line-height: 1; }
.btn-page:disabled { opacity: .4; cursor: default; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font-size: 12.5px; color: var(--label); }
.tool svg { width: 22px; height: 22px; }
.tool:hover:not(:disabled) { border-color: var(--blue-line); background: var(--blue-soft); }
.tool.primary { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-d); }
.tool:disabled { opacity: .45; cursor: default; }
.set { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.set svg { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--muted); }
.set select { height: 32px; min-width: 92px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.target { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--label); }
.target input { width: 110px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; font-weight: 700; }
.g2 { grid-template-columns: 1fr 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.paper { width: 210mm; height: 297mm; flex: none; transform-origin: top left; box-shadow: 0 6px 24px rgba(15, 23, 42, .18); background: #fff; }
.pg-t { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; padding: 0; }
.sw.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 111, 232, .25); }
.sw[data-bg="#ffffff"] { background: #ffffff; }
.sw[data-bg="#8cc4f0"] { background: #8cc4f0; }
.small-btn { padding: 5px 10px; font-size: 12.5px; align-self: flex-start; }
.straight { display: grid; grid-template-columns: 82px 1fr 38px auto; align-items: center; gap: 8px; font-size: 12.5px; }
.straight input { width: 100%; accent-color: var(--blue); }
.cw { display: flex; gap: 12px; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg-b { border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg-b.sel { background: var(--surface); color: var(--blue); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.modal,
.progress { position: fixed; inset: 0; z-index: 120; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card,
.progress-card { background: var(--surface); border-radius: 16px; padding: 24px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); text-align: center; }
.modal-card h2 { margin: 0 0 8px; font-size: 20px; }
.modal-card p { color: var(--muted); margin: 0 0 18px; word-break: break-word; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.progress-card { max-width: 340px; font-weight: 600; }
.pw-modal { z-index: 125; }
.pw-card { text-align: left; }
.pw-card h2 { text-align: center; }
.pw-card .pw-file { color: var(--text); font-weight: 600; text-align: center; margin-bottom: 8px; }
.pw-card .pw-help { font-size: 13px; margin-bottom: 12px; }
.pw-in { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text); margin-bottom: 8px; }
.pw-in:focus { border-color: var(--blue); outline: 2px solid rgba(29, 111, 232, .2); }
.pw-show { margin-bottom: 12px; font-size: 14px; }
.pw-card .pw-err { color: var(--red); font-weight: 600; margin: 0 0 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 130; background: #111827; color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; max-width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
.qr-sel { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--surface); }
.qr-sel:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.work-pe { flex: 1; min-width: 0; min-height: 0; padding: 18px; overflow: hidden; display: flex; }
.pe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.pe-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pe-name { font-weight: 700; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pe-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) 270px; }
.pe-rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-right: 1px solid var(--line); overflow: auto; }
.pe-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1.5px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--label); }
.pe-tool b { font-size: 18px; line-height: 1.1; }
.pe-tool:hover { background: var(--surface-2); }
.pe-tool.sel { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.pe-stage { overflow: auto; background: var(--well); position: relative; padding: 18px; display: flex; justify-content: safe center; align-items: flex-start; }
.pe-drop { margin: auto; width: min(460px, 90%); }
.pe-page { position: relative; box-shadow: 0 4px 20px rgba(0, 0, 0, .18); background: #fff; flex: none; }
.pe-page canvas { display: block; }
.pe-layer { position: absolute; inset: 0; }
.pe-line { position: absolute; border-radius: 2px; }
.pe-edit.ghost { outline-style: dashed; }
.pe-obj.editing { visibility: hidden; }
.pe-edit { position: absolute; white-space: pre; outline: 2px solid var(--blue); outline-offset: 1px; line-height: 1; padding: 0; margin: 0; min-width: 8px; z-index: 5; cursor: text; }
.pe-obj { position: absolute; box-sizing: border-box; }
.pe-obj.sel { outline: 1.5px dashed var(--blue); outline-offset: 2px; }
.pe-obj .pe-h { position: absolute; right: -7px; bottom: -7px; width: 12px; height: 12px; border-radius: 3px; background: var(--blue); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.pe-obj.sel .pe-h { display: block; }
.pe-stage.hand,
.pe-stage.hand .pe-layer,
.pe-stage.hand .pe-layer .pe-line,
.pe-stage.hand .pe-layer .pe-obj { cursor: grab; }
.pe-stage.grabbing,
.pe-stage.grabbing .pe-layer,
.pe-stage.grabbing .pe-layer .pe-line,
.pe-stage.grabbing .pe-layer .pe-obj { cursor: grabbing; }
.pe-obj-text { white-space: pre; line-height: 1.2; }
.pe-obj img,
.pe-obj svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pe-rubber { position: absolute; border: 1.5px dashed var(--blue); background: rgba(29, 111, 232, .08); pointer-events: none; }
.se-body { grid-template-columns: minmax(0, 1fr) 300px; }
.work-se:not(.has) .pe-top > :not(#seOpen):not(.pe-name) { opacity: .55; }
.se-scan { position: absolute; inset: 0; overflow: hidden; pointer-events: none; display: none; background: rgba(15, 23, 42, .10); }
#sePage.scanning .se-scan,
#pePage.scanning .se-scan { display: block; }
.se-scan::before { content: ''; position: absolute; left: 0; right: 0; top: -110px; height: 110px; background: linear-gradient(to bottom, rgba(59, 130, 246, 0), rgba(59, 130, 246, .20) 65%, rgba(59, 130, 246, .50)); border-bottom: 2px solid #60a5fa; box-shadow: 0 8px 22px rgba(59, 130, 246, .75); animation: se-sweep 1.7s cubic-bezier(.45, 0, .55, 1) infinite; }
.se-scan::after { content: ''; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(rgba(96, 165, 250, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(96, 165, 250, .16) 1px, transparent 1px); background-size: 26px 26px; animation: se-grid 1.7s ease-in-out infinite; }
@keyframes se-sweep { from { top: -110px; } to { top: 100%; } }
@keyframes se-grid { 0%, 100% { opacity: .15; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .se-scan::before,
.se-scan::after { animation-duration: 4s; }
}
.se-hover { position: absolute; outline: 1.5px solid rgba(29, 111, 232, .85); background: rgba(29, 111, 232, .10); pointer-events: none; border-radius: 2px; }
.se-word { position: absolute; outline: 1px solid rgba(29, 111, 232, .45); pointer-events: none; }
.se-sel { position: absolute; outline: 2px dashed var(--blue); outline-offset: 1px; pointer-events: none; }
.se-band { position: absolute; outline: 2px dashed #ea580c; background: rgba(234, 88, 12, .10); pointer-events: none; }
.pe-stage.on-word { cursor: text; }
.pe-stage.on-word #sePage,
.pe-stage.on-word #seLayer { cursor: text; }
#sePage { cursor: grab; }
.pe-layer.se-area-on { cursor: crosshair; }
.pe-stage.grabbing,
.pe-stage.grabbing #sePage { cursor: grabbing; }
.se-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.se-chip { border: 1px solid var(--line-2); background: var(--card, #fff); border-radius: 8px; padding: 4px 9px; font-size: 13px; cursor: pointer; color: inherit; }
.se-chip.sel { border-color: var(--blue); background: rgba(29, 111, 232, .10); }
.se-nudge { gap: 4px; }
.pe-props .se-warn { color: #b45309; font-weight: 600; }
#seSize { width: 84px; }
#seArea.sel { background: rgba(234, 88, 12, .14); border-color: #ea580c; color: #c2410c; }
.pe-props { border-left: 1px solid var(--line); padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.pe-props h3 { margin: 0; font-size: 14px; }
.pe-props label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--label); }
.pe-props input[type="number"],
.pe-props select,
.pe-props textarea { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; font: inherit; }
.pe-props textarea { min-height: 70px; resize: vertical; }
.pe-props input[type="color"] { width: 48px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; }
.pe-props .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pe-props .note { color: var(--muted); font-weight: 400; line-height: 1.45; }
.pe-hint { padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; min-height: 18px; }
.pe-props label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
:root[data-mode="dark"] .modal { background: rgba(0, 0, 0, 0.6); }
:root[data-mode="dark"] .toast { background: #f3f4f6; color: #111827; }
.heart { width: 20px; height: 20px; color: #e11d48; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .heart { animation: none; }
}
.es-status { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid; border-radius: 12px; padding: 10px 12px; }
.es-status.ok { background: #f0fdf4; border-color: #86efac; }
.es-status.bad { background: #fffbeb; border-color: #fcd34d; }
.es-status.none { background: var(--soft-bg); border-color: var(--line-2); }
.es-ic { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: #16a34a; }
.es-status.bad .es-ic { background: #d97706; }
.es-status.none .es-ic { background: var(--muted); }
.es-tx { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.45; color: #1f2937; }
.es-tx b { font-size: 14px; color: #14532d; }
.es-status.bad .es-tx b { color: #92400e; }
.es-status.none .es-tx b { color: var(--text); }
.es-note { word-break: break-word; }
.es-note { color: #4b5563; }
:root[data-mode="dark"] .es-status.ok { background: #052e16; border-color: #166534; }
:root[data-mode="dark"] .es-status.bad { background: #2a1a05; border-color: #92400e; }
:root[data-mode="dark"] .es-tx,
:root[data-mode="dark"] .es-note { color: var(--text); }
:root[data-mode="dark"] .es-tx b { color: #4ade80; }
:root[data-mode="dark"] .es-status.bad .es-tx b { color: #fbbf24; }
.se-drop-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.se-drop-btns .btn svg,
#seScan svg { width: 18px; height: 18px; }
.ic-gal { display: flex; flex-direction: column; gap: 10px; }
.ic-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ic-bar .btn.on { border-color: var(--green); background: var(--green-soft); color: var(--green-d); }
.ic-col { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--label); cursor: pointer; }
.ic-col input[type="color"] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.ic-item { aspect-ratio: 1; padding: 7px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: grab; touch-action: none; display: flex; align-items: center; justify-content: center; }
.ic-item:hover { border-color: var(--blue); background: var(--blue-soft, #eaf2ff); }
.ic-item svg { width: 100%; height: 100%; pointer-events: none; }
.ic-tip { margin: 0; }
.ic-ghost { position: fixed; z-index: 7000; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; opacity: .85; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .35)); }
.ic-ghost:not(.ok) { opacity: .4; }
.ic-ghost svg { width: 100%; height: 100%; }
.pe-adj { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.pe-adj b { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; order: 3; }
.pe-adj input[type="range"] { flex: 1; min-width: 0; order: 2; }
.se-icon { position: absolute; box-sizing: border-box; pointer-events: auto; cursor: move; touch-action: none; }
.se-icon img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.se-icon.sel { outline: 1.5px dashed var(--blue); outline-offset: 2px; }
.se-ih { display: none; position: absolute; right: -7px; bottom: -7px; width: 12px; height: 12px; border-radius: 3px; background: var(--blue); border: 2px solid #fff; cursor: nwse-resize; }
.se-icon.sel .se-ih { display: block; }
.se-hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.es-status:empty { display: none; }
.pe-top .qr-sel { width: auto; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.pe-top .pager,
.pe-top .btn { flex: none; }
@media (max-height: 820px) {
  .upload { padding: 6px 14px; gap: 2px; }
  .upload .up-cloud { width: 32px; height: 32px; }
  .upload h2 { font-size: 16px; }
  .upload .btn { margin: 2px 0; padding-top: 7px; padding-bottom: 7px; }
  .pe-rail { gap: 2px; padding: 6px 6px; }
  .pe-tool { padding: 4px 3px; gap: 0; }
  .pe-tool b { font-size: 15px; }
}
