/* pp-uploader — theme-aware (uses --pp-* tokens; degrades to sane fallbacks). */
.pp-uploader{position:relative;display:block}
.pp-uploader *{box-sizing:border-box}

.pp-up-drop{
  border:2px dashed var(--pp-border,#cbd5e1);
  border-radius:var(--pp-radius,12px);
  background:var(--pp-surface-2,var(--pp-input-bg,#f8fafc));
  padding:22px 18px;text-align:center;cursor:pointer;
  transition:border-color .15s,background .15s,box-shadow .15s;
  color:var(--pp-text-muted,#64748b);
}
.pp-up-drop:hover{border-color:var(--pp-primary,#3b82f6);background:var(--pp-surface,#fff)}
.pp-up-drop.pp-up-over{border-color:var(--pp-primary,#3b82f6);background:color-mix(in srgb,var(--pp-primary,#3b82f6) 8%,transparent);box-shadow:0 0 0 4px color-mix(in srgb,var(--pp-primary,#3b82f6) 12%,transparent)}
.pp-up-drop-inner{display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none}
.pp-up-drop-ic{width:40px;height:40px;display:inline-block;background:no-repeat center/contain;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M8 8l4-4 4 4'/%3E%3Cpath d='M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E");opacity:.9}
.pp-up-drop.pp-up-over .pp-up-drop-ic{transform:translateY(-2px)}
.pp-up-drop-text{font-size:14px;color:var(--pp-text,#0f172a)}
.pp-up-browse{color:var(--pp-primary,#3b82f6);font-weight:600;text-decoration:underline;pointer-events:auto;cursor:pointer}
.pp-up-drop-hint{font-size:11.5px;letter-spacing:.02em}

.pp-up-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.pp-up-list:empty{margin-top:0}

.ppu-card{
  display:flex;align-items:center;gap:12px;position:relative;
  border:1px solid var(--pp-border,#e2e8f0);border-radius:10px;
  background:var(--pp-surface,#fff);padding:8px 10px;overflow:hidden;
}
.ppu-card.ppu-dragging{opacity:.55}
.ppu-card.ppu-error{border-color:var(--pp-danger,#ef4444)}
.ppu-card[draggable="true"]{cursor:grab}

.ppu-thumb{
  flex:0 0 auto;width:46px;height:46px;border-radius:8px;
  background:var(--pp-surface-2,#f1f5f9) no-repeat center/cover;
  display:inline-block;position:relative;
}
.ppu-ic{background-repeat:no-repeat;background-position:center;background-size:24px}
.ppu-ic-file{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E")}
.ppu-ic-img{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='1.6'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E")}
.ppu-ic-pdf{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E")}
.ppu-ic-doc{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h6'/%3E%3C/svg%3E")}
.ppu-ic-xls{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M9 13l6 5M15 13l-6 5'/%3E%3C/svg%3E")}
.ppu-ic-zip{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='1.6'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M11 7v2M11 11v2M11 15v2'/%3E%3C/svg%3E")}
.ppu-ic-audio{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='1.6'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E")}
.ppu-ic-video{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ec4899' stroke-width='1.6'%3E%3Crect x='2' y='4' width='14' height='16' rx='2'/%3E%3Cpath d='M22 8l-6 4 6 4z'/%3E%3C/svg%3E")}

.ppu-meta{flex:1 1 auto;min-width:0}
.ppu-name{font-size:13px;font-weight:600;color:var(--pp-text,#0f172a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ppu-sub{font-size:11.5px;color:var(--pp-text-muted,#64748b);margin-top:1px}
.ppu-alt-in{margin-top:5px;width:100%;font-size:12px;padding:4px 7px;border:1px solid var(--pp-border,#e2e8f0);border-radius:6px;background:var(--pp-surface-2,#f8fafc);color:var(--pp-text,#0f172a)}
.ppu-alt-in:focus{outline:none;border-color:var(--pp-primary,#3b82f6);background:var(--pp-surface,#fff)}

.ppu-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}
.ppu-open,.ppu-del,.ppu-retry{
  border:none;background:transparent;cursor:pointer;color:var(--pp-text-muted,#64748b);
  width:28px;height:28px;border-radius:7px;font-size:16px;line-height:1;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;transition:background .12s,color .12s;
}
.ppu-retry{width:auto;padding:0 8px;font-size:12px;font-weight:600;color:var(--pp-primary,#3b82f6)}
.ppu-open:hover{background:var(--pp-surface-2,#f1f5f9);color:var(--pp-primary,#3b82f6)}
.ppu-del:hover{background:color-mix(in srgb,var(--pp-danger,#ef4444) 12%,transparent);color:var(--pp-danger,#ef4444)}

.ppu-progress{position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--pp-surface-2,#e2e8f0)}
.ppu-progress>span{display:block;height:100%;width:0;background:var(--pp-primary,#3b82f6);transition:width .2s ease}

.pp-up-flash{
  position:absolute;left:0;right:0;bottom:-6px;transform:translateY(100%);
  background:var(--pp-danger,#ef4444);color:#fff;font-size:12px;padding:6px 10px;border-radius:8px;
  opacity:0;pointer-events:none;transition:opacity .2s;z-index:5;
}
.pp-up-flash.show{opacity:1}

/* Compact single-image variant when maxFiles=1 & imageOnly: cards read like an avatar row. */
.pp-uploader.pp-up-avatar .ppu-thumb{width:64px;height:64px;border-radius:10px}

@media (prefers-color-scheme:dark){
  .pp-up-drop{background:var(--pp-surface-2,#1e293b);border-color:var(--pp-border,#334155)}
  .ppu-card{background:var(--pp-surface,#0f172a);border-color:var(--pp-border,#334155)}
}
