/* "Your clips" (screens/clips.js). Owner: WP2. Same composition as the Upload screen:
   one flush #1f1f1f panel, a centred column, rows divided by 1px #2b2b2b rules. */
.screen-clips { background: var(--c-panel); }
.screen-clips .clips-wrap { flex: 1; display: flex; justify-content: center; padding: 48px 32px; }
.screen-clips .clips-inner { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 16px; }
.screen-clips .clips-head { display: flex; flex-direction: column; gap: 16px; }
.screen-clips .clips-head .display:focus { outline: none; }
.screen-clips .clips-banner { padding-left: 10px; box-shadow: inset 2px 0 0 var(--c-ink); font-size: var(--fs-m); line-height: 18px; }
.screen-clips .clips-status { font-size: var(--fs-m); color: var(--c-muted); }

.screen-clips .clips-list { margin: 8px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--c-field); }
.screen-clips .clip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 72px 196px 128px;
  align-items: center;
  column-gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-field);
}
.screen-clips .clip-main { min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.screen-clips .clip-thumb { position: relative; width: 96px; height: 54px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-chip); background: var(--c-field); color: var(--c-disabled); }
.screen-clips .clip-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen-clips .clip-thumb-ph { display: grid; place-items: center; }
.screen-clips .clip-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.screen-clips .clip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; font-weight: 600; }
.screen-clips .clip-main:hover .clip-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.screen-clips .clip-sub, .screen-clips .clip-facts { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-s); line-height: 16px; color: var(--c-muted); }
.screen-clips .clip-facts { display: none; }
.screen-clips .clip-row[data-tone="failed"] .clip-sub { color: var(--c-ink); user-select: text; -webkit-user-select: text; }
.screen-clips .clip-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-m); }
.screen-clips .clip-state { color: var(--c-muted); }
.screen-clips .clip-state::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: currentColor; vertical-align: middle; }
.screen-clips .clip-state[data-tone="done"], .screen-clips .clip-state[data-tone="busy"], .screen-clips .clip-state[data-tone="failed"] { color: var(--c-ink); }
.screen-clips .clip-state[data-tone="busy"]::before { animation: clips-pulse 1.4s ease-in-out infinite; }
.screen-clips .clip-state[data-tone="failed"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
@keyframes clips-pulse { 50% { opacity: 0.25; } }
.screen-clips .clip-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.screen-clips .clip-del { color: var(--c-muted); }
.screen-clips .clip-del:not(:disabled):hover, .screen-clips .clip-del[aria-expanded="true"] { color: var(--c-ink); background: var(--c-field); }
.screen-clips .clip-del:disabled { color: var(--c-disabled); }

/* In-page delete confirm (never a browser dialog) */
.screen-clips .clip-confirm {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  border-radius: var(--r-control);
  background: var(--c-field);
}
.screen-clips .clip-confirm-copy { min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-m); line-height: 18px; }
.screen-clips .clip-confirm-error { font-weight: 600; }
.screen-clips .clip-confirm-error:empty { display: none; }
.screen-clips .clip-confirm-actions { flex: none; display: flex; gap: 4px; }

.screen-clips .clips-empty { padding: 32px 0 8px; border-top: 1px solid var(--c-field); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.screen-clips .clips-empty-icon { color: var(--c-muted); }
.screen-clips .clips-empty-title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: 600; }

@media (max-width: 899.98px) {
  .screen-clips .clips-wrap { padding: 32px var(--gutter); }
  .screen-clips .clip-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .screen-clips .clip-cell { display: none; }
  .screen-clips .clip-facts { display: block; }
  .screen-clips .clip-thumb { width: 80px; height: 45px; }
  .screen-clips .clip-main { gap: 10px; }
  .screen-clips .clip-confirm { flex-direction: column; align-items: stretch; }
  .screen-clips .clip-confirm-actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-clips .clip-state[data-tone="busy"]::before { animation: none; }
}

/* ---- Card grid (colour pass): the footage is the colour, status gets semantic tones ---- */
.screen-clips { --tone-busy: #5fa8ff; --tone-ready: #4fd1a5; --tone-done: var(--c-pink); --tone-failed: #f7806a; }
.screen-clips .clips-inner { max-width: 1180px; }
.screen-clips .clips-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; border-top: 0; }
.screen-clips .clip-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main main" "strip strip" "state actions" "confirm confirm";
  row-gap: 10px;
  padding: 0 0 12px;
  border: 0;
  border-radius: var(--r-control);
  background: #171717;
  overflow: hidden;
  transition: background .15s, transform .15s;
}
.screen-clips .clip-row:hover { background: var(--c-field); }
.screen-clips .clip-main { grid-area: main; flex-direction: column; align-items: stretch; gap: 10px; }
.screen-clips .clip-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; background: #0a0a0a; }
.screen-clips .clip-thumb img { transition: transform .3s ease; }
.screen-clips .clip-thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tone-ready); z-index: 1; }
.screen-clips .clip-row[data-tone="busy"] .clip-thumb::after { background: var(--tone-busy); }
.screen-clips .clip-row[data-tone="done"] .clip-thumb::after { background: var(--tone-done); }
.screen-clips .clip-row[data-tone="failed"] .clip-thumb::after { background: var(--tone-failed); }
.screen-clips .clip-row:hover .clip-thumb img { transform: scale(1.03); }
.screen-clips .clip-thumb-len { position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: var(--r-chip); background: rgba(0,0,0,.72); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.screen-clips .clip-thumb-state { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: var(--r-chip); background: rgba(0,0,0,.72); color: #fff; font-size: 12px; font-weight: 600; }
.screen-clips .clip-thumb-state::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--tone-ready); vertical-align: middle; }
.screen-clips .clip-thumb-state[data-tone="busy"]::before { background: var(--tone-busy); animation: clips-pulse 1.4s ease-in-out infinite; }
.screen-clips .clip-thumb-state[data-tone="done"]::before { background: var(--tone-done); }
.screen-clips .clip-thumb-state[data-tone="failed"]::before { background: var(--tone-failed); }
.screen-clips .clip-row[data-tone="busy"] .clip-thumb { box-shadow: inset 0 -3px 0 var(--tone-busy); }
.screen-clips .clip-row[data-tone="ready"] .clip-thumb { box-shadow: inset 0 -3px 0 var(--tone-ready); }
.screen-clips .clip-row[data-tone="done"] .clip-thumb { box-shadow: inset 0 -3px 0 var(--tone-done); }
.screen-clips .clip-row[data-tone="failed"] .clip-thumb { box-shadow: inset 0 -3px 0 var(--tone-failed); }
.screen-clips .clip-text { padding: 0 14px; }
.screen-clips .clip-name { font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: 700; }
.screen-clips .clip-killstrip { grid-area: strip; display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.screen-clips .clip-killmore { font-size: 12px; color: var(--c-muted); }
.screen-clips .clip-cell.clip-len, .screen-clips .clip-cell.clip-state { display: none; }
.screen-clips .clip-cell.clip-kills { grid-area: state; padding-left: 14px; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.screen-clips .clip-actions { grid-area: actions; padding-right: 10px; }
.screen-clips .clip-confirm { grid-area: confirm; margin: 0 10px; }
.screen-clips .clip-facts { display: none !important; }
@media (max-width: 899.98px) {
  .screen-clips .clips-list { grid-template-columns: 1fr; }
  .screen-clips .clip-row { grid-template-columns: minmax(0, 1fr) auto; }
  .screen-clips .clip-cell.clip-kills { display: block; }
  .screen-clips .clip-thumb { width: 100%; height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .screen-clips .clip-thumb-state[data-tone="busy"]::before { animation: none; }
  .screen-clips .clip-thumb img { transition: none; }
}

/* ---- Rename in place and select-to-delete (screens/clips.js) ---- */
.screen-clips .clips-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.screen-clips .clips-tools { flex: none; display: flex; align-items: center; gap: 4px; padding-bottom: 6px; }
.screen-clips .clips-select[aria-pressed="true"] { box-shadow: var(--ring-pick); }
.screen-clips .clip-ren { color: var(--c-muted); }
.screen-clips .clip-ren:hover { color: var(--c-ink); }
.screen-clips .clip-name-input { height: 26px; margin: -2px 0 0 -8px; width: calc(100% + 8px); padding: 0 8px; background: var(--c-seam); font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.screen-clips .clip-name-input:focus-visible { outline-offset: 0; }
.screen-clips .clip-row.is-renaming .clip-main { cursor: default; }
.screen-clips .clip-row.is-renaming:hover .clip-thumb img { transform: none; }
/* Checkbox on the thumbnail (selection mode): the pink box is the selection state, nothing else turns pink. */
.screen-clips .clip-select { position: absolute; top: 6px; right: 6px; z-index: 2; min-height: 0; padding: 5px; border-radius: var(--r-chip); background: rgba(0, 0, 0, .72); }
.screen-clips .clip-select .check-box { box-shadow: inset 0 0 0 1.5px var(--c-ink); }
.screen-clips .clip-select[aria-checked="true"] .check-box { box-shadow: none; }
.screen-clips .clip-select:focus-visible { outline-offset: 0; }
.screen-clips.is-selecting .clip-row { cursor: pointer; }
.screen-clips.is-selecting .clip-main:hover .clip-name { text-decoration: none; }
.screen-clips.is-selecting .clip-actions { visibility: hidden; }
.screen-clips .clip-row.is-selected { background: var(--c-selected); outline: 2px solid var(--c-ink); outline-offset: -2px; }
.screen-clips .clip-row.is-selected .clip-thumb img { transform: none; }
/* The bar under the list sticks to the bottom of the window while you scroll. */
.screen-clips .clips-bar {
  position: sticky;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-control);
  background: var(--c-field);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.screen-clips .clips-bar-copy { min-width: 0; display: flex; flex-direction: column; font-size: var(--fs-m); line-height: 18px; }
.screen-clips .clips-bar-count { font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: 700; }
.screen-clips .clips-bar-actions { flex: none; display: flex; gap: 4px; }
@media (max-width: 899.98px) {
  .screen-clips .clips-bar { bottom: 12px; }
  .screen-clips .clips-bar.is-confirming { flex-direction: column; align-items: stretch; }
  .screen-clips .clips-bar.is-confirming .clips-bar-actions { justify-content: flex-end; }
}
@media (max-width: 599.98px) {
  .screen-clips .clips-title-row { align-items: center; }
  .screen-clips .clips-tools { padding-bottom: 0; }
}
