/* Caption timer. Phone first: the article frame is 311 px on a phone and 700 px on a computer. */

h1 { font-size: 1.25rem; }
h2 { font-size: 1.0625rem; margin: 0 0 10px; }
h3 { font-size: 0.9375rem; margin: 14px 0 6px; }

/* Tabs */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.tab {
  min-height: 44px; padding: 8px 10px; font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--accent);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer;
}
.tab[aria-selected='true'] { color: #fff; background: var(--accent); border-color: var(--accent); }

textarea {
  width: 100%; min-height: 8rem; padding: 10px 12px; font: inherit; font-size: 0.9375rem; line-height: 1.45;
  color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; resize: vertical;
}
#shift-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.file-button { min-height: 44px; padding: 10px 14px; font-size: 0.9375rem; cursor: pointer; max-width: 100%; }
.button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#video-name, #script-name, #shift-name { overflow-wrap: anywhere; min-width: 0; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; font-size: 0.9375rem; cursor: pointer;
}
.pill input { margin: 0; accent-color: var(--accent); }
.pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
.check input { margin: 0; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.seconds-row { display: flex; align-items: center; gap: 10px; }
.time-input {
  width: 100%; max-width: 11rem; height: 44px; padding: 0 12px; font: inherit; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}

/* Timing */
.timer { padding: 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
video { display: block; width: 100%; max-height: 60vh; margin: 0 0 12px; border-radius: 8px; background: #000; }
.current { min-height: 3.2em; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 1.0625rem; line-height: 1.4; overflow-wrap: anywhere; }
.current:empty { display: none; }
.current-label { font-weight: 700; color: var(--accent); margin-right: 6px; }
.after { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }
.after:empty { display: none; }
.controls { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.controls .button { min-height: 48px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.controls .button.secondary { border: 1px solid var(--accent); }
.controls .button.primary { font-size: 1.0625rem; }
.controls .button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.progress { margin: 10px 0 8px; font-size: 0.9375rem; font-weight: 600; }
.captions { max-height: 18rem; overflow: auto; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; }
.captions:empty { display: none; }
.cap { border-bottom: 1px solid var(--line); }
.cap:last-child { border-bottom: 0; }
.cap-row {
  display: grid; grid-template-columns: 1.8rem 1fr; gap: 2px 8px; width: 100%; padding: 8px 10px; text-align: left;
  font: inherit; font-size: 0.875rem; line-height: 1.4; color: var(--text); background: none; border: 0;
}
button.cap-row { cursor: pointer; }
button.cap-row:hover { background: var(--panel); }
.cap.current .cap-row { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cap-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.cap-text { overflow-wrap: anywhere; }
.cap-time { grid-column: 2; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cap-time:empty { display: none; }

/* Results */
.out { padding: 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.note { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: #fff4e5; color: #7a4100; font-size: 0.875rem; }
.out .note { margin: 0 0 10px; }
.summary { margin: 0 0 8px; font-size: 0.9375rem; }
.caption-text {
  max-height: 14rem; overflow: auto; margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); font-size: 0.8125rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.checks { margin: 0; padding-left: 1.2rem; font-size: 0.9375rem; }
.checks li { margin: 0 0 6px; }
.detail { color: var(--muted); }
.ok { margin: 0; font-size: 0.9375rem; color: #1d6b3a; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 14px; }
.actions .button { min-height: 44px; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.actions .button.secondary { border: 1px solid var(--accent); }
.copied { font-size: 0.875rem; color: var(--muted); }
.cta { margin: 0; font-size: 0.9375rem; }
.copy-source { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; min-height: 0; opacity: 0; }

[hidden] { display: none !important; }

@media (min-width: 480px) {
  .controls { grid-template-columns: repeat(3, 1fr); }
  .controls .button.primary { grid-column: 1 / -1; }
}
@media (min-width: 600px) {
  h1 { font-size: 1.375rem; }
  .tabs { display: flex; }
}
