/* ── Pose library › Pose (its 3D view and side card: .wb-poseedit) ── */
.wbpl {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.wbpl-save {
  margin-top: 6px;
}

/* The 3D view and the timeline under it share the view column. */
.wbpl-viewcol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* ── The timeline strip (WorkbenchPoseLibraryTimeline.js) ── */
.wbpl-time {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* A server that serves no motions draws no strip. */
.wbpl-time[hidden] {
  display: none;
}

.wbpl-timebar .wb-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wbpl-clock {
  min-width: 96px;
  color: var(--text-secondary);
  font: 12px var(--font-mono);
}

/* Loop, as a tier that may not change it reads it. */
.wbpl-loopv {
  color: var(--text-secondary);
  font-size: 12px;
}

.wbpl-grow {
  flex: 1;
}

/* The track: a rail, a diamond per key, the playhead. Inset by half a
   diamond, so the keys at 0 and at the end sit inside the card. */
.wbpl-track {
  position: relative;
  height: 26px;
  margin: 0 8px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.wbpl-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-hover);
}

/* A key: a small square turned into a diamond, centred on its time. */
.wbpl-key {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  padding: 0;
  border: 1px solid var(--text-secondary);
  border-radius: 1px;
  background: var(--bg-secondary);
  transform: translate(-50%, -50%) rotate(45deg);
  cursor: grab;
}

.wbpl-key:hover {
  border-color: var(--text-primary);
}

.wbpl-key.first {
  cursor: pointer;
}

/* The key on the playhead. */
.wbpl-key.on {
  border-color: var(--accent);
  background: var(--accent);
}

.wbpl-head {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  pointer-events: none;
}

/* ── The Layers card, under the timeline (WorkbenchPoseLibraryLayersCard.js) ── */
.wbpl-layers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* A motion without layers, or a still pose, draws no card. */
.wbpl-layers[hidden] {
  display: none;
}

.wbpl-layers .wb-fgroup-h {
  margin: 0;
}

.wbpl-layers-list {
  margin: 0;
}

/* A layer: what it plays and its parts across, then its four times. */
.wbpl-layer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
}

@media (max-width: 1100px) {
  .wbpl-layer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Import motion file…'s card, above the list (WorkbenchPoseLibraryImport.js) ── */
.wbpl-imp .wb-list-bar {
  margin-bottom: 0;
}

.wbpl-imp-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* A long file scrolls inside the card, so the list stays in reach. */
.wbpl-imp-rows {
  max-height: 360px;
  overflow-y: auto;
}

.wbpl-imp-rows tr[data-wbpl-imp-row] {
  cursor: pointer;
}

.wbpl-imp-rows tr[data-wbpl-imp-row]:not(.wbpl-imp-off):hover td {
  background: var(--bg-hover);
}

/* An animation that can't be imported: no box, its name dimmed. */
.wbpl-imp-rows tr.wbpl-imp-off {
  color: var(--text-muted);
  cursor: default;
}

.wbpl-imp-box {
  width: 56px;
}

.wbpl-imp-box .wb-check {
  min-height: 0;
}
