.audio-tool-page { line-height: 1.6; }
/* A native submit before the audio modules load would navigate away and discard the selected file. */
@media (scripting: enabled) {
  main[data-audio-tool]:not([data-tool-ready]) #audio-tool-form { interactivity: inert; }
  main[data-audio-tool]:not([data-tool-ready]) #tool-run { visibility: hidden; }
}
.audio-tool-page :is(input, textarea, select, button) { font-family: inherit; }
.audio-tool-page a { text-underline-offset: .2em; }
.audio-tool-page .audio-tool-heading { display: grid; gap: 12px; }
.audio-tool-heading h1 { text-wrap: balance; }
.audio-tool-heading p { margin: 0; font-size: 15px; color: var(--muted); }
.audio-tool-page .tool-nameplate { margin-block: 0 10px; min-height: 20px; }
.audio-tool-page .tool-nameplate span { text-transform: uppercase; }
.audio-tool-page .tool-nameplate a { font: 12px var(--font-sans); letter-spacing: 0; text-decoration-color: #b3b8a3; }
.audio-tool-form { display: grid; gap: 18px; min-width: 0; }
.audio-tool-help { margin: 0; color: var(--muted); }
.audio-tool-guide, .audio-tool-terms { font-size: 13px; }
.audio-tool-guide > summary, #editor-quota > summary { width: fit-content; cursor: pointer; padding: 5px 0; color: var(--olive); font-weight: 500; }
.audio-tool-guide[open] p { margin: 6px 0; }
.audio-tool-field { display: grid; min-width: 0; gap: 7px; }
.audio-tool-field label, .redact-categories legend { font-size: 14px; font-weight: 600; }
.audio-tool-field :is(input, select, textarea), .audio-source-panel :is(input[type=url], input[type=number], input[type=text]) {
  min-width: 0; max-width: 100%; min-height: 44px; border: 1px solid #aeb59e; border-radius: 3px;
  padding: 10px 12px; background: #fffef6; color: var(--ink); font-size: 16px; box-shadow: inset 0 1px 3px #3037260a;
}
.audio-tool-field :is(select, input[type=number]) { width: min(100%, 17rem); }
.audio-tool-field input[type=file] { width: 100%; padding: 7px; background: #edf0e3; border-style: dashed; font-size: 13px; }
.audio-tool-field input::file-selector-button, .audio-tool-page button:not(.button, .redact-word) {
  color: var(--ink); cursor: pointer; min-height: 44px; padding: 8px 14px; border: 1px solid #a2aa93;
  border-radius: 3px; background: linear-gradient(#faf9f0, #e2e5d7); box-shadow: inset 0 1px #fff9, inset 0 -2px #b9bbaa60;
  font: 500 13px/1.45 var(--font-sans);
}
.audio-tool-field input::file-selector-button { margin-right: 9px; }
.audio-tool-page button:not(.button, .redact-word):hover:enabled, .audio-tool-field input::file-selector-button:hover { border-color: var(--olive); }
.audio-tool-page button:disabled { cursor: default; }
#tool-sources:empty { display: none; }
#tool-sources:not(:empty) { margin-top: -9px; display: grid; gap: 9px; }
.audio-tool-field input[type=file].audio-source-native { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
.audio-source-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.audio-source-actions:has(#tool-source-file) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.audio-source-actions:has(#tool-source-file) button { padding-inline: 7px; }
.audio-source-actions:has(#tool-source-stop:not([hidden])) { display: flex; }
.audio-source-video:empty { display: none; }
.audio-source-panel { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 12px; background: var(--soft); }
.audio-source-panel :is(input[type=url], input[type=text]) { width: 100%; }
.audio-source-range { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.audio-source-panel label { font-size: 13px; }
.audio-source-range label { min-width: 0; }
.audio-source-range input { width: 100%; }
.audio-source-files { margin: 0; padding-inline-start: 20px; font-size: 13px; overflow-wrap: anywhere; }
.audio-source-files li { padding-block: 3px; }
.audio-tool-page .audio-source-files .audio-source-remove { min-width: 44px; margin-inline-start: 6px; vertical-align: middle; }
.audio-source-remove svg { width: 14px; height: 14px; }
.audio-source-status { color: var(--muted); font-size: 13px; }
.audio-source-status:empty, .audio-source-files:empty { display: none; }
.audio-source-preview { width: 100%; }
.audio-file-order { margin: 0; overflow-wrap: anywhere; }
.audio-file-order:empty { display: none; }
.audio-tool-field textarea { width: 100%; min-height: 7em; resize: vertical; }
.audio-tool-consent, #quota-paid { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; }
.redact-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; margin: 0; padding: 0; gap: 8px; border: 0; }
.redact-categories legend { margin-bottom: 8px; padding: 0; }
.redact-categories label { padding: 10px; min-height: 44px; background: #eef0e4; border: 1px solid var(--line); border-radius: 3px; }
.redact-categories label:has(input:checked) { background: var(--accent-soft); border-color: var(--olive); }
input[type=checkbox] { flex: none; width: 18px; height: 18px; accent-color: var(--olive); margin: 4px 0 0; }
#tool-status:empty, #tool-results:empty { display: none; }
#tool-status { margin: 16px 0 0; }
#tool-status[data-state=error] { color: var(--danger); border-color: #c99d86; background: #f3e7db; }
#tool-cancel { margin-top: 10px; }
#tool-results { display: grid; gap: 10px; margin-top: 18px; }
.audio-tool-result { min-width: 0; display: grid; gap: 10px 18px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 14px; background: #edf0e5; border: 1px solid var(--rule); border-radius: 6px; }
.audio-tool-result h2 { grid-column: 1/-1; margin: 0; font-size: 21px; }
.audio-tool-result audio { width: 100%; min-width: 0; }
.audio-tool-result pre { font: inherit; margin: 0; max-height: 20rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.audio-tool-result a { color: var(--olive); font: 500 13px/1.5 var(--font-sans); }
.audio-result-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .92rem; }
#sync-settings, .sync-track fieldset { display: grid; gap: 12px; min-width: 0; }
#sync-settings:empty { display: none; }
.sync-track { border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.sync-track summary { cursor: pointer; color: var(--olive); font-weight: 600; padding-block: 10px; }
.sync-track fieldset { border: 1px solid var(--rule); margin: 8px 0; padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sync-track legend { padding-inline: 4px; max-width: 100%; }
.sync-track audio { grid-column: 1/-1; width: 100%; }
.sync-marker { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.sync-marker label { max-width: 100%; font-size: .9rem; color: var(--muted); }
.sync-marker input { display: block; padding: 8px; border: 1px solid #9da68e; border-radius: 4px; width: 7rem; max-width: 100%; min-height: 44px; }
.sync-marker button { font-size: .88rem; }
.audio-tool-terms { margin: 23px 0 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: #e6e9db; }
.audio-tool-terms p { margin: 8px 0; }
#editor-quota summary { cursor: pointer; font-weight: 600; color: var(--olive); padding-block: 4px; }
.audio-tool-related { justify-content: space-between; font-size: 12px; }
.redact-inspection { margin-top: 20px; border-block: 1px solid var(--rule); padding: 8px 0; }
.redact-inspection summary { padding: 8px 0; color: var(--olive); cursor: pointer; font-weight: 600; }
.redact-inspection h2 { margin: 22px 0 0; font-size: 1.2rem; }
.redact-inspection p { margin: 8px 0; }
#redact-player { width: 100%; margin-top: 8px; }
.redact-transcript { max-height: 18rem; overflow-y: auto; border: 1px solid var(--rule); border-radius: 4px; padding: 8px 12px; background: #fffef8; }
.redact-word { display: inline; min-height: 0; padding: 2px 1px; line-height: 1.7; font: inherit; color: inherit; background: none; border: 0; overflow-wrap: anywhere; }
.redact-word.is-match { background: #fbecba; text-decoration: underline dotted; }
.redact-word.is-selected { background: #cfdfbd; text-decoration: underline; }
.redact-list { display: grid; gap: 10px; max-height: 34rem; overflow-y: auto; padding: 3px; }
.redact-hit { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--rule); border-radius: 6px; }
.redact-hit > label { display: flex; gap: 10px; align-items: baseline; overflow-wrap: anywhere; font-weight: 600; }
.redact-hit small { color: var(--muted); }
.redact-bounds, .redact-output-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 8px 14px; }
fieldset.redact-bounds { min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid var(--rule); }
.redact-bounds label, .redact-output-controls label { display: grid; gap: 3px; font-size: .88rem; }
.redact-bounds input, #redact-mode { border: 1px solid #9da68e; border-radius: 4px; padding: 8px; min-height: 44px; background: #fffef8; }
.redact-bounds input { max-width: 8rem; width: 100%; }
.redact-output-controls { margin: 12px 0; }
.audio-tool-page #redact-apply { color: #f8f5e3; border-color: #34412d; background: linear-gradient(#61724d, #46543a); }
@media (max-width: 560px) {
  .audio-tool-page .site-header { min-height: 60px; }
  .audio-tool-page .tool-return-row { padding-top: 0; }
  .audio-tool-page .audio-tool-heading { padding-block: 8px 19px; }
  .audio-tool-heading p { font-size: 14px; }
  .audio-tool-page .tool-instrument { padding-top: 13px; }
  .audio-tool-result { grid-template-columns: minmax(0, 1fr); }
  .audio-tool-form { gap: 15px; }
  .audio-tool-related { justify-content: flex-start; }
  .audio-source-actions:has(#tool-source-file) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #tool-source-file { grid-column: 1 / -1; }
  .audio-source-actions:has(#tool-source-stop:not([hidden])) { display: flex; }
}
@media (max-width: 380px) {
  .redact-categories { grid-template-columns: 1fr; }
  .audio-source-actions { align-items: stretch; }
}
.workspace-tool-page.audio-tool-page .audio-tool-related { display: none; }
