/* 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: #eef3ed;
  --y-muted: #bdbdbd;
  --y-faint: #a1a1aa;
  --y-ease: cubic-bezier(0.23, 1, 0.32, 1);
  display: grid;
  gap: 12px;
  color: var(--y-text);
}

/* ---------- the star on a tile ---------- */
.fav-host {
  position: relative;
}
.fav-star {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #0b0b0bcc;
  color: #d4d4d8;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 150ms ease,
    color 150ms ease,
    transform 160ms var(--y-ease, ease-out);
}
.fav-star svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.fav-star[aria-pressed='true'] {
  opacity: 1;
  color: #ffd400;
}
.fav-star[aria-pressed='true'] svg {
  fill: currentColor;
}
.fav-host:hover > .fav-star,
.fav-host:focus-within > .fav-star,
.fav-star:focus-visible {
  opacity: 1;
}
.fav-star:hover {
  color: #fff;
}
.fav-star[aria-pressed='true']:hover {
  color: #ffe45c;
}
.fav-star:focus-visible {
  outline: 3px solid #6dff3d;
  outline-offset: 1px;
}
.fav-star:active {
  transform: scale(0.9);
}
/* a row (sound effects): the star sits in the row, its space kept so nothing moves when it shows */
.cc-sound > .fav-star {
  position: static;
  flex: 0 0 auto;
}
/* touch screens: always shown, with a 44 px target (the star plus its invisible edge) */
@media (hover: none) {
  .fav-star {
    opacity: 1;
    width: 30px;
    height: 30px;
    top: 2px;
    left: 2px;
  }
  .fav-star::before {
    content: '';
    position: absolute;
    inset: -7px;
  }
  /* emoji tiles are 44 px: their star shows once starred (press and hold an emoji to star it) */
  .cc-emoji-grid .fav-star {
    width: 18px;
    height: 18px;
    top: 1px;
    left: 1px;
    pointer-events: none;
  }
  .cc-emoji-grid .fav-star::before {
    content: none;
  }
  .cc-emoji-grid .fav-star:not([aria-pressed='true']) {
    opacity: 0;
  }
  .cc-emoji-grid .fav-star svg {
    width: 12px;
    height: 12px;
  }
}

/* ---------- 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: 12px;
  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: #8dff66;
  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: 999px;
  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 */
.yours-skeleton span {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #1a1a1d 0%, #242428 50%, #1a1a1d 100%) 0 0 / 200% 100%;
  animation: yours-shimmer 1.2s linear infinite;
}
.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;
}
@keyframes yours-shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .yours-skeleton span {
    animation: none;
  }
}

/* ---------- 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: 7px;
  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: 12px;
  border: 1px solid var(--y-line);
  background: var(--y-surface);
}
.yours-preset-look {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 8px;
  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: 999px;
}
.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: 12px;
  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: 10px;
  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: #53fc18;
}
.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: 10px;
  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: #53fc18;
  color: #fff;
}
.yours-add.busy {
  cursor: progress;
  border-style: solid;
  background: linear-gradient(90deg, #1a1a1d 0%, #242428 50%, #1a1a1d 100%) 0 0 / 200% 100%;
  animation: yours-shimmer 1.2s linear infinite;
}
.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: 10px;
  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: 10px;
  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: 8px;
  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: 10px;
  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: 8px;
}
.yours-clip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  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: 10px;
  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: #8dff66;
  font-size: 13px;
}

/* the toast's Undo */
#toast .toast-undo {
  margin-left: 8px;
  padding: 4px 12px;
  min-height: 0;
  border-radius: 999px;
  border: 1px solid #8dff66;
  background: transparent;
  color: #8dff66;
  font-size: 12px;
  font-weight: 600;
}
#toast .toast-undo:hover {
  background: #8dff6622;
}

/* 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;
  }
}
