.timing-field > [hidden], .listen-field[hidden] { display: none !important; }
button.clip-choose {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px;
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px;
  background: transparent; color: var(--text); text-align: left; box-shadow: none;
}
.clip-choose-copy { display: grid; gap: 5px; flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.clip-choose-copy output { color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.clip-choose-arrow { font-size: 25px; color: var(--muted); }
.clip-choose { transition: border-color 140ms ease, background-color 140ms ease; }
.clip-choose:not(:disabled):hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, transparent); }
.clip-choose-icon, .clip-track-icon {
  display: block; flex: none; width: 22px; height: 22px; background: var(--accent);
  mask: url('./icons/music.svg') center / contain no-repeat;
  -webkit-mask: url('./icons/music.svg') center / contain no-repeat;
}
.clip-picker {
  position: fixed; inset: 0; width: min(100%, 480px); max-width: 100%; max-height: 100dvh;
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); background: var(--panel); letter-spacing: 0; overflow: auto;
  box-shadow: 0 24px 80px #0006; overscroll-behavior: contain;
}
.clip-picker[open] { animation: clip-picker-enter 220ms cubic-bezier(.2, .8, .2, 1); }
.clip-picker::backdrop { background: #0009; }
.clip-picker *, .clip-choose * { box-sizing: border-box; letter-spacing: 0; }
.clip-picker button { margin: 0; box-shadow: none; transform: none; }
.clip-picker-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: 58px; padding: 6px 12px; border-bottom: 1px solid var(--line);
}
.clip-picker-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.clip-picker-header button { min-height: 44px; padding: 8px; background: none; border: 0; border-radius: 4px; font-size: 14px; color: var(--muted); justify-self: start; }
.clip-picker-header #clipPickerDone { color: var(--accent); font-weight: 700; justify-self: end; }
.clip-picker-body { padding: 20px 20px max(20px, env(safe-area-inset-bottom)); }
.clip-picker-track { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; margin-bottom: 20px; }
.clip-track-icon { width: 18px; height: 18px; opacity: .85; }
.clip-track-name { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 500; overflow-wrap: anywhere; max-height: 59px; overflow: auto; }
.clip-picker-player { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 14px; align-items: center; }
.clip-duration-badge { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-variant-numeric: tabular-nums; }
.clip-picker .clip-audition { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--text); color: var(--panel); border: 0; }
.clip-audition::before { content: ''; display: block; width: 20px; height: 20px; background: currentColor; mask: url('./icons/play.svg') center / contain no-repeat; -webkit-mask: url('./icons/play.svg') center / contain no-repeat; }
.clip-audition.is-playing::before { mask-image: url('./icons/pause.svg'); -webkit-mask-image: url('./icons/pause.svg'); }
.clip-picker-header button, .clip-picker .clip-audition { transition: transform 120ms ease, opacity 120ms ease; }
.clip-picker-header button:active, .clip-picker .clip-audition:active { transform: scale(.94); opacity: .8; }
.clip-audition::before { transition: transform 140ms ease; }
.clip-audition.is-playing::before { transform: scale(.9); }
.clip-wave-wrap { position: relative; height: 88px; margin-top: 18px; }
.clip-wave-scroll { width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; touch-action: pan-x; overscroll-behavior-x: contain; cursor: grab; direction: ltr; }
.clip-wave-scroll::-webkit-scrollbar { display: none; }
.clip-wave-scroll:active { cursor: grabbing; }
.clip-wave-spacer { height: 88px; position: relative; }
.clip-wave-canvas { position: sticky; left: 0; height: 88px; display: block; pointer-events: none; }
.clip-wave-selection { position: absolute; top: 9px; height: 70px; border: 2px solid var(--accent); border-radius: 6px; pointer-events: none; overflow: hidden; }
.clip-wave-selection { transition: background-color 160ms ease; }
.clip-wave-selection.is-scrubbing { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.clip-wave-selection::before, .clip-wave-selection::after { content: ''; position: absolute; width: 3px; height: 18px; top: 24px; border-radius: 2px; background: var(--accent); }
.clip-wave-selection::before { left: 4px; } .clip-wave-selection::after { right: 4px; }
.clip-wave-playhead { display: block; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px; background: var(--text); opacity: .65; }
.clip-picker-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.clip-duration-label { display: flex; justify-content: space-between; margin: 20px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.clip-duration-label output { color: var(--text); font-variant-numeric: tabular-nums; }
.clip-picker input[type=range] { appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 0; height: 44px; padding: 0; margin: 0; background: transparent; border: 0; cursor: pointer; }
.clip-picker input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line); }
.clip-picker input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; margin-top: -7px; background: var(--accent); border: 0; border-radius: 50%; }
.clip-picker input[type=range]::-moz-range-track { height: 3px; background: var(--line); }
.clip-picker input[type=range]::-moz-range-thumb { width: 17px; height: 17px; background: var(--accent); border: 0; border-radius: 50%; }
.clip-picker input:disabled { opacity: .35; cursor: default; }
.clip-picker :focus-visible, .clip-choose:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.clip-picker-error { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
@keyframes clip-picker-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) { .clip-picker { margin: auto auto 0; border-radius: 8px 8px 0 0; border-bottom: 0; } }
@media (max-height: 460px) { .clip-picker-body { padding-top: 12px; padding-bottom: 12px; } .clip-picker-track { margin-bottom: 8px; } .clip-wave-wrap { margin-top: 4px; } .clip-duration-label { margin-top: 10px; } }
@media (prefers-reduced-motion: reduce) { .clip-picker[open] { animation: none; } .clip-picker *, .clip-choose { transition: none !important; } }
