/* YouTube Caption Bot: only what is this app's own. Everything else is the studio look
   (/_ui/studio-ui.css, Roles/Platform Engineer/UI.md); colours come from its tokens, so light
   and dark both follow the OS. */

/* Video red, the brand's measured pair (UI.md accent table: 5.18:1 or better on both grounds). */
:root {
  --ui-accent: #c4161c;
  --ui-dark-accent: #ff6b6b;
}

/* Anchors the debug overlay's .ui-coord labels. Only the page's own cards: the bell's panel is a
   .ui-card too, and must stay absolutely positioned. */
.ui-main > .ui-card { position: relative; }

.input-row { flex-wrap: nowrap; }
.input-row .ui-input { flex: 1; min-width: 0; }

/* ---- result ---- */
.result-header { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.result-thumb {
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-sunken);
  flex: none;
}
.result-meta { flex: 1 1 200px; min-width: 0; }
.result-meta .ui-card-title { margin: 0 0 2px; font-size: 16px; overflow-wrap: anywhere; }
.result-meta .ui-hint { margin: 0 0 8px; }

#result-transcript { min-height: 320px; max-height: 55vh; line-height: 1.6; }

/* The timestamped view: each time is a link into the video at that moment. */
.segments {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  max-height: 55vh;
  overflow: auto;
  background: var(--ui-sunken);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  line-height: 1.6;
}
.segment { display: flex; gap: 10px; align-items: baseline; padding: 1px 0; }
.segment-time {
  flex: none;
  width: 56px;
  text-align: right;
  font: 12px var(--ui-mono);
  font-variant-numeric: tabular-nums;
  text-decoration: none;   /* the kit colours links in the accent: these are references into the video */
}
.segment-time:hover { text-decoration: underline; }

/* ---- history ---- */
#history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--ui-border);
  cursor: pointer;
}
.history-item:first-child { border-top: none; }
.history-item:hover { background: var(--ui-raised); }
.history-item.is-removed { cursor: default; background: none; }
.history-item.is-removed .ui-hint { flex: 1; margin: 0; overflow-wrap: anywhere; }

.history-thumb {
  width: 68px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ui-sunken);
  flex: none;
}
/* The row's main area is a real button, so every entry opens from the keyboard too. */
.history-open {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--ui-radius-sm);
}
.history-meta { display: block; min-width: 0; }
.history-title {
  display: block;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-sub { display: block; margin: 0; font-size: 12px; color: var(--ui-dim); }
.history-snippet { display: block; margin: 4px 0 0; font-size: 12px; color: var(--ui-dim); line-height: 1.5; }
.history-snippet mark { background: none; color: var(--ui-accent); font-weight: 600; }
