/* Audios: hub (/audios), artist/album/creator pages and the dashboard
   Audio Studio section.
   Layout and section heads come from home.css (.home-content, .content-hub,
   .content-row, .content-section-*); this file owns the audio components. */

/* The page is a flex item of body: without this, the phone shelf's
   percentage columns inflate its min-content width past the viewport. */
.audios-page {
  width: 100%;
  min-width: 0;
}

/* Pre-launch preview: only Audio creators, managers and admins reach the page. */
.audios-preview-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-ui);
  background: var(--color-brand-subtle);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.audios-preview-note .lucide-icon {
  flex: none;
  width: var(--space-4);
  height: var(--space-4);
  color: var(--color-brand-light);
}

/* ── Hub header ── */
.audios-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-10);
}

.audios-hero__text {
  min-width: 0;
  max-width: 40rem;
}

.audios-hero .audios-hero__title {
  margin-bottom: var(--space-2);
}

.audios-hero__subtitle {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
}

.audios-hero__cta {
  flex-shrink: 0;
}

/* ── Hub search: own row under the title, input + visible submit ── */
.audios-search {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  flex: 1 1 100%;
  max-width: 40rem;
}

.audios-search__field {
  flex: 1 1 auto;
  min-width: 0;
}

.audios-search__input {
  height: 100%;
}

.audios-search__submit {
  flex: none;
}

/* ── Search results ── */
.audios-results__title {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audios-pager {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.audios-pager__next {
  margin-left: auto;
}

.audios-empty__action {
  margin-top: var(--space-3);
}

/* ── Shared cover / picture with fallback underneath ── */
.audio-cover {
  position: relative;
  display: block;
  flex: none;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--radius-ui);
  background: var(--color-bg-hover);
}

.audio-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-cover__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}

.audio-cover__initial {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}

.audio-cover--round {
  border-radius: var(--radius-pill);
  corner-shape: round;
}

.audio-cover--card {
  width: 3.5rem;
  /* 56px cover: the 20px UI radius would turn it into a blob. */
  border-radius: var(--radius-thumb);
}

.audio-cover--chip {
  width: var(--space-12);
  border-radius: var(--radius-thumb);
}

.audio-cover--person {
  width: var(--space-10);
}

.audio-cover--person .audio-cover__initial {
  font-size: var(--font-size-base);
}

/* ── Audio lists ── */
.audio-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .audio-list--list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Hub shelves: a 3-up grid on desktop, a swipeable 4-row strip on phones. */
@media (min-width: 640px) {
  .audio-list--shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .audio-list--shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .audio-list--shelf {
    grid-auto-flow: column;
    grid-template-rows: repeat(4, auto);
    grid-template-columns: none;
    grid-auto-columns: 86%;
    gap: var(--space-2) var(--space-3);
    margin-inline: var(--space-neg-4);
    padding-inline: var(--space-4);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-4);
    scrollbar-width: none;
  }

  .audio-list--shelf::-webkit-scrollbar {
    display: none;
  }

  .audio-list--shelf > .audio-card {
    scroll-snap-align: start;
  }
}

/* ── Audio card ── */
.audio-card {
  --audio-progress: 0;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-ui);
  background: var(--color-bg-elevated);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.audio-card:hover,
.audio-card:focus-within {
  background: var(--color-bg-hover);
}

.audio-card[data-audio-state="playing"],
.audio-card[data-audio-state="loading"],
.audio-card[data-audio-state="paused"] {
  border-color: var(--color-border);
  background: var(--color-bg-hover);
}

.audio-card__play {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius-thumb);
  background: transparent;
  color: var(--color-text-on-solid);
  cursor: pointer;
}

.audio-card__play:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-brand);
}

.audio-card__play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.audio-card__icon {
  display: none;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  border-radius: var(--radius-pill);
  corner-shape: round;
  background: var(--color-bg-overlay);
  backdrop-filter: blur(6px);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.audio-card__icon .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.audio-card__icon--play .lucide-icon {
  /* Optical centring: the play triangle's mass sits left of its box. */
  transform: translateX(1px);
}

.audio-card__icon--play,
.audio-card[data-audio-state="paused"] .audio-card__icon--play {
  display: grid;
}

.audio-card[data-audio-state="playing"] .audio-card__icon--play,
.audio-card[data-audio-state="loading"] .audio-card__icon--play {
  display: none;
}

.audio-card[data-audio-state="playing"] .audio-card__icon--pause,
.audio-card[data-audio-state="loading"] .audio-card__icon--loading {
  display: grid;
}

.audio-card[data-audio-state="playing"] .audio-card__icon,
.audio-card[data-audio-state="loading"] .audio-card__icon,
.audio-card__play:hover .audio-card__icon {
  background: var(--color-brand);
}

.audio-card__play:hover .audio-card__icon {
  transform: scale(1.08);
}

/* Plain rows (album and artist pages): the header already shows the cover,
   so the play button is a round control instead of a repeated thumbnail. */
.audio-card--plain .audio-card__play {
  width: var(--space-10);
  height: var(--space-10);
  margin-left: var(--space-1);
  border-radius: var(--radius-pill);
  corner-shape: round;
}

.audio-card--plain .audio-card__icon {
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-hover);
  backdrop-filter: none;
}

.audio-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-0);
  min-width: 0;
}

.audio-card__title,
.audio-card__meta,
.audio-card__credit {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-card__title {
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

.audio-card[data-audio-state="playing"] .audio-card__title {
  color: var(--color-brand-light);
}

.audio-card__meta {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
}

/* Creator credit: their avatar stands in for the word "by". */
.audio-card__credit {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-snug);
}

.audio-card__credit .audio-card__link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-cover--credit {
  width: var(--space-4);
}

.audio-cover--credit .lucide-icon {
  width: var(--space-4);
  height: var(--space-4);
}

.audio-card__link {
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-xs);
}

.audio-card__link:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.audio-card__link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.audio-card__time {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Seek bar along the card's bottom edge; only interactive once started. */
.audio-card__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--space-3);
  cursor: pointer;
  pointer-events: none;
  touch-action: none;
}

.audio-card__progress::before,
.audio-card__progress-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  opacity: 0;
  transition: height var(--transition-fast), opacity var(--transition-fast);
}

.audio-card__progress::before {
  content: "";
  background: var(--color-progress-track);
}

.audio-card__progress-fill {
  display: block;
  background: var(--color-brand);
  transform: scaleX(var(--audio-progress));
  transform-origin: left center;
}

.audio-card:not([data-audio-state="idle"])[data-audio-state] .audio-card__progress {
  pointer-events: auto;
}

.audio-card:not([data-audio-state="idle"])[data-audio-state] .audio-card__progress::before,
.audio-card:not([data-audio-state="idle"])[data-audio-state] .audio-card__progress-fill {
  opacity: 1;
}

.audio-card__progress:hover::before,
.audio-card__progress:hover .audio-card__progress-fill,
.audio-card__progress:focus-visible::before,
.audio-card__progress:focus-visible .audio-card__progress-fill,
.audio-card[data-audio-scrubbing] .audio-card__progress::before,
.audio-card[data-audio-scrubbing] .audio-card__progress-fill {
  height: 6px;
}

.audio-card__progress:focus-visible {
  outline: none;
}

.audio-card:has(.audio-card__progress:focus-visible) {
  box-shadow: var(--shadow-focus-brand);
}

/* Phones: the time tucks under the actions so the title keeps its width. */
@media (max-width: 639px) {
  .audio-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "play body actions"
      "play body time";
    gap: 0 var(--space-3);
  }

  .audio-card__play { grid-area: play; }
  .audio-card__body { grid-area: body; }

  .audio-card__actions {
    grid-area: actions;
    gap: 0;
  }

  .audio-card__time {
    grid-area: time;
    justify-self: end;
    padding-right: var(--space-3);
  }
}

/* ── Tile rows (artists, albums, creators) ── */
.audio-tile-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 9rem;
  gap: var(--space-5);
  margin: 0 var(--space-neg-6);
  padding: var(--space-1) var(--space-6) var(--space-3);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--space-6);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

.audio-tile-row--album {
  grid-auto-columns: 10.5rem;
}

@media (max-width: 640px) {
  .audio-tile-row {
    grid-auto-columns: 7.5rem;
    gap: var(--space-4);
    margin-inline: var(--space-neg-4);
    padding-inline: var(--space-4);
    scroll-padding-inline: var(--space-4);
  }

  .audio-tile-row--album {
    grid-auto-columns: 8.5rem;
  }

  .audio-tile-row--creator {
    grid-auto-columns: 85%;
  }
}

.audio-tile-row--creator {
  grid-auto-columns: 22rem;
  gap: var(--space-4);
}

.audio-tile {
  min-width: 0;
  scroll-snap-align: start;
}

.audio-tile__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  color: var(--color-text);
  text-decoration: none;
}

.audio-tile--artist .audio-tile__link {
  align-items: center;
  text-align: center;
}

.audio-tile__link .audio-cover {
  width: 100%;
  transition: transform var(--duration-base), box-shadow var(--duration-base);
}

.audio-tile__link:hover .audio-cover {
  transform: scale(var(--home-card-hover-scale, 1.03));
  box-shadow: var(--shadow-md);
}

.audio-tile__link:focus-visible {
  outline: none;
}

.audio-tile__link:focus-visible .audio-cover {
  box-shadow: var(--shadow-focus-brand);
}

.audio-tile__name,
.audio-tile__meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-tile__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
}

.audio-tile__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-snug);
}

/* The tile's gap spaces the cover from the text; keep name and meta as one tight group. */
.audio-tile__link > .audio-tile__meta {
  margin-top: var(--space-neg-1);
}

/* Creator tile: mirrors the homepage "Popular Creators" tile (home.css
   .creator-tile) with square album covers in place of 2:3 posters. */
.audio-creator-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  height: 100%;
  padding: var(--space-6);
  overflow: hidden;
  border-radius: var(--radius-ui);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  text-decoration: none;
  transition: transform var(--duration-base), box-shadow var(--duration-base);
}

.audio-creator-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-bg-overlay);
  pointer-events: none;
}

.audio-creator-tile:hover {
  transform: scale(var(--home-card-hover-scale, 1.015));
  box-shadow: var(--shadow-md);
}

.audio-creator-tile:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-brand);
}

.audio-creator-tile__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(12px);
  transform: scale(1.08);
  opacity: 0.55;
  pointer-events: none;
}

.audio-creator-tile__head,
.audio-creator-tile__mosaic {
  position: relative;
  z-index: 2;
}

.audio-creator-tile__head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.audio-creator-tile__head .audio-cover {
  width: 4.75rem;
}

.audio-creator-tile__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.audio-creator-tile__name,
.audio-creator-tile__stats {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-creator-tile__name {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.audio-creator-tile__stats {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Lead cover spans a 2x2 block; the other four fill the 2x2 beside it. */
.audio-creator-tile__mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.audio-creator-tile__cover {
  border-radius: var(--radius-thumb);
  box-shadow: var(--shadow-md);
}

.audio-creator-tile__cover--lead {
  grid-column: span 2;
  grid-row: span 2;
  border-radius: var(--radius-ui);
}

@media (max-width: 640px) {
  .audio-creator-tile {
    gap: var(--space-4);
    padding: var(--space-5);
  }

  .audio-creator-tile__head .audio-cover {
    width: 3.75rem;
  }

  .audio-creator-tile__name {
    font-size: var(--font-size-xl);
  }

  .audio-creator-tile__stats {
    font-size: var(--font-size-xs);
  }
}

/* ── Artist / album / creator page header ── */
.audios-crumbs {
  margin-bottom: var(--space-6);
}

.audios-crumbs a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

.audios-crumbs a:hover {
  color: var(--color-text);
}

.audios-crumbs a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.audio-page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.audio-page-head > .audio-cover {
  width: clamp(6.5rem, 18vw, 12rem);
  box-shadow: var(--shadow-lg);
}

.audio-page-head > .audio-cover .audio-cover__initial {
  font-size: var(--font-size-5xl);
}

.audio-page-head > .audio-cover .audio-cover__fallback .lucide-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.audio-page-head__text {
  min-width: 0;
}

.audio-page-head__eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.audio-page-head__title {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-6xl));
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--line-height-tight);
}

.audio-page-head__meta {
  margin: var(--space-2) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
}

.audio-page-head__link {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.audio-page-head__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 639px) {
  .audio-page-head {
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
  }

  .audio-page-head__title {
    font-size: clamp(var(--font-size-2xl), 8vw, var(--font-size-4xl));
  }

  .audio-page-head__meta {
    font-size: var(--font-size-sm);
  }
}

/* ── Artist page album groups ── */
.audio-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.audio-group__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.audio-group__cover {
  display: block;
  flex: none;
  width: var(--space-12);
}

.audio-group__cover .audio-cover {
  width: 100%;
  border-radius: var(--radius-thumb);
}

.audio-group__text {
  min-width: 0;
}

.audio-group__title {
  margin: 0;
  overflow: hidden;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-group__title a {
  color: var(--color-text);
  text-decoration: none;
}

.audio-group__title a:hover {
  color: var(--color-accent-light);
}

.audio-group__title a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.audio-group__meta {
  margin: var(--space-1) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* ── Empty state ── */
.audios-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-16) var(--space-6);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-ui);
  text-align: center;
}

.audios-empty__icon {
  display: grid;
  place-items: center;
  width: var(--space-14);
  height: var(--space-14);
  margin-bottom: var(--space-2);
  border-radius: var(--radius-pill);
  corner-shape: round;
  background: var(--color-brand-subtle);
  color: var(--color-brand-light);
}

.audios-empty__icon .lucide-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.audios-empty__title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.audios-empty__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
}

/* ── Studio ── */
.audio-studio__head {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}

/* Tabs reuse the dashboard's .request-work-tabs; each panel is one column. */
.audio-studio__tab {
  gap: var(--space-2);
}

.audio-studio__tab .lucide-icon {
  width: 1rem;
  height: 1rem;
}

.audio-studio__tab-count {
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
  font-variant-numeric: tabular-nums;
}

.audio-studio__tab-count:empty {
  display: none;
}

.audio-studio__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

/* Panels fill the section width, same as the audio lists in the other tabs. */
.audio-studio .audio-post,
.audio-creators {
  width: 100%;
  padding: var(--space-6);
}

.audio-studio .audio-drop {
  padding-block: var(--space-12);
}

@media (max-width: 640px) {
  .audio-studio .audio-post,
  .audio-creators {
    padding: var(--space-5);
  }

  .audio-studio .audio-drop {
    padding-block: var(--space-8);
  }
}

.audio-creators {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.audio-studio__empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.audio-studio__more {
  align-self: center;
}

.audio-studio .field-error {
  margin: 0;
}

.audio-list[aria-busy="true"]:empty {
  min-height: var(--space-20);
  border-radius: var(--radius-ui);
  background: var(--color-bg-hover);
  animation: audio-pulse var(--duration-shimmer) var(--ease-in-out) infinite;
}

@keyframes audio-pulse {
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .audio-list[aria-busy="true"]:empty {
    animation: none;
  }
}

@media (max-width: 639px) {
  .audio-studio .audio-post,
  .audio-creators {
    padding: var(--space-4);
  }

  .audio-studio__tabs {
    gap: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .audio-studio__tab {
    flex: none;
  }

  /* Four tabs fit a phone once the icons go. */
  .audio-studio__tab .lucide-icon {
    display: none;
  }
}

/* Post form */
.audio-post {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.audio-field {
  min-width: 0;
}

.audio-search-input {
  position: relative;
}

.audio-search-input__icon {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  z-index: var(--z-raised);
  color: var(--color-text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.audio-track-results {
  max-height: 22rem;
  margin: var(--space-2) 0 0;
  padding: var(--space-1);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-ui);
  background: var(--color-bg);
  list-style: none;
  box-shadow: var(--shadow-lg);
}

.audio-track-option,
.audio-track-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.audio-track-option {
  padding: var(--space-2);
  border-radius: var(--radius-menu-item);
  cursor: pointer;
}

.audio-track-option:hover,
.audio-track-option[aria-selected="true"] {
  background: var(--color-bg-hover);
}

.audio-track-option__time {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-variant-numeric: tabular-nums;
}

.audio-track-chip {
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-ui);
  background: var(--color-brand-subtle);
}

.audio-track-chip > .btn {
  margin-left: auto;
}

.audio-track-chip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.audio-track-chip__title,
.audio-track-chip__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-track-chip__title {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.audio-track-chip__meta {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.audio-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-8) var(--space-4);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-ui);
  background: var(--color-control-bg);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.audio-drop:hover,
.audio-drop.is-dragover {
  border-color: var(--color-brand);
  background: var(--color-brand-subtle);
}

.audio-field:has(.sr-only:focus-visible) .audio-drop {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-focus-brand);
}

.audio-drop__icon {
  display: grid;
  place-items: center;
  width: var(--space-10);
  height: var(--space-10);
  margin-bottom: var(--space-1);
  border-radius: var(--radius-pill);
  corner-shape: round;
  background: var(--color-brand-subtle);
  color: var(--color-brand-light);
}

.audio-drop__text strong {
  color: var(--color-text);
  font-weight: var(--font-weight-semibold);
}

.audio-drop__choose {
  color: var(--color-brand-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.audio-drop .helper-text {
  margin-top: var(--space-1);
}

.audio-file-preview {
  grid-template-columns: minmax(0, 1fr);
}

.audio-upload-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.audio-upload-progress__track {
  --audio-upload-progress: 0;
  height: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-pill);
  corner-shape: round;
  background: var(--color-progress-track);
}

.audio-upload-progress__fill {
  display: block;
  height: 100%;
  background: var(--color-brand);
  transform: scaleX(var(--audio-upload-progress));
  transform-origin: left center;
  transition: transform var(--transition-fast);
}

.audio-post__error {
  margin: 0;
}

.audio-post__actions {
  display: flex;
  justify-content: flex-end;
}

/* Creators panel */
.audio-people {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.audio-people--results {
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-ui);
  background: var(--color-bg);
}

.audio-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-menu-item);
}

.audio-person:hover {
  background: var(--color-bg-hover);
}

.audio-person__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.audio-person__name,
.audio-person__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-person__name {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.audio-person__name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.audio-person__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.audio-creators > .helper-text:empty {
  display: none;
}

/* Components above set display; keep the hidden attribute authoritative. */
.audios-page [hidden],
.audio-studio [hidden] {
  display: none;
}
