/* CLAUDE 10-06: Media > Subprojects (subprojects.js). The tiles, menu, skeletons and empty states are the media bin's
   (mediabin.css .mb-*); this adds the progress on a tile, the "changed" state, inline rename, the Import dialog and the
   header's "Back to <project>". */
.sp-lead,
.sp-count {
  margin: 0;
  color: var(--q-soft, #a1a1aa);
  font-size: 12px;
  line-height: 1.45;
}
.sp-count:empty,
.sp-lead[hidden],
.mb-import[hidden] {
  display: none;
}
body main .mb-import:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* the ⋯ stays by the name when a tile has a line under it */
.sp-tile {
  align-self: start;
}
.sp-head {
  position: relative;
}
/* a subproject being prepared: a bar along the bottom of its picture */
.sp-prog {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 5px;
  padding: 0 8px 8px;
  background: linear-gradient(transparent 30%, #000c);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.sp-prog b {
  font-weight: 600;
}
.sp-prog i {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #ffffff33;
}
.sp-prog em {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: left;
  transition: transform 300ms linear;
}
.sp-busy .mb-hover,
.sp-busy .mb-dur,
.sp-busy .mb-used {
  display: none;
}
.sp-busy .mb-main {
  cursor: progress;
}
/* changed since it was added: the update button under the tile */
.sp-changed .mb-thumb {
  border-color: #ffd40080;
}
.sp-update {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
  margin-top: 6px;
  padding: 0 6px;
  border: 1px solid #ffd40055;
  border-radius: 6px;
  background: #ffd4000f;
  color: #ffe36b;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}
.sp-update svg {
  flex: none;
  width: 13px;
  height: 13px;
}
.sp-update:hover {
  background: #ffd4001f;
}
.sp-update:active {
  transform: scale(0.97);
}
.sp-note {
  margin: 6px 0 0;
  color: #ffb4b4;
  font-size: 11px;
  line-height: 1.35;
}
.sp-rename {
  width: 100%;
  min-height: 26px;
  margin: 0;
  padding: 0 6px;
  border: 1px solid var(--q-ink, #f3f2ee);
  border-radius: 6px;
  background: #111113;
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 12px;
}
/* the Import dialog */
.sp-pick {
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid #333338;
  border-radius: 14px;
  background: #151517;
  color: var(--q-ink, #f3f2ee);
  box-shadow: 0 30px 80px #000c;
}
.sp-pick-box {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  max-height: inherit;
  margin: 0;
  padding: 18px 18px 16px;
}
.sp-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sp-pick h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.sp-pick-sub {
  margin: 0;
  color: var(--q-soft, #a1a1aa);
  font-size: 13px;
}
.sp-x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--q-soft, #a1a1aa);
  cursor: pointer;
}
.sp-x:hover {
  background: var(--q-raise-hover, #26262b);
  color: var(--q-ink, #f3f2ee);
}
.sp-search input {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--q-line, #2c2c31);
  border-radius: 8px;
  background: #0f0f11;
  color: var(--q-ink, #f3f2ee);
  font: inherit;
  font-size: 14px;
}
.sp-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 220px;
  margin: 0;
  padding: 2px;
  overflow-y: auto;
  border: 0;
  overscroll-behavior: contain;
}
.sp-row {
  display: grid;
  grid-template-columns: 20px 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}
.sp-row:hover {
  background: #1d1d21;
}
.sp-row:has(input:checked) {
  border-color: #f3f2ee55;
  background: #202024;
}
.sp-row:has(input:disabled:not(:checked)) {
  opacity: 0.45;
  cursor: not-allowed;
}
.sp-row:has(input:focus-visible) {
  outline: 2px solid #53fc18aa;
  outline-offset: 1px;
}
.sp-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #f3f2ee;
}
.sp-row-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #1f1f23;
}
.sp-row-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sp-row-name {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-row-len {
  color: var(--q-soft, #a1a1aa);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.sp-skel {
  cursor: default;
}
.sp-skel .sp-row-thumb,
.sp-skel i {
  background: linear-gradient(90deg, #1b1b1e 30%, #26262a 50%, #1b1b1e 70%) 0 0 / 300% 100%;
  animation: mb-shine 1.2s linear infinite;
}
.sp-skel .sp-row-thumb {
  grid-column: 2;
}
.sp-skel i {
  display: block;
  width: 60%;
  height: 10px;
  border-radius: 4px;
}
.sp-pick-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--q-soft, #a1a1aa);
  font-size: 13px;
  text-align: center;
}
.sp-pick-empty p {
  max-width: 34ch;
  margin: 0;
}
.sp-pick-empty b {
  color: var(--q-ink, #f3f2ee);
}
.sp-msg {
  min-height: 1.3em;
  margin: 0;
  color: #ffb4b4;
  font-size: 12px;
}
.sp-pick-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.sp-pick-foot .mb-import {
  min-width: 120px;
}
.sp-pick-foot .mb-import:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* the header while a subproject is open */
.sp-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  min-height: 34px;
  margin-right: 8px;
  padding: 0 10px 0 6px;
  border: 1px solid #ffd40066;
  border-radius: 999px;
  background: #ffd40014;
  color: #ffe36b;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}
.sp-back[hidden] {
  display: none;
}
.sp-back:hover {
  background: #ffd40026;
}
.sp-back:active {
  transform: scale(0.97);
}
.sp-back svg {
  flex: none;
  width: 15px;
  height: 15px;
}
.sp-back-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-back b {
  font-weight: 650;
}
.sp-badge {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: #ffd40026;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
@media (max-width: 760px) {
  .sp-back {
    max-width: 46vw;
  }
  .sp-badge {
    display: none;
  }
  .sp-pick {
    width: 100vw;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
  .sp-row {
    grid-template-columns: 20px 64px minmax(0, 1fr) auto;
  }
}
@media (pointer: coarse) {
  .sp-back,
  .sp-update,
  .sp-x,
  .sp-search input,
  .sp-pick-foot button {
    min-height: 44px;
  }
  .sp-x {
    width: 44px;
  }
  .sp-rename {
    min-height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-skel .sp-row-thumb,
  .sp-skel i {
    animation: none;
  }
  .sp-prog em {
    transition: none;
  }
  .sp-update:active,
  .sp-back:active {
    transform: none;
  }
}
