/* Плашка загрузок (uploads.js): справа снизу, над панелью сравнения; на телефоне — во всю ширину с отступами */
#upDock { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(360px, calc(100vw - 32px)); display: flex; justify-content: flex-end; pointer-events: none; }
#upDock > * { pointer-events: auto; }
.up-dock { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); overflow: hidden; font-size: 14px; }
.up-h { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; background: var(--tile); color: var(--tile-ink); }
.up-h b { font: 600 16px var(--f-display); margin-right: auto; }
.up-link { border: 0; background: transparent; color: var(--lime); font-size: 12px; text-decoration: underline; padding: 2px 4px; cursor: pointer; }
.up-ib { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: inherit; font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.up-ib:hover, .up-ib:focus-visible { background: color-mix(in srgb, currentColor 14%, transparent); }
.up-list { max-height: min(46vh, 340px); overflow: auto; overscroll-behavior: contain; }
.up-it { padding: 10px 8px 10px 14px; display: grid; gap: 7px; border-top: 1px solid var(--line); }
.up-it:first-child { border-top: 0; }
.up-row { display: flex; align-items: flex-start; gap: 4px; }
.up-main { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; border: 0; background: transparent; color: inherit; padding: 0; font: inherit; }
button.up-main { cursor: pointer; }
.up-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.up-l { color: var(--muted); font-size: 12.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.up-acts { display: flex; flex: none; }
.up-bar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; margin-right: 6px; }
.up-bar i { display: block; height: 100%; background: var(--lime); transition: width .4s linear; }
.up-pick { justify-self: start; font-size: 13px; padding: 6px 12px; cursor: pointer; }
.up-f { padding: 8px 14px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.st-retry .up-l, .st-error .up-l { color: var(--want); }
.st-retry .up-bar i, .st-paused .up-bar i { background: var(--muted); }
.st-needfile .up-l { color: var(--ink); }
/* готово: зелёная и мягко пульсирует, пока человек не открыл карточку */
.st-done { background: color-mix(in srgb, var(--have) 14%, var(--surface)); }
.st-done .up-l { color: var(--have); font-weight: 600; }
.st-done b::before { content: "✓ "; color: var(--have); }
.up-it.fresh, .up-dock.fresh .up-h { animation: upPulse 2.4s ease-in-out infinite; }
.up-dock.fresh .up-h { background: var(--have); color: #fff; animation-name: upPulseH; }
@keyframes upPulse { 0%, 100% { background: color-mix(in srgb, var(--have) 12%, var(--surface)); } 50% { background: color-mix(in srgb, var(--have) 26%, var(--surface)); } }
@keyframes upPulseH { 0%, 100% { filter: none; } 50% { filter: brightness(1.15); } }
/* свёрнутая: кружок с процентом */
.up-mini { width: 60px; height: 60px; border-radius: 50%; padding: 0; display: grid; place-items: center; position: relative; cursor: pointer; background: var(--tile); color: var(--tile-ink); border: 0; }
.up-ring { --p: 0; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--p) * 1%), color-mix(in srgb, var(--tile-ink) 18%, transparent) 0); }
.up-ring::before { content: ""; grid-area: 1 / 1; width: 40px; height: 40px; border-radius: 50%; background: var(--tile); }
.up-pct { grid-area: 1 / 1; position: relative; font: 600 13px var(--f-display); font-variant-numeric: tabular-nums; }
.up-n { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--lime); color: var(--on-lime); font: 700 12px/20px var(--f-body); }
.up-mini.fresh { background: var(--have); animation: upPulseMini 2.4s ease-in-out infinite; }
.up-mini.fresh .up-ring { background: #fff3; }
.up-mini.fresh .up-ring::before { background: var(--have); }
.up-mini.need .up-n { background: var(--want); color: #fff; }
@keyframes upPulseMini { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--have) 50%, transparent), 0 10px 30px rgba(0, 0, 0, .25); } 50% { box-shadow: 0 0 0 10px transparent, 0 10px 30px rgba(0, 0, 0, .25); } }
@media (prefers-reduced-motion: reduce) { .up-it.fresh, .up-dock.fresh .up-h, .up-mini.fresh { animation: none; } .up-bar i { transition: none; } }
/* сообщения внизу не прячутся за плашкой */
body.up-on #toast { bottom: var(--up-top, calc(96px + env(safe-area-inset-bottom, 0px))) !important; }
@media (max-width: 560px) {
  #upDock { right: max(8px, env(safe-area-inset-right, 0px)); left: max(8px, env(safe-area-inset-left, 0px)); width: auto; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .up-list { max-height: 38vh; }
  .up-ib { width: 36px; height: 36px; }
}
/* прогресс в мастере «Добавить файл» */
.fx-prog .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.fx-prog .acts button { border: 0; background: transparent; color: var(--accent); padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.fx-wiz .wh .min { margin-left: auto; font-size: 13px; padding: 6px 12px; }
.fx-wiz .wh .min + .x { margin-left: 0; }
