/* Audio to MP3 — tool body only. Layout, header, cards, type and buttons come from shell.css. */
#tool-form{display:flex;flex-direction:column;align-items:stretch}
.tool-drop input[type=file]{width:100%;max-width:420px}
#input-info{overflow-wrap:anywhere;font-weight:600;color:var(--green)}
#input-info:empty{display:none}
.actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px}
#status{min-height:1.5em;margin:14px 0 0;text-align:center;font-size:14px;color:var(--green)}
progress{width:100%;margin-top:8px;accent-color:var(--green)}
#result{margin:8px 0 0;text-align:center;font-size:14px;font-weight:600;overflow-wrap:anywhere}
#result:empty{display:none}
audio{width:100%;display:block;margin-top:14px}
.download{display:block;width:max-content;margin:14px auto 0;text-decoration:none}
/* Trim Audio & Video */
#editor{margin-top:18px}
#player,#result-player{display:block;width:100%;max-height:360px;background:#111;border-radius:8px}
#player.audio-only{height:54px;background:transparent}
.trim-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:14px}
.trim-fields .field{margin:0}
.trim-fields input{width:100%;font-variant-numeric:tabular-nums}
.trim-fields .secondary{margin-top:8px;width:100%}
#editor .actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
#result-box{margin-top:16px;display:grid;gap:10px}
#progress{width:100%}
@media (max-width:680px){.trim-fields{grid-template-columns:1fr}}
.trim-fields label{display:block;font-size:13px;font-weight:600;color:var(--green);margin-bottom:6px}
.trim-fields input{border:1px solid var(--border);border-radius:6px;background:var(--surface);padding:11px 12px;min-height:44px;color:#25372f;font-size:16px}
.trim-fields input[aria-invalid=true]{border-color:#994825}
#source-info{overflow-wrap:anywhere;font-weight:600;color:var(--green)}
#source-info:empty{display:none}
#time-hint{margin:8px 0 0}
#result-box[hidden],#editor[hidden],#player[hidden],#result-player[hidden]{display:none}
/* Trim timeline: waveform with start/end handles */
.timeline{--wave-on:#2f5b45;--wave-off:#c3ccc1;position:relative;height:84px;margin:14px 16px 0;border:1px solid var(--border);border-radius:8px;background:var(--surface);touch-action:none;cursor:pointer;user-select:none}
.timeline canvas{position:absolute;inset:6px 0;width:100%;height:calc(100% - 12px);display:block}
.tl-selection{position:absolute;top:0;bottom:0;background:#2f5b4514;border-top:3px solid #d9a441;border-bottom:3px solid #d9a441;pointer-events:none}
.tl-playhead{position:absolute;top:-4px;bottom:-4px;width:2px;margin-left:-1px;background:#25372f;pointer-events:none}
.tl-handle{position:absolute;top:-1px;bottom:-1px;width:16px;background:#d9a441;cursor:ew-resize;touch-action:none;z-index:1}
.tl-handle::after{content:"";position:absolute;left:6px;top:50%;width:4px;height:22px;margin-top:-11px;border-radius:2px;background:#fff9}
.tl-handle::before{content:"";position:absolute;inset:0 -12px}
.tl-handle-start{margin-left:-16px;border-radius:7px 0 0 7px}
.tl-handle-end{border-radius:0 7px 7px 0}
.tl-handle:focus-visible{outline:3px solid #ce9343;outline-offset:2px}
.timeline.dragging,.timeline.dragging .tl-handle{cursor:grabbing}
.timeline.locked{pointer-events:none;opacity:.6}
.timeline[data-wave=loading] canvas{opacity:.55}
.tl-hint{margin:6px 0 0}
@media (max-width:680px){.timeline{height:72px;margin:14px 20px 0}.tl-handle{width:20px}.tl-handle-start{margin-left:-20px}.tl-handle::after{left:8px}}
/* Compress Video */
#options{margin-top:18px;display:grid;gap:14px}
#options[hidden],#size-field[hidden],#levels[hidden]{display:none}
.compress-mode,.levels{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.compress-mode legend{font-size:13px;font-weight:600;color:var(--green);margin-bottom:6px;padding:0}
.compress-mode label,.levels .level{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:6px;background:var(--surface);padding:10px 12px;min-height:44px;cursor:pointer;font-size:15px}
.levels .level{flex:1 1 150px}
.levels small{color:var(--muted);font-size:12px}
.compress-mode label:has(input:checked),.levels .level:has(input:checked){border-color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
#size-field label{display:block;font-size:13px;font-weight:600;color:var(--green);margin-bottom:6px}
#megabytes{width:100%;max-width:220px;border:1px solid var(--border);border-radius:6px;background:var(--surface);padding:11px 12px;min-height:44px;color:#25372f;font-size:16px}
#megabytes[aria-invalid=true]{border-color:#994825}
#estimate{text-align:center}
#estimate:empty{display:none}
#options .actions{margin-top:0}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:680px){.levels .level{flex-basis:100%}}
.long-note{color:#7a4a12;text-align:center}.long-note:empty{display:none}
.tool-drop.drop-over{border-color:var(--green);border-style:solid;background:#e7efe6}
/* Video thumbnail (Compress Video) and Start over (all tools) */
.thumb{display:block;max-width:min(320px,100%);max-height:180px;border-radius:6px;border:1px solid var(--border);background:#111;object-fit:contain}
.tool-drop .restart{margin-top:2px}
