/* ============================================================
 *  /history — v0.56 admin-uplift Tier 1.2
 *
 *  Inset row split into three columns: timestamp left,
 *  source/target middle, status/duration/actions right.
 *  Failed rows flip the soft pink band background. Each row
 *  also carries a 64×64 thumbnail of the rendered frame
 *  (or a placeholder when no render exists).
 *
 *  v0.63.7 extracted from settings.css. No rules changed.
 * ============================================================ */

/* Row + columns -------------------------------------------------- */
.dx-history-row { align-items: stretch; padding: 12px 15px; gap: 14px; }
.dx-history-row--failed {
  background: var(--t-pill-danger-bg);
  border-color: var(--t-pill-danger-border);
}
.dx-history-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  min-width: 70px;
}
.dx-history-clock code {
  font-family: var(--t-font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--t-fg);
  background: transparent;
  padding: 0;
}
.dx-history-date {
  font-size: 11px;
  color: var(--t-muted);
}
.dx-history-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.dx-history-target {
  font-size: 13px;
  color: var(--t-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 0;
  min-width: 0;
}
.dx-history-err {
  font-size: 11.5px;
  color: var(--t-pill-danger-fg);
  font-family: var(--t-font-mono);
}
/* Secondary detail line rendered next to the target on rows where
   the raw target alone doesn't tell the whole story (currently only
   button events, whose target is a device id and whose interesting
   fields sit in extra: button name, action spec, pushed page).
   Same wrap as the rest of dx-history-mid, monospace for the
   ``→ action`` glyph to sit predictably. */
.dx-history-detail {
  font-size: 11.5px;
  font-family: var(--t-font-mono);
  white-space: normal;
  min-width: 0;
  flex-basis: 100%;
  order: 10;
}
.dx-history-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.dx-history-dur {
  font-family: var(--t-font-mono);
  font-size: 12.5px;
  color: var(--t-fg-soft);
  min-width: 36px;
  text-align: right;
}

/* Square thumbnail at the left of each push row. Click opens
   the same lightbox as the timestamp link. ``--empty`` is a
   placeholder square for events without a stored composition
   PNG (URL pushes, errors before render). */
.dx-history-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--t-border, #ecebe5);
  background: var(--t-inset, #faf9f6);
  display: grid;
  place-items: center;
}
.dx-history-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dx-history-thumb--empty {
  color: var(--t-muted, #9a9a93);
  font-size: 22px;
}

/* Device chip (small inline pill on history rows + anywhere else
   we surface "this push went to <device>"). */
.dx-device-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t-fg-soft);
}
.dx-device-chip .ph { color: var(--t-muted); font-size: 12px; }

/* Source pill — colour-coded by push origin. Lightweight pill;
   distinct from .dx-pill status chips so the two read as
   different categories ("how was this pushed" vs "did it land"). */
.dx-source-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--t-pill-neutral-bg);
  color: var(--t-pill-neutral-fg);
  border: 1px solid transparent;
}
.dx-source-page,
.dx-source-file,
.dx-source-url,
.dx-source-webpage {
  background: color-mix(in oklab, var(--t-accent) 16%, var(--t-surface));
  color: var(--t-accent);
}
.dx-source-schedule,
.dx-source-rotation {
  background: var(--t-pill-warn-bg);
  color: var(--t-pill-warn-fg);
}
.dx-source-webhook,
.dx-source-ha {
  background: color-mix(in oklab, #a35a2c 16%, var(--t-surface));
  color: var(--t-warn);
}
.dx-source-resend,
.dx-source-manual,
.dx-source-setup,
.dx-source-unknown {
  background: var(--t-pill-neutral-bg);
  color: var(--t-pill-neutral-fg);
}
