:root {
  --red: #ff5a5f; --orange: #ff9f1c; --yellow: #f7b801; --green: #2ec27e; --blue: #3a86ff; --purple: #8338ec; --pink: #ff4fa3;
  --rainbow: linear-gradient(90deg, #ff5a5f, #ff9f1c, #f7b801, #2ec27e, #3a86ff, #8338ec);
  --bg: #fffaf3; --card: #ffffff; --ink: #1f2140; --muted: #6b6f8e; --line: #ece6f5; --soft: #f6f1ff;
  --r: 18px; --shadow: 0 2px 0 rgba(31,33,64,.04), 0 8px 24px rgba(31,33,64,.08);
  --head: 'Fredoka', 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); overscroll-behavior-y: none; }
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: -.01em; }
a { color: var(--blue); }
.hide { display: none !important; }

/* boot */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 18px; text-align: center; }
.boot-logo { font: 700 44px var(--head); background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-bar { width: 160px; height: 6px; border-radius: 9px; background: var(--rainbow); background-size: 200% 100%; animation: slide 1.2s linear infinite; margin: 0 auto; }
@keyframes slide { to { background-position: 200% 0; } }

/* layout */
.screen { min-height: 100vh; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 28px); max-width: 760px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topbar h1 { font-size: 26px; flex: 1; }
.wordmark { font: 700 30px var(--head); background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; flex: 0 1 auto; margin-right: auto; line-height: 1.1; }
.logo-img { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow); }
.rainbow-rule { height: 5px; border-radius: 9px; background: var(--rainbow); margin: 4px 0 18px; }
.sub { color: var(--muted); font-size: 15px; }
.section-title { font: 600 18px var(--head); margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count { font: 600 13px var(--body); background: var(--soft); color: var(--purple); border-radius: 99px; padding: 1px 9px; }

/* tabs */
:root { --rail: calc(78px + env(safe-area-inset-left, 0px)); }
body.has-rail #app { padding-left: var(--rail); }
.tabs { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 30; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: calc(var(--safe-t) + 12px) 6px calc(var(--safe-b) + 12px) calc(6px + env(safe-area-inset-left, 0px)); }
.tabs::after { content: ''; position: absolute; top: 0; bottom: 0; right: -1px; width: 3px; background: linear-gradient(180deg, #ff5a5f, #ff9f1c, #f7b801, #2ec27e, #3a86ff, #8338ec); opacity: .85; }
.tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding: 10px 0; font-size: 10.5px; font-weight: 700; color: var(--muted); border-radius: 16px; width: 100%; letter-spacing: -.01em; }
.tabs button svg { width: 26px; height: 26px; }
.tabs button.on { color: var(--purple); background: var(--soft); }
.rail-brand { display: none; }
.rail-spacer { flex: 1; }
@media (min-width: 900px) {
  :root { --rail: 232px; }
  .tabs { padding: 20px 14px; gap: 4px; }
  .tabs button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-size: 15px; justify-content: flex-start; }
  .tabs button svg { width: 22px; height: 22px; }
  .rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
  .rail-brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--shadow); }
  .rail-brand .wordmark { font-size: 22px; }
  body.has-rail .screen > .topbar .logo-img, body.has-rail .screen > .topbar .wordmark { display: none; }
}

/* icons */
.i { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.i svg, svg.i { width: 100%; height: 100%; }

/* buttons */
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 650; background: var(--soft); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; transition: transform .08s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 6px 16px rgba(131,56,236,.3); }
.btn-rainbow { background: var(--rainbow); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: 0 6px 18px rgba(255,90,95,.25); }
.btn-danger { background: #ffe9ea; color: #c7262c; }
.btn-ghost { background: transparent; }
.btn-ghost-light { background: rgba(255,255,255,.14); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 11px; font-size: 14px; }
.icon-btn { border: 0; background: var(--card); width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; box-shadow: var(--shadow); flex: none; }
.icon-btn:disabled { opacity: .35; }
.icon-btn .i { width: 22px; height: 22px; }

/* big actions */
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big { border: 0; border-radius: 22px; padding: 18px 16px; color: #fff; text-align: left; min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.big .i { width: 34px; height: 34px; }
.big b { font: 600 20px var(--head); display: block; }
.big small { opacity: .92; font-size: 13px; }
.big.scan { background: linear-gradient(135deg, #ff5a5f, #ff9f1c); }
.big.upload { background: linear-gradient(135deg, #3a86ff, #8338ec); }
.big::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.14); right: -30px; top: -40px; }
.dropzone { margin-top: 12px; border: 2px dashed #d9cff0; border-radius: 18px; padding: 14px; text-align: center; color: var(--muted); font-size: 14px; background: #fff; }
.dropzone.over { border-color: var(--purple); background: var(--soft); color: var(--purple); }

/* doc list */
.search { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; background: #fff; margin-bottom: 10px; }
.doc-card { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); margin-bottom: 10px; position: relative; overflow: hidden; border: 0; width: 100%; text-align: left; }
.doc-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c, var(--purple)); }
.doc-thumb { width: 58px; height: 74px; border-radius: 8px; background: #f3f0fa center/cover no-repeat; flex: none; margin-left: 6px; border: 1px solid var(--line); }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--purple); }
.pill.ok { background: #e6f8ef; color: #198754; }
.pill.todo { background: #fff3dc; color: #b26a00; }
.doc-more { border: 0; background: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.empty-state { text-align: center; padding: 26px 16px; color: var(--muted); background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.empty-state .art { font-size: 44px; }

/* cards & forms */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea, .input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px; min-height: 46px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus, .search:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(131,56,236,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.secret { display: flex; gap: 6px; }
.secret input { flex: 1; }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 12px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--purple); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.acc { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.acc > summary { list-style: none; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.acc > summary .dot .i { width: 18px; height: 18px; }
.acc > summary .chev { margin-left: auto; transition: transform .2s; color: var(--muted); }
.acc[open] > summary .chev { transform: rotate(90deg); }
.acc .acc-body { padding: 0 16px 6px; }
.note { font-size: 13px; color: var(--muted); background: var(--soft); padding: 9px 12px; border-radius: 12px; margin-bottom: 12px; }

/* people */
.person-card { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 10px; border: 0; width: 100%; text-align: left; }
.avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; font: 600 22px var(--head); flex: none; }
.avatar.lg { width: 68px; height: 68px; border-radius: 22px; font-size: 30px; }
.person-card .who { flex: 1; }
.person-card .who b { display: block; font-size: 17px; }
.person-card .who small { color: var(--muted); }
.sig-preview { height: 54px; background: #fff; border: 1.5px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 4px 10px; }
.sig-preview img { max-height: 100%; max-width: 100%; }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(31,33,64,.38); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 10px 18px calc(var(--safe-b) + 18px); animation: up .22s cubic-bezier(.2,.9,.3,1.1); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 26px; } }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: #ddd5ea; margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { flex: 1; font-size: 22px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #fff; border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; text-align: left; box-shadow: var(--shadow); font-weight: 650; }
.list-btn small { display: block; color: var(--muted); font-weight: 500; }
.list-btn .i { color: var(--purple); }
.list-btn .val { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* toast */
#toast { position: fixed; left: calc(50% + var(--rail) / 2); bottom: calc(var(--safe-b) + 24px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%); }

/* busy */
.busy { position: fixed; inset: 0; background: rgba(255,250,243,.92); z-index: 80; display: grid; place-content: center; text-align: center; gap: 16px; padding: 20px; }
.busy .spinner { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(#ff5a5f, #ff9f1c, #f7b801, #2ec27e, #3a86ff, #8338ec, #ff5a5f); -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%); animation: spin 1s linear infinite; margin: 0 auto; }
.busy p { font: 600 18px var(--head); margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* onboarding */
.ob { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-t) + 28px) 20px calc(var(--safe-b) + 28px); min-height: 100vh; display: flex; flex-direction: column; }
.ob-hero { text-align: center; margin: 8vh 0 26px; }
.ob-hero .wordmark { font-size: 54px; display: block; }
.ob-hero p { font-size: 19px; color: var(--muted); margin: 10px 0 0; }
.ob-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.ob-steps i { flex: 1; height: 6px; border-radius: 9px; background: var(--line); }
.ob-steps i.on { background: var(--rainbow); }
.ob h2 { font-size: 28px; margin-bottom: 6px; }
.ob .grow { flex: 1; }
.ob .actions { display: flex; gap: 10px; margin-top: 18px; }
.ob .actions .btn { flex: 1; }
.feature { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.feature .dot { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.feature b { display: block; }
.feature > div > span { color: var(--muted); font-size: 15px; }

/* signature pad */
.pad-wrap { position: relative; background: #fff; border-radius: 16px; border: 2px solid var(--line); height: 190px; touch-action: none; }
.pad-wrap canvas { width: 100%; height: 100%; display: block; border-radius: 14px; }
.pad-wrap .base { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 2px solid #e3dcef; pointer-events: none; }
.pad-wrap .x { position: absolute; left: 18px; bottom: 50px; color: #c8bfdc; font-weight: 700; pointer-events: none; }
.pad-wrap .hint { position: absolute; inset: 0; display: grid; place-items: center; color: #b8aed0; pointer-events: none; font-weight: 600; }
.font-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.font-choice { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 10px; min-height: 64px; text-align: left; overflow: hidden; }
.font-choice.on { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(131,56,236,.15); }
.font-choice .sample { font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1a1f4a; }
.font-choice small { color: var(--muted); font-size: 12px; font-weight: 600; }
.seg { display: flex; background: var(--soft); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 11px; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* editor */
.ed-screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: #ece8f3; }
.ed-head { background: #fff; padding: calc(var(--safe-t) + 8px) 10px 8px; display: flex; align-items: center; gap: 8px; box-shadow: 0 1px 0 var(--line); z-index: 5; }
.ed-head::after { content: ''; position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 58px); height: 3px; background: var(--rainbow); opacity: .9; }
.ed-title { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 4px 6px; border-radius: 10px; }
.ed-title b { display: block; font: 600 17px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-sub { background: #fff; padding: 8px 12px; display: flex; gap: 8px; align-items: center; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; margin-top: 3px; }
.ed-sub::-webkit-scrollbar { display: none; }
.stat { white-space: nowrap; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 99px; }
.stat.f { background: #e6f8ef; color: #198754; }
.stat.o { background: #fff3dc; color: #b26a00; }
.stat.x { background: #f0eef5; color: #6b6f8e; }
.ed-sub .btn-sm { white-space: nowrap; margin-left: auto; }
.ed-body { flex: 1; position: relative; overflow: hidden; }
.ed-scroll { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px 10px 160px; }
.ed-pages { margin: 0 auto; max-width: 900px; display: grid; gap: 16px; transition: width .2s; }
.zoomed .ed-pages { max-width: none; }
.pg { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(31,33,64,.14); border-radius: 4px; }
.pg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4px; }
.pg-ov { position: absolute; inset: 0; }
.pg-num { position: absolute; bottom: -15px; right: 4px; font-size: 11px; color: var(--muted); }
.placing .pg-ov { cursor: crosshair; outline: 3px dashed rgba(131,56,236,.45); outline-offset: 2px; }
.it { position: absolute; border-radius: 3px; display: flex; align-items: center; user-select: none; -webkit-user-select: none; }
.it .txt { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; white-space: pre; overflow: visible; pointer-events: none; }
.it .txt.top { justify-content: flex-start; }
.it .txt > div { overflow: hidden; text-overflow: clip; }
.it.empty { background: rgba(255,79,163,.10); box-shadow: inset 0 0 0 1.5px rgba(255,79,163,.55); }
.it.empty.t-check { background: rgba(58,134,255,.08); box-shadow: inset 0 0 0 1.2px rgba(58,134,255,.45); }
.it.t-text:not(.empty):not(.office), .it.t-sig:not(.empty):not(.office), .it.t-initials:not(.empty):not(.office) { background: rgba(46,194,126,.08); }
.it .ph { font-size: 11px; color: #d63384; font-weight: 600; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; pointer-events: none; }
.it.t-check { justify-content: center; }
.it.t-check svg { width: 88%; height: 88%; }
.it.t-sig, .it.t-initials { align-items: flex-end; }
.it.t-sig img, .it.t-initials img { max-height: 120%; max-width: 100%; margin-left: 2px; pointer-events: none; transform: translateY(6%); }
.it.office { background: repeating-linear-gradient(135deg, rgba(150,150,170,.10) 0 5px, rgba(150,150,170,.03) 5px 10px); box-shadow: inset 0 0 0 1px rgba(150,150,170,.35); }
.it .off-tag { white-space: nowrap; overflow: hidden; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: #8e8aa6; font-weight: 700; padding-left: 4px; }
.it.sel { box-shadow: 0 0 0 2px var(--purple), 0 0 0 5px rgba(131,56,236,.2) !important; z-index: 3; touch-action: none; }
.it .rs { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--purple); border: 3px solid #fff; box-shadow: var(--shadow); touch-action: none; }
.tools { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 8px calc(var(--safe-b) + 8px); display: flex; justify-content: center; pointer-events: none; z-index: 6; }
.toolbar { pointer-events: auto; background: #fff; border-radius: 22px; box-shadow: 0 6px 30px rgba(31,33,64,.2); display: flex; gap: 2px; padding: 6px; overflow-x: auto; max-width: 100%; }
.tool { border: 0; background: none; min-width: 58px; padding: 6px 6px; border-radius: 15px; display: grid; justify-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.tool .i { width: 24px; height: 24px; }
.tool.on { background: var(--purple); color: #fff; }
.tool:nth-child(1) .i { color: var(--red); } .tool:nth-child(2) .i { color: var(--orange); } .tool:nth-child(3) .i { color: var(--green); }
.tool:nth-child(4) .i { color: var(--blue); } .tool:nth-child(5) .i { color: var(--purple); } .tool:nth-child(6) .i { color: var(--pink); }
.tool.on .i { color: #fff !important; }
.panel { pointer-events: auto; background: #fff; border-radius: 22px; box-shadow: 0 6px 30px rgba(31,33,64,.25); width: 100%; max-width: 640px; padding: 12px; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head .lbl { flex: 1; font-size: 13px; color: var(--muted); font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 17px; resize: none; min-height: 48px; }
.panel textarea:focus { outline: none; border-color: var(--purple); }
.panel-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.panel-row .spacer { flex: 1; }
.placing-hint { pointer-events: auto; background: var(--purple); color: #fff; padding: 12px 16px; border-radius: 16px; font-weight: 700; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 30px rgba(131,56,236,.35); }
.placing-hint button { border: 0; background: rgba(255,255,255,.2); color: #fff; border-radius: 10px; padding: 6px 12px; font-weight: 700; }
.banner { margin: 10px auto 0; max-width: 900px; background: #fff; border-radius: 16px; padding: 12px 14px; font-size: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; }
.banner .i { color: var(--purple); flex: none; margin-top: 1px; }
.zoom-ctl { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; z-index: 4; }
.zoom-ctl .icon-btn { width: 38px; height: 38px; border-radius: 12px; font-weight: 800; font-size: 20px; }

/* scanner */
.scanner { position: fixed; inset: 0; background: #111; color: #fff; z-index: 70; display: flex; flex-direction: column; }
.scan-top { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 14px 10px; }
.scan-x { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 20px; }
.scan-title { font: 600 18px var(--head); }
.scan-view { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; }
.scan-guide { position: absolute; inset: 7% 9%; border: 3px solid rgba(255,255,255,.75); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); pointer-events: none; }
.scan-nocam { max-width: 340px; text-align: center; padding: 20px; display: grid; gap: 12px; }
.scan-nocam .btn:not(.btn-primary) { background: rgba(255,255,255,.14); color: #fff; }
.scan-strip { display: flex; gap: 8px; padding: 8px 14px; overflow-x: auto; min-height: 8px; }
.scan-thumb { position: relative; flex: none; }
.scan-thumb img { height: 56px; border-radius: 6px; display: block; }
.scan-thumb span { position: absolute; top: -6px; right: -6px; background: var(--purple); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 6px; }
.scan-bottom { display: flex; align-items: center; justify-content: space-around; padding: 10px 10px calc(var(--safe-b) + 18px); }
.scan-shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--rainbow); box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.scan-shutter:active, .scan-shutter.flash { transform: scale(.92); }
.scan-shutter:disabled { opacity: .3; }
.scan-side { border: 0; background: none; color: #fff; display: grid; justify-items: center; gap: 2px; font-size: 13px; font-weight: 700; width: 84px; }
.scan-side .ico { font-size: 26px; }
.scan-side:disabled { opacity: .35; }
.crop-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
.crop-wrap { position: relative; transition: transform .2s; }
.crop-wrap img { width: 100%; height: 100%; display: block; user-select: none; }
.crop-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crop-svg polygon { fill: rgba(131,56,236,.18); stroke: #fff; stroke-width: .5; vector-effect: non-scaling-stroke; stroke-width: 2.5px; }
.crop-dot { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(131,56,236,.35); border: 3px solid #fff; touch-action: none; }
.crop-dot.active { background: rgba(131,56,236,.7); transform: scale(1.25); }
.crop-tools { padding: 10px 14px calc(var(--safe-b) + 16px); display: grid; gap: 12px; }
.crop-tools .chip { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.crop-tools .chip.on { background: #fff; color: var(--ink); }
.crop-actions { display: flex; gap: 8px; }
.crop-actions .btn-primary { flex: 1; }

/* finish */
.finish-prev { width: 140px; margin: 0 auto 10px; display: block; border-radius: 8px; box-shadow: var(--shadow); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-grid .btn { flex-direction: column; min-height: 84px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.share-grid .btn .i { width: 28px; height: 28px; }
.share-grid .btn:nth-child(1) .i { color: var(--red); } .share-grid .btn:nth-child(2) .i { color: var(--blue); }
.share-grid .btn:nth-child(3) .i { color: var(--green); } .share-grid .btn:nth-child(4) .i { color: var(--purple); }
.share-grid .btn.wide { grid-column: span 2; flex-direction: row; min-height: 56px; }

.help h3 { font-size: 18px; margin: 18px 0 8px; }
.help ol { padding-left: 22px; margin: 0; }
.help li { margin-bottom: 8px; }
.kbd { background: var(--soft); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.small { font-size: 13px; color: var(--muted); }

/* folders */
.folder-card { cursor: pointer; }
.folder-thumbs { display: flex; margin-left: 6px; width: 70px; flex: none; position: relative; height: 74px; align-items: center; }
.folder-thumbs .doc-thumb.sm { position: absolute; width: 46px; height: 60px; margin: 0; box-shadow: var(--shadow); }
.folder-thumbs .doc-thumb.sm:nth-child(1) { left: 0; transform: rotate(-6deg); }
.folder-thumbs .doc-thumb.sm:nth-child(2) { left: 12px; transform: rotate(2deg); }
.folder-thumbs .doc-thumb.sm:nth-child(3) { left: 24px; transform: rotate(8deg); }
.folder-ico { width: 58px; height: 58px; border-radius: 16px; background: var(--soft); display: grid; place-items: center; }
.folder-ico .i { width: 30px; height: 30px; }
.doc-thumb.sm { width: 38px; height: 48px; margin: 0; border-radius: 6px; }
.folder-dot { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.order-num { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; margin-left: 6px; }
.folder-note { min-height: 56px; resize: vertical; }
.send-bar { margin-top: 16px; padding: 10px; background: #fffaf3; border-radius: 18px; box-shadow: 0 -6px 18px rgba(31,33,64,.08); }

.grip { flex: none; width: 30px; align-self: stretch; display: grid; place-items: center; color: #b9b0d3; font-size: 16px; letter-spacing: -5px; cursor: grab; touch-action: none; margin-left: 4px; user-select: none; -webkit-user-select: none; }
.grip:active { cursor: grabbing; color: var(--purple); }
.folder-list .doc-card { transition: transform .15s ease; }
.folder-list .doc-card.dragging { transition: none; z-index: 5; box-shadow: 0 14px 36px rgba(31,33,64,.25); transform-origin: center; }
.folder-list .doc-card.dragging::after { content: ''; position: absolute; inset: 0; border-radius: var(--r); box-shadow: inset 0 0 0 2px var(--purple); pointer-events: none; }
.drop-overlay { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(131,56,236,.12); border: 4px dashed var(--purple); border-radius: 22px; margin: 8px; place-items: center; pointer-events: none; }
.drop-overlay > div { background: #fff; padding: 18px 24px; border-radius: 18px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; color: var(--purple); }
.dropping .drop-overlay { display: grid; }

.ready-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }

.it.t-image img { width: 100%; height: 100%; object-fit: fill; pointer-events: none; display: block; }
.it.t-image { background: none !important; }

.sync-code { font: 700 clamp(15px, 4.6vw, 22px) ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; white-space: nowrap; overflow-x: auto; text-align: center; background: #fff; border: 2px dashed #d9cff0; border-radius: 16px; padding: 16px 8px; word-break: break-all; color: var(--purple); }

body:not(.has-rail) #toast { left: 50%; }
