/* CLAUDE 10-06: the Audio tab (audiotab.js): Sound effects (chips, search, rows), Extract audio, Copyright, and the
   audio rows of yours.js (Audio › Favorites, Brand music). Same surfaces and lines as yours.css (DESIGN-SYSTEM.md);
   green = the brand accent, amber = the warn token. Touch screens get 44 px targets. */
.at,
.yours-music,
.yours-afavs {
  --a-surface: #171719;
  --a-raised: #1d1d20;
  --a-line: #232325;
  --a-line-hi: #3a3a3f;
  --a-text: #eef3ed;
  --a-muted: #bdbdbd;
  --a-faint: #a1a1aa;
  --a-green: #53fc18;
  --a-warn: #ffc107;
  --a-ease: cubic-bezier(0.23, 1, 0.32, 1);
}
.at {
  display: grid;
  gap: 10px;
  color: var(--a-text);
}

/* ---------- search + chips ---------- */
.at-search {
  position: relative;
  display: flex;
  align-items: center;
}
.at-search svg {
  position: absolute;
  left: 10px;
  color: var(--a-faint);
  pointer-events: none;
}
.at .at-search input,
main .cc-content .at .at-search input[type='search'] /* past editor-chrome.css's panel inputs (it loads earlier) */ {
  width: 100%;
  min-height: 36px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--a-line-hi);
  border-radius: 9px;
  background: #121214;
  color: var(--a-text);
  font: inherit;
  font-size: 13px;
}
.at-search input:focus-visible {
  outline: 2px solid #6dff3d;
  outline-offset: 1px;
}
.at-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.at-chip {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--a-line-hi);
  border-radius: 999px;
  background: transparent;
  color: var(--a-muted);
  font-size: 12px;
  font-weight: 500;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    transform 120ms var(--a-ease);
}
.at-chip:hover {
  color: var(--a-text);
  border-color: #55555c;
}
.at-chip[aria-pressed='true'] {
  background: var(--a-green);
  border-color: var(--a-green);
  color: #0b0b0b;
  font-weight: 600;
}
.at-chip:active,
.at-add:active,
.at-play:active,
.at-use:active,
.at-fix:active,
.yours-ause:active,
.yours-switch button:active {
  transform: scale(0.97);
}
.at-status,
.at-sum {
  margin: 0;
  min-height: 1.4em; /* the line is always there, so the list under it never jumps */
  color: var(--a-faint);
  font-size: 12px;
}

/* ---------- rows: a sound, a song, a video, a verdict ---------- */
.at-list.cc-sounds {
  max-height: none;
  overflow: visible;
  gap: 6px;
}
.at-row.cc-sound,
.yours-arow,
.at-vrow,
.at-rrow {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 8px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: var(--a-surface);
  transition: border-color 150ms ease;
}
.at-row.cc-sound:hover,
.yours-arow:hover,
.at-vrow:hover {
  border-color: var(--a-line-hi);
}
.at-text,
.yours-atext {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.at-text b,
.yours-atext b {
  overflow: hidden;
  color: var(--a-text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.at-text small,
.yours-atext small {
  color: var(--a-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.at-play {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--a-line-hi);
  border-radius: 999px;
  background: var(--a-raised);
  color: var(--a-text);
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 120ms var(--a-ease);
}
.at-play:hover {
  background: #2a2a2f;
}
.at-play.on {
  background: var(--a-green);
  border-color: var(--a-green);
  color: #0b0b0b;
}
.at-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #22262a;
  color: #9fb4c8;
}
/* each category's own tint, so a long list reads at a glance */
.at-art[data-tag='trending'] {
  background: #2b2414;
  color: #ffcf5a;
}
.at-art[data-tag='swooshes'] {
  background: #14262b;
  color: #6fd8ff;
}
.at-art[data-tag='funny'] {
  background: #2b1424;
  color: #ff8fd0;
}
.at-art[data-tag='impacts'] {
  background: #2b1714;
  color: #ff8a6a;
}
.at-art[data-tag='risers'] {
  background: #1d142b;
  color: #b99bff;
}
.at-art[data-tag='gaming'],
.at-art[data-tag='ding'] {
  background: #172b14;
  color: #8dff66;
}
.at-add,
.at-use,
.at-fix,
.yours-ause {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--a-line-hi);
  border-radius: 8px;
  background: var(--a-raised);
  color: var(--a-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 120ms var(--a-ease);
}
.at-add:hover,
.at-use:hover,
.at-fix:hover,
.yours-ause:hover {
  background: #2a2a2f;
}
.at-add.added,
.yours-ause.added {
  border-color: var(--a-green);
  color: var(--a-green);
}
.at-use:disabled,
.at-import:disabled,
.at-check:disabled {
  opacity: 0.7;
  cursor: progress;
}
/* editor.css styles the old .cc-sound row's spans and buttons; these rows keep their own sizes */
.at-row.cc-sound > .at-art {
  flex: 0 0 34px;
  display: grid;
}
.at-row.cc-sound > .at-play {
  padding: 0;
  border-radius: 999px;
  font-size: inherit;
}
.at-row.cc-sound > .at-add {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}
.at-row > .fav-star,
.yours-arow > .fav-star {
  position: static;
  flex: 0 0 auto;
}
.at :focus-visible,
.yours-arow :focus-visible,
.yours-switch :focus-visible {
  outline: 2px solid #6dff3d;
  outline-offset: 2px;
}

/* ---------- cards (Extract audio, Copyright) ---------- */
.at-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--a-line-hi);
  border-radius: 12px;
  background: linear-gradient(180deg, #1c1f1b, #171719);
}
.at-card-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #1f2b19;
  color: var(--a-green);
}
.at-card-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.at-card-text b {
  font-size: 14px;
  font-weight: 600;
}
.at-card-text small {
  color: var(--a-muted);
  font-size: 12px;
  line-height: 1.45;
}
.at-import,
.at-check {
  flex: 0 0 auto;
  min-height: 36px;
  min-width: 84px;
}
.at-head {
  margin: 4px 0 0;
  color: var(--a-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.at-videos,
.at-rlist {
  display: grid;
  gap: 6px;
}
.at-vrow img,
.at-noimg {
  flex: 0 0 auto;
  width: 64px;
  height: 36px;
  border-radius: 6px;
  background: #0e0e10;
  object-fit: cover;
}

/* ---------- Copyright ---------- */
.at-sum[data-state='ok'] {
  color: #8dff66;
}
.at-sum[data-state='warn'] {
  color: var(--a-warn);
}
.at-rrow {
  align-items: flex-start;
}
.at-rrow .at-text b {
  white-space: normal;
}
.at-badge {
  flex: 0 0 auto;
  min-width: 96px;
  margin-top: 1px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f2b19;
  color: #8dff66;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.at-rrow[data-verdict='yours'] .at-badge {
  background: #172330;
  color: #7cc4ff;
}
.at-rrow[data-verdict='unknown'] {
  border-color: #4a3d12;
}
.at-rrow[data-verdict='unknown'] .at-badge {
  background: #2e2608;
  color: var(--a-warn);
}
.at-fix {
  align-self: center;
}

/* ---------- loading and empty ---------- */
.at-skeleton {
  display: grid;
  gap: 6px;
}
.at-skeleton span {
  display: block;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(90deg, #1a1a1d 0%, #242428 50%, #1a1a1d 100%) 0 0 / 200% 100%;
  animation: at-shimmer 1.2s linear infinite;
}
.at-skeleton.at-rrows span {
  height: 64px;
}
@keyframes at-shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .at-skeleton span {
    animation: none;
  }
}
.at-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 18px 16px;
  border: 1px dashed var(--a-line-hi);
  border-radius: 12px;
  background: #121214;
}
.at-empty b {
  font-size: 14px;
  font-weight: 600;
}
.at-empty p {
  margin: 0 0 4px;
  color: var(--a-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- yours.js audio rows: Audio › Favorites switch, Brand music ---------- */
.yours-alist {
  display: grid;
  gap: 6px;
  container-type: inline-size;
}
/* narrow: ▶, the name and the star on top, the Use button full width under them */
@container (max-width: 300px) {
  .yours-arow {
    flex-wrap: wrap;
  }
  .yours-arow .yours-atext {
    flex: 1 1 0;
  }
  .yours-arow > .fav-star {
    order: 2;
  }
  .yours-arow .yours-ause {
    order: 3;
    flex: 1 1 100%;
    justify-content: center;
  }
}
.yours-arow {
  position: relative;
}
.yours-switch {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  justify-self: start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: #121214;
}
.yours-switch button {
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--a-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 120ms var(--a-ease);
}
.yours-switch button[aria-pressed='true'] {
  background: #2a2a2f;
  color: var(--a-text);
}
.yours-song .yours-x {
  position: static; /* in the row: a corner badge would stick out of the narrow panel */
  flex: 0 0 auto;
  order: 2;
}
.yours-song:is(:hover, :focus-within) .yours-x {
  opacity: 1;
}
.yours-music .yours-add,
.yours-music .yours-font-add {
  justify-self: start;
}

/* the export's progress card: a quiet heads-up, never a blocker */
.job-rights {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0 0;
  color: var(--a-warn, #ffc107);
  font-size: 12px;
}
.job-rights button {
  min-height: 0;
  padding: 3px 10px;
  font-size: 12px;
}

/* ---------- touch: 44 px targets ---------- */
@media (hover: none), (pointer: coarse) {
  .at-chip {
    min-height: 44px;
    padding: 0 14px;
  }
  .at-play {
    width: 44px;
    height: 44px;
  }
  .at-add,
  .at-row.cc-sound > .at-add,
  .at-use,
  .at-fix,
  .yours-ause,
  .yours-switch button,
  .at .at-search input,
  .at-import,
  .at-check,
  .job-rights button {
    min-height: 44px;
  }
  .at-row.cc-sound,
  .yours-arow,
  .at-vrow,
  .at-rrow {
    min-height: 60px;
  }
}
/* a narrow panel (the editor's left column is ~310 px): the add button keeps its icon (its name stays for screen
   readers) so the sound's name has room; narrower still, the category tile goes */
.at-list {
  container-type: inline-size;
}
@container (max-width: 380px) {
  .at-add span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .at-row.cc-sound > .at-add {
    padding: 0 9px;
  }
}
@container (max-width: 250px) {
  .at-row.cc-sound > .at-art {
    display: none;
  }
}
/* the panel is narrow on most screens: a card's button and a row's button go under their words, full width */
.at {
  container-type: inline-size;
}
@container (max-width: 340px) {
  /* the chips scroll sideways in one row, as CapCut's, so the sounds start higher */
  .at-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    margin: 0 -2px;
    padding: 2px;
  }
  .at-chips::-webkit-scrollbar {
    display: none;
  }
  .at-chip {
    flex: 0 0 auto;
  }
  /* a long name gets two lines rather than an ellipsis */
  .at-row .at-text b {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .at-card,
  .at-vrow,
  .at-rrow {
    flex-wrap: wrap;
  }
  .at-card .at-card-text {
    flex: 1 1 120px;
  }
  .at-card .at-import,
  .at-card .at-check,
  .at-vrow .at-use,
  .at-rrow .at-fix {
    flex: 1 1 100%;
    justify-content: center;
  }
  .at-vrow .at-text {
    flex: 1 1 80px;
  }
  .at-rrow .at-text {
    flex: 1 1 100%; /* the verdict on its own line, the words under it */
  }
  .at-rrow .at-badge {
    min-width: 0;
  }
}
