/* OlahPDF — meja kerja kertas dengan tinta stempel ungu */
:root {
  --desk: #eef1f5;
  --desk-2: #e3e7ee;
  --paper: #ffffff;
  --ink: #1b1f2a;
  --ink-2: #4a5163;
  --ink-3: #747b8c;
  --line: #d5dae3;
  --stamp: #5b3fd6;
  --stamp-dark: #4329b8;
  --stamp-soft: #ece8fc;
  --ok: #1e8e4e;
  --danger: #c2364f;
  --danger-soft: #fbe9ec;

  --h-amber: #c27c0e;  --h-blue: #2f6fdb;  --h-orange: #dd5f22;  --h-green: #1e8e4e;
  --h-teal: #0f8b8d;   --h-rose: #c2364f;  --h-slate: #56627a;   --h-violet: #5b3fd6;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --sheet-shadow: 0 1px 0 rgba(27, 31, 42, .06), 0 8px 24px -12px rgba(27, 31, 42, .25);
  --focus: 0 0 0 3px rgba(91, 63, 214, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: var(--desk); min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
a { color: var(--stamp-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px); background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.topnav a:hover { background: var(--desk); color: var(--ink); }
.topnav .topnav-edit { background: var(--ink); color: #fff; }
.topnav .topnav-edit:hover { background: var(--stamp-dark); color: #fff; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--desk); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-portal { text-decoration: none; display: inline-flex; align-items: center; padding: 5px 10px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; font-size: 13px; font-weight: 700; border-radius: var(--r-sm); transition: background 0.15s ease; }
.btn-portal:hover { background: #d1fae5; color: #065f46; }
.btn-logout { background: none; border: 1px solid var(--line); color: var(--ink-3); padding: 5px 9px; font-size: 13px; font-weight: 600; border-radius: var(--r-sm); cursor: pointer; transition: all 0.15s ease; }
.btn-logout:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
@media (max-width: 640px) {
  .topnav a:not(.topnav-edit) { display: none; }
  .user-name { display: none; }
}

.foot { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 48px) 36px; color: var(--ink-3); font-size: 14px; }
.foot p { margin: 0; max-width: 70ch; }

/* ── Tombol & kontrol ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 600;
  padding: 10px 16px; border-radius: var(--r-sm); text-decoration: none; font-size: 15px; line-height: 1.2;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn-primary:hover { background: var(--stamp-dark); border-color: var(--stamp-dark); }
.btn-primary:disabled { background: #b9b0e6; border-color: #b9b0e6; cursor: not-allowed; }
.btn-big { padding: 15px 22px; font-size: 17px; width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--desk); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn svg { width: 18px; height: 18px; flex: none; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
}
.textarea { min-height: 72px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--stamp); box-shadow: var(--focus); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15px; cursor: pointer; color: var(--ink); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--stamp); }
.range-row { display: flex; gap: 12px; align-items: center; }
.range-row input[type=range] { flex: 1; accent-color: var(--stamp); }
.range-row output { min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.posgrid { display: grid; grid-template-columns: repeat(3, 40px); gap: 4px; }
.posgrid button { height: 34px; border: 1px solid var(--line); background: var(--paper); border-radius: 4px; cursor: pointer; position: relative; }
.posgrid button::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 2px; background: var(--line); }
.posgrid button[aria-pressed=true] { border-color: var(--stamp); background: var(--stamp-soft); }
.posgrid button[aria-pressed=true]::after { background: var(--stamp); }
.pos-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.note { font-size: 14px; color: var(--ink-2); background: var(--desk); border-left: 3px solid var(--ink-3); padding: 10px 12px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ── Lencana tipe file (lembar dengan sudut terlipat) ───── */
.badge {
  --h: var(--h-slate);
  width: 34px; height: 40px; flex: none; position: relative; display: grid; place-items: end center;
  padding-bottom: 6px; font-weight: 800; font-size: 11px; letter-spacing: .02em; color: #fff; background: var(--h);
  clip-path: polygon(0 0, 68% 0, 100% 26%, 100% 100%, 0 100%); border-radius: 3px;
}
.badge::before { content: ""; position: absolute; right: 0; top: 0; width: 32%; height: 26%; background: rgba(255,255,255,.45); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.badge svg { width: 16px; height: 16px; margin-bottom: 1px; }
.badge.big { width: 54px; height: 64px; font-size: 16px; padding-bottom: 10px; }
.badge.big svg { width: 24px; height: 24px; }
.hue-amber { --h: var(--h-amber); } .hue-blue { --h: var(--h-blue); } .hue-orange { --h: var(--h-orange); }
.hue-green { --h: var(--h-green); } .hue-teal { --h: var(--h-teal); } .hue-rose { --h: var(--h-rose); }
.hue-slate { --h: var(--h-slate); } .hue-violet { --h: var(--h-violet); }

/* ── Beranda ────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.hero { padding: clamp(28px, 6vw, 64px) 0 28px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 16px; font-weight: 800; }
.hero p { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 44ch; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.desk-drop {
  position: relative; background: var(--paper); border-radius: 4px; box-shadow: var(--sheet-shadow);
  padding: clamp(20px, 3vw, 32px); min-height: 280px; display: grid; place-items: center; text-align: center;
  clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 44px, 100% 100%, 0 100%);
}
.desk-drop::before { /* sudut terlipat */
  content: ""; position: absolute; right: 0; top: 0; width: 44px; height: 44px; background: var(--desk-2);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.desk-drop .dz-inner { border: 2px dashed var(--line); border-radius: var(--r-md); padding: 32px 20px; width: 100%; transition: border-color .15s, background .15s; }
.desk-drop.over .dz-inner, .dropzone.over { border-color: var(--stamp); background: var(--stamp-soft); }
.dz-title { font-weight: 700; font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
.dz-sub { color: var(--ink-3); margin: 0 0 18px; font-size: 15px; }
.suggest { width: 100%; text-align: left; }
.suggest h2 { font-size: 17px; margin: 0 0 4px; }
.suggest .files-line { color: var(--ink-3); font-size: 14px; margin: 0 0 14px; overflow-wrap: anywhere; }
.suggest-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-weight: 600; font-size: 14px; }
.chip:hover { border-color: var(--stamp); }
.chip .badge { width: 22px; height: 26px; font-size: 8px; padding-bottom: 3px; }
.chip .badge svg { width: 11px; height: 11px; }

.directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 32px; padding: 28px 0 8px; }
@media (max-width: 1000px) { .directory { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .directory { grid-template-columns: 1fr; } }
.dir-col h2 { font-size: 15px; font-weight: 700; color: var(--ink-3); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.dir-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tool-link { display: flex; gap: 12px; align-items: center; padding: 8px 8px 8px 4px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.tool-link:hover { background: var(--paper); }
.tool-link strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.tool-link span.d { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-3); }

/* ── Halaman tool ───────────────────────────────────────── */
.tool-head { display: flex; gap: 16px; align-items: center; padding: 28px 0 20px; }
.tool-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; line-height: 1.1; }
.tool-head p { margin: 4px 0 0; color: var(--ink-2); }
.back { display: inline-flex; gap: 6px; align-items: center; margin-top: 20px; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink-2); }
.back:hover { color: var(--ink); }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; padding-bottom: 32px; }
@media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border-radius: var(--r-md); border: 1px solid var(--line); padding: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 16px; letter-spacing: -.01em; }
.options { position: sticky; top: 84px; }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r-md); padding: 40px 20px; text-align: center; background: var(--paper);
  transition: border-color .15s, background .15s;
}
.dropzone .dz-title { font-size: 19px; }
.sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.sheet {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px; display: grid; gap: 8px; cursor: grab; user-select: none;
}
.sheet.dragging { opacity: .4; }
.sheet.drop-before { box-shadow: -4px 0 0 var(--stamp); }
.sheet .thumb { aspect-ratio: 3 / 4; background: var(--desk); border-radius: 3px; display: grid; place-items: center; overflow: hidden; }
.sheet .thumb img, .sheet .thumb canvas { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 1px 3px rgba(0,0,0,.15); background: #fff; }
.sheet .fname { font-size: 13px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet .fmeta { font-size: 12px; color: var(--ink-3); }
.sheet .order { position: absolute; left: -8px; top: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.sheet .acts { display: flex; gap: 2px; justify-content: flex-end; }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: var(--r-sm); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--desk); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.add-more { border: 2px dashed var(--line); border-radius: var(--r-sm); display: grid; place-items: center; min-height: 220px; cursor: pointer; background: transparent; color: var(--ink-2); font-weight: 600; }
.add-more:hover { border-color: var(--stamp); color: var(--stamp-dark); }
.files-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.files-bar p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ── Progres & hasil ────────────────────────────────────── */
.progress-box { text-align: center; padding: 48px 20px; }
.progress-box h2 { margin: 0 0 6px; font-size: 22px; }
.progress-box p { color: var(--ink-2); margin: 0 0 22px; }
.bar { height: 8px; background: var(--desk); border-radius: 99px; overflow: hidden; max-width: 420px; margin: 0 auto; }
.bar span { display: block; height: 100%; width: 0; background: var(--stamp); transition: width .2s; }
.bar.indet span { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

.result { position: relative; text-align: center; padding: 48px 20px 36px; overflow: hidden; }
.result h2 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
.result .meta { color: var(--ink-2); margin: 0 0 24px; overflow-wrap: anywhere; }
.result .saved { font-size: 15px; color: var(--ok); font-weight: 700; margin: -14px 0 22px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 0 auto; }
.result-actions .row { display: flex; gap: 10px; }
.result-actions .row .btn { flex: 1; }
.stamp {
  position: absolute; right: clamp(12px, 6%, 64px); top: 26px; transform: rotate(-12deg);
  border: 4px double var(--stamp); color: var(--stamp); border-radius: 8px; padding: 4px 14px 2px;
  font-weight: 800; font-size: 26px; letter-spacing: .12em; opacity: .85; pointer-events: none;
  mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.75) 61%, #000 75%);
}
.stamp small { display: block; font-size: 10px; letter-spacing: .08em; font-weight: 700; margin-top: -2px; }
.stamp.animate { animation: stamp-in .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp-in { 0% { transform: rotate(-12deg) scale(2.4); opacity: 0; } 70% { opacity: .95; } 100% { transform: rotate(-12deg) scale(1); opacity: .85; } }
@media (max-width: 560px) { .stamp { position: static; display: inline-block; margin-bottom: 12px; } }
.error-box { border: 1px solid #efc2ca; background: var(--danger-soft); color: #7d1d2f; border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 16px; font-weight: 500; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); z-index: 100; font-size: 15px; max-width: calc(100vw - 32px); box-shadow: var(--sheet-shadow); }

/* ── Editor ─────────────────────────────────────────────── */
body.editing .foot { display: none; }
.ed { display: grid; grid-template-rows: auto auto 1fr; height: calc(100vh - 63px); }
.ed-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-bar .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.ed-bar .grow { flex: 1; }
.ed-file { font-weight: 700; font-size: 14px; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 54px; padding: 5px 6px 4px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn:hover { background: var(--desk); color: var(--ink); }
.tool-btn[aria-pressed=true] { background: var(--stamp-soft); color: var(--stamp-dark); border-color: #cfc5f6; }
.tool-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.ed-props { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #f7f8fb; border-bottom: 1px solid var(--line); min-height: 46px; flex-wrap: wrap; font-size: 13px; }
.ed-props label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.ed-props input[type=number] { width: 64px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.ed-props select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.ed-props input[type=color] { width: 30px; height: 26px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.ed-props input[type=range] { width: 90px; accent-color: var(--stamp); }
.ed-props .toggle { width: 30px; height: 28px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; font-weight: 800; }
.ed-props .toggle[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ed-props .hint { color: var(--ink-3); font-weight: 500; }
.ed-body { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: 0; }
.ed-thumbs { background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 14px; }
.ed-thumb { position: relative; border: 2px solid transparent; border-radius: var(--r-sm); padding: 6px; cursor: pointer; background: transparent; text-align: center; }
.ed-thumb:hover { background: var(--desk); }
.ed-thumb[aria-current=true] { border-color: var(--stamp); background: var(--stamp-soft); }
.ed-thumb.drop-before::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 3px; background: var(--stamp); border-radius: 2px; }
.ed-thumb .tframe { height: 150px; display: grid; place-items: center; }
.ed-thumb .tpage { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; display: grid; place-items: center; overflow: hidden; }
.ed-thumb .tpage img { width: 100%; height: 100%; display: block; }
.ed-thumb .tnum { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 4px; }
.ed-thumb .tacts { position: absolute; top: 4px; right: 4px; display: none; flex-direction: column; gap: 2px; background: rgba(255,255,255,.95); border-radius: var(--r-sm); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.ed-thumb:hover .tacts, .ed-thumb:focus-within .tacts, .ed-thumb[aria-current=true] .tacts { display: flex; }
.ed-thumb .tacts .icon-btn { width: 26px; height: 26px; }
.ed-thumb .edited-dot { position: absolute; left: 8px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--stamp); }
.ed-thumbs .add-page { display: grid; gap: 6px; }
.ed-thumbs .add-page .btn { font-size: 13px; padding: 8px; }
.ed-main { overflow: auto; position: relative; background: var(--desk-2); }
.ed-pagebar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: 8px; align-items: center; padding: 8px; pointer-events: none; }
.ed-pagebar > * { pointer-events: auto; }
.ed-pill { display: inline-flex; gap: 2px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px; box-shadow: var(--sheet-shadow); font-size: 13px; font-weight: 600; }
.ed-pill .icon-btn { width: 28px; height: 28px; border-radius: 50%; }
.ed-scroll { display: flex; justify-content: center; padding: 8px 24px 48px; min-width: max-content; }
.ed-rot { position: relative; flex: none; }
.ed-stage { position: absolute; left: 50%; top: 50%; background: #fff; box-shadow: 0 2px 12px rgba(27,31,42,.22); transform-origin: center center; touch-action: none; }
.ed-stage canvas.page { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-layer { position: absolute; inset: 0; }
.ed-stage[data-tool=text] .ed-layer, .ed-stage[data-tool=image] .ed-layer { cursor: text; }
.ed-stage[data-tool=rect] .ed-layer, .ed-stage[data-tool=ellipse] .ed-layer, .ed-stage[data-tool=line] .ed-layer,
.ed-stage[data-tool=highlight] .ed-layer, .ed-stage[data-tool=whiteout] .ed-layer, .ed-stage[data-tool=draw] .ed-layer { cursor: crosshair; }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ed-svg .hit { pointer-events: stroke; cursor: move; stroke: transparent; }
.ed-stage:not([data-tool=select]) .ed-svg .hit { pointer-events: none; }
.ed-obj { position: absolute; cursor: move; }
.ed-stage:not([data-tool=select]) .ed-obj:not(.editing) { pointer-events: none; }
.ed-obj.text, .ed-obj.textEdit { white-space: pre; line-height: 1.2; outline: none; min-width: 4px; padding: 0; }
.ed-obj.textEdit { background: #fff; box-shadow: 0 0 0 1px rgba(91,63,214,.35); }
.ed-obj.text.editing, .ed-obj.textEdit.editing { cursor: text; box-shadow: 0 0 0 1px var(--stamp); }
.ed-obj.whiteout { background: #fff; outline: 1px dashed rgba(27,31,42,.35); }
.ed-obj.highlight { mix-blend-mode: multiply; }
.ed-obj.image img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-obj.ellipse { border-radius: 50%; }
.ed-sel { position: absolute; border: 1.5px solid var(--stamp); pointer-events: none; }
.ed-sel .h { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--stamp); border-radius: 2px; pointer-events: auto; }
.ed-sel .h.nw { left: -6px; top: -6px; cursor: nwse-resize; } .ed-sel .h.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ed-sel .h.sw { left: -6px; bottom: -6px; cursor: nesw-resize; } .ed-sel .h.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ed-sel .h.p1, .ed-sel .h.p2 { border-radius: 50%; cursor: crosshair; }
.ed-textlayer { position: absolute; inset: 0; }
.ed-textlayer span { position: absolute; color: transparent; white-space: pre; cursor: text; border-radius: 2px; line-height: 1; transform-origin: 0 0; }
.ed-textlayer span:hover { background: rgba(91,63,214,.14); box-shadow: 0 0 0 1px rgba(91,63,214,.55); }
.ed-empty { display: grid; place-items: center; height: 100%; padding: 24px; }
.ed-empty .dropzone { max-width: 620px; width: 100%; }
.ed-modal-back { position: fixed; inset: 0; background: rgba(27,31,42,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.ed-modal { background: var(--paper); border-radius: var(--r-md); max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
@media (max-width: 760px) {
  .ed { height: auto; min-height: calc(100vh - 63px); }
  .ed-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(60vh, 1fr); }
  .ed-thumbs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-thumb { min-width: 110px; }
  .ed-thumb .tframe { height: 110px; }
  .ed-thumbs .add-page { min-width: 120px; }
  .tool-btn { min-width: 44px; }
  .tool-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.back svg { width: 18px; height: 18px; }
.add-more { gap: 6px; align-content: center; }
.add-more svg { width: 28px; height: 28px; }
.dz-inner .dz-title, .dropzone .dz-title { margin-bottom: 6px; }
.ed-stage[data-tool=textEdit] .ed-layer { pointer-events: none; }
.ed-stage .ed-obj.editing { pointer-events: auto; }

.extra-row { display: flex; gap: 6px; align-items: center; }
.extra-row .btn { flex: 1; min-width: 0; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extra-audio { width: 100%; height: 36px; margin-top: 4px; }
.hint-sm { font-size: 13px; color: var(--ink-3); }
