/* CLAUDE 11-16: "Your clips are ready" (clipsready.js): the best clip playing, one Download, the rest as a list.
   Graphite: the dialog is the one surface; the video and the thumbnails are the only shapes in it, one primary. */
dialog.cr {
  width: min(880px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--c-overlay);
  color: var(--c-fg);
  box-shadow: var(--e-float);
  overflow: hidden;
}
dialog.cr .cr-x {
  position: absolute; /* over .m-btn's relative (controls.css loads later) */
  top: var(--s-3);
  right: var(--s-3);
  z-index: 1;
  font-size: var(--t-page); /* the × glyph, on the type scale (test_motion_css style drift) */
  line-height: 1;
}
.cr-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-5);
  max-height: calc(100dvh - 48px);
}
.cr-stage {
  height: min(64dvh, 600px);
  aspect-ratio: 9 / 16;
  max-width: 52vw;
  border-radius: var(--r-md);
  background: var(--c-stage);
  overflow: hidden;
}
.cr-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--c-stage);
}
.cr-side {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--s-6); /* clear of the close button */
}
.cr-title {
  margin: 0;
  font-size: var(--t-page);
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cr-sub,
.cr-name,
.cr-note,
.cr-mark {
  margin: 0;
  font-size: var(--t-body);
  color: var(--c-fg-2);
}
.cr-name {
  color: var(--c-fg-3);
  font-size: var(--t-meta);
}
.cr-note:empty {
  display: none;
}
.cr-go {
  align-self: flex-start;
  margin-top: var(--s-3);
}
/* CLAUDE 11-19: Edit and Post or schedule, the two next steps under Download */
.cr-next {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.cr-mark {
  color: var(--c-fg-3);
  font-size: var(--t-meta);
}
.cr-up {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-fg);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.cr-more {
  margin: var(--s-4) 0 0;
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-line);
  font-size: var(--t-title);
  font-weight: 600;
}
.cr-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cr-list li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.cr-pick {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-1);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-fg);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.cr-pick img {
  flex: none;
  width: 36px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--c-raised);
}
.cr-pick span {
  display: grid;
  min-width: 0;
}
.cr-pick b {
  overflow: hidden;
  font-size: var(--t-body);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cr-pick small {
  color: var(--c-fg-3);
  font-size: var(--t-meta);
}
.cr-list li[data-on] .cr-pick img {
  outline: 1.5px solid var(--c-fg);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .cr-pick:hover {
    background: var(--c-raised);
  }
}
.cr-lib {
  align-self: flex-start;
  margin-top: var(--s-3);
}
/* loading */
.cr-body[aria-busy='true'] .cr-stage {
  border-radius: var(--r-md);
}
.cr-skel-line {
  height: 16px;
  width: 60%;
}
.cr-skel-btn {
  height: var(--h-lg);
  width: 160px;
  margin-top: var(--s-3);
  border-radius: var(--r-pill);
}
.cr-skel-row {
  height: 64px;
  margin-top: var(--s-2);
}
.cr-body.cr-empty {
  display: block;
  padding: var(--s-6) var(--s-5);
}

/* the phone: the whole screen, the video on top, the button full width */
@media (max-width: 767.98px) {
  dialog.cr {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .cr-body {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    height: 100%;
    max-height: none;
    padding: var(--s-4) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .cr-stage {
    align-self: center;
    flex: none;
    height: min(52dvh, 480px);
    max-width: 100%;
  }
  .cr-side {
    overflow: visible;
    padding-right: 0;
  }
  .cr-title {
    font-size: var(--t-title);
    line-height: 20px;
  }
  .cr-go {
    align-self: stretch;
  }
  .cr-next > .m-btn {
    flex: 1;
  }
  dialog.cr .cr-x {
    top: calc(var(--s-2) + env(safe-area-inset-top));
    right: var(--s-2);
    background: rgba(14, 14, 16, 0.6);
  }
}

/* the Library's line for the newest batch (index.html #libReady) */
.lib-ready {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  margin: 0 0 var(--s-4);
  padding: var(--s-2) 0;
  border: 0;
  border-bottom: 1px solid var(--c-line);
  background: none;
  color: var(--c-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.lib-ready[hidden] {
  display: none;
}
.lib-ready img {
  flex: none;
  width: 32px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--c-raised);
}
.lib-ready > span:not(.lib-ready-go) {
  display: grid;
  flex: 1;
  min-width: 0;
}
.lib-ready b {
  font-size: var(--t-body);
  font-weight: 500;
}
.lib-ready small {
  overflow: hidden;
  color: var(--c-fg-3);
  font-size: var(--t-meta);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lib-ready-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--h-md);
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--c-raised);
  font-size: var(--t-body);
  font-weight: 500;
}
@media (hover: hover) and (pointer: fine) {
  .lib-ready:hover .lib-ready-go {
    background: var(--c-overlay);
  }
}
