/* CLAUDE 10-16: the Text library (textlib-ui.js): Text > Text templates and Text effects, and the Effects page of a selected
   text (app-texteffects.js). The chrome is the Filters tab's (fxlib.css: search, favorites star, tabs, empty state); this adds
   the tile pictures (the real renderer's drawing on a canvas), the skeleton until one is drawn, and the Effects page's rows. */
.tlb-lib {
  min-width: 0;
}
.cc-fx.tlb-grid,
main .cc-fx.tlb-grid {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px 8px;
}
.cc-fx.tlb-grid button {
  position: relative;
  min-width: 0;
}
/* the picture: a card wider than tall, the text drawn on it; a skeleton pulse until it is drawn (opacity only: composited) */
.cc-fx.tlb-grid i.tlb-pic {
  aspect-ratio: 150 / 65;
  overflow: hidden;
  background: var(--c-raised);
}
.cc-fx.tlb-tpl i.tlb-pic {
  aspect-ratio: 150 / 53;
}
.tlb-pic canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.tlb-pic.tlb-ready canvas {
  opacity: 1;
  transition: opacity var(--d-ui, 0.15s) ease;
}
.tlb-pic:not(.tlb-ready) {
  animation: tlb-pulse 1.4s ease-in-out infinite;
}
@keyframes tlb-pulse {
  50% {
    opacity: 0.55;
  }
}
/* the current effect of the text: the ring the other tile grids use for "added" */
main .cc-fx.tlb-grid button[aria-pressed='true'] i.tlb-pic {
  box-shadow: 0 0 0 1.5px var(--c-fg);
}
@media (prefers-reduced-motion: reduce) {
  .tlb-pic:not(.tlb-ready) {
    animation: none;
  }
  .tlb-pic.tlb-ready canvas {
    transition: none;
  }
}
/* the Effects page of a text's editor */
.tfx-fxlib {
  margin-bottom: 6px;
}
.tfx-fxopts {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.tfx-fxopts[hidden],
.tfx-fxopts [hidden] {
  display: none;
}
.tfx-ramp-bar {
  height: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-line);
}
.tfx-ramp-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tfx-fxopts .hint {
  margin: 0;
}
/* CLAUDE 10-16 (round 2) Text templates > Yours: save the project's texts as a template, then the account's own templates
   with Rename / Copy link / Delete under each */
.tlb-yours {
  display: grid;
  gap: 10px;
}
.tlb-yours[hidden] {
  display: none;
}
.tlb-ysave {
  display: grid;
  gap: 8px;
}
.tlb-yhead {
  margin: 0;
  color: var(--c-fg-2, #cfcfd2);
  font-size: var(--t-label, 12px);
  font-weight: 600;
}
.tlb-ytexts {
  display: grid;
  gap: 4px;
  max-height: 148px;
  overflow-y: auto;
}
.tlb-ytext {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--c-fg);
  font-size: var(--t-body, 13px);
}
.tlb-ytext span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tlb-ysave > input[type='text'] {
  min-height: var(--h-md, 36px);
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-raised);
  color: var(--c-fg);
  font-size: var(--t-body, 13px);
}
.tlb-ysave > input[type='text']:focus-visible,
.tlb-yitem input:focus-visible,
.tlb-yacts button:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
.tlb-ysave > button {
  min-height: var(--h-md, 36px);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--c-fg);
  color: var(--c-bg, #0e0e10);
  font-weight: 600;
  cursor: pointer;
}
.tlb-ysave > button:disabled {
  opacity: 0.45;
  cursor: default;
}
.tlb-yitem {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.tlb-yitem > input {
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-raised);
  color: var(--c-fg);
  font-size: 11px;
}
/* the three small actions under a tile: the grid's tile rules must not turn them into tiles */
.cc-fx.tlb-grid .tlb-yacts {
  display: flex;
  justify-content: center;
  gap: 2px;
}
.cc-fx.tlb-grid .tlb-yacts button {
  flex: 0 0 auto;
  min-width: 28px;
  min-height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-fg-3);
  font-size: 12px;
  cursor: pointer;
}
.cc-fx.tlb-grid .tlb-yacts button:hover {
  color: var(--c-fg);
  background: var(--c-raised);
}
.cc-fx.tlb-grid .tlb-yacts button.armed {
  color: var(--c-warn, #ffb020);
}
@media (pointer: coarse) {
  .cc-fx.tlb-grid .tlb-yacts button,
  .tlb-ytext {
    min-height: 44px;
    min-width: 44px;
  }
}
/* CLAUDE 10-16 (round 2): the picture fill's row of textures (our own pictures), "No picture" and "Your own picture" */
.tfx-texes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.tfx-tex {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--c-raised);
  color: var(--c-fg-3);
  cursor: pointer;
}
.tfx-tex img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tfx-tex:hover {
  color: var(--c-fg);
}
.tfx-tex[aria-pressed='true'] {
  box-shadow: 0 0 0 1.5px var(--c-fg);
  color: var(--c-fg);
}
.tfx-tex:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
@media (pointer: coarse) {
  .tfx-tex {
    width: 44px;
    height: 44px;
  }
}
