/* Contact Sheet — the small stylesheet on top of 00.css.
 *
 * Everything here reads the same semantic tokens 00.css defines (--ink, --line, --accent, …), which
 * are themselves the host's tokens with a readable fallback. So light and dark both come out right,
 * and an injected theme wins over both, without a single colour being written twice.
 */

/* ── header ───────────── */

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s2);
}
.head-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.head .toolbar {
  justify-content: flex-end;
}
#tally {
  font-variant-numeric: tabular-nums;
}

/* ── the sheet ───────────── */

.drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: var(--s2);
}

.sheet {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s2);
}
/* The phone: two columns, always — one is a scroll and three is a thumbnail nobody can judge. */
@media (max-width: 380px) {
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
  padding: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.tile.selected { border-color: var(--accent); }
.tile.keep { border-left: 3px solid var(--accent); }
.tile.reject { border-left: 3px solid var(--danger); }

.tile-pick {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
  padding: var(--s1);
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.tile-pick:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The picture's box. A generated image is any shape — 1:1, 3:2, a tall poster — so the frame is
   fixed and the image is CONTAINED in it: nothing is ever stretched or cropped to fit a grid. The
   checker underneath is what a transparent PNG shows through, in both themes. */
.frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background-color: var(--raised);
  background-image:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.shot {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* No src yet (bytes still on their way, or `media` not allowed): the frame stays, so the grid does
   not jump when the picture lands. */
.shot:not([src]) { visibility: hidden; }

.tile-name {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}
.tile-meta {
  display: block;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.tile.keep .tile-meta { color: var(--accent); }
.tile.reject .tile-meta { color: var(--danger); }

/* Three real buttons, always visible — nothing here appears on hover, because a thumb has none. */
.tile-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--s2);
  font-size: 13px;
}

/* ── compare ───────────── */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}
@media (min-width: 560px) {
  .compare-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.cmp {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
}
/* Side by side, a bigger frame: this is the view where the choice is actually made. */
.cmp .frame { aspect-ratio: 1 / 1; }
.cmp figcaption { font-size: 12px; }

kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--raised);
  font-family: var(--mono);
  font-size: 11px;
}
