.pdfm { display: grid; gap: 24px; }
.res:not([hidden]) { display: grid; gap: 14px; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 260px; padding: 24px; border: 1.5px dashed var(--ink); border-radius: 24px;
  background: var(--mist); cursor: pointer; transition: background .15s;
}
.drop:hover, .drop.over { background: var(--mint); }
.drop strong { font: 700 clamp(32px, 5vw, 48px)/.95 var(--display); text-transform: uppercase; letter-spacing: -0.03em; }
.drop .link { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.drop small { font: 400 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: -0.03em; color: var(--smoke); }
.drop-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--ink); color: var(--paper); margin-bottom: 8px; }
.pdfm.has .drop { min-height: 120px; }
.pdfm.has .drop-ico { display: none; }
.pdfm.has .drop strong { font-size: 28px; }
.help { margin: 0; color: var(--slate); }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: d; }
.doc { display: grid; grid-template-columns: 28px 64px 1fr auto; align-items: center; gap: 14px; padding: 10px 12px; background: var(--mist); border-radius: 20px; counter-increment: d; }
.doc::before { content: counter(d, decimal-leading-zero); font: 400 12px var(--mono); color: var(--slate); }
.doc .th { width: 64px; height: 84px; border-radius: 8px; background: var(--paper); overflow: hidden; display: grid; place-items: center; }
.doc .th canvas { width: 100%; height: 100%; object-fit: cover; }
.doc .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .meta { min-width: 0; }
.doc .info { font-size: 14px; color: var(--slate); }
.doc .err { color: var(--danger); }
.doc .ctl { display: flex; gap: 6px; }
.doc .ctl button { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--paper); cursor: pointer; font: 500 18px var(--sans); color: var(--ink); }
.doc .ctl button:hover { background: var(--mint); }
.doc .ctl button:disabled { opacity: .3; cursor: default; }
.sum:empty { display: none; }
.sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 20px 24px; border-radius: 24px; background: var(--ink); color: var(--paper); }
.sum span:first-child { font: 400 12px/1.3 var(--mono); text-transform: uppercase; color: var(--smoke); }
.sum b { font: 700 64px/.9 var(--display); color: var(--mint); letter-spacing: -0.03em; }
.sum .muted { color: var(--smoke); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) {
  .doc { grid-template-columns: 52px 1fr; }
  .doc::before { display: none; }
  .doc .th { width: 52px; height: 68px; }
  .doc .ctl { grid-column: 1 / -1; justify-content: flex-end; }
}
