/* ==========================================================================
   FOLIO — create.css
   Template gallery, text typesetting and the scanner workbench.
   ========================================================================== */

/* ---------- template thumbnails (pure CSS document miniatures) ---------- */
.tpl-shot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255,255,255,.05), transparent 60%),
    var(--panel-3);
  border-radius: 6px;
  padding: 9px;
  height: 100%;
  overflow: hidden;
}
.tpl-shot[data-orientation="landscape"] { padding: 14px 9px; }
.tpl-paper {
  position: relative;
  width: 100%;
  aspect-ratio: 0.772;
  max-height: 100%;
  background: #fdfcf9;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), 0 0 0 1px rgba(0,0,0,.28);
  overflow: hidden;
  color: #26282c;
  font-family: Georgia, "Times New Roman", serif;
  padding: 8.5% 8%;
}
.tpl-shot[data-orientation="landscape"] .tpl-paper { aspect-ratio: 1.414; width: 100%; }
.tpl-paper i, .tpl-paper span, .tpl-paper b, .tpl-paper div { display: block; }
.tp-line { height: 2.1px; border-radius: 1px; background: #d3d4d6; margin-bottom: 3.4px; }
.tp-line.light { background: #e4e4e6; }
.tp-band { position: absolute; top: 0; left: 0; right: 0; height: 3.5%; background: var(--ta); }
.tp-kicker { font-family: var(--font); font-size: 5px; font-weight: 800; letter-spacing: .16em; color: var(--ta); margin-bottom: 3px; }
.tp-corner { position: absolute; width: 9px; height: 9px; border-color: var(--ta-faint); border-style: solid; opacity: .7; }
.tp-corner.tl { top: 16%; left: 12%; border-width: 1px 0 0 1px; }
.tp-corner.br { bottom: 16%; right: 12%; border-width: 0 1px 1px 0; }
.tp-blank-tag { position: absolute; left: 0; right: 0; top: 47%; text-align: center; font-family: var(--font); font-size: 5.4px; letter-spacing: .1em; color: var(--ta); text-transform: uppercase; }

/* letter */
.tp-letter-top { display: flex !important; justify-content: space-between; align-items: baseline; }
.tp-brand { font-family: var(--font); font-size: 4.6px; font-weight: 800; letter-spacing: .11em; color: #26282c; }
.tp-date { font-family: var(--font); font-size: 4px; color: #90929a; }
.tp-letter-rule { height: 1px; background: #dcdee0; margin: 5px 0 8px; }
.tp-address { width: 52%; margin-bottom: 10px; }
.tp-address .tp-line { height: 1.7px; margin-bottom: 2.6px; }
.tp-subject { font-size: 6.2px; font-weight: 700; color: #23252a; margin-bottom: 7px; letter-spacing: -.01em; }
.tp-letter-body .tp-line { height: 1.7px; margin-bottom: 2.9px; background: #d8d9db; }
.tp-sign { margin-top: 12px; }
.tp-sign-line { width: 46%; height: 1px; background: #c4c6c9; margin-bottom: 3px; }
.tp-sign-name { font-family: var(--font); font-size: 4px; color: #8b8d94; }

/* invoice */
.tp-inv-top { display: flex !important; align-items: center; gap: 4px; margin-bottom: 9px; }
.tp-logo { width: 12px; height: 12px; display: flex !important; align-items: center; justify-content: center; background: var(--ta); color: #fff; font-family: var(--font); font-size: 4.2px; font-weight: 800; border-radius: 1px; flex: none; }
.tp-inv-brand { font-family: var(--font); font-size: 4.8px; font-weight: 700; color: #26282c; flex: 1; }
.tp-inv-word { font-family: var(--font); font-size: 5.4px; font-weight: 800; letter-spacing: .12em; color: var(--ta); }
.tp-inv-meta { display: grid !important; grid-template-columns: 1fr 1fr; gap: 2px 6px; margin-bottom: 8px; }
.tp-inv-meta span { font-family: var(--font); font-size: 3.4px; font-weight: 800; letter-spacing: .1em; color: var(--ta); }
.tp-inv-meta i { height: 1.5px; background: #dedfe1; }
.tp-table { border-top: 1px solid #d9dadd; }
.tp-tr { display: grid !important; grid-template-columns: 1fr 16px 30px; gap: 3px; padding: 2.6px 2px; border-bottom: 1px solid #e6e7e9; }
.tp-tr span { font-family: var(--font); font-size: 3.7px; color: #60636b; text-align: right; }
.tp-tr span:first-child { text-align: left; }
.tp-tr.tp-th { background: var(--ta-soft); border-bottom: 0; }
.tp-tr.tp-th span { font-size: 3px; font-weight: 800; letter-spacing: .06em; color: var(--ta); }
.tp-totals { display: flex !important; justify-content: space-between; align-items: center; background: var(--ta); color: #fff; padding: 3px 4px; margin-top: 6px; border-radius: 1px; }
.tp-totals span { font-family: var(--font); font-size: 3.4px; font-weight: 700; letter-spacing: .1em; }
.tp-totals b { font-family: var(--font); font-size: 5px; }
.tp-pay { margin-top: 8px; }

/* report */
.tp-rep-band { position: absolute; top: 0; left: 0; right: 0; height: 3.5%; background: var(--ta); }
.tp-rep-rail { position: absolute; left: 8%; top: 20%; bottom: 30%; width: 1.2px; background: var(--ta-faint); }
.tp-rep-content { position: absolute; left: 13%; right: 8%; top: 20%; }
.tp-rep-title { font-size: 8.4px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; color: #1f2126; margin: 4px 0 6px; }
.tp-rep-sub { margin-bottom: 12px; }
.tp-rep-meta { display: flex !important; flex-direction: column; gap: 3px; }
.tp-rep-block { position: absolute; right: 8%; bottom: 12%; width: 32%; height: 22%; background: var(--ta-soft); border: 1px solid var(--ta-faint); border-radius: 1px; }
.tp-rep-block span { position: absolute; left: 12%; right: 12%; height: 1.6px; background: var(--ta-faint); top: 34%; }
.tp-rep-block span:nth-child(2) { top: 48%; }
.tp-rep-block span:nth-child(3) { top: 62%; right: 42%; }
.tp-rep-block b { position: absolute; right: 8%; bottom: 6%; font-family: var(--font); font-size: 5px; font-weight: 800; color: var(--ta); }

/* meeting */
.tp-meet-band { background: #1b1e24; margin: -8.5% -8% 7px; padding: 10% 8% 7%; }
.tp-meet-band span { font-family: var(--font); font-size: 3.6px; font-weight: 800; letter-spacing: .18em; color: var(--ta); margin-bottom: 4px; }
.tp-meet-band b { font-size: 7.2px; color: #fff; font-weight: 700; line-height: 1.15; }
.tp-meet-meta { display: grid !important; grid-template-columns: 1fr 1.5fr .9fr; gap: 2px 5px; margin-bottom: 8px; }
.tp-meet-meta span { font-family: var(--font); font-size: 3px; font-weight: 800; letter-spacing: .08em; color: var(--ta); }
.tp-meet-meta i { height: 1.5px; background: #dedfe1; }
.tp-meet-label { font-family: var(--font); font-size: 3.4px; font-weight: 800; letter-spacing: .13em; color: var(--ta); margin-bottom: 4px; }
.tp-meet-label.second { margin-top: 9px; }
.tp-meet-body { margin-bottom: 2px; }
.tp-meet-body .tp-line { height: 1.6px; margin-bottom: 2.6px; }
.tp-action { display: flex !important; align-items: center; gap: 3px; margin-bottom: 3px; }
.tp-action i { width: 4px; height: 4px; border: .7px solid var(--ta); border-radius: .5px; flex: none; }
.tp-action span { height: 1.6px; background: #d6d7d9; border-radius: 1px; }

/* certificate */
.tpl-certificate .tpl-paper { padding: 0; }
.tp-cert-frame { position: absolute; inset: 5%; border: 1px solid var(--ta); }
.tp-cert-inner { position: absolute; inset: 4px; border: .5px solid var(--ta-faint); text-align: center; padding: 9% 10%; }
.tp-cert-issuer { font-family: var(--font); font-size: 3.6px; font-weight: 800; letter-spacing: .2em; color: var(--ta); margin-bottom: 9%; }
.tp-cert-kicker { font-family: var(--font); font-size: 3.4px; font-weight: 800; letter-spacing: .3em; color: #a0a2a8; }
.tp-cert-award { font-size: 7.2px; font-weight: 700; color: #1f2126; line-height: 1.15; margin: 4px 0 5px; }
.tp-cert-rule { width: 18%; height: 1px; background: var(--ta); margin: 0 auto 6px; }
.tp-cert-to { font-size: 3.7px; color: #8b8d94; margin-bottom: 3px; }
.tp-cert-name { font-size: 8px; font-weight: 700; color: var(--ta); margin-bottom: 5px; }
.tp-cert-copy { width: 74%; margin: 0 auto; }
.tp-cert-copy .tp-line { height: 1.5px; margin-bottom: 2.4px; }
.tp-cert-seal { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); width: 15px; height: 15px; border-radius: 50%; border: .8px solid var(--ta); background: var(--ta-soft); color: var(--ta); font-family: var(--font); font-size: 4px; font-weight: 800; display: flex !important; align-items: center; justify-content: center; }
.tp-cert-signs { position: absolute; left: 10%; right: 10%; bottom: 7%; display: flex !important; justify-content: space-between; }
.tp-cert-signs i { width: 30%; height: 1px; background: #ced0d3; }

/* checklist */
.tp-check-title { font-size: 7.4px; font-weight: 700; color: #1f2126; line-height: 1.15; margin: 3px 0 6px; }
.tp-check-intro { margin-bottom: 10px; }
.tp-check-row { display: flex !important; align-items: center; gap: 4px; margin-bottom: 4.4px; }
.tp-box { width: 5px; height: 5px; border: .7px solid #b9bbc0; border-radius: .5px; flex: none; }
.tp-box.on { background: var(--ta); border-color: var(--ta); }
.tp-check-row .tp-line { margin-bottom: 0; height: 1.7px; }

/* ---------- gallery ---------- */
.tpl-gallery { display: flex; flex-direction: column; gap: 12px; }
.tpl-gallery-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11.5px; color: var(--muted);
}
.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpl-card {
  display: flex; flex-direction: column; gap: 0; padding: 0; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; color: var(--text); transition: border-color .12s, transform .12s, box-shadow .12s;
}
.tpl-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.tpl-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 26px rgba(0,0,0,.3); }
.tpl-thumb { display: block; height: 148px; padding: 0; border-bottom: 1px solid var(--line); }
.tpl-thumb .tpl-shot { height: 100%; border-radius: 0; }
.tpl-meta { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px 10px; }
.tpl-name { font-size: 12px; font-weight: 650; letter-spacing: -.005em; }
.tpl-desc { font-size: 10.5px; color: var(--muted); line-height: 1.42; }
.tpl-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.tpl-gallery-foot {
  display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint);
  border-top: 1px solid var(--line); padding-top: 9px;
}

/* ---------- template editor ---------- */
.tpl-form { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 18px; align-items: start; }
.tpl-form-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tpl-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.tpl-field { display: flex; flex-direction: column; gap: 5px; grid-column: span 1; min-width: 0; }
.tpl-field.wide { grid-column: 1 / -1; }
.tpl-field > span { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.tpl-field textarea.input { min-height: 58px; font-size: 12px; line-height: 1.5; }
.tpl-field .field-hint { font-style: normal; }
.tpl-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tpl-accent-field { gap: 6px; }
.tpl-accents { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-accent {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 7px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 10.5px; font-weight: 600;
}
.tpl-accent i { width: 12px; height: 12px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.tpl-accent:hover { color: var(--text); border-color: var(--line-strong); }
.tpl-accent.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.tpl-form-error { font-size: 11px; color: var(--err); }
.tpl-form-aside { position: sticky; top: 0; display: flex; flex-direction: column; gap: 7px; }
.tpl-preview-label { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.tpl-preview { height: 244px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-3); }
.tpl-preview .tpl-shot { height: 100%; }
.tpl-preview-caption { font-size: 10px; color: var(--muted); }
.tpl-preview-note { margin: 0; font-size: 10px; line-height: 1.45; color: var(--faint); }

/* ---------- from text ---------- */
.txt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: stretch; }
.txt-main { display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.txt-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.txt-file-tools { display: flex; gap: 6px; }
.txt-text-field { min-width: 0; }
.txt-input { min-height: 220px; max-height: 300px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; resize: vertical; }
textarea.txt-input { min-height: 220px; max-height: 300px; }
.txt-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.txt-range { grid-column: span 2; }
.txt-range > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.txt-range output { font-family: var(--mono); font-size: 10px; color: var(--text-soft); text-transform: none; letter-spacing: 0; }
.txt-range input[type=range] { accent-color: var(--accent); height: 30px; }
.txt-error { font-size: 11px; color: var(--err); }
.txt-preview { display: flex; flex-direction: column; gap: 8px; min-height: 380px; }
.txt-preview-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700;
}
.txt-pagecount { font-family: var(--mono); letter-spacing: 0; text-transform: none; font-size: 10px; color: var(--muted); }
.txt-preview-stage {
  position: relative; flex: 1; min-height: 300px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background:
    repeating-conic-gradient(rgba(255,255,255,.018) 0% 25%, transparent 0% 50%) 50% / 14px 14px,
    var(--panel-3);
  overflow: hidden; padding: 14px;
}
#txt-preview-canvas { display: none; max-width: 100%; max-height: 100%; box-shadow: 0 8px 26px rgba(0,0,0,.45); border-radius: 2px; }
#txt-preview-canvas.ready { display: block; }
.txt-preview-empty { font-size: 11px; color: var(--faint); text-align: center; padding: 20px; }
.txt-preview-busy {
  position: absolute; inset: auto 10px 10px auto; display: none; align-items: center; gap: 5px;
  background: rgba(10,12,16,.86); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 9px 4px 7px; font-size: 10px; color: var(--muted);
}
.txt-preview-busy.on { display: inline-flex; }
.txt-spinner { display: flex; animation: txtSpin 1.1s linear infinite; }
@keyframes txtSpin { to { transform: rotate(360deg); } }
.txt-preview-foot { display: flex; gap: 5px; font-size: 10px; line-height: 1.45; color: var(--faint); }
.txt-preview-foot svg { flex: none; margin-top: 1px; }

/* ---------- scanner ---------- */
.scan-root { display: flex; flex-direction: column; gap: 12px; }
.scan-root [hidden] { display: none !important; }
.scan-root .btn:disabled, .dialog-foot .btn:disabled { opacity: .42; cursor: default; pointer-events: none; }
.scan-main { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 12px; }
.scan-stage {
  position: relative; min-height: 400px; height: 46vh; max-height: 520px;
  background: #07090c; border: 1px solid var(--line); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.scan-video { width: 100%; height: 100%; object-fit: contain; background: #07090c; display: none; }
.scan-stage.is-live .scan-video { display: block; }
.scan-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  padding: 24px; color: var(--faint); max-width: 320px;
}
.scan-placeholder b { font-size: 12.5px; color: var(--text-soft); font-weight: 600; }
.scan-placeholder span { font-size: 11px; line-height: 1.5; }
.scan-placeholder-icon {
  width: 54px; height: 54px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); margin-bottom: 4px;
}
.scan-edit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; }
.scan-img-wrap { position: relative; line-height: 0; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.scan-canvas { background: #fff; display: block; }
.scan-crop {
  position: absolute; border: 1.5px solid var(--accent); cursor: move;
  box-shadow: 0 0 0 9999px rgba(4,6,10,.55);
}
.scan-crop-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, transparent calc(33.333% - .5px), rgba(255,255,255,.28) 33.333%, transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.28) 66.666%, transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), rgba(255,255,255,.28) 33.333%, transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), rgba(255,255,255,.28) 66.666%, transparent calc(66.666% + .5px));
}
.scan-handle {
  position: absolute; width: 11px; height: 11px; background: var(--accent);
  border: 2px solid #0b0d11; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.scan-handle.h-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.scan-handle.h-n  { top: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.scan-handle.h-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.scan-handle.h-e  { top: 50%; right: -6px; margin-top: -5px; cursor: ew-resize; }
.scan-handle.h-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.scan-handle.h-s  { bottom: -6px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.scan-handle.h-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.scan-handle.h-w  { top: 50%; left: -6px; margin-top: -5px; cursor: ew-resize; }

.scan-side { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.scan-block {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 7px;
}
.scan-block .field > span { font-size: 9.5px; }
.scan-block .input { height: 30px; font-size: 11.5px; }
.scan-block-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--faint);
}
.scan-block-title svg { color: var(--muted); }
.scan-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-left: auto; transition: background .15s; }
.scan-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(75,214,162,.15); }
.scan-button-row { display: flex; gap: 6px; }
.scan-button-row .btn { flex: 1; justify-content: center; }
.scan-status { margin: 0; font-size: 10px; line-height: 1.45; color: var(--muted); }
.scan-status[data-kind="warn"] { color: var(--warn); }
.scan-status[data-kind="ok"] { color: var(--muted); }
.scan-tip { margin: 0; font-size: 10px; line-height: 1.45; color: var(--faint); }
.scan-import-btn { width: 100%; justify-content: center; }
.scan-capture-btn { width: 100%; justify-content: center; }
.scan-add-page { width: 100%; justify-content: center; }
.scan-seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.scan-seg button {
  flex: 1; height: 26px; border: 0; background: transparent; color: var(--muted);
  font-size: 10.5px; font-weight: 600; border-right: 1px solid var(--line);
}
.scan-seg button:last-child { border-right: 0; }
.scan-seg button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.scan-seg button.on { background: var(--accent-soft); color: var(--accent); }
.scan-fallback { display: flex; gap: 6px; margin: 0; font-size: 10px; align-items: flex-start; }
.scan-fallback svg { flex: none; margin-top: 1px; }
.scan-fallback[hidden] { display: none; }

.scan-tray { border-top: 1px solid var(--line); padding-top: 9px; }
.scan-tray-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.scan-tray-head > span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-soft); }
.scan-tray-head b { font-weight: 650; }
.scan-thumbs {
  display: flex; gap: 8px; overflow-x: auto; min-height: 104px; padding-bottom: 4px; align-items: flex-start;
}
.scan-empty {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 96px;
  border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--faint);
  font-size: 10.5px; padding: 12px 18px; text-align: center;
}
.scan-thumb {
  position: relative; flex: none; width: 108px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel-2); overflow: hidden;
}
.scan-thumb-img { display: flex; align-items: center; justify-content: center; height: 82px; background: #07090c; }
.scan-thumb-img img { max-width: 100%; max-height: 100%; display: block; }
.scan-thumb-foot { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px; font-size: 9px; color: var(--faint); }
.scan-thumb-foot b { color: var(--text-soft); }
.scan-thumb-actions {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between;
  padding: 2px 3px; background: linear-gradient(transparent, rgba(7,9,12,.86) 45%);
  opacity: 0; transition: opacity .12s;
}
.scan-thumb:hover .scan-thumb-actions { opacity: 1; }
.scan-mini {
  width: 20px; height: 20px; border-radius: 4px; border: 0; background: rgba(255,255,255,.08);
  color: var(--text-soft); display: inline-flex; align-items: center; justify-content: center;
}
.scan-mini:hover { background: rgba(255,255,255,.16); color: var(--text); }
.scan-mini.danger:hover { background: rgba(255,111,111,.2); color: var(--err); }
.scan-mini:disabled { opacity: .3; pointer-events: none; }

.scan-save-bar {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr .8fr; gap: 9px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.scan-save-bar .field > span { font-size: 9.5px; }
.scan-save-bar .input { height: 31px; font-size: 11.5px; }

/* ---------- create panel ---------- */
.create-intro {
  display: flex; gap: 10px; padding: 12px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: linear-gradient(140deg, var(--accent-soft), rgba(255,255,255,.012) 70%);
}
.create-mark {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--accent);
}
.create-intro-copy h3 { margin: 0 0 3px; font-size: 12.5px; font-weight: 650; letter-spacing: -.005em; }
.create-intro-copy p { margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); }
.create-quick { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.create-action {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 8px;
  border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left;
  color: var(--text-soft);
}
.create-action:hover { background: rgba(255,255,255,.045); border-color: var(--line); color: var(--text); }
.create-action-ic {
  width: 26px; height: 26px; border-radius: 6px; flex: none; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border: 1px solid rgba(124,147,255,.16);
}
.create-action-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.create-action-main b { font-size: 11.5px; font-weight: 600; }
.create-action-main small { font-size: 9.5px; color: var(--faint); line-height: 1.35; }
.create-action-go { color: var(--faint); display: flex; }
.create-action:hover .create-action-go { color: var(--accent); }
.create-recent { display: flex; flex-direction: column; gap: 4px; }
.create-recent-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 6px;
  border-radius: 7px; border: 1px solid transparent; background: transparent; text-align: left; color: var(--text-soft);
}
.create-recent-row:hover { background: rgba(255,255,255,.045); border-color: var(--line); color: var(--text); }
.create-recent-shot { width: 34px; height: 44px; flex: none; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.create-recent-shot .tpl-shot { padding: 3px; border-radius: 0; background: var(--panel-3); }
.create-recent-shot .tpl-paper { border-radius: 1px; }
.create-recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.create-recent-main b { font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-recent-main small { font-size: 9px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-empty { font-size: 10px; color: var(--faint); padding: 8px 2px; }
.create-note { margin-top: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tpl-form { grid-template-columns: 1fr; }
  .tpl-form-aside { display: none; }
  .txt-layout { grid-template-columns: 1fr; }
  .txt-preview { display: none; }
  .scan-main { grid-template-columns: 1fr; }
  .scan-stage { height: 340px; }
  .scan-save-bar { grid-template-columns: 1fr 1fr; }
  .txt-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl-thumb { height: 168px; }
}
