/* Audio Pitch Changer. Shared chrome comes from /assets/base.css; tokens only, no new colors. */

.ap-file { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.ap-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-file-main b { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#apMeta { color: var(--muted-2); font-size: .86rem; font-variant-numeric: tabular-nums; }

/* Waveform: the one big visual on the page, and the way to pick where to listen */
.ap-wave-wrap { position: relative; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
#apWave { display: block; width: 100%; height: 132px; cursor: pointer; touch-action: pan-y; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.ap-transport { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.ap-play { min-width: 104px; }
.ap-play .ap-ic-pause { display: none; }
.ap-play.playing .ap-ic-play { display: none; }
.ap-play.playing .ap-ic-pause { display: block; }
.ap-ab, .ap-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.ap-ab button, .ap-seg button { font: inherit; font-size: .88rem; font-weight: 560; color: var(--muted); background: none; border: 0;
  border-radius: 6px; padding: 7px 12px; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.ap-ab button:hover, .ap-seg button:hover { color: var(--text); }
.ap-ab button[aria-pressed="true"], .ap-seg button[aria-checked="true"] { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.ap-ab button[data-ab="b"][aria-pressed="true"] { color: var(--accent); }
.ap-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.ap-time-sep { color: var(--muted-2); margin: 0 6px; }
.ap-spacer { flex: 1; }
.ap-render { color: var(--muted-2); font-size: .84rem; font-variant-numeric: tabular-nums; }
.ap-render.ready { color: var(--good); }
.ap-keys { color: var(--muted-2); font-size: .82rem; margin: 10px 0 0; line-height: 1.9; }
.ap-keys kbd { margin-right: 2px; }
.ap-keys kbd + kbd { margin-left: 2px; }

/* Controls */
.ap-panel { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.ap-readout { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.ap-big { font-stretch: var(--wide); font-weight: 720; font-size: 2.6rem; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--text); }
.ap-big.on { color: var(--accent); }
.ap-big small { font-stretch: 100%; font-size: .95rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 10px; }
.ap-keyline { color: var(--muted); font-size: .95rem; }
.ap-keyline b { color: var(--text); font-weight: 600; }
.ap-keyline .ap-arrow { color: var(--muted-2); margin: 0 6px; }
.ap-keyline small { color: var(--muted-2); font-size: .82rem; margin-left: 6px; }

.ap-row { display: flex; align-items: center; gap: 12px; }
.ap-row input[type=range] { flex: 1; }
.ap-step { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: transparent;
  color: var(--text); font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; transition: background-color .15s ease, transform .14s var(--ease-out); }
.ap-step:hover { background: var(--card-2); }
.ap-step:active { transform: scale(.94); }
.ap-scale { display: flex; justify-content: space-between; margin: 6px 52px 0; color: var(--muted-2); font-size: .76rem; font-variant-numeric: tabular-nums; }

.ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-top: 22px; }
.ap-val { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 6px; font-weight: 600; }
.ap-label { font-size: .85rem; font-weight: 560; color: var(--muted); }
.ap-hint { color: var(--muted-2); font-size: .8rem; }
.ap-seg { align-self: flex-start; }
#apHz { margin-top: 8px; }
.field input[type=range] { margin: 12px 0 6px; }

.ap-opts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.ap-check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .92rem; font-weight: 560; flex: 1; min-width: 220px; }
.ap-check input { width: 17px; height: 17px; margin: 0; }
.ap-check span { color: var(--muted-2); font-weight: 400; }

/* Export */
.ap-export { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.ap-export .field { min-width: 210px; }
.ap-export .progress-row { flex: 1; min-width: 200px; padding-bottom: 14px; }

.ap-keys-touch { display: none; }
@media (pointer: coarse) {
  .ap-keys-kb { display: none; }
  .ap-keys-touch { display: inline; }
  .ap-ab button, .ap-seg button { min-height: 44px; padding: 0 16px; }
  .ap-step { width: 46px; height: 46px; }
  .ap-scale { margin: 6px 58px 0; }
  .ap-check { min-height: 44px; }
  .ap-check input { width: 22px; height: 22px; }
  .ap-semi input[type=range] { height: 6px; }
  .ap-semi input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; }
  .ap-semi input[type=range]::-moz-range-thumb { width: 24px; height: 24px; }
  #apCents::-webkit-slider-thumb { width: 24px; height: 24px; }
}
@media (max-width: 640px) {
  .ap-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-file { align-items: flex-start; }
  #apWave { height: 104px; }
  .ap-big { font-size: 2.1rem; }
  .ap-render { flex-basis: 100%; }
  .ap-transport { gap: 10px; }
  .ap-play { flex: 1; }
  .ap-ab { flex: 1; }
  .ap-ab button { flex: 1; }
  .ap-spacer { display: none; }
  .ap-time { flex-basis: 100%; order: 3; }
  .ap-render { order: 4; }
  .ap-export { flex-direction: column; align-items: stretch; }
  .ap-export .field { min-width: 0; }
  .ap-export .btn { width: 100%; }
  .ap-export .progress-row { padding-bottom: 0; }
  .ap-opts .btn { flex: 1; }
  .ap-check { flex-wrap: wrap; row-gap: 0; }
  .ap-check span { flex-basis: 100%; padding-left: 31px; }
  .ap-seg { display: flex; align-self: stretch; }
  .ap-seg button { flex: 1; }
  .ap-file .btn { flex-shrink: 0; }
}
