/* Metre2 Fill & Sign PDF - "the signing desk". Warm walnut desk, paper pages, frosted ink tray,
   seal red #e4573a to coral #ff8a5c accents. */
@font-face { font-family: 'Inter'; src: url('fonts/inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Dancing Script'; src: url('fonts/dancing-script.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Great Vibes'; src: url('fonts/great-vibes.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Caveat'; src: url('fonts/caveat.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Homemade Apple'; src: url('fonts/homemade-apple.woff2') format('woff2'); font-display: block; }

:root {
  --bg: #17130f; --bg2: #211a14; --wood1: #2a2018; --wood2: #1a140f;
  --panel: rgba(38, 31, 25, 0.78); --panel-solid: #2a221b; --line: rgba(255, 236, 214, 0.1); --line2: rgba(255, 236, 214, 0.18);
  --text: #f6ece2; --muted: #b9a998; --dim: #8a7b6c;
  --acc: #e4573a; --acc2: #ff8a5c; --acc-soft: rgba(228, 87, 58, 0.16); --glow: 0 6px 22px rgba(228, 87, 58, 0.35);
  --ok: #3fbf7f; --warn: #f0b04a; --bad: #ef5c5c;
  --paper-shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.45);
  --radius: 12px;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { font-size: 13.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
a { color: var(--acc2); }

#app { position: fixed; inset: 0; display: grid; grid-template-rows: 58px 1fr; }
#app::before { /* the desk */
  content: ''; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(255, 138, 92, 0.10), transparent 60%),
    radial-gradient(900px 700px at 5% 110%, rgba(228, 87, 58, 0.08), transparent 60%),
    repeating-linear-gradient(92deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wood1), var(--wood2));
}

/* ---- top bar ---- */
.bar { display: flex; align-items: center; gap: 18px; padding: 0 16px; background: rgba(23, 19, 15, 0.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.seal { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--acc), var(--acc2)); box-shadow: var(--glow); color: #fff; }
.seal svg { width: 17px; height: 17px; stroke-width: 2.2; }
.brand-name { font-size: 15px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 999px; }
.tab { border: 0; background: none; padding: 6px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.on { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; box-shadow: var(--glow); }
.tab.on .pro-tag { background: rgba(255,255,255,0.22); color: #fff; }
.bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pro-tag { font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; padding: 1px 5px; border-radius: 5px; background: rgba(240, 176, 74, 0.18); color: #f3c06a; vertical-align: 1px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: rgba(255,255,255,0.05); color: var(--text); padding: 7px 13px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; transition: transform .12s, background .15s, box-shadow .15s; }
.btn:hover { background: rgba(255,255,255,0.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.main { border: 0; background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; box-shadow: var(--glow); }
.btn.main:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.soft { background: var(--acc-soft); border-color: rgba(228, 87, 58, 0.35); color: #ffc2ae; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.big { padding: 11px 22px; font-size: 14.5px; border-radius: 12px; }
.btn.icon { padding: 7px; }
.btn.wide { width: 100%; margin-top: 8px; }

/* ---- welcome ---- */
.welcome { grid-row: 2; display: grid; place-items: center; padding: 24px; overflow: auto; }
#app:not(.empty) .welcome { display: none; }
#app.empty #view-sign { display: none; }
.welcome-card { max-width: 620px; text-align: center; }
.welcome-card h2 { font-size: 28px; letter-spacing: -0.02em; margin: 22px 0 8px; }
.lede { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.welcome-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.or { color: var(--dim); }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: left; }
.points li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; color: var(--muted); }
.points b { color: var(--text); }
.paper-art { position: relative; width: 210px; height: 170px; margin: 0 auto; }
.paper-art .sheet { position: absolute; width: 130px; height: 160px; border-radius: 6px; background: #fbf8f3; box-shadow: var(--paper-shadow); }
.paper-art .back { left: 30px; top: 8px; transform: rotate(-8deg); background: #ece5da; }
.paper-art .front { left: 58px; top: 2px; transform: rotate(4deg); padding: 18px 14px; }
.paper-art .front i { display: block; height: 4px; border-radius: 2px; background: #d9d1c5; margin-bottom: 11px; }
.paper-art .front i.short { width: 60%; }
.tickmark { position: absolute; left: 16px; top: 66px; color: #1b3a8a; font-size: 20px; }
.scrawl { position: absolute; left: 22px; bottom: 30px; width: 80px; height: 26px; border-bottom: 2px solid #c7bdb0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 26'%3E%3Cpath d='M2 20c6-2 7-14 12-14s0 14 6 14 6-10 11-10 3 7 8 7 7-12 13-12 4 11 10 11 8-6 16-6' fill='none' stroke='%23142a6b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat; animation: write 2.4s ease-in-out infinite alternate; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stamp-art { position: absolute; right: -16px; bottom: 6px; transform: rotate(-12deg); border: 2px solid #1d7f45; color: #1d7f45; font-weight: 800; font-size: 11px; letter-spacing: .12em; padding: 3px 7px; border-radius: 5px; background: rgba(255,255,255,0.6); }

/* ---- sign view ---- */
#view-sign { grid-row: 2; display: grid; grid-template-columns: 116px 1fr 300px; min-height: 0; }
.thumbs { overflow-y: auto; padding: 14px 12px; border-right: 1px solid var(--line); background: rgba(16, 13, 10, 0.45); }
.thumb { display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; position: relative; }
.thumb canvas { display: block; width: 100%; border-radius: 4px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.thumb.on { border-color: var(--acc); }
.thumb .n { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 700; background: rgba(0,0,0,.6); color: #fff; border-radius: 4px; padding: 0 5px; }
.thumb .dot { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 2px #fff; }

.desk { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.doc-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px 0 86px; color: var(--muted); font-size: 12.5px; min-height: 30px; }
.doc-head b { color: var(--text); font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.chip.acc { background: var(--acc-soft); border-color: rgba(228,87,58,.35); color: #ffc2ae; }
.dock { position: absolute; left: 14px; top: 46px; z-index: 4; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 16px; background: var(--panel); backdrop-filter: blur(16px); border: 1px solid var(--line2); box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.tool { width: 58px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border: 0; border-radius: 11px; background: none; color: var(--muted); cursor: pointer; font-size: 10.5px; font-weight: 600; }
.tool:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.tool.on { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #fff; box-shadow: var(--glow); }
.tool.sm { padding: 6px 0; }
.tool:disabled { opacity: .35; cursor: default; background: none; }
.dock-gap { height: 1px; background: var(--line); margin: 4px 6px; }
.pages { overflow: auto; padding: 12px 24px 80px 92px; scroll-behavior: auto; }
.page { position: relative; margin: 0 auto 22px; background: #fff; box-shadow: var(--paper-shadow); border-radius: 2px; }
.page canvas.pc { position: absolute; inset: 0; width: 100%; height: 100%; }
.page .layer { position: absolute; inset: 0; }
.page .pno { position: absolute; left: -38px; top: 0; color: var(--dim); font-size: 11px; font-weight: 700; }
.desk.t-text .layer, .desk.t-tick .layer, .desk.t-cross .layer, .desk.t-date .layer { cursor: crosshair; }
.desk.t-sig .layer, .desk.t-initials .layer, .desk.t-stamp .layer { cursor: copy; }
.ghost-guide { position: absolute; height: 0; border-top: 2px dashed var(--acc); pointer-events: none; opacity: .8; }

/* placed items */
.it { position: absolute; user-select: none; touch-action: none; }
.it.sel { outline: 1.5px solid var(--acc); outline-offset: 2px; border-radius: 2px; }
.it.txt { font-family: Helvetica, Arial, sans-serif; color: #12161f; white-space: pre; line-height: 1.2; cursor: text; outline-offset: 2px; }
.it.txt[contenteditable="true"] { outline: 1.5px dashed var(--acc); background: rgba(228,87,58,0.06); }
.it.txt:empty::before { content: 'Type here'; color: #9aa; }
.it.ink-blue { color: #1c3b99 !important; }
.it img { width: 100%; height: 100%; display: block; pointer-events: none; }
.it svg { width: 100%; height: 100%; stroke-width: 3; pointer-events: none; }
.it.mark { color: #12161f; cursor: move; }
.it.sig, .it.initials { cursor: move; }
.it.stamp { cursor: move; border-radius: 6px; border: 2px solid currentColor; background: rgba(255,255,255,0.0); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: Helvetica, Arial, sans-serif; overflow: hidden; }
.it.stamp::after { content: ''; position: absolute; inset: 2px; border: 0.5px solid currentColor; border-radius: 4px; opacity: .7; }
.it.stamp b { font-weight: 700; letter-spacing: .02em; line-height: 1; }
.it.stamp span { line-height: 1.15; }
.handle { position: absolute; right: -7px; bottom: -7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--acc); cursor: nwse-resize; }
.it:not(.sel) .handle { display: none; }
.k-received { color: #1f61b8; } .k-approved { color: #1a8040; } .k-comments { color: #bf730d; } .k-rejected { color: #c72121; } .k-checked { color: #0d7878; } .k-custom { color: #54389a; }

/* form fields */
.fld { position: absolute; border: 0; margin: 0; padding: 0 3px; background: rgba(255, 196, 120, 0.22); outline: 1px solid rgba(214, 120, 40, 0.45); font-family: Helvetica, Arial, sans-serif; color: #10141c; border-radius: 1px; }
.fld:focus { background: rgba(255, 196, 120, 0.38); outline: 2px solid var(--acc); }
textarea.fld { resize: none; padding-top: 2px; line-height: 1.2; }
.fld.cb { display: grid; place-items: center; cursor: pointer; padding: 0; font-weight: 700; color: #1c3b99; }
.fld.ro { background: transparent; outline: 1px dashed rgba(0,0,0,.2); pointer-events: none; }

.hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(23,19,15,0.88); border: 1px solid var(--line2); color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 12.5px; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.hint.show { opacity: 1; }

/* ---- ink tray ---- */
.tray { border-left: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(16px); min-height: 0; display: flex; }
.tray-scroll { overflow-y: auto; padding: 14px 16px 24px; width: 100%; }
.tray-sec { padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tray-sec:last-child { border-bottom: 0; }
.tray h3 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
.sig-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sig-card { position: relative; height: 66px; border-radius: 10px; background: #fbf8f3; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; padding: 15px 6px 5px; }
.sig-card img { position: relative; z-index: 0; }
.sig-card img { max-width: 100%; max-height: 46px; object-fit: contain; display: block; }
.sig-card.on { border-color: var(--acc); box-shadow: var(--glow); }
.sig-card .kind { z-index: 1; position: absolute; left: 5px; top: 3px; font-size: 9px; font-weight: 800; color: #9a8f82; letter-spacing: .06em; text-transform: uppercase; }
.sig-card .del { position: absolute; right: 2px; top: 0; border: 0; background: none; color: #9a8f82; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.sig-card .del:hover { color: var(--bad); }
.sig-empty { grid-column: 1 / -1; color: var(--dim); font-size: 12.5px; padding: 8px 0; }
.row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stamp-chip { border: 1.5px solid currentColor; background: rgba(255,255,255,0.03); border-radius: 7px; padding: 6px 4px; font-weight: 800; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; text-align: center; }
.stamp-chip.on { background: currentColor; }
.stamp-chip.on span { color: #fff; }
.stamp-grid .k-received { color: #6ea2ef; } .stamp-grid .k-approved { color: #4fc27a; } .stamp-grid .k-comments { color: #f0b04a; } .stamp-grid .k-rejected { color: #ef6b6b; } .stamp-grid .k-checked { color: #40c2c2; } .stamp-grid .k-custom { color: #a68bf0; }
.fine { color: var(--dim); font-size: 12px; margin: 8px 0 0; }
.check { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 10px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--acc); }
.check b { color: var(--text); font-weight: 600; }
.cert-box { display: grid; gap: 6px; margin: -2px 0 12px 24px; }
.cert-box select, .cert-box input, .field-lbl input, .field-lbl select, .insp input, .insp select, .insp textarea, .ask-body input, .ask-body select, .ask-body textarea, #sig-type, .sheet-map select {
  width: 100%; background: rgba(0,0,0,0.25); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 9px; color: var(--text); }
.field-lbl { display: grid; gap: 5px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.insp { display: grid; gap: 8px; }
.insp .r { display: flex; gap: 8px; align-items: center; }
.insp .r > * { flex: 1; }
.insp label { color: var(--muted); font-size: 12px; display: grid; gap: 4px; }

/* ---- panel views (templates, batch, log) ---- */
.panel-view { grid-row: 2; overflow: auto; padding: 26px; }
.pv-inner { max-width: 1040px; margin: 0 auto; }
.pv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pv-head h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; backdrop-filter: blur(14px); }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; position: relative; overflow: hidden; }
.tpl::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.tpl h4 { margin: 0; font-size: 15px; }
.tpl .meta { color: var(--dim); font-size: 12px; }
.tpl .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tpl-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px; border: 1.5px dashed var(--line2); border-radius: 16px; }
.batch-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.batch-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 46vh; overflow: auto; display: grid; gap: 6px; }
.batch-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,0.04); font-size: 12.5px; }
.batch-list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ok { color: var(--ok); } .st-bad { color: var(--bad); } .st-run { color: var(--warn); }
.pattern-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 5px; color: var(--muted); font-size: 12.5px; }
.batch-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; color: var(--muted); }
.log-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
table.log { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.log th { text-align: left; color: var(--dim); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.log td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
table.log td b { color: var(--text); font-weight: 600; }
.log-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---- dialogs ---- */
dialog.dlg { border: 1px solid var(--line2); border-radius: 18px; background: #261e18; color: var(--text); padding: 20px 22px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
dialog.dlg.wide { width: min(680px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 7, 5, 0.6); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 14px; font-size: 18px; }
dialog h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,0.25); border: 1px solid var(--line); margin-bottom: 12px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--acc); color: #fff; }
.seg.small { margin: 0; }
.seg.small button { padding: 3px 10px; font-size: 12px; }
#sig-canvas, #sig-preview { width: 100%; height: auto; aspect-ratio: 10 / 3; background: #fbf8f3; border-radius: 12px; touch-action: none; cursor: crosshair; display: block; margin-bottom: 8px; background-image: linear-gradient(transparent calc(78% - 1px), #d8cfc2 calc(78% - 1px), #d8cfc2 78%, transparent 78%); }
.font-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.font-opt { background: #fbf8f3; color: #121a33; border: 2px solid transparent; border-radius: 10px; height: 64px; display: grid; place-items: center; font-size: 28px; cursor: pointer; overflow: hidden; white-space: nowrap; padding: 0 8px; }
.font-opt.on { border-color: var(--acc); }
.ink-row { margin-top: 12px; justify-content: space-between; }
.ask-body { display: grid; gap: 10px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.ask-body label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.ask-body label.check { display: flex; gap: 9px; align-items: center; margin: 0; }
.ask-body label.check input { width: auto; margin: 0; }
.sheet-map { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; max-height: 50vh; overflow: auto; margin-bottom: 12px; }
.sheet-map label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; background: #2f251d; border: 1px solid var(--line2); color: var(--text); padding: 10px 16px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); transition: all .25s; z-index: 50; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { margin-left: 8px; cursor: pointer; }
.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(23, 19, 15, 0.75); backdrop-filter: blur(4px); }
.drop-overlay div { border: 2px dashed var(--acc); color: var(--text); padding: 40px 60px; border-radius: 20px; font-size: 18px; font-weight: 700; }

/* ---- narrow (browser edition on phones, small windows) ---- */
@media (max-width: 1100px) { #view-sign { grid-template-columns: 0 1fr 270px; } .thumbs { display: none; } }
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { grid-template-rows: auto 1fr; }
  .bar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tab { padding: 5px 9px; font-size: 12px; }
  .bar-actions .btn span { display: none; }
  #view-sign { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; }
  .desk { min-height: 70vh; }
  .dock { position: sticky; top: 0; left: 0; flex-direction: row; overflow-x: auto; border-radius: 0; margin: 0; }
  .tool { width: 44px; flex: none; padding: 8px 0; }
  .tool span { display: none; }
  .hint { white-space: normal; width: calc(100% - 24px); text-align: center; border-radius: 12px; bottom: 10px; }
  .dock-gap { width: 1px; height: auto; margin: 4px; }
  .doc-head { padding: 8px 12px 0; }
  .pages { padding: 12px 10px 40px; overflow: visible; }
  .page .pno { display: none; }
  .tray { border-left: 0; border-top: 1px solid var(--line); }
  .panel-view { padding: 16px; }
  .pv-head { flex-direction: column; }
  .batch-cols { grid-template-columns: 1fr; }
  .welcome-card h2 { font-size: 22px; }
  .welcome-actions { flex-direction: column; }
  .sheet-map { grid-template-columns: 1fr; }
}
