/* cust-pics.css: a customer's pictures and videos (js/cust-pics.js, plan phase B, 12 Nov 2026). Prefix cpk-.
   The record's own look (lt-cust.css): the quiet count bar, 15/14 px text, the app's tokens, rounded squares.
   ⚠ NOTHING MOVES: every tile is the same square (aspect-ratio 1), its two lines are one line each; a tile on its way
     and a tile that failed are that same square. The date picker floats over the box (the kit's KitFloat).
   ⚠ No icon on every tile: only a video carries the play mark, because that is what it is. */

/* the bar: the count at the left, Add pictures at the right (the same bar every tab of the box has) */
.cpk-pane { min-width: 0; }
.cpk-pane .cpk-bar0 { display: flex; align-items: center; min-height: 52px; padding: 8px 0; }
/* its own class: this sheet loads on every width now (phase D), so it never styles a laptop-layer class */
.cpk-pane .cpk-bar0 .cpk-grow { flex: 1 1 0; min-width: 8px; }
.cpk-pane .cpk-count { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.cpk-file { position: relative; cursor: pointer; }
.cpk-real { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cpk-file:has(.cpk-real:focus-visible) { outline: 2px solid var(--sp-red, var(--accent)); outline-offset: 2px; }

/* the filter on the bar (12 Nov 2026, "add filter too"): chips, the search, the Filter button, left of Add pictures.
   The search and the button have fixed widths and sit at the right; chips grow leftwards into the free middle and are
   cut with a fade when there is no room, so a chip coming or going and the count changing never move anything. */
.cpk-tools { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.cpk-chips { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px); mask-image: linear-gradient(to right, transparent 0, #000 18px); padding-left: 18px; }
.cpk-chips:empty { padding-left: 0; }
.cpk-chips .cg-chip { height: 32px; border-radius: 16px; }
.cpk-chips .cg-chip-main { padding: 0 6px 0 12px; max-width: 200px; }
.cpk-chips .cg-chip-x svg, .cpk-qx svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cpk-qw { position: relative; flex: none; width: 200px; }
.cpk-qi { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--ink-soft); pointer-events: none; }
.cpk-qi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cpk-q { width: 100%; height: 36px; padding: 0 34px 0 34px; border: 1px solid var(--rule-strong); border-radius: 18px; background: var(--field); color: var(--ink);
  font: inherit; font-size: 14px; transition: border-color 150ms ease, background-color 150ms ease; }
.cpk-q::placeholder { color: var(--ink-soft); }
.cpk-q:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.cpk-qx { position: absolute; right: 4px; top: 50%; width: 28px; height: 28px; margin-top: -14px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 14px;
  background: none; color: var(--ink-soft); cursor: pointer; transition: background-color 140ms ease, opacity 140ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
.cpk-qx:hover { background: var(--field); color: var(--ink); }
.cpk-qx:active { transform: scale(.94); }
.cpk-qx[data-off] { opacity: 0; pointer-events: none; }
.cpk-filt { position: relative; flex: none; }
.cpk-none { margin: 8px 0; }
/* the menu: the kit's pop-over; its sliding choices fill the width */
.cpk-fpop { width: 340px; }
.cpk-fpop .cpk-seg button { padding: 0 8px; }
.cpk-fpop .cpk-frange, :where(.kt) .cpk-fpop .cpk-frange.pp-bd { display: block; margin: 2px 2px 6px; padding: 0; gap: 0; overflow: visible; font-size: 14px; }
.cpk-fpop .cpk-frange[hidden] { display: none; }
.cpk-fpop .cpk-frange .dp-d.cpk-later { color: var(--ink-soft); opacity: .4; cursor: default; }
.cpk-fpop .cg-list .cg-mi span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the day picker's days after today: greyed, not pressable */
.cpk-dp .dp-d.cpk-later { color: var(--ink-soft); opacity: .4; cursor: default; }

/* the grid of squares */
.cpk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 16px; padding: 4px 0 8px; }
.cpk-t { margin: 0; min-width: 0; display: grid; align-content: start; gap: 8px; }
.cpk-sq { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: var(--field); color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.cpk-sq:active { transform: scale(.97); }
.cpk-sq:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cpk-sq img, .cpk-sq video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 320ms cubic-bezier(.23, 1, .32, 1); }
.cpk-sq.cpk-broken img { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  button.cpk-sq:hover img { transform: scale(1.03); }
}
.cpk-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 22px;
  background: rgba(20, 20, 18, .62); pointer-events: none; }
.cpk-play svg { width: 20px; height: 20px; margin-left: 2px; fill: #fff; }

/* under the square: the date (the thing he asked for), then the note on one line */
.cpk-t figcaption { display: grid; gap: 2px; min-width: 0; }
/* flex, not block: no text line box around the date, so a waiting square, the add square and a picture all stand the
   same height (measured: a block line box added 6 px to the waiting ones) */
.cpk-dw { position: relative; display: flex; min-width: 0; }
.cpk-dt { display: inline-block; max-width: 100%; margin: 0 0 0 -6px; padding: 1px 6px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.45; color: var(--ink); text-align: left; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.cpk-dt { cursor: pointer; transition: background-color 140ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
button.cpk-dt:active { transform: scale(.97); }
button.cpk-dt:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
@media (hover: hover) and (pointer: fine) { button.cpk-dt:hover { background: var(--field); } }
.cpk-dt.cpk-err { color: var(--accent); }
.cpk-note { display: block; min-width: 0; font-size: 14px; line-height: 1.45; min-height: 1.45em; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpk-addn { justify-self: start; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-soft); text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; transition: color 140ms ease, text-decoration-color 140ms ease; }
.cpk-addn:hover { color: var(--ink); text-decoration-color: currentColor; }
/* with a mouse, "Add a note" shows on the picture you point at (opacity only: it keeps its room and stays pressable);
   on a touch screen it is always there */
@media (hover: hover) and (pointer: fine) {
  .cpk-addn { opacity: 0; transition: opacity 140ms ease, color 140ms ease, text-decoration-color 140ms ease; }
  .cpk-t:hover .cpk-addn, .cpk-addn:focus-visible, .cpk-t:focus-within .cpk-addn { opacity: 1; }
}
.cpk-addn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* the day picker laid over the date line: our line shows, the kit's field takes the press and opens its month */
.cpk-dp { position: absolute; left: -6px; top: 0; z-index: 20; width: 304px; pointer-events: none; }
.cpk-dp .dp { width: 100%; font-size: 14px; }
.cpk-dp .dp-lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
.cpk-dp .dp-btn { width: var(--cpk-w, 100%); height: var(--cpk-h, 24px); min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; pointer-events: auto; }
.cpk-dp.cpk-dp-r .dp-btn { margin-left: var(--cpk-x, 0); }
.cpk-dp .dp-fold.is-open { pointer-events: auto; }
.cpk-dp .dp-sheet-e { margin-top: 6px; }
.cpk-dw:has(.dp.is-open) .cpk-dt { background: var(--field); }
@media (hover: hover) and (pointer: fine) { .cpk-dw:has(.dp-btn:hover) .cpk-dt { background: var(--field); } }
.cpk-dw:has(.dp-btn:focus-visible) .cpk-dt { outline: 2px solid var(--accent); outline-offset: 0; }

/* on its way: the same square, a bar inside it; failed: the words inside it */
.cpk-up .cpk-sq { cursor: default; }
.cpk-up .cpk-sq img, .cpk-up .cpk-sq video { opacity: .72; }
.cpk-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--surface) 78%, transparent); }
.cpk-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left center; transition: transform 200ms ease-out; }
.cpk-fail { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 12px; text-align: center;
  background: color-mix(in srgb, var(--surface) 86%, transparent); font-size: 14px; line-height: 1.4; color: var(--ink); }
.cpk-retry { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--ink); color: var(--surface); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform 160ms cubic-bezier(.23, 1, .32, 1); }
.cpk-retry:active { transform: scale(.97); }
.cpk-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dragging files over the tab: the tab says it will take them; nothing in it moves */
.cg-rpanel.cpk-drag { position: relative; background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.cg-rpanel.cpk-drag::after { content: 'Drop to add'; position: absolute; left: 50%; top: 72px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 600; pointer-events: none; z-index: 5; }
.cg-rpanel.cpk-drag .cpk-grid { pointer-events: none; }

/* ── phase C: a visit's few pictures (the visit box) and the ones chosen in the visit report ──
   smaller squares in one grid with the add square at the end (.cpk-grid is "contents", so the add square, drawn outside
   it and kept across redraws, sits in the same rows); an empty row, a loading row and a row of pictures stand alike */
.cpk-compact .cpk-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
.cpk-compact .cpk-grid { display: contents; }
.cpk-compact .cpk-sq { border-radius: 12px; }
.cpk-compact .cpk-dt { font-size: 14px; }
.cpk-compact .cpk-note { font-size: 14px; }
.cpk-compact .cpk-play { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.cpk-compact .cpk-play svg { width: 16px; height: 16px; }
.cpk-compact .cpk-bar { left: 8px; right: 8px; bottom: 8px; height: 5px; }
.cpk-compact .cpk-fail { font-size: 13px; padding: 6px; }
.cpk-ghost .cpk-sq { cursor: default; }
.cpk-addsq { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--ink-soft); font-size: 14px; font-weight: 500;
  background: none; box-shadow: inset 0 0 0 1.5px var(--rule-strong); transition: box-shadow 140ms ease, color 140ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
.cpk-addsq svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .cpk-addsq:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-soft); } }
.cpk-addsq:has(.cpk-real:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cpk-nonev { font-size: 15px; color: var(--sp-grey, var(--ink-soft)); }
.cpk-vd { min-width: 0; }
/* a picture chosen in the report: its note box under it; "take it out" shows on the picture you point at (always on touch) */
.cpk-draft .cpk-sq { cursor: default; }
.cpk-dn { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--field); color: var(--ink);
  font: inherit; font-size: 14px; text-overflow: ellipsis; transition: border-color 150ms ease, background-color 150ms ease; }
.cpk-dn::placeholder { color: var(--ink-soft); }
.cpk-dn:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.cpk-dn:disabled { opacity: .7; }
.cpk-rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 14px;
  background: rgba(20, 20, 18, .62); color: #fff; cursor: pointer; transition: opacity 140ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
.cpk-rm svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cpk-rm:active { transform: scale(.94); }
.cpk-rm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .cpk-rm { opacity: 0; }
  .cpk-draft:hover .cpk-rm, .cpk-rm:focus-visible, .cpk-bad .cpk-rm { opacity: 1; }
}
.cpk-sent .cpk-sq::after { content: 'Sent'; position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(20, 20, 18, .62); color: #fff; font-size: 13px; font-weight: 600; }
#srPics.cpk-drag { border-radius: 12px; box-shadow: 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
/* while Send runs the add square and the take-out wait, greyed (the report on screen is the one being sent) */
#srPics.cpk-busy .cpk-addsq { opacity: .45; pointer-events: none; }
#srPics.cpk-busy .cpk-rm { opacity: 0; pointer-events: none; }
.sr-card .sr-x:disabled, .sr-card .sr-clear:disabled { opacity: .4; cursor: default; pointer-events: none; }
.sr-lost { margin: 0 0 10px; font-size: 14px; line-height: 1.45; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .cpk-sq, .cpk-sq img, .cpk-bar i, button.cpk-dt { transition: none; }
}
