/* Ding Web: the voice studio in a composer (studio.js). Its trays in the
   composer's panel (Voice Filter, Sound FX, Song: tiles of the app's own
   colours), what's been added on a strip under the take's line (each sound a
   tag where it starts, the voice filter over its stretch, the song a bar),
   and a whiteboard's tile where the things would be. */

.st-box { margin: -2px 0 8px; display: flex; flex-direction: column; gap: 8px; }

/* MARK: The strip under the take */

.st-strip { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 20px; transition: opacity 0.2s ease; }
.st-strip.making .st-lane { opacity: 0.55; }
.st-lane { position: relative; height: 20px; }
.st-tag, .st-tint, .st-bar {
  position: absolute; top: 0; height: 20px; border: 0; padding: 0; cursor: pointer; font: inherit; color: #fff;
  display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; background: var(--art, var(--ink));
  box-shadow: 0 0 0 1.5px var(--mist-1); white-space: nowrap; overflow: hidden;
}
.st-tag { width: 22px; justify-content: center; touch-action: none; z-index: 2; cursor: grab; transform: translateX(-1px); }
.st-tag.lifted { cursor: grabbing; transform: translateX(-1px) scale(1.12); box-shadow: 0 0 0 1.5px var(--mist-1), var(--shadow); z-index: 3; transition: none; }
.st-tag:focus-visible, .st-tint:focus-visible, .st-bar:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.st-tint { padding: 0 6px; min-width: 22px; z-index: 1; }
.st-tint::before { content: ""; position: absolute; inset: 0; background: var(--mist-1); opacity: 0.25; }
.st-bar { padding: 0 7px; min-width: 22px; }
.st-tint > *, .st-bar > * { position: relative; }
.st-emoji { font-size: 12px; line-height: 1; flex: none; }
.st-words { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }
.st-making { position: absolute; right: 0; top: -2px; font-size: 11px; font-weight: 600; color: var(--steel); padding: 3px 8px; border-radius: 999px; background: var(--glass-strong); }

/* Picked before there's a voice. */
.st-waiting { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-chip .st-emoji { font-size: 13px; }

/* MARK: A whiteboard's tile */

.st-board { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border-radius: 18px; background: var(--soft); max-width: 380px; }
.st-board-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.st-board-mini { width: 48px; flex: none; pointer-events: none; }
.st-board-mini .wb-board { box-shadow: inset 0 0 0 1px var(--hair); }
.st-board-words { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.st-board-words b { font-size: 14px; }
.st-board-words span { font-size: 12px; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-board-go svg { width: 14px; height: 14px; color: var(--steel); stroke-width: 2.4; }
.st-board-x {
  width: 30px; height: 30px; flex: none; border-radius: 999px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--hair); color: var(--steel);
}
.st-board-x svg { width: 12px; height: 12px; stroke-width: 2.6; }
.st-board-open:focus-visible, .st-board-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 12px; }

/* MARK: Its trays */

.st-head .icon-btn svg { stroke-width: 2.2; }
.st-head .st-use { height: 32px; }
.st-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.st-search { position: relative; display: flex; align-items: center; flex: 1 1 180px; min-width: 0; }
.st-search > svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--steel); pointer-events: none; }
.st-search .field { padding-left: 33px; }
.st-tabs, .st-seg { display: flex; padding: 3px; border-radius: 999px; background: var(--soft); flex: none; }
.st-tabs button, .st-seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.st-tabs button[aria-selected="true"], .st-seg button[aria-checked="true"] { background: var(--glass-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--hair); }
.st-tabs button:focus-visible, .st-seg button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.st-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px 6px;
  max-height: min(244px, 34vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px 4px 4px; scrollbar-width: thin;
}
/* In +'s tray (add-tray.js): taller, the tiles fill it. */
.add-tray.at-tall .st-tiles, .add-tray.lifted .st-tiles { max-height: none; }
.st-tray .st-head .at-title { padding-left: 4px; }
.st-tile {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none;
  color: var(--ink); font: inherit; cursor: pointer; min-width: 0;
}
.st-art {
  position: relative; width: 62px; height: 62px; border-radius: 18px; background: var(--art); display: grid; place-items: center;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25), 0 1px 3px rgba(0, 0, 0, 0.12); transition: transform 0.15s ease;
}
.st-tile.round .st-art { border-radius: 50%; }
.st-art .st-emoji { font-size: 28px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15)); }
.st-tile:hover .st-art { transform: scale(1.04); }
.st-tile:active .st-art { transform: scale(0.96); }
.st-tile.chosen .st-art { box-shadow: 0 0 0 2.5px var(--mist-1), 0 0 0 5px var(--ink); }
.st-tile:focus-visible { outline: none; }
.st-tile:focus-visible .st-art { box-shadow: 0 0 0 2.5px var(--mist-1), 0 0 0 5px var(--steel); }
.st-name {
  font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; max-width: 100%;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.st-spin { display: none; position: absolute; inset: 0; border-radius: inherit; background: rgba(0, 0, 0, 0.28); }
.st-tile.busy .st-spin { display: block; }
.st-tile.busy .st-spin::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: st-turn 0.8s linear infinite;
}
@keyframes st-turn { to { transform: rotate(360deg); } }
.st-empty { grid-column: 1 / -1; padding: 18px 4px; text-align: center; margin: 0; }
.st-note { margin: 8px 2px 0; min-height: 1em; }

/* A song picked: the part that plays, along the song. */
.st-song { display: flex; align-items: center; gap: 12px; }
.st-song-play {
  width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--art, var(--ink)); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.st-song-play svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.st-song-play:disabled { opacity: 0.45; cursor: default; }
.st-window-box { position: relative; flex: 1; min-width: 0; height: 56px; touch-action: none; cursor: pointer; }
.st-window-bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 1.5px; }
.st-window-bars i { flex: 1; min-width: 1px; border-radius: 2px; background: var(--ink); opacity: 0.28; }
.st-window-bars.loading i { animation: st-wait 1.2s ease-in-out infinite alternate; }
@keyframes st-wait { to { opacity: 0.12; } }
.st-window {
  position: absolute; top: -3px; bottom: -3px; border-radius: 10px; cursor: grab;
  border: 2px solid var(--ink); background: color-mix(in srgb, var(--ink) 10%, transparent); box-sizing: border-box; min-width: 8px;
}
.st-window:active { cursor: grabbing; }
.st-window:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
.st-song-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.st-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-seg button { padding: 0 10px; }

@media (max-width: 520px) {
  .st-search .field { font-size: 16px; }
  .st-tiles { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px 4px; max-height: min(220px, 32vh); }
  .st-art { width: 56px; height: 56px; border-radius: 16px; }
  .st-art .st-emoji { font-size: 25px; }
  .st-tabs button { padding: 0 10px; }
  .st-bar-row .st-tabs { flex: 1 1 100%; }
  .st-bar-row .st-tabs button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .st-art, .st-tag.lifted { transition: none; }
  .st-window-bars.loading i, .st-tile.busy .st-spin::after { animation: none; }
}

/* With something added, the take's line spans its row, as the strip under it does. */
.composer:has(.st-strip) .composer-take .wave { justify-content: space-between; }
