/* KASKOW Alat PDF — tampilan bersama semua alat PDF (pdf-studio.js). */
.pds {
  --pds-r: 22px;
  --pds-acc: #ef4444;
  --pds-acc2: #f97316;
  --pds-soft: color-mix(in srgb, var(--brand) 8%, transparent);
  --pds-line: var(--border);
  --pds-card: var(--card-solid, var(--card));
  position: relative;
  margin-top: 26px;
}
.pds * { box-sizing: border-box; }
.pds button, .pds input, .pds select { font-family: inherit; }
.pds [hidden] { display: none !important; }

/* ---------- dropzone ---------- */
.pds-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 340px;
  padding: 44px 24px;
  border-radius: var(--pds-r);
  background:
    radial-gradient(40rem 16rem at 50% -6rem, color-mix(in srgb, var(--pds-acc) 12%, transparent), transparent 70%),
    var(--pds-card);
  border: 2px dashed color-mix(in srgb, var(--text) 16%, transparent);
  text-align: center;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.pds-drop.over, .pds-drop:hover { border-color: var(--pds-acc); }
.pds-drop.over { transform: scale(1.005); background-color: color-mix(in srgb, var(--pds-acc) 6%, var(--pds-card)); }
.pds-drop-ic {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(145deg, var(--pds-acc2), var(--pds-acc));
  box-shadow: 0 22px 40px -20px var(--pds-acc), inset 0 1px 0 rgba(255,255,255,.3);
}
.pds-drop-ic svg { width: 38px; height: 38px; }
.pds-drop h2 { margin: 6px 0 0; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; letter-spacing: -.01em; }
.pds-drop p { margin: 0; color: var(--muted); font-size: .95rem; }
.pds-pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 16px 34px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(135deg, var(--pds-acc2), var(--pds-acc));
  box-shadow: 0 18px 34px -18px var(--pds-acc);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.pds-pick:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 22px 40px -18px var(--pds-acc); }
.pds-pick svg { width: 20px; height: 20px; }
.pds-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.pds-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.pds-chip svg { width: 14px; height: 14px; color: var(--accent-text); }
.pds-veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--pds-acc) 14%, rgba(5,10,15,.55));
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  pointer-events: none;
}

/* ---------- area kerja ---------- */
.pds-work { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.pds-stage {
  min-height: 420px;
  padding: 18px;
  border-radius: var(--pds-r);
  background: var(--pds-card);
  border: 1px solid var(--pds-line);
}
.pds-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.pds-bar .grow { flex: 1; }
.pds-count { font-weight: 700; font-size: .9rem; }
.pds-count small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.pds-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid var(--pds-line);
  background: transparent;
  color: var(--text);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.pds-btn:hover { background: var(--pds-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.pds-btn svg { width: 16px; height: 16px; }
.pds-btn.ghost { border-color: transparent; }
.pds-btn.danger:hover { color: #ef4444; border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.08); }

.pds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.pds-grid.files { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pds-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--pds-line);
  background: color-mix(in srgb, var(--text) 2.5%, transparent);
  transition: border-color .15s, box-shadow .15s, transform .15s, opacity .15s;
  user-select: none;
}
.pds-item:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); box-shadow: 0 14px 30px -22px rgba(0,0,0,.5); }
.pds-item.dragging { opacity: .35; }
.pds-item.drop-before { box-shadow: -4px 0 0 0 var(--brand); }
.pds-item.drop-after { box-shadow: 4px 0 0 0 var(--brand); }
.pds-item[draggable="true"] { cursor: grab; }
.pds-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 4%, transparent);
}
.pds-thumb canvas, .pds-thumb img {
  max-width: 92%;
  max-height: 92%;
  background: #fff;
  box-shadow: 0 6px 16px -8px rgba(0,0,0,.45);
  transition: transform .25s ease;
}
.pds-thumb .ph { width: 60%; aspect-ratio: 3/4; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); animation: pdsPulse 1.2s ease-in-out infinite; }
@keyframes pdsPulse { 50% { opacity: .45; } }
.pds-thumb .lock { display: grid; place-items: center; gap: 6px; color: var(--muted); font-size: .75rem; text-align: center; padding: 10px; }
.pds-thumb .lock svg { width: 30px; height: 30px; }
.pds-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.pds-meta b { font-size: .8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pds-meta small { flex: none; font-size: .72rem; color: var(--muted); }
.pds-num {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  color: #fff;
  background: rgba(15,23,42,.72);
}
.pds-acts {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .15s, transform .15s;
}
.pds-item:hover .pds-acts, .pds-item:focus-within .pds-acts { opacity: 1; transform: none; }
@media (hover: none) { .pds-acts { opacity: 1; transform: none; } }
.pds-act {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #0f172a;
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,.35);
  transition: transform .12s, color .12s;
}
.pds-act:hover { transform: scale(1.08); color: var(--pds-acc); }
.pds-act svg { width: 15px; height: 15px; }
.pds-item.is-del .pds-thumb::after, .pds-item.is-sel .pds-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}
.pds-item.is-del { border-color: rgba(239,68,68,.6); }
.pds-item.is-del .pds-thumb::after { background: rgba(239,68,68,.22); }
.pds-item.is-del .pds-thumb canvas { opacity: .45; }
.pds-item.is-sel { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.pds-item.is-sel .pds-thumb::after { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.pds-mark {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
}
.pds-mark svg { width: 15px; height: 15px; }
.pds-item.is-del .pds-mark { display: grid; background: #ef4444; }
.pds-item.is-sel .pds-mark { display: grid; background: var(--brand); }
.pds-item.clickable { cursor: pointer; }
.pds-group-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 800;
  color: #fff;
}
.pds-blank { width: 70%; aspect-ratio: 210/297; background: #fff; border: 1px dashed #cbd5e1; display: grid; place-items: center; color: #94a3b8; font-size: .7rem; }

/* ---------- panel opsi ---------- */
.pds-side {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  border-radius: var(--pds-r);
  background: var(--pds-card);
  border: 1px solid var(--pds-line);
  overflow: hidden;
}
.pds-side-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--pds-line); }
.pds-side-head .ic {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--pds-acc2), var(--pds-acc));
}
.pds-side-head .ic svg { width: 21px; height: 21px; }
.pds-side-head b { display: block; font-size: 1.05rem; font-weight: 800; }
.pds-side-head small { display: block; font-size: .78rem; color: var(--muted); }
.pds-opts { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px; max-height: calc(100vh - 290px); overflow-y: auto; }
.pds-field { display: flex; flex-direction: column; gap: 8px; }
.pds-field > label, .pds-label { font-size: .78rem; font-weight: 800; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; }
.pds-hint { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.pds-input, .pds-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--pds-line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pds-input:focus, .pds-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.pds-input.bad { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.pds-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pds-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pds-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 13px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.pds-seg button {
  padding: 8px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.pds-seg button.on { background: var(--pds-card); color: var(--text); box-shadow: 0 2px 8px -3px rgba(0,0,0,.3); }
.pds-cards { display: flex; flex-direction: column; gap: 8px; }
.pds-card-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--pds-line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pds-card-opt:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.pds-card-opt.on { border-color: var(--brand); background: var(--pds-soft); }
.pds-card-opt .dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--pds-line); }
.pds-card-opt.on .dot { border: 5px solid var(--brand); }
.pds-card-opt b { display: block; font-size: .88rem; }
.pds-card-opt small { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.pds-check { display: flex; align-items: center; gap: 10px; font-size: .86rem; cursor: pointer; }
.pds-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.pds-range { display: flex; align-items: center; gap: 10px; }
.pds-range input[type="range"] { flex: 1; accent-color: var(--brand); }
.pds-range output { min-width: 44px; text-align: right; font-weight: 700; font-size: .85rem; }
.pds-color { width: 42px; height: 42px; padding: 3px; border-radius: 12px; border: 1px solid var(--pds-line); background: transparent; cursor: pointer; }
.pds-pos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.pds-pos button {
  height: 34px;
  border: 1px dashed var(--pds-line);
  border-radius: 9px;
  background: var(--pds-card);
  cursor: pointer;
  position: relative;
}
.pds-pos button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--muted); opacity: .4; }
.pds-pos button.on { border-style: solid; border-color: var(--brand); }
.pds-pos button.on::after { background: var(--brand); opacity: 1; }
.pds-pos.rows2 { grid-template-rows: 34px 34px; }
.pds-err {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .84rem;
  line-height: 1.45;
  color: #b91c1c;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
}
[data-theme="dark"] .pds-err { color: #fca5a5; }
.pds-err a { color: inherit; font-weight: 700; }
.pds-cta-wrap { padding: 16px 20px 20px; border-top: 1px solid var(--pds-line); background: color-mix(in srgb, var(--text) 2%, transparent); }
.pds-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pds-acc2), var(--pds-acc));
  box-shadow: 0 16px 30px -18px var(--pds-acc);
  transition: transform .15s, filter .15s, opacity .15s;
}
.pds-cta:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.pds-cta:disabled { opacity: .55; cursor: not-allowed; }
.pds-cta svg { width: 20px; height: 20px; }
.pds-cta .spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: pdsSpin .8s linear infinite; }
@keyframes pdsSpin { to { transform: rotate(360deg); } }
.pds-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: .74rem; color: var(--muted); text-align: center; }
.pds-note svg { width: 13px; height: 13px; color: var(--accent-text); flex: none; }
.pds-progress { height: 6px; margin-top: 12px; border-radius: 99px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.pds-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--pds-acc2), var(--pds-acc)); transition: width .2s; }

/* ---------- pratinjau besar (nomor, tanda air, potong, tanda tangan) ---------- */
.pds-preview { display: block; text-align: center; padding: 10px; }
.pds-paper { position: relative; display: inline-block; line-height: 0; box-shadow: 0 18px 40px -22px rgba(0,0,0,.55); border-radius: 4px; overflow: hidden; background: #fff; touch-action: none; }
.pds-paper canvas { display: block; max-width: 100%; height: auto; }
.pds-ov { position: absolute; inset: 0; pointer-events: none; }
.pds-ov-text { position: absolute; white-space: nowrap; line-height: 1; font-family: Helvetica, Arial, sans-serif; transform-origin: center; }
.pds-ov-img { position: absolute; transform-origin: center; }
.pds-crop-shade { position: absolute; background: rgba(15,23,42,.45); }
.pds-crop-box { position: absolute; border: 2px dashed #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.5); }
.pds-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.pds-pager span { font-size: .85rem; font-weight: 700; min-width: 90px; text-align: center; }

/* tanda tangan */
.pds-sig { position: absolute; border: 1.5px dashed var(--brand); border-radius: 4px; cursor: move; touch-action: none; background: color-mix(in srgb, var(--brand) 6%, transparent); line-height: 0; }
.pds-sig img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.pds-sig .rz { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; cursor: nwse-resize; }
.pds-sig .x { position: absolute; right: -10px; top: -10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #ef4444; color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.pds-paper.placing { cursor: crosshair; }
.pds-pad { position: relative; border-radius: 14px; border: 1px solid var(--pds-line); background: #fff; overflow: hidden; touch-action: none; }
.pds-pad canvas { display: block; width: 100%; height: 160px; cursor: crosshair; }
.pds-pad .line { position: absolute; left: 16px; right: 16px; bottom: 36px; border-bottom: 1px dashed #cbd5e1; pointer-events: none; }
.pds-pad .hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #94a3b8; font-size: .72rem; pointer-events: none; }
.pds-swatches { display: flex; gap: 8px; }
.pds-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--pds-card); box-shadow: 0 0 0 1px var(--pds-line); cursor: pointer; }
.pds-swatches button.on { box-shadow: 0 0 0 2px var(--brand); }
.pds-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pds-fonts button { height: 54px; border-radius: 12px; border: 1px solid var(--pds-line); background: #fff; color: #0f172a; font-size: 1.35rem; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 8px; }
.pds-fonts button.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.pds-sigprev { display: grid; place-items: center; min-height: 70px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--pds-line); }
.pds-sigprev img { max-width: 100%; max-height: 80px; }

/* teks hasil */
.pds-textout { width: 100%; min-height: 380px; padding: 14px; border-radius: 14px; border: 1px solid var(--pds-line); background: color-mix(in srgb, var(--text) 3%, transparent); color: var(--text); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.pds-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pds-info div { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.pds-info small { display: block; font-size: .72rem; color: var(--muted); }
.pds-info b { font-size: .95rem; }

/* ---------- hasil ---------- */
.pds-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 46px 22px 34px;
  border-radius: var(--pds-r);
  text-align: center;
  background:
    radial-gradient(40rem 16rem at 50% -6rem, color-mix(in srgb, #10b981 14%, transparent), transparent 70%),
    var(--pds-card);
  border: 1px solid var(--pds-line);
}
.pds-done-ic { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #34d399, #059669); box-shadow: 0 20px 40px -20px #059669; animation: pdsPop .45s cubic-bezier(.2,1.4,.4,1); }
.pds-done-ic svg { width: 38px; height: 38px; }
@keyframes pdsPop { from { transform: scale(.4); opacity: 0; } }
.pds-done h2 { margin: 4px 0 0; font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 800; }
.pds-done .sum { color: var(--muted); font-size: .92rem; }
.pds-done .sum b { color: var(--text); }
.pds-saving { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: .85rem; color: #047857; background: rgba(16,185,129,.14); }
[data-theme="dark"] .pds-saving { color: #34d399; }
.pds-dl { display: inline-flex; align-items: center; gap: 10px; padding: 17px 38px; border-radius: 16px; color: #fff; font-weight: 800; font-size: 1.08rem; text-decoration: none; background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 18px 34px -18px #0d9488; transition: transform .15s; }
.pds-dl:hover { transform: translateY(-2px); }
.pds-dl svg { width: 20px; height: 20px; }
.pds-done-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pds-next { width: 100%; max-width: 720px; margin-top: 18px; padding-top: 20px; border-top: 1px solid var(--pds-line); }
.pds-next > b { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.pds-next-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pds-next-grid button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--pds-line); background: transparent; color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.pds-next-grid button:hover { border-color: var(--brand); background: var(--pds-soft); transform: translateY(-1px); }
.pds-next-grid svg { width: 16px; height: 16px; color: var(--pds-acc); }

/* ---------- hub ---------- */
.pds-hub-drop { min-height: 240px; margin-bottom: 30px; }
.pds-hub-sec { margin-top: 26px; }
.pds-hub-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; }
.pds-hub-sec h2 small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.pds-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pds-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--pds-line);
  background: var(--pds-card);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
a.pds-tool:hover, button.pds-tool:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--h) 55%, transparent); box-shadow: 0 20px 40px -28px var(--h); }
.pds-tool .ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--h); background: color-mix(in srgb, var(--h) 13%, transparent); transition: transform .18s; }
.pds-tool:hover .ic { transform: scale(1.08) rotate(-3deg); }
.pds-tool .ic svg { width: 22px; height: 22px; }
.pds-tool b { font-size: .98rem; font-weight: 800; }
.pds-tool p { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--muted); }
.pds-tool.soon { opacity: .55; cursor: default; }
.pds-tool .tag { position: absolute; top: 14px; right: 14px; padding: 2px 8px; border-radius: 99px; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--text) 7%, transparent); }
.pds-tool .tag.srv { color: #2563eb; background: rgba(59,130,246,.12); }
.pds-hub-pick { padding: 14px 18px; margin-bottom: 18px; border-radius: 16px; background: var(--pds-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); font-size: .9rem; }

/* ---------- HP ---------- */
@media (max-width: 900px) {
  .pds-work { grid-template-columns: 1fr; }
  .pds-side { position: static; }
  .pds-opts { max-height: none; }
  .pds-cta-wrap { position: sticky; bottom: 0; z-index: 5; }
}
@media (max-width: 560px) {
  .pds-stage { padding: 12px; }
  .pds-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .pds-grid.files { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pds-drop { min-height: 300px; padding: 34px 16px; }
  .pds-pick { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .pds * { animation: none !important; transition: none !important; } }

/* =================== progres pemrosesan =================== */
.pds-prog {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 11, 17, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .25s ease;
}
.pds-prog.show { opacity: 1; }
.pds-prog-card {
  position: relative;
  width: min(380px, 100%);
  padding: 34px 28px 28px;
  border-radius: 28px;
  text-align: center;
  color: var(--text);
  background: var(--card-solid, var(--card));
  border: 1px solid var(--border);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
  transform: translateY(12px) scale(.97);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}
.pds-prog.show .pds-prog-card { transform: none; }
.pds-prog-card::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto;
  height: 70%;
  background: radial-gradient(closest-side, color-mix(in srgb, #f97316 22%, transparent), transparent);
  pointer-events: none;
}
.pds-prog.ok .pds-prog-card::before { background: radial-gradient(closest-side, rgba(16,185,129,.25), transparent); }
.pds-ring { position: relative; width: 168px; height: 168px; margin: 0 auto 18px; }
.pds-ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pds-ring circle { fill: none; stroke-width: 10; }
.pds-ring .trk { stroke: color-mix(in srgb, var(--text) 9%, transparent); }
.pds-ring .bar { stroke: url(#pdsg); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; filter: drop-shadow(0 4px 10px rgba(239,68,68,.35)); }
.pds-prog.ok .pds-ring .bar { stroke: #10b981; filter: drop-shadow(0 4px 10px rgba(16,185,129,.4)); transition: stroke .3s; }
.pds-ring-in { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 58px; font-variant-numeric: tabular-nums; transition: opacity .2s, transform .25s; }
.pds-ring-in b { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.pds-ring-in span { font-size: 1.25rem; font-weight: 800; margin-left: 2px; color: var(--muted); }
.pds-ring-ok { position: absolute; inset: 0; display: grid; place-items: center; color: #10b981; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .35s cubic-bezier(.2,1.5,.4,1); }
.pds-ring-ok svg { width: 64px; height: 64px; stroke-width: 3; transform: none; }
.pds-prog.ok .pds-ring-in { opacity: 0; transform: scale(.7); }
.pds-prog.ok .pds-ring-ok { opacity: 1; transform: none; }
.pds-prog-title { font-size: 1.12rem; font-weight: 800; }
.pds-prog-label { margin-top: 6px; min-height: 1.3em; font-size: .9rem; color: var(--muted); }
.pds-prog-file { margin-top: 14px; display: inline-flex; max-width: 100%; padding: 6px 12px; border-radius: 99px; font-size: .76rem; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--text) 5%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pds-prog-dots { display: inline-block; width: 1.2em; text-align: left; }

/* =================== penampil (zoom) =================== */
.pv { display: flex; flex-direction: column; min-height: 0; height: 100%; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 5%, var(--card-solid, var(--card))); }
.pv-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--card-solid, var(--card)); }
.pv-bar .grow { flex: 1; }
.pv-title { font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.pv-grp { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.pv-grp button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; transition: background .15s; font-variant-numeric: tabular-nums; }
.pv-grp button:hover:not(:disabled) { background: var(--card-solid, var(--card)); box-shadow: 0 2px 6px -3px rgba(0,0,0,.3); }
.pv-grp button:disabled { opacity: .35; cursor: default; }
.pv-grp button svg { width: 16px; height: 16px; }
.pv-grp span { min-width: 64px; text-align: center; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-scroll { position: relative; flex: 1; min-height: 360px; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.pv-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; width: max-content; min-width: 100%; }
.pv-page { position: relative; flex: none; background: #fff; border-radius: 3px; box-shadow: 0 12px 30px -16px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.04); }
.pv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 3px; }
.pv-page.img { background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.pv-no { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); font-size: .7rem; font-weight: 700; color: var(--muted); }
.pv-loading { display: grid; place-items: center; gap: 10px; min-height: 300px; color: var(--muted); font-size: .85rem; }
.pv-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--text) 12%, transparent); border-top-color: var(--brand); animation: pdsSpin .8s linear infinite; }
.pv-modal { position: fixed; inset: 0; z-index: 2147483500; display: grid; place-items: center; padding: 3vh 2vw; background: rgba(6,11,17,.7); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.pv-modal.show { opacity: 1; }
.pv-modal-in { width: min(1100px, 100%); height: 94vh; display: flex; transform: scale(.97); transition: transform .25s; }
.pv-modal.show .pv-modal-in { transform: none; }
.pv-modal .pv { flex: 1; background: color-mix(in srgb, var(--text) 6%, var(--card-solid, var(--card))); box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); }
.pv-modal .pv-scroll { min-height: 0; }

/* =================== hasil =================== */
.pds-result { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.pds-res-side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; padding: 24px 22px; border-radius: var(--pds-r); border: 1px solid var(--pds-line); text-align: center; align-items: center;
  background: radial-gradient(28rem 12rem at 50% -4rem, rgba(16,185,129,.16), transparent 70%), var(--pds-card); }
.pds-res-side h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.pds-res-side .sum { color: var(--muted); font-size: .86rem; word-break: break-word; }
.pds-res-side .sum b { color: var(--text); }
.pds-res-side .pds-dl { width: 100%; justify-content: center; }
.pds-res-side .pds-done-acts { width: 100%; }
.pds-res-side .pds-done-acts .pds-btn { flex: 1; justify-content: center; }
.pds-res-view { height: min(78vh, 900px); min-height: 460px; }
.pds-res-view .pds-textout { height: 100%; min-height: 0; }
.pds-flist { width: 100%; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; text-align: left; }
.pds-flist button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--pds-line); background: transparent; color: var(--text); font-size: .8rem; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.pds-flist button.on { border-color: var(--brand); background: var(--pds-soft); }
.pds-flist button svg { flex: none; width: 18px; height: 18px; color: var(--pds-acc); }
.pds-flist button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pds-flist button small { flex: none; color: var(--muted); }
.pds-res-side .pds-seg { width: 100%; }
.pds-res-side .pds-next { margin-top: 4px; padding-top: 16px; }
.pds-res-side .pds-next-grid { justify-content: center; }
.pds-res-side .pds-next-grid button { padding: 7px 11px; font-size: .78rem; }
.pds-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 2147482500; overflow: hidden; }
.pds-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: .9; animation: pdsFall 1.6s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes pdsFall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--rot)); opacity: 0; } }

/* zoom area kerja */
.pds-zoom { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.pds-zoom button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.pds-zoom button:hover:not(:disabled) { background: var(--pds-card); }
.pds-zoom button:disabled { opacity: .35; cursor: default; }
.pds-zoom button svg { width: 15px; height: 15px; }
.pds-zoom span { min-width: 44px; text-align: center; font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pds-grid { grid-template-columns: repeat(auto-fill, minmax(var(--tw, 150px), 1fr)); }
.pds-grid.files { grid-template-columns: repeat(auto-fill, minmax(calc(var(--tw, 150px) + 20px), 1fr)); }
.pds-preview { overflow: auto; max-height: 78vh; border-radius: 14px; }
.pds-act.zoom { color: #0f172a; }

@media (max-width: 900px) {
  .pds-result { grid-template-columns: 1fr; }
  .pds-res-side { position: static; }
  .pds-res-view { height: 70vh; min-height: 380px; }
  .pv-title { display: none; }
}
@media (max-width: 560px) {
  .pds-grid { grid-template-columns: repeat(auto-fill, minmax(calc(var(--tw, 150px) * .8), 1fr)); }
  .pds-ring { width: 148px; height: 148px; }
  .pds-ring-in { padding-top: 50px; }
  .pv-pages { padding: 14px; }
  .pv-modal { padding: 0; }
  .pv-modal-in { height: 100vh; }
  .pv-modal .pv { border-radius: 0; }
}

.pds-result.pds-done { display: grid; padding: 0; border: 0; background: none; text-align: left; align-items: start; gap: 20px; }
.pds-ring > svg { overflow: visible; }
@media (max-width: 560px) {
  .pv-bar { justify-content: center; }
  .pv-bar .grow { display: none; }
  .pds-res-side { padding: 20px 16px; gap: 12px; }
  .pds-res-side .pds-done-ic { width: 60px; height: 60px; }
}

/* =================== tombol penting & ubin tambah =================== */
.pds-btn.primary {
  color: var(--accent-text);
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  font-weight: 800;
  box-shadow: 0 6px 16px -12px var(--brand);
  transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.pds-btn.primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -12px #0d9488;
}
.pds-btn.primary:active { transform: translateY(0); }
.pds-btn.primary svg { width: 17px; height: 17px; }
.pds-add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  padding: 14px;
  border-radius: 16px;
  border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent);
  background: color-mix(in srgb, var(--brand) 5%, transparent);
  color: var(--accent-text);
  font-weight: 800;
  font-size: .86rem;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.pds-add-tile:hover, .pds-add-tile.over { background: color-mix(in srgb, var(--brand) 12%, transparent); border-color: var(--brand); transform: translateY(-2px); }
.pds-add-tile .plus { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 12px 24px -12px #0d9488; transition: transform .2s; }
.pds-add-tile:hover .plus { transform: rotate(90deg) scale(1.06); }
.pds-add-tile .plus svg { width: 24px; height: 24px; }
.pds-add-tile small { font-weight: 600; color: var(--muted); font-size: .72rem; }
.pds-pick2 { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--brand) 45%, transparent); background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--accent-text); font-weight: 800; cursor: pointer; transition: background .15s, color .15s; }
.pds-pick2:hover { background: linear-gradient(135deg, #14b8a6, #0d9488); color: #fff; }
.pds-pick2 svg { width: 18px; height: 18px; }
.pds-picks { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }

/* daftar file untuk proses banyak file sekaligus */
.pds-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 4px; scrollbar-width: thin; }
.pds-strip .chip { flex: none; display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 7px 8px 7px 12px; border-radius: 12px; border: 1px solid var(--pds-line); background: transparent; color: var(--text); font-size: .8rem; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.pds-strip .chip.on { border-color: var(--brand); background: var(--pds-soft); }
.pds-strip .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pds-strip .chip small { color: var(--muted); font-weight: 600; }
.pds-strip .chip i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-style: normal; color: var(--muted); }
.pds-strip .chip i:hover { color: #ef4444; background: rgba(239,68,68,.12); }
.pds-batch-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: .8rem; background: var(--pds-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.pds-batch-note svg { flex: none; width: 16px; height: 16px; color: var(--accent-text); }
