/* CLAUDE 10-06: the editor's "Yours" group (yours.js): favorite stars on the panels' tiles, the Favorites / My presets
   / Brand kit sub-items and the logo strip in Stickers › Logo. Colours and sizes from DESIGN-SYSTEM.md; the gold is
   the warn token (#ffd400), as starred items read in CapCut. */
.yours {
  --y-surface: #171719;
  --y-line: #232325;
  --y-line-hi: #3a3a3f;
  --y-text: #f2f0eb;
  --y-muted: #bdbdbd;
  --y-faint: #a1a1aa;
  --y-ease: var(--ease-out);
  display: grid;
  gap: 12px;
  color: var(--y-text);
}

/* ---------- the star (favStar): one control for every panel ----------
   CLAUDE 10-11 (the owner: "this is fucked up in sound effects and probably a lot of other places"). Two shapes:
   - on a tile (stickers, effects, transitions, filters, animations, voice, stock): a 28 px disc in the corner, shown
     on hover / focus and always once starred; dark glass with a hairline ring so it reads on light and dark thumbnails;
   - in a row (Sound effects, Music library, Audio › Favorites, Brand music): a plain 32 px icon button, always shown,
     so a row never has a hole where the star appears.
   Starred = filled gold (warn #ffd400); 3 px green focus ring (DESIGN-SYSTEM.md); touch screens get a 44 px target. */
.fav-host {
  position: relative;
}
.fav-star {
  --fav-size: 28px;
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: var(--fav-size);
  height: var(--fav-size);
  border-radius: var(--r-pill);
  background: rgba(10, 10, 12, 0.66);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #e4e4e7;
  cursor: pointer;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
  transition:
    opacity 150ms ease-out,
    color 150ms ease-out,
    background-color 150ms ease-out,
    transform 160ms var(--ease-out);
}
/* the box itself, above the hosts' own `span` rules (editor.css `.cc-sound > span`, editor-chrome.css
   `main .cc-fx button span`): those made it a flex column or a clamped -webkit-box and pushed the glyph into a corner */
.fav-star[role='button'] {
  display: grid;
  place-items: center;
  flex: none;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  -webkit-line-clamp: none;
  line-height: 0;
  font-size: 0;
}
.fav-star svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  filter: drop-shadow(0 0.5px 0.5px rgba(0, 0, 0, 0.4));
}
.fav-star[aria-pressed='true'] {
  opacity: 1;
  color: #ffd400;
}
.fav-star[aria-pressed='true'] svg {
  fill: currentColor;
}
/* shown while its tile or row is hovered or focused (any parent, so hosts need no rule of their own) */
:hover > .fav-star,
:focus-within > .fav-star,
.fav-star:focus-visible {
  opacity: 1;
}
.fav-star:hover {
  background-color: rgba(10, 10, 12, 0.86);
  color: #fff;
}
.fav-star[aria-pressed='true']:hover {
  color: #ffe45c;
}
.fav-star:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
.fav-star:active {
  transform: scale(0.88);
}
/* in a row: in the flow, no disc, always there */
:is(.at-row, .yours-arow, .ml-row) > .fav-star {
  --fav-size: 32px;
  position: relative;
  top: auto;
  left: auto;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #a1a1aa;
  opacity: 1;
}
:is(.at-row, .yours-arow, .ml-row) > .fav-star:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: #f5f5f8;
}
:is(.at-row, .yours-arow, .ml-row) > .fav-star[aria-pressed='true'] {
  color: #ffd400;
}
/* emoji tiles are ~44 px: a smaller star, so it never covers the emoji */
.cc-emoji-grid .fav-star {
  --fav-size: 20px;
  top: 2px;
  left: 2px;
}
.cc-emoji-grid .fav-star svg {
  width: 12px;
  height: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .fav-star {
    transition: none;
  }
  .fav-star:active {
    transform: none;
  }
}
/* touch screens: always shown, with a 44 px target (the disc plus an invisible edge; a row's star is 44 px itself) */
@media (hover: none) {
  .fav-star {
    opacity: 1;
  }
  .fav-star::before {
    content: '';
    position: absolute;
    inset: -8px;
  }
  :is(.at-row, .yours-arow, .ml-row) > .fav-star {
    --fav-size: 44px;
  }
  :is(.at-row, .yours-arow, .ml-row) > .fav-star::before {
    content: none;
  }
  /* an emoji tile is the target itself: its star only marks a starred emoji (press and hold an emoji to star it) */
  .cc-emoji-grid .fav-star {
    pointer-events: none;
  }
  .cc-emoji-grid .fav-star::before {
    content: none;
  }
  .cc-emoji-grid .fav-star:not([aria-pressed='true']) {
    opacity: 0;
  }
}

/* ---------- shared pieces ---------- */
.yours-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 0;
  color: var(--y-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.yours-head span {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.yours-empty {
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 18px 16px;
  border: 1px dashed var(--y-line-hi);
  border-radius: var(--r-md);
  background: #121214;
}
.yours-empty b {
  font-size: 14px;
  font-weight: 600;
}
.yours-empty p {
  margin: 0 0 4px;
  color: var(--y-muted);
  font-size: 13px;
  line-height: 1.5;
}
.yours-link {
  justify-self: start;
  color: var(--c-fg);
  font-size: 13px;
  text-decoration: none;
}
.yours-link:hover {
  text-decoration: underline;
}
.yours .hint {
  margin: 0;
  color: var(--y-faint);
  font-size: 12px;
}
.yours-x {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--y-line-hi);
  background: #232326;
  color: var(--y-muted);
  opacity: 0;
}
.yours-x svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.yours-x:hover {
  background: #b3261e;
  border-color: #b3261e;
  color: #fff;
}
:is(.yours-logo, .yours-color, .yours-font, .yours-clip):is(:hover, :focus-within) .yours-x,
.yours-x:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .yours-x {
    opacity: 1;
    width: 28px;
    height: 28px;
  }
  .yours-x::before {
    content: '';
    position: absolute;
    inset: -8px;
  }
}

/* loading: the same boxes the content will fill, so nothing jumps when it arrives */
/* the shimmer is motion.css .m-skel (yours.js adds the class); these boxes only give it a shape */
.yours-skeleton span {
  display: block;
  border-radius: var(--r-md);
}
.yours-grid.yours-skeleton span {
  aspect-ratio: 0.8; /* the picture plus its name, as the tiles that replace it */
}
.yours-list.yours-skeleton span {
  height: 64px;
}
.yours-kit-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.yours-kit-skeleton span {
  aspect-ratio: 1;
}

/* ---------- Favorites ---------- */
.yours-groups {
  display: grid;
  gap: 8px;
}
/* the same tile as the Effects / Filters panels (editor-chrome.css): the picture, its name below in small muted text */
.yours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 10px 6px;
}
.yours-tile .yours-apply {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}
.yours-tile .yours-apply:hover {
  background: transparent;
  color: #e4e4e8;
}
.yours-pic {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #2c2c31;
  border-radius: var(--r-sm);
  background: #0f0f11;
  overflow: hidden;
  transition: border-color 150ms ease;
}
.yours-tile .yours-apply:hover .yours-pic {
  border-color: #6a6a72;
}
.yours-tile .yours-apply.added .yours-pic {
  box-shadow: 0 0 0 2px #f3f2ee;
}
.yours-pic :is(img, canvas, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.yours-pic.contain img {
  inset: 14%;
  width: 72%;
  height: 72%;
  object-fit: contain;
}
.yours-pic i {
  font-style: normal;
  font-size: 24px;
  color: #e4e4e7;
}
.yours-label {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- My presets ---------- */
.yours-list {
  display: grid;
  gap: 8px;
}
.yours-preset {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--y-line);
  background: var(--y-surface);
}
.yours-preset-look {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: var(--r-sm);
  background: #0f0f11;
}
.yours-preset-look b {
  font-size: 22px;
  font-weight: 800;
}
.yours-preset-look i {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
}
.yours-preset-name {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yours-preset-name small {
  color: var(--y-faint);
  font-size: 12px;
  font-weight: 400;
}
.yours-preset-apply {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Brand kit ---------- */
.yours-premium {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid #4a4000;
  background: #1c1900;
}
.yours-premium p {
  flex: 1;
  margin: 0;
  color: #f5e9a8;
  font-size: 13px;
  line-height: 1.45;
}
.yours-logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.yours-logo {
  position: relative;
}
.yours-logo .yours-apply,
.logo-kit-row .yours-apply {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--y-line);
  background: repeating-conic-gradient(#202022 0 25%, #18181a 0 50%) 0 0 / 12px 12px;
}
.yours-logo .yours-apply:hover,
.logo-kit-row .yours-apply:hover {
  border-color: var(--c-fg);
}
.yours-logo img,
.logo-kit-row img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.yours-add {
  display: grid;
  place-items: center;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px dashed var(--y-line-hi);
  color: var(--y-muted);
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease;
}
.yours-add:hover,
.yours-add:focus-visible {
  border-color: var(--c-fg);
  color: #fff;
}
.yours-add.busy {
  cursor: progress;
  border-style: solid; /* the shimmer: .m-skel, added in yours.js fileButton */
}
.yours-clip .yours-add {
  aspect-ratio: auto;
  width: 100%;
}
.yours-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.yours-color {
  position: relative;
  transition: transform 180ms var(--y-ease);
}
.yours-color.dragging {
  z-index: 3;
  transition: none;
}
.yours-color.dragging .yours-swatch {
  box-shadow: 0 8px 24px #000a;
  transform: scale(1.08);
}
.yours-swatch {
  display: block;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid #ffffff26;
  background: var(--c);
  box-shadow: inset 0 0 0 1px #0004;
  touch-action: pan-y;
  cursor: grab;
}
.yours-swatch:hover {
  background: var(--c);
  transform: translateY(-1px);
}
.yours-color.dragging .yours-swatch {
  cursor: grabbing;
}
.yours-color-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.yours-color-add input[type='color'] {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: var(--r-md);
  border: 1px solid var(--y-line-hi);
  background: #1a1a1a;
  cursor: pointer;
}
.yours-color-add input[type='text'] {
  width: 96px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--y-line-hi);
  background: #111113;
  color: var(--y-text);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.yours-color-add input[aria-invalid='true'] {
  border-color: #ff6a6a;
}
.yours-color-add button {
  height: 40px;
  padding: 0 14px;
}
.yours-fonts {
  display: grid;
  gap: 6px;
}
.yours-font {
  position: relative;
}
.yours-font .yours-apply {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--y-line);
  background: var(--y-surface);
  font-size: 17px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yours-font .yours-apply:hover {
  border-color: #4a4a50;
}
.yours-font .yours-x {
  top: 50%;
  right: 8px;
  margin-top: -11px;
}
.yours-font-add {
  min-height: 40px;
  border-radius: var(--r-sm);
}
.yours-clip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--y-line);
  background: var(--y-surface);
}
.yours-clip > b,
.yours-clip > small {
  flex: 1 1 100%;
}
.yours-clip > small,
.yours-clip-info small {
  color: var(--y-faint);
  font-size: 12px;
}
.yours-clip-info {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.yours-clip-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yours-clip .primary {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

/* Stickers › Logo: "From brand kit" */
.logo-kit {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid #232325;
  background: #121214;
}
.logo-kit[hidden] {
  display: none;
}
.logo-kit-head {
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.logo-kit-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
}
.logo-kit-row:empty {
  display: none;
}
.logo-kit .quiet {
  justify-self: start;
  padding: 4px 0;
  border: 0;
  color: var(--c-fg);
  font-size: 13px;
}

/* the toast's Undo */
#toast .toast-undo {
  margin-left: 8px;
  padding: 4px 12px;
  min-height: 0;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-fg);
  background: transparent;
  color: var(--c-fg);
  font-size: 12px;
  font-weight: 600;
}
#toast .toast-undo:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* phones: 44 px targets */
@media (max-width: 720px), (pointer: coarse) {
  .yours-swatch,
  .yours-color-add input[type='color'] {
    width: 44px;
    height: 44px;
  }
  .yours-color-add input[type='text'],
  .yours-color-add button,
  .yours-font-add,
  .yours-preset-apply,
  .yours-clip .primary {
    min-height: 44px;
  }
  .yours-premium {
    flex-direction: column;
    align-items: stretch;
  }
}
