/* The audio and video to text pages (/tools/audio-to-text/, the pages for
   one kind of file, and /tools/record-and-transcribe/) only.
   Everything shared by the tool pages is in site.css ("free tools" block);
   colours come from its tokens, so dark mode follows by itself. */

/* ---------- the tool box ---------- */
.at-model-note { margin: 0; }
.at-work { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.at-work p { margin: 0; }
.at-phase { font-weight: 600; }
.at-work progress { height: 14px; }
/* Cancel sits at the foot of the progress box, so wherever focus takes the
   page while a run starts, the progress is on screen with it. */
.at-work .at-cancel { justify-self: start; margin-top: 4px; }
.at-box[aria-busy="true"] #at-run { cursor: progress; }
/* "Label speakers", with its extra download beside it. The row stays 44 px
   tall; on a phone the size wraps under the words. */
.tool-box .at-speakers { align-items: flex-start; }
.tool-box .at-speakers input { margin-top: 12px; }
.tool-box .at-speakers > span { padding: 10px 0; }
.tool-box .at-speakers .hint { display: inline; margin-left: 4px; white-space: nowrap; }
.tool-box .check-row.at-speakers:has(input:disabled) { cursor: default; color: var(--muted); }
/* Phones (under 640 px): while a run works, the parts above the progress
   that can't be used then (the file picker, the model note, the disabled
   Transcribe button, and on the record page the recorder) fold away, so the
   progress sits just below the KhuHu card. The language and "Label
   speakers" stay, so the choices made are still shown. All of it comes back
   when the run ends. */
@media (max-width: 639.98px) {
  .at-box[aria-busy="true"] > .drop,
  .at-box[aria-busy="true"] .at-model-note,
  .at-box[aria-busy="true"] .tool-actions:has(> #at-run),
  .at-box[aria-busy="true"] > .rec-consent,
  .at-box[aria-busy="true"] > .rec-panel { display: none; }
}

/* The one quiet line about KhuHu accounts, under the trust row. */
.at-planned { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.at-planned .pill { margin-left: 4px; }

/* ---------- the text as it arrives ---------- */
/* "Language found: French. Not right? Choose the language and start again."
   The button looks like a link and is a full 44 px tall to tap. */
.at-lang-note { margin: 22px 0 0; padding: 4px 14px; border-left: 4px solid var(--hl); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--fg); font-size: 1rem; line-height: 1.5; }
.at-lang-note[hidden] { display: none; }
.at-link-btn {
  display: inline; min-height: 44px; margin: 0; padding: 10px 0; border: 0; background: none;
  color: var(--fg); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left;
}
.at-link-btn:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
.at-link-btn:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; border-radius: 4px; }
.at-lang-note + .at-live { margin-top: 14px; }
.at-hidden-note { color: var(--warn-fg) !important; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 10px !important; }
.at-hidden-note[hidden] { display: none; }
.at-live { margin-top: 26px; }
.at-live h2 { font-size: 1.25rem; letter-spacing: 0; margin: 0 0 10px; }
.at-live-text {
  max-height: 320px; overflow: auto; padding: 12px 16px;
  border: 1.5px dashed var(--field-line); border-radius: 12px; background: var(--surface);
  font: 1rem/1.6 var(--sans); overflow-wrap: anywhere;
}
.at-live-text p { margin: 0 0 6px; }
.at-live-text p:last-child { margin-bottom: 0; }
.at-stamp { color: var(--muted); font: .85rem ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; }
.at-live-text:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }

/* ---------- the result ---------- */
/* How many speakers were found, and that the labels are a best guess. */
.result .at-speakers-note { color: var(--fg); font-size: .95rem; }
/* The Clean up panel: four choices, a line saying what was removed, and the
   switch to the raw transcript. Applied at once, without a new run. */
.at-clean { margin: 12px 0 10px; padding: 10px 16px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.at-clean legend { padding: 0 6px; margin-left: -6px; font-weight: 700; }
.at-clean .rows { gap: 0 22px; }
.at-clean-note { margin: 2px 0 0; font-size: .95rem; color: var(--fg); }
.at-clean-note:empty { display: none; }
.at-clean .at-raw { margin-top: 2px; }
.at-clean .check-row:has(input:disabled) { cursor: default; color: var(--muted); }
.at-onward { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 8px 0 0; padding: 0; list-style: none; }
.at-onward li { margin: 0; }
.at-onward a { display: inline-block; padding: 10px 0; font-weight: 600; }

/* ---------- "Good to know" ---------- */
.at-facts { max-width: 820px; margin: 14px 0 0; padding-left: 1.2em; }
.at-facts li { margin: 0 0 .5em; }

/* ---------- the recorder ---------- */
.rec-consent { padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); }
.rec-consent .check-row { align-items: flex-start; font-weight: 600; color: var(--warn-fg); }
.rec-consent .check-row input { margin-top: 12px; }
.rec-consent .check-row span { padding: 10px 0; }
.rec-consent p { margin: 0; font-size: .92rem; }
.rec-consent a { color: inherit; display: inline-block; padding: 4px 0; }
.rec-panel { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.rec-panel > * { margin: 0; }
.rec-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.rec-time { font: 600 1.6rem/1.2 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-variant-numeric: tabular-nums; }
.rec-state { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.rec-panel[data-state="recording"] .rec-dot { background: #c62828; animation: rec-pulse 1.4s ease-in-out infinite; }
.rec-panel[data-state="paused"] .rec-dot { background: #b26a00; }
@media (prefers-color-scheme: dark) {
  .rec-panel[data-state="recording"] .rec-dot { background: #ff8a80; }
  .rec-panel[data-state="paused"] .rec-dot { background: #f3d49b; }
}
@keyframes rec-pulse { 50% { opacity: .35; } }
.rec-level-row { display: flex; align-items: center; gap: 10px; }
.rec-level-row label { font-weight: 600; font-size: .95rem; }
.rec-level-row meter { flex: 1 1 auto; min-width: 0; height: 16px; }
.rec-done { display: grid; gap: 12px; }
.rec-done > * { margin: 0; }
.rec-done audio { display: block; width: 100%; min-height: 44px; }
.rec-done h2 { font-size: 1.25rem; letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  .rec-panel[data-state="recording"] .rec-dot { animation: none; }
}
@media (max-width: 420px) {
  .at-work, .rec-panel { padding: 12px; }
  .at-clean { padding: 8px 12px 4px; }
  .at-clean .rows { display: grid; gap: 0; }
  .at-live-text { padding: 10px 12px; max-height: 260px; }
}
