/* 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 {
  /* CLAUDE 10-12: the Graphite tokens (style.css :root) behind the Audio tab's names */
  --a-surface: var(--c-surface);
  --a-raised: var(--c-raised);
  --a-line: var(--c-line);
  --a-line-hi: var(--c-line-strong);
  --a-text: var(--c-fg);
  --a-muted: var(--c-fg-2);
  --a-faint: var(--c-fg-3);
  --a-green: var(--c-signal);
  --a-warn: var(--c-warn);
  --a-ease: var(--ease-out);
}
.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: var(--h-md);
  padding: 0 10px 0 32px;
  border: 0;
  border-radius: var(--r-sm);
  /* CLAUDE 10-16: the hairline is a straight bottom strip, not an inset shadow (that curls up at rounded corners) */
  box-shadow: none;
  background: var(--field-line) no-repeat left bottom / 100% 1px;
  color: var(--a-text);
  font: inherit;
  font-size: var(--t-body);
}
.at .at-search input:is(:hover, :focus),
main .cc-content .at .at-search input[type='search']:is(:hover, :focus) {
  background: var(--c-raised);
  box-shadow: none;
}
.at-search input:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}
/* CLAUDE 10-12 Graphite: category chips are text; the chosen one is bright with a thin underline (no pill) */
.at-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--s-3);
}
.at-chip {
  min-height: var(--h-sm);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--a-faint);
  font-size: var(--t-label);
  font-weight: 500;
  /* the open chip's straight bar is drawn by editor.css (.ed-bar list), not an inset shadow */
  transition:
    color var(--d-hover) ease,
    transform var(--d-press) var(--a-ease);
}
.at-chip:hover {
  color: var(--a-text);
  background: transparent;
}
.at-chip[aria-pressed='true'] {
  background: transparent;
  color: var(--a-text);
  font-weight: 500;
}
.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: 48px;
  padding: 6px 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  transition: background-color var(--d-hover) ease;
}
.at-row.cc-sound:hover,
.yours-arow:hover,
.at-vrow:hover {
  background: var(--c-raised);
}
.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: 0;
  border-radius: var(--r-pill);
  background: var(--a-raised);
  color: var(--a-text);
  transition:
    background-color var(--d-hover) ease,
    color var(--d-hover) ease,
    transform var(--d-press) var(--a-ease);
}
.at-play:hover {
  background: var(--c-overlay);
}
.at-play.on {
  background: var(--c-fg);
  border-color: transparent;
  color: var(--c-primary-ink);
}
/* CLAUDE 10-12 (owner 10-11: the rainbow icon tiles were "not pleasing to the eye"): one quiet monochrome mark for
   every category; the category name already sits under the title */
.at-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--a-raised);
  color: var(--a-faint);
}
.at-add,
.at-use,
.at-fix,
.yours-ause {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--h-md);
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--a-text);
  font-size: var(--t-label);
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color var(--d-hover) ease,
    color var(--d-hover) ease,
    transform var(--d-press) var(--a-ease);
}
.at-add:hover,
.at-use:hover,
.at-fix:hover,
.yours-ause:hover {
  background: var(--c-raised);
}
.at-add.added,
.yours-ause.added {
  border-color: transparent;
  color: var(--c-signal);
}
.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: var(--r-pill);
  font-size: inherit;
}
.at-row.cc-sound > .at-add {
  min-height: var(--h-md);
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-label);
}
.at :focus-visible,
.yours-arow :focus-visible,
.yours-switch :focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

/* ---------- cards (Extract audio, Copyright): a section with an icon, not a boxed card ---------- */
.at-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  border-radius: 0;
  background: transparent;
}
.at-card-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--a-raised);
  color: var(--a-muted);
}
.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: var(--t-meta);
  font-weight: 500; /* a quiet group name, not tracked caps */
}
.at-videos,
.at-rlist {
  display: grid;
  gap: 6px;
}
.at-vrow img,
.at-noimg {
  flex: 0 0 auto;
  width: 64px;
  height: 36px;
  border-radius: var(--r-sm);
  background: #0e0e10;
  object-fit: cover;
}

/* ---------- Copyright ---------- */
.at-sum[data-state='ok'] {
  color: var(--c-signal);
}
.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: var(--r-pill);
  background: var(--c-signal-soft);
  color: var(--c-signal);
  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: var(--r-md); /* the shimmer is the shared skeleton in editor.css */
}
.at-skeleton.at-rrows span {
  height: 64px;
}
.at-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 16px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.at-empty b {
  font-size: var(--t-body);
  font-weight: 600;
}
.at-empty p {
  margin: 0 0 4px;
  color: var(--a-faint);
  font-size: var(--t-label);
  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: var(--s-4);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
/* CLAUDE 10-12 Graphite: a segmented switch is text with an underline under the chosen one */
.yours-switch button {
  min-height: var(--h-sm);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--a-faint);
  font-size: var(--t-label);
  font-weight: 500;
  transition: color var(--d-hover) ease;
}
.yours-switch button[aria-pressed='true'] {
  background: transparent;
  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;
    /* 2 px of room for the focus ring on the left only: a box wider than the section on the right made the whole Sound
       effects panel 2 px wider than the phone (10-15) */
    margin: 0 0 0 -2px;
    width: calc(100% + 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;
  }
}
