/* assets/js/davix-h2i-thumbs.js: the small pictures in lists, and the one placeholder used wherever there is no picture */
.th-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.th-cell > .th-text { min-width: 0; }
.th-thumb { position: relative; flex: none; display: block; box-sizing: border-box; }

/* ---- the placeholder: a soft brand-tinted tile with a line icon and, under it, what is missing or what kind of file it is ------------- */
.th-empty { --th-tint: 255, 100, 180; position: absolute; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; overflow: hidden; border-radius: inherit; container-type: inline-size;
  background: radial-gradient(130% 100% at 12% 0%, rgba(var(--th-tint), .24), transparent 62%), radial-gradient(120% 90% at 100% 100%, rgba(122, 92, 255, .20), transparent 66%), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(var(--th-tint), .26); color: var(--pink-dark, #fc0082); }
.th-empty svg { inline-size: 46cqi; block-size: 46cqi; min-inline-size: 16px; min-block-size: 16px; max-inline-size: 44px; max-block-size: 44px; flex: none; }
.th-empty b { max-inline-size: 100%; padding: 0 2px; box-sizing: border-box; font-size: clamp(7px, 15cqi, 11px); line-height: 1.15; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.th-empty--file b { padding: 1px 4px; border-radius: 4px; background: var(--surface); color: var(--text); }
.th-empty--expired, .th-empty--none, .th-empty--waiting { --th-tint: 150, 160, 190; color: var(--text-muted); }
.th-empty--failed { --th-tint: 255, 82, 82; color: var(--danger, #ff5252); }
.th-empty--failed b { color: var(--danger, #ff5252); }
.th-empty--error { --th-tint: 255, 170, 60; color: var(--warn, #d99200); }
.th-empty--loading svg { opacity: .35; }
.th-empty--loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); animation: th-shine 1.3s linear infinite; }
@keyframes th-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .th-empty--loading::after { animation: none; } }

/* ---- a template: a small sheet of paper ----------------------------------------------------------------------------------------- */
.th-tpl { --th-box: 52px; inline-size: var(--th-box); block-size: 66px; border-radius: 8px; overflow: hidden; }
.th-tpl.drawn { background: #fff; border: 1px solid var(--border-strong); }
.th-tpl iframe { position: absolute; top: 0; left: 0; inline-size: calc(var(--th-w, 560) * 1px); block-size: calc(var(--th-w, 560) * 1.28px); border: 0; transform: scale(calc(50 / var(--th-w, 560))); transform-origin: top left; pointer-events: none; background: #fff; }
.th-doc { display: flex; flex-direction: column; gap: 1px; inline-size: 100%; padding: 4px; box-sizing: border-box; overflow: hidden; color: #1d2129; text-align: start; }
.th-doc > span { display: block; font-size: 3.4px; line-height: 1.35; white-space: nowrap; overflow: hidden; }
.th-doc > span.h { font-size: 5px; font-weight: 800; }
.th-doc > span.gap { block-size: 2px; }

/* ---- result files: one, or several lying on each other ---------------------------------------------------------------------------- */
.th-job { inline-size: 52px; block-size: 52px; }
.th-job.none { border-radius: 10px; overflow: hidden; }
.th-piece { position: absolute; inset-block-start: 5px; inset-inline-start: 5px; inline-size: 42px; block-size: 42px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-3); overflow: hidden; display: block; font-style: normal; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.th-piece img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; background: repeating-conic-gradient(#8883 0 25%, transparent 0 50%) 0 0 / 10px 10px; }
.th-job.n1 .th-piece { inset-block-start: 2px; inset-inline-start: 2px; inline-size: 48px; block-size: 48px; border-radius: 10px; }
.th-job.n2 .th-piece:nth-child(1) { transform: translate(5px, -3px) rotate(8deg); }
.th-job.n2 .th-piece:nth-child(2) { transform: translate(-4px, 2px) rotate(-4deg); }
.th-job.n3 .th-piece:nth-child(1) { transform: translate(6px, -2px) rotate(11deg); }
.th-job.n3 .th-piece:nth-child(2) { transform: translate(-6px, -1px) rotate(-10deg); }
.th-job.n3 .th-piece:nth-child(3) { transform: translate(0, 2px); }
.th-job em { position: absolute; z-index: 1; inset-block-end: -3px; inset-inline-end: -4px; min-inline-size: 18px; block-size: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 99px; background: var(--pink, #ff64b4); color: #fff; font-style: normal; font-size: 9.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ---- one file filling a box of any size (a job's page, Latest files, History) ----------------------------------------------------- */
.th-fill { position: relative; display: block; inline-size: 100%; block-size: 100%; border-radius: inherit; overflow: hidden; }
.th-fill img { display: block; inline-size: 100%; block-size: 100%; object-fit: contain; }
.th-fell { position: relative; }

/* ---- the large preview at the top of a template's own page ------------------------------------------------------------------------ */
.th-large { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; inline-size: 100%; }
.th-stage { position: relative; box-sizing: content-box; overflow: hidden; border-radius: 12px; inline-size: 100%; block-size: 220px; max-inline-size: 100%; }
.th-stage.is-empty { inline-size: min(320px, 100%); block-size: 220px; }
.th-stage.is-page { background: #fff; border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.th-stage.is-page iframe { position: absolute; top: 0; left: 0; inline-size: calc(var(--th-w, 560) * 1px); block-size: 2400px; border: 0; transform-origin: top left; pointer-events: none; background: #fff; }
.th-stage.is-paper { inline-size: min(440px, 100%); block-size: auto; }
.th-paper { container-type: inline-size; aspect-ratio: 210 / 297; max-block-size: 62vh; overflow: hidden; box-sizing: border-box; padding: 8% 9%; background: #fff; color: #1d2129; border-radius: 12px; border: 1px solid var(--border-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); text-align: start; }
.th-paper p { margin: 0 0 1.4cqi; font-size: 3cqi; line-height: 1.45; overflow-wrap: anywhere; }
.th-paper p.h { font-size: 4.6cqi; font-weight: 800; }
.th-paper p.gap { block-size: 2cqi; }
.th-large-note { margin: 0; font-size: 11.5px; color: var(--text-faint); text-align: center; max-inline-size: 520px; }

/* a second line under a name, only where the table has no room for its columns */
.th-phone { display: none; }
@media (max-width: 640px) { .th-phone { display: block; } }
@media (max-width: 900px) { .rc-table .rc-hide-md { display: none; } }

@media (max-width: 480px) {
  .th-cell { gap: 9px; }
  .th-tpl { --th-box: 44px; block-size: 56px; }
  .th-tpl iframe { transform: scale(calc(42 / var(--th-w, 560))); }
  .th-job { inline-size: 44px; block-size: 44px; }
  .th-piece { inset-block-start: 5px; inset-inline-start: 5px; inline-size: 34px; block-size: 34px; }
  .th-job.n1 .th-piece { inset-block-start: 1px; inset-inline-start: 1px; inline-size: 42px; block-size: 42px; }
}
