/* Upload center (cloud/workspace_tools.html + uploader.js): header with the batch progress, a drop area, file cards with
   state badges and icon actions, a collapsible «finished» group and the minimised corner panel. Colours follow theme.css. */
.upload-center{width:min(640px,calc(100vw - 32px));padding:20px 20px 16px}
.uc-head{display:flex;align-items:center;gap:14px}
.uc-badge{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:12px;background:var(--tint);color:var(--accent)}
.uc-badge .icon{width:22px;height:22px}
.uc-title{flex:1;min-width:0}
.upload-center .uc-title h2{margin:0;font-size:20px;line-height:1.25}
.uc-title p{margin:2px 0 0;font-size:13px;color:var(--muted)}
.upload-center .uc-close{flex:none;display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:var(--r-ctl,12px)}
.uc-close .icon{width:18px;height:18px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round}

.uc-total{display:grid;gap:6px;margin:16px 0 0}
.uc-total[hidden]{display:none}
.uc-total small{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.uc-bar{display:block;height:6px;overflow:hidden;border-radius:3px;background:color-mix(in srgb,var(--accent) 14%,transparent)}
.uc-bar i{display:block;width:0;height:100%;border-radius:inherit;background:var(--uu-primary,#4b17cc);transition:width .3s ease}

/* drop area: large while the queue is empty, a slim strip once there is something to show */
.uc-drop{display:grid;justify-items:center;gap:4px;margin:16px 0 4px;padding:16px;border:1.5px dashed color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:14px;background:color-mix(in srgb,var(--accent) 4%,transparent);text-align:center;transition:background .15s,border-color .15s}
.uc-drop p{margin:0;font-size:14px}
.uc-drop small{max-width:440px;font-size:12px;line-height:1.5;color:var(--muted)}
.uc-drop-icon{display:none;place-items:center;width:52px;height:52px;margin-bottom:6px;border-radius:16px;background:var(--tint);color:var(--accent)}
.uc-drop-icon .icon{width:26px;height:26px}
.upload-center.is-empty .uc-drop{padding:36px 20px}
.upload-center.is-empty .uc-drop-icon{display:grid}
.uc-drop.is-over{border-color:var(--accent);background:var(--tint)}
.uc-link{display:inline;min-height:0;padding:0;border:0;background:none;color:var(--accent);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* file cards */
.upload-center .upload-items{display:grid;gap:8px;margin:12px 0 0;padding:0;list-style:none}
.upload-center .upload-items[hidden]{display:none}
.upload-center .upload-items li{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--card);border-top:1px solid var(--line)}
.uc-file{--fc:var(--accent);position:relative;display:grid;place-items:center;width:40px;height:40px;border-radius:10px;color:var(--fc);background:color-mix(in srgb,var(--fc) 13%,transparent)}
.uc-file .icon{width:20px;height:20px}
.uc-file b{position:absolute;bottom:-5px;right:-6px;padding:1px 4px;border-radius:5px;background:var(--fc);color:#fff;font-size:9px;font-weight:700;line-height:1.3;text-transform:uppercase;letter-spacing:.02em}
li[data-kind=pdf] .uc-file{--fc:#c2410c}
li[data-kind=doc] .uc-file{--fc:#2f6fde}
li[data-kind=sheet] .uc-file{--fc:#1f8a4c}
li[data-kind=slides] .uc-file{--fc:#d9480f}
li[data-kind=image] .uc-file{--fc:#9333ea}
li[data-kind=video] .uc-file{--fc:#4b17cc}
li[data-kind=audio] .uc-file{--fc:#0e7490}
li[data-kind=archive] .uc-file{--fc:#6b6880}
.uc-main{display:grid;gap:6px;min-width:0}
.uc-line{display:flex;align-items:center;gap:10px;min-width:0}
.uc-name{flex:1;min-width:0;overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.uc-state{flex:none;padding:2px 8px;border-radius:999px;background:var(--tint);color:var(--accent);font-size:11.5px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap}
.uc-meta{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.uc-error{font-size:12.5px;font-weight:500;color:var(--danger-text)}
.uc-error[hidden]{display:none}
.upload-center .upload-row-actions{display:flex;gap:6px;margin:0}
.upload-center .upload-row-actions .icon-button{display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0;border-radius:var(--r-ctl,12px)}
.upload-row-actions .icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.upload-row-actions .is-danger{color:var(--danger-text)}
/* states */
li[data-state=done] .uc-state{background:color-mix(in srgb,var(--uu-lime,#b8f54a) 55%,transparent);color:#2b4a06}
li[data-state=done] .uc-bar i{background:#7cbf1a}
li[data-state=done] .uc-bar,li[data-state=cancelled] .uc-bar{display:none}
li:is([data-state=error],[data-state=reselect]) .uc-state{background:var(--bad-bg,#fde8e3);color:var(--danger-text)}
li:is([data-state=error],[data-state=reselect]){border-color:color-mix(in srgb,var(--danger-text) 35%,var(--line))}
li[data-state=paused] .uc-state{background:var(--warn-bg,#fff1d6);color:var(--warn,#8a5300)}
li[data-state=paused] .uc-bar i{background:var(--warn,#8a5300)}
li[data-state=cancelled]{opacity:.7}
li[data-state=cancelled] .uc-state{background:var(--surface-2);color:var(--muted)}
li[data-state=queued] .uc-state,li[data-state=hashing] .uc-state{background:var(--surface-2);color:var(--muted)}

/* finished group */
.uc-done{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.uc-done[hidden]{display:none}
.uc-done-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.uc-toggle{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 8px 0 4px;border:0;border-radius:10px;background:none;color:var(--ink);font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.uc-toggle:hover{background:var(--surface-2)}
.uc-toggle .icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.uc-toggle[aria-expanded=true] .icon{transform:rotate(90deg)}
.uc-done-tools{display:inline-flex;gap:14px;font-size:13px}
.uc-done-tools .uc-link{color:var(--muted);font-weight:500}
.uc-done-tools .uc-link:hover{color:var(--ink)}

.uc-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:16px}
.upload-center .uc-foot .primary{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px}
.uc-foot .primary .icon{width:18px;height:18px}
.uc-foot .uc-link{font-size:13px;font-weight:500;color:var(--muted)}
.uc-foot .uc-link[hidden]{display:none}

/* minimised corner panel */
.uc-mini{position:fixed;right:20px;bottom:20px;z-index:45;display:flex;align-items:center;gap:12px;min-width:240px;padding:10px 16px 10px 10px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--ink);font:inherit;text-align:left;cursor:pointer;box-shadow:0 2px 6px #1d0f4f14,0 16px 36px -12px #1d0f4f55;animation:uc-in .22s cubic-bezier(.2,.8,.2,1)}
.uc-mini[hidden]{display:none}
.uc-mini:hover{border-color:var(--accent)}
.uc-mini strong{display:block;font-size:13.5px}
.uc-mini small{display:block;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.uc-mini-ring svg{display:block;width:40px;height:40px;transform:rotate(-90deg)}
.uc-mini-ring circle{fill:none;stroke-width:4;stroke:color-mix(in srgb,var(--accent) 16%,transparent)}
.uc-mini-ring .uc-mini-val{stroke:var(--uu-primary,#4b17cc);stroke-linecap:round;stroke-dasharray:94.25;stroke-dashoffset:94.25;transition:stroke-dashoffset .3s}
.uc-mini.is-done .uc-mini-val{stroke:#7cbf1a}
.workspace main:has(.bulk-bar:not([hidden]))~.uc-mini,body:has(.bulk-bar:not([hidden])) .uc-mini{bottom:96px}
@keyframes uc-in{from{opacity:0;transform:translateY(12px)}}

@media (max-width:620px){
  .upload-center .upload-items li{grid-template-columns:40px minmax(0,1fr)}
  .upload-center .upload-row-actions{grid-column:2;justify-content:flex-start}
  .uc-mini{left:12px;right:12px;bottom:12px;min-width:0}
}
@media (prefers-reduced-motion:reduce){.uc-mini{animation:none}.uc-bar i,.uc-mini-ring .uc-mini-val{transition:none}}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) li[data-state=done] .uc-state{color:#e9ffc8;background:color-mix(in srgb,var(--uu-lime,#b8f54a) 22%,transparent)}}
:root[data-theme="dark"] li[data-state=done] .uc-state{color:#e9ffc8;background:color-mix(in srgb,var(--uu-lime,#b8f54a) 22%,transparent)}
li[data-fatal] .uc-bar{display:none}
