/* Audio editor styles: sounds and the transcript (left), the timeline (centre), the AI assistant (right), Properties and Effects (windows). */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }
#au-left, #au-side { min-height: 0; }
.au-pane { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
.au-pane.grow { flex: 1; border-bottom: 0; }
#au-assist-pane { display: flex; flex-direction: column; min-height: 0; }
#au-props { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
#au-bin { flex: 1; min-height: 0; overflow: auto; }

/* sounds */
.au-bin { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.au-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: none; color: var(--text-2); font: inherit; font-size: var(--fs); cursor: pointer; }
.au-add:hover { border-color: var(--prog); color: var(--prog-strong); }
.au-add.rec .material-symbols-outlined { color: var(--rec); }
.au-add .material-symbols-outlined { font-size: var(--ic); }
.au-media { display: flex; flex-direction: column; gap: 2px; }
.au-m { display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: var(--radius); cursor: grab; outline: none; }
.au-m:hover { background: var(--line-soft); }
.au-m:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
.au-m-wave { width: 100%; height: 30px; border-radius: var(--radius-xs); background: var(--prog-soft); }
.au-m-name { font-size: var(--fs-m); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-m-meta, .au-m-st { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-m-st { color: var(--prog-strong); }

/* the timeline */
#au-center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
#au-timeline { flex: 1; min-height: 150px; display: grid; grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: 26px minmax(0, 1fr) auto 58px; background: var(--tl-bg); user-select: none; -webkit-user-select: none; }
#au-timeline canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.au-corner { background: var(--tl-ruler); border-right: 1px solid var(--tl-line); border-bottom: 1px solid var(--tl-line); }
#au-ruler { cursor: pointer; }
/* the project overview along the bottom (audio/overview.js) */
.au-ov-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 8px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--tl-line); border-right: 1px solid var(--tl-line); background: var(--tl-head); }
#au-ov-fit { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--text-2); cursor: pointer; }
#au-ov-fit:hover { border-color: var(--prog); color: var(--prog-strong); }
#au-ov-fit .material-symbols-outlined { font-size: var(--ic-s); }
#au-overview { border-top: 1px solid var(--tl-line); background: var(--tl-row); }
#au-timeline > .au-ov-head, #au-overview { grid-row: 4; }
.au-heads { overflow: hidden; border-right: 1px solid var(--tl-line); background: var(--tl-head); position: relative; }
.au-heads-in { position: absolute; left: 0; right: 0; top: 0; }
.au-tl-wrap { position: relative; min-height: 0; overflow: hidden; }
.au-head { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--tl-line); box-sizing: border-box; cursor: pointer; position: relative; }
.au-head::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 var(--radius-xs) var(--radius-xs) 0; background: var(--tc, var(--prog)); }
.au-head.on { background: var(--prog-soft); }
.au-head-top { display: flex; align-items: center; gap: 4px; }
.au-head-name { flex: 1; min-width: 0; font-size: var(--fs-m); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-head-sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-head-btns { display: flex; gap: 2px; }
.au-hb { width: 22px; height: 20px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-xs); background: var(--surface); color: var(--muted); font: 600 var(--fs-xs) var(--font); cursor: pointer; }
.au-hb:hover { color: var(--text); border-color: var(--text-2); }
.au-hb.on { background: var(--prog-strong); border-color: var(--prog-strong); color: var(--surface); }
/* content: solo's yellow, as on a mixing desk */
.au-hb.solo.on { background: #d9a400; border-color: #d9a400; color: #1d1d20; }
.au-hb.arm { color: var(--rec); }
.au-hb.arm.on { background: var(--rec); border-color: var(--rec); color: var(--surface); }
/* a track's effects in its header (audio/timeline.js headChips): a chip each, in the track's colour – its name, its icon
   or (one chip for them all) how many there are: the first that fits; off: an outline, its name struck through */
.au-chips { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 3px; overflow: hidden; }
.au-chips > .au-head-sub { flex: none; margin-right: 2px; line-height: 18px; }
.au-chip { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 7px; border: 1px solid color-mix(in oklab, var(--tc, var(--prog)) 55%, transparent); border-radius: var(--radius-pill); background: color-mix(in oklab, var(--tc, var(--prog)) 14%, transparent); color: var(--text); font: 500 var(--fs-xs) var(--font); white-space: nowrap; cursor: pointer; }
.au-chip:hover { border-color: var(--tc, var(--prog)); }
.au-chip.off { border-style: dashed; border-color: var(--line-strong); background: none; color: var(--faint); }
.au-chip.making { border-style: dotted; }
.au-chip.off .au-chip-name { text-decoration: line-through; }
.au-chip .material-symbols-outlined { display: none; font-size: 13px; }
.au-chip-add, .au-chip-n, .au-chips.icons .au-chip { padding: 0 4px; }
.au-chip-add { border-color: var(--line-strong); background: none; color: var(--muted); }
.au-chip-add .material-symbols-outlined, .au-chip-n .material-symbols-outlined, .au-chips.icons .au-chip .material-symbols-outlined { display: inline-block; }
.au-chip-n, .au-chips.icons .au-chip-name, .au-chips.count .au-chip { display: none; }
.au-chips.count .au-chip-n, .au-chips.count .au-chip-add { display: inline-flex; }
.au-chips.noadd .au-chip-add { display: none; }
.au-meter, .au-master-meter { height: 5px; border-radius: var(--radius-pill); background: var(--tl-tick); overflow: hidden; }
/* content: a level meter's green, yellow and red */
.au-meter i, .au-master-meter i { display: block; height: 100%; width: 0; background: #1f8a5b; transition: width 0.05s linear; }
/* content */
.au-meter i.hot, .au-master-meter i.hot { background: #d9a400; }
.au-meter i.clip, .au-master-meter i.clip { background: var(--rec); }
.au-master-meter { display: block; width: 90px; height: 8px; margin: 0 8px; align-self: center; }
/* the mix's level meter on a bar (audio/app.js w.meter – a button): its icon, then the bar; on the left bar its name
   between the two, and where a bar's buttons are an icon over a name (or icons only) the bar under the icon */
.au-level { gap: 6px; padding: 0 6px; }
.au-level .au-master-meter { order: 3; flex: none; width: 72px; height: 6px; margin: 0; }
.cmd-left .au-level .au-master-meter { flex: 1 1 0; width: auto; min-width: 24px; }
.cmd-left.lab-off .au-level, .lab-below .au-level, .lab-above .au-level { flex-direction: column; gap: 3px; }
.cmd-left.lab-off .au-level .au-master-meter, .lab-below .au-level .au-master-meter, .lab-above .au-level .au-master-meter { flex: none; width: 26px; height: 4px; }
.lab-below .au-level .au-master-meter, .lab-above .au-level .au-master-meter { width: 40px; }
@media (max-width: 700px) {
  .cmd-left .au-level { flex-direction: column; gap: 3px; }
  .cmd-left .au-level .au-master-meter { flex: none; width: 26px; height: 4px; }
}
.au-addtrack { display: inline-flex; align-items: center; gap: 4px; margin: 6px 8px; height: 28px; padding: 0 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); background: none; color: var(--text-2); font: inherit; font-size: var(--fs-m); cursor: pointer; }
.au-addtrack:hover { border-color: var(--prog); color: var(--prog-strong); }
.au-addtrack .material-symbols-outlined { font-size: var(--ic-s); }

/* top bar */
.au-transport { display: inline-flex; align-items: center; gap: 1px; }
.au-transport .cmd-btn.active { background: var(--prog-soft); color: var(--prog-strong); }
.au-transport .au-rec .material-symbols-outlined { color: var(--rec); }
.au-transport .au-rec.rec { background: color-mix(in srgb, var(--rec) 14%, transparent); }
.au-time { min-width: 76px; padding: 0 8px; font: 500 var(--fs) var(--font-mono); color: var(--text-2); text-align: left; }

/* properties */
.pf-row.au-keyed { grid-template-columns: 84px minmax(0, 1fr) 24px; gap: 4px 8px; }
.pf-row.au-keyed .pf-unit { right: 40px; }
@media (max-width: 1150px) { .pf-row.au-keyed { grid-template-columns: 74px minmax(0, 1fr) 24px; } }
.au-key { width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.au-key:hover { background: var(--line-soft); color: var(--text); }
/* content: a keyframe's gold, as on the timeline */
.au-key.has { color: #b8860b; }
/* content */
.au-key.on { color: #d18b00; }
.au-key .material-symbols-outlined { font-size: var(--ic-s); }
/* Effects (a window – audio/panels.js renderFx): the lists of the selected clip, of its track and of the mix; a row an
   effect (the kit's list row) – its switch, its name, what it's set to, the arrow for its settings, which open under it */
#au-fxp { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
.au-fxg { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 12px; }
.au-fxg > .pf-note { padding: 0 4px; }
.au-fxl { padding: 0; }
.au-fxr .lr-name { color: var(--text); font-weight: 600; }
.au-fxr.off .lr-name { color: var(--faint); font-weight: 500; text-decoration: line-through; }
.au-fxr .lr-meta { min-width: 0; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-fxr.off .lr-meta { color: var(--faint); }
.au-fxr .switch { min-height: 0; }
.au-fxr .lr-btn.au-fx-chev { opacity: 1; }
.au-fxr.new { animation: au-fx-new 1.5s ease-out; }
@keyframes au-fx-new { from { background: var(--prog-soft); } to { background: transparent; } }
.pf-rows.au-fx-set { margin: 1px 0 5px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--sunk); }
.au-fx-addbtn { align-self: flex-start; margin: 0 2px; }
/* under a list: Add effect…, then copy and paste; a clean-up effect that's still being made: a dotted line round its row */
.au-fx-foot { display: flex; align-items: center; gap: 6px; }
.au-fx-foot .pf-iconrow { margin-left: auto; }
.au-fxr.making { outline: 1px dotted var(--line-strong); outline-offset: -1px; }
.au-fp-tool { flex: none; }

/* Effects under the timeline – the rack (audio/app.js buildRack, audio/panels.js renderFx): a band between the tracks
   and the overview; the three lists side by side as the sound passes them, an effect a card (its settings open beside
   it); folded: a line of chips */
#au-rack { grid-row: 3; grid-column: 1 / -1; display: flex; flex-direction: column; min-width: 0; border-top: 1px solid var(--tl-line); background: var(--panel); cursor: default; }
#au-rack[hidden] { display: none; }
.au-rack-head { flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-m); font-weight: 600; }
.au-rack-head > .material-symbols-outlined { font-size: var(--ic-s); color: var(--prog-strong); }
.au-rack-hint { flex: 1; min-width: 0; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-rack-body { display: flex; align-items: stretch; height: 152px; padding: 8px 10px; box-sizing: border-box; overflow-x: auto; overflow-y: hidden; }
#au-rack.folded .au-rack-body { height: auto; align-items: center; flex-wrap: wrap; gap: 4px 18px; padding: 6px 10px; overflow: visible; }
.au-rack-g { flex: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--line); }
.au-rack-g:last-child { margin-right: 0; padding-right: 0; border-right: 0; }
.au-rack-gt { flex: none; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); white-space: nowrap; }
.au-rack-g .au-fxg { flex: 1; min-height: 0; flex-direction: row; align-items: stretch; gap: 6px; padding: 0; }
.au-rack-g .au-fxg > .pf-note { align-self: center; max-width: 230px; padding: 0; }
.au-rack-g .au-fxl { flex-direction: row; align-items: stretch; gap: 6px; padding: 0; }
.au-rack-g .au-fxr { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 5px; width: 132px; height: auto; padding: 8px 8px 6px; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.au-rack-g .au-fxr.off { border-style: dashed; background: none; }
.au-rack-g .au-fxr.making { border-style: dotted; outline: 0; }
.au-rack-g .au-fxr.open { border-color: var(--prog); }
.au-rack-g .au-fxr .lr-name { flex: none; max-width: 100%; }
.au-rack-g .au-fxr .lr-meta { max-width: 100%; white-space: normal; line-height: 1.35; }
.au-rack-g .au-fxr .lr-btn.au-fx-chev { position: absolute; right: 4px; top: 5px; }
.au-rack-g .pf-rows.au-fx-set { flex: none; display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, 28px); grid-auto-columns: 178px; align-content: start; gap: 6px 14px; margin: 0; padding: 8px 10px; overflow: hidden; }
.au-rack-g .au-fx-set .pf-note { grid-row: span 3; font-size: var(--fs-xs); }
.au-rack-g .au-fx-foot { flex-direction: column; justify-content: center; gap: 2px; }
.au-rack-g .au-fx-foot .pf-iconrow { flex-direction: column; gap: 2px; margin: 0; }
.au-rack-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.au-rack-line .au-rack-gt { margin-right: 4px; }
.au-rack-none { font-size: var(--fs-xs); color: var(--faint); }

/* adding and downloading: a progress line */
.au-busy { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 10px 12px; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--pop-shadow); font-size: var(--fs); }
.au-busy-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.au-busy-bar { flex: none; width: 140px; height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.au-busy-bar i { display: block; height: 100%; width: 0; background: var(--prog); transition: width 0.2s; }

/* dialogs */
.au-q, .au-songs { display: flex; flex-direction: column; gap: 8px; }
.au-songs { max-height: 50vh; overflow: auto; }
.au-q-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: var(--fs); }
.au-q-opt:has(input:checked) { border-color: var(--prog); background: var(--prog-soft); }
.au-q-opt.off { opacity: 0.6; cursor: default; }
.au-q-text { display: flex; flex-direction: column; }
.au-q-paid { font-size: var(--fs-s); color: var(--prog-strong); }

@media (max-width: 700px) { #au-timeline { grid-template-columns: 110px minmax(0, 1fr); } .au-head-sub { display: none; } }

/* recording */
.au-countin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 30; font: 800 120px var(--font); color: var(--rec); background: color-mix(in srgb, var(--surface) 55%, transparent); pointer-events: none; }
.au-rec-meter { width: 100%; height: 10px; margin: 2px 0; }

/* the transcript */
#au-tx { flex: 1; min-height: 0; overflow: auto; outline: none; }
.au-tx { display: flex; flex-direction: column; gap: 6px; padding: 6px; min-height: 100%; box-sizing: border-box; }
.au-tx-bar { display: flex; align-items: center; gap: 2px; position: sticky; top: 0; background: var(--panel); padding-bottom: 4px; z-index: 1; }
.au-tx-find { flex: 1; min-width: 0; height: 26px; }
.au-tx-text { font-size: var(--fs); line-height: 1.6; }
.au-tx-p { margin: 0 0 8px; }
.au-tx-who { font-weight: 700; margin-right: 6px; }
.au-tx-at { font: 500 var(--fs-xs) var(--font-mono); color: var(--muted); margin-right: 6px; }
.au-w { cursor: pointer; border-radius: var(--radius-xs); padding: 0 1px; }
.au-w:hover { background: var(--line-soft); }
.au-w.sel { background: color-mix(in srgb, var(--prog) 22%, transparent); }
.au-w.found { background: var(--find-hl); color: var(--toast); }
.au-w.fhit { background: var(--find-hl); color: var(--toast); }
.au-w.fcur { background: var(--find-cur); color: var(--toast); }
.au-w.now { background: var(--prog-strong); color: var(--surface); }
.au-tx-hint { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--muted); }

/* New AI song (audio/aisong.js) */
.au-ai { display: flex; flex-direction: column; gap: 10px; }
.au-ai p { margin: 0; }
.au-ai-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: start; gap: 4px 10px; }
.au-ai-row > .muted { grid-column: 2; }
.au-ai-row[hidden] { display: none; }
.au-ai-l { padding-top: 7px; font-size: var(--fs); color: var(--text-2); }
.au-ai-in { width: 100%; box-sizing: border-box; font: inherit; font-size: var(--fs); padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--text); }
.au-ai-in:focus { outline: none; border-color: var(--prog); box-shadow: 0 0 0 3px color-mix(in srgb, var(--prog) 18%, transparent); }
.au-ai-lyrics { resize: vertical; min-height: 44px; line-height: 1.4; }
/* New AI song (audio/aisong.js): the song's waveform and player in The song */
.au-song-wave { display: block; max-width: 100%; }
.au-song-player { width: 100%; height: 36px; }
