/* The sound tools (sound-tools.js): Merge Audio Files, Split Audio, Remove Silence, Audio Converter, Extract Audio from
   Video, Change Audio Volume, Remove Background Noise and Audio Effects. Loaded after tool.css. The same layout as the
   PDF tools: the file or the files on one side, the settings and the new files on the other. */
.sn-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; align-content: start; }
.sn-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.sn-side { position: sticky; top: 0; }
.tk-toolbar .tk-note, .sn-main .tk-note, .sn-main legend { color: var(--text-2); }
.sn-main [hidden] { display: none !important; }

/* choosing files */
.sn-drop { display: grid; justify-items: center; gap: 10px; padding: 34px 18px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--panel); text-align: center; transition: border-color 0.15s, background-color 0.15s; }
.sn-drop.is-over { border-color: var(--accent); background: var(--info-bg); }
.sn-drop.is-small { grid-template-columns: auto minmax(0, 1fr) auto; justify-items: start; align-items: center; padding: 12px 14px; text-align: start; }
.sn-art { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 20px; background: var(--info-bg); color: var(--accent); }
.sn-art svg { width: 38px; height: 38px; }
.sn-drop.is-small .sn-art { width: 42px; height: 42px; border-radius: 12px; }
.sn-drop.is-small .sn-art svg { width: 24px; height: 24px; }
.sn-drop h2 { margin: 2px 0 0; font-size: 19px; font-weight: 650; }
.sn-drop.is-small h2 { margin: 0; font-size: 15px; }
.sn-drop p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.sn-drop.is-small .sn-or, .sn-drop.is-small .sn-dnote { display: none; }
.sn-pick { position: relative; overflow: hidden; }
.sn-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.sn-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sn-busy .sn-pick { opacity: 0.45; pointer-events: none; }
.sn-veil { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(8, 14, 24, 0.55); color: #fff; font-size: 22px; font-weight: 650; pointer-events: none; }
.sn-veil.is-on { display: grid; }

/* headings and rows */
.sn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.sn-head h2 { margin: 0; font-size: 15px; }
.sn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sn-doc { min-width: 0; flex: 1 1 220px; display: grid; gap: 2px; }
.sn-doc h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-docmeta, .sn-fmeta { color: var(--text-2); font-size: 12.5px; }
.sn-docmeta.is-err, .sn-fmeta.is-err { color: var(--msg-error); }
.sn-fmeta.is-warn { color: var(--msg-warn); }
.sn-hint { margin: 10px 0 0; }
.sn-ib { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.sn-ib:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.sn-ib.x:hover:not(:disabled) { color: var(--fail); }
.sn-ib:disabled { opacity: 0.35; cursor: default; }
.sn-ib svg { width: 18px; height: 18px; }
.sn-ib:focus-visible, .sn-wave:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sn-ib[aria-pressed="true"] { color: var(--accent); }

/* the list of files */
.sn-files { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.sn-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.sn-main[data-mode="merge"] .sn-file { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.sn-file.is-err { border-color: rgba(242, 112, 109, 0.35); }
.sn-file.is-drag { position: relative; z-index: 2; border-color: var(--accent); box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.6); }
.sn-grip { display: grid; place-items: center; width: 22px; height: 40px; color: var(--text-3); cursor: grab; touch-action: none; }
.sn-file.is-drag .sn-grip { cursor: grabbing; }
.sn-grip svg { width: 18px; height: 18px; }
.sn-fplay { width: 36px; height: 36px; border-radius: 50%; background: var(--raised); color: var(--text); }
.sn-fplay svg { width: 15px; height: 15px; }
.sn-finfo { min-width: 0; display: grid; gap: 2px; }
.sn-fname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.sn-fnum { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-inline-end: 8px; padding: 0 5px; border-radius: 6px; background: var(--raised); color: var(--text-2); font-size: 11.5px; font-weight: 650; vertical-align: 1px; }
.sn-fbtns { display: flex; align-items: center; gap: 2px; }

/* one file: its name, the drawing of its sound and playing */
.sn-file1 { display: grid; gap: 12px; }
.sn-wave { position: relative; height: 150px; border-radius: 10px; background: var(--stage); overflow: hidden; cursor: pointer; touch-action: none; direction: ltr; }
.sn-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sn-wave:not(.is-ready) { cursor: default; }
.sn-headline { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--text); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); pointer-events: none; }
.sn-wave:not(.is-ready) .sn-headline { display: none; }
.sn-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--text-2); font-size: 13px; }
.sn-play { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sn-time { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.sn-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.sn-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--lc, var(--accent)); opacity: 0.6; }
.sn-legend.is-line i { height: 0; border-top: 2px dashed var(--warn); background: none; opacity: 1; }
.sn-main video { width: 100%; max-height: 320px; border-radius: 10px; background: #000; }

/* Split: the parts */
.sn-parts { display: grid; gap: 4px; max-height: 330px; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; }
.sn-part { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 4px 8px; border-radius: 9px; background: var(--panel-2); border-inline-start: 4px solid var(--pc); }
.sn-pnum { min-width: 22px; color: var(--text-2); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sn-pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sn-ptime { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Remove Silence: before and after */
.sn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.sn-stat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.sn-stat dt { color: var(--text-2); font-size: 12px; }
.sn-stat dd { margin: 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Audio Effects: the effects */
.sn-fxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; border: 0; }
.sn-fxc { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); cursor: pointer; }
.sn-fxc:hover { border-color: var(--line-strong); }
.sn-fxc:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.sn-fxc:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.sn-fxc input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sn-fxi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--raised); color: var(--accent); }
.sn-fxi svg { width: 20px; height: 20px; }
.sn-fxt { display: grid; gap: 1px; min-width: 0; }
.sn-fxn { font-size: 13.5px; font-weight: 650; }
.sn-fxd { color: var(--text-2); font-size: 12px; line-height: 1.35; }

/* fields */
.sn-set { display: grid; gap: 14px; }
.sn-set > h2 { margin: 0; font-size: 15px; }
.sn-field { display: grid; gap: 6px; }
.sn-field > label, .sn-field > .sn-lbl, .sn-modes legend { color: var(--text-2); font-size: 13px; }
.sn-text { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; }
.sn-text:focus, .sn-area:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sn-text[aria-invalid="true"], .sn-area[aria-invalid="true"] { border-color: var(--fail); }
.sn-area { width: 100%; min-height: 110px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5; resize: vertical; }
.sn-small { width: 90px; }
.sn-field .tk-note, .sn-set > .tk-note { margin: 0; }
.sn-field .tk-select { max-width: none; width: 100%; }
.sn-inline { display: flex; align-items: center; gap: 8px; }
.sn-inline .tk-select { width: auto; flex: 1; }
.sn-modes { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.sn-modes legend { padding: 0; margin-bottom: 6px; }
.sn-radio { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: 13.5px; cursor: pointer; }
.sn-radio:hover { border-color: var(--line-strong); }
.sn-radio:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.sn-radio input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.sn-sub { display: grid; gap: 12px; padding: 12px; border-radius: 10px; background: var(--panel-2); }
.sn-q { display: flex; align-items: center; gap: 10px; }
.sn-q input { flex: 1; min-width: 0; accent-color: var(--accent); }
.sn-q output { min-width: 64px; text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.sn-q input:disabled + output { color: var(--text-2); }
.sn-seg { width: 100%; display: flex; }
.sn-seg button { flex: 1; }
.sn-seg button:focus-visible, .sn-pv button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sn-set .tk-check { justify-self: start; }
.sn-sum { margin: 0; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.sn-sum:empty { display: none; }
.sn-sum.is-why { color: var(--text-2); }
.sn-go { width: 100%; height: auto; min-height: 44px; padding-block: 8px; white-space: normal; text-align: center; line-height: 1.3; }
.sn-progress { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; direction: ltr; }
.sn-progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
#status { margin: 0; }
#status:empty { display: none; }
.sn-warn { margin: 0; color: var(--msg-warn); font-size: 12.5px; line-height: 1.45; }

/* before and after */
.sn-pv { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--panel-2); }
.sn-pv .sn-lbl { color: var(--text-2); font-size: 13px; }
.sn-pv .tk-seg { width: 100%; }
.sn-pv .tk-seg button { flex: 1; height: 34px; font-size: 13px; }
.sn-pv .tk-seg button.is-on { background: var(--accent); color: var(--accent-ink); }
.sn-pv .tk-seg button:disabled { opacity: 0.45; cursor: default; }

/* the new files */
.sn-outs { display: grid; gap: 6px; max-height: 360px; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; }
.sn-out { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 7px 8px; border-radius: 9px; background: var(--panel-2); }
.sn-oplay { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--raised); color: var(--text); }
.sn-oplay svg { width: 14px; height: 14px; }
.sn-out-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.sn-out-meta { grid-column: 2; color: var(--text-2); font-size: 12px; }
.sn-out .tk-btn { grid-row: 1 / span 2; grid-column: 3; text-decoration: none; }
.sn-out .tk-btn svg { width: 15px; height: 15px; }
.sn-out-more { padding: 4px 8px; }
.sn-out-again { padding-top: 4px; }
.sn-out-again .tk-btn { width: 100%; }
.sn-stale { margin-top: 10px; }
.sn-private { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text-2); font-size: 12px; }
.sn-private svg { width: 16px; height: 16px; flex: none; color: var(--pass); }

@media (max-width: 900px) {
  .sn-main { grid-template-columns: minmax(0, 1fr); }
  .sn-side { position: static; }
}
@media (max-width: 520px) {
  .sn-drop.is-small { grid-template-columns: auto minmax(0, 1fr); }
  .sn-drop.is-small .sn-pick { grid-column: 1 / -1; }
  .sn-main[data-mode="merge"] .sn-file { grid-template-columns: auto auto minmax(0, 1fr); }
  .sn-file { grid-template-columns: auto minmax(0, 1fr); }
  .sn-fbtns { grid-column: 1 / -1; justify-content: flex-end; }
  .sn-wave { height: 120px; }
  .sn-stats { grid-template-columns: minmax(0, 1fr); }
  .sn-part { grid-template-columns: auto auto minmax(0, 1fr); }
  .sn-ptime { grid-column: 3; }
}
@media (prefers-reduced-motion: reduce) { .sn-progress i, .sn-drop { transition: none; } }
:root[data-theme="light"] .sn-pv .tk-seg button.is-on { color: #fff; }
html.a11y-contrast .sn-wave { outline: 1px solid var(--line-strong); }
.sn-fxsel { margin: 0; font-size: 14px; font-weight: 650; color: var(--text); }
.sn-miss:empty, #fmtNote:empty, #humNote:empty, #rateNote:empty, #pvNote:empty { display: none; }
.sn-pv .tk-note { margin: 0; }
