/* CLAUDE 10-09: Style Studio > Overlays (app-deco.js): the upload button, the clip's overlays and their settings, the
   library grid, the empty state. Same dark panel language as the Text tab (editor.css .ov-row / .ov-tile). */
/* five tabs now (Presets, Font, Caption, Layout, Overlays): they must still fit the narrowest desktop panel */
main .inspector .tabs {
  flex-wrap: nowrap;
}
main .inspector .tabs button {
  min-width: 0;
  padding-inline: 5px;
}
#tab-decos .dl-top {
  margin-bottom: 12px;
}
.dl-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
}
#tab-decos.dl-dropping {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 10px;
  background: rgba(83, 252, 24, 0.05);
}
.dl-sec {
  margin-bottom: 16px;
}
.dl-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  color: #cfcfd2;
}
.dl-title b {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dl-title span {
  color: #8d8d90;
  font-size: 10px;
}
/* a picture on a checkerboard: the transparent parts show as transparent */
.dl-thumb,
.dl-mini {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background:
    conic-gradient(#2c2c2e 25%, #1f1f21 0 50%, #2c2c2e 0 75%, #1f1f21 0) 0 0 / 14px 14px,
    #1f1f21;
}
.dl-thumb {
  aspect-ratio: 1;
  border: 1px solid #353537;
}
.dl-mini {
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid #353537;
}
.dl-thumb img,
.dl-mini img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* on this clip */
.dl-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #2a2a2c;
  border-radius: 8px;
  background: #151517;
  color: #cfcfd2;
}
.dl-row.selected {
  border-color: #8a8a92;
  background: #29292b;
  color: #fff;
}
.dl-pick {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.dl-txt {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}
.dl-pick strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-pick .dl-when {
  color: #8d8d90;
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dl-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: #a9a9ad;
}
.dl-icon:hover:not(:disabled) {
  color: #fff;
  background: #2a2a2d;
}
.dl-icon:disabled {
  opacity: 0.3;
  cursor: default;
}
.dl-row[data-pro] {
  padding-right: 4px;
}
.dl-save {
  width: 100%;
  margin-top: 8px;
  font-size: 11px;
}
/* an overlay's settings */
.dl-card {
  margin: 0 0 8px;
  padding: 10px 10px 4px;
  border: 1px solid #353537;
  border-radius: 8px;
  background: #121214;
}
.dl-set {
  margin-bottom: 12px;
}
.dl-lbl {
  display: block;
  margin-bottom: 6px;
  color: #cfcfd2;
  font-size: 11px;
  font-weight: 600;
}
.dl-seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.dl-seg button {
  min-height: 34px;
  padding: 6px 4px;
  font-size: 11px;
}
.dl-seg button[aria-pressed='true'] {
  border-color: #afafb2;
  background: #29292b;
  color: #fff;
}
.dl-card .hint {
  margin: 6px 0 0;
}
.dl-custom,
.dl-secs,
.dl-times {
  margin-top: 10px;
}
.dl-custom[hidden],
.dl-secs[hidden],
.dl-times[hidden],
.dl-warn[hidden] {
  display: none;
}
.dl-card .field {
  margin-bottom: 8px;
}
.dl-card .range-field {
  margin-bottom: 14px;
}
.dl-card .switch-row {
  margin: 8px 0 4px;
  gap: 10px;
}
.dl-card .pair button {
  min-height: 34px;
  font-size: 11px;
}
.dl-warn {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid #6a5a1c;
  border-radius: 8px;
  background: #241f0c;
  color: #f0dc8a;
  font-size: 11px;
  line-height: 1.5;
}
.dl-warn button {
  justify-self: start;
  min-height: 32px;
  font-size: 11px;
}
.dl-actions {
  display: flex;
  gap: 8px;
}
.dl-actions button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  font-size: 11px;
}
/* the library */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.dl-tile {
  position: relative;
  min-width: 0;
}
.dl-use {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #cfcfd2;
  font-size: 11px;
  text-align: left;
}
.dl-use:hover .dl-thumb,
.dl-use:focus-visible .dl-thumb {
  border-color: #8a8a92;
}
.dl-name,
.dl-rename {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-rename {
  width: 100%;
  padding: 3px 5px;
}
.dl-kind,
.dl-opaque {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dl-opaque {
  left: auto;
  right: 4px;
  background: rgba(60, 46, 0, 0.9);
  color: #ffd24a;
  text-transform: none;
  letter-spacing: 0;
}
.dl-fav,
.dl-more {
  position: absolute;
  top: 3px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s;
}
.dl-fav {
  left: 3px;
}
.dl-more {
  right: 3px;
}
.dl-tile:hover .dl-fav,
.dl-tile:hover .dl-more,
.dl-fav:focus-visible,
.dl-more:focus-visible,
.dl-fav[aria-pressed='true'] {
  opacity: 1;
}
.dl-fav[aria-pressed='true'] {
  color: #ffd24a;
}
.dl-fav[aria-pressed='true'] svg {
  fill: currentColor;
}
@media (hover: none) {
  .dl-fav,
  .dl-more {
    opacity: 1;
  }
}
.dl-tile.fresh .dl-thumb {
  animation: dl-fresh 1.4s ease-out 1;
}
@keyframes dl-fresh {
  from {
    box-shadow: 0 0 0 3px var(--accent);
  }
  to {
    box-shadow: 0 0 0 0 transparent;
  }
}
/* Premium badge (pro.js; the pill itself is in editor.css): on a tile it sits on the picture's top left */
.pro-free .dl-use[data-pro]::after {
  position: absolute;
  top: 5px;
  left: 5px;
  margin: 0;
}
.pro-free .dl-fav[aria-pressed='false'] ~ .dl-more {
  right: 3px;
}
.dl-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 14px;
  border: 1px dashed #4a4a4e;
  border-radius: 10px;
  text-align: center;
}
.dl-empty strong {
  color: #fff;
  font-size: 13px;
}
.dl-empty p {
  margin: 0;
  color: #cfcfd2;
  font-size: 12px;
  line-height: 1.5;
}
.dl-empty small {
  color: #8d8d90;
  font-size: 10.5px;
  line-height: 1.5;
}
.dl-empty-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #1c1c1f;
  color: #a9a9ad;
}
.dl-empty .primary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.dl-ups {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.dl-up {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #2a2a2c;
  border-radius: 8px;
  background: #151517;
  font-size: 11px;
}
.dl-up-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-up progress {
  grid-column: 1;
  width: 100%;
}
.dl-up small {
  color: #8d8d90;
  font-size: 10px;
}
.dl-up .dl-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.dl-skel {
  aspect-ratio: 1;
  border-radius: 6px;
  background: linear-gradient(90deg, #1b1b1d, #262628, #1b1b1d) 0 0 / 200% 100%;
  animation: dl-skel 1.2s linear infinite;
}
@keyframes dl-skel {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dl-skel,
  .dl-tile.fresh .dl-thumb {
    animation: none;
  }
  .dl-fav,
  .dl-more {
    transition: none;
  }
}
/* the Presets page builder: a preset's overlays */
.dl-pe {
  display: grid;
  gap: 10px;
}
.dl-pe-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #2f2f32;
  border-radius: 10px;
  background: #121214;
}
.dl-pe-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dl-pe-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-pe-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}
/* the timeline block of a style overlay */
.tl-ov.tl-deco {
  background: #1f3a4a;
  border-color: #3b7894;
  color: #d8f1ff;
}
.tl-ov.tl-deco.selected {
  border-color: #53fc18;
}
/* a finger: 44 px targets */
@media (pointer: coarse), (max-width: 767.98px) {
  .dl-upload,
  .dl-empty .primary {
    min-height: 44px;
  }
  .dl-pick {
    min-height: 44px;
  }
  .dl-icon {
    width: 44px;
    height: 44px;
  }
  .dl-fav,
  .dl-more {
    top: 2px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
  }
  .dl-fav {
    left: 2px;
  }
  .dl-more {
    right: 2px;
  }
  .dl-seg button,
  .dl-card .pair button,
  .dl-actions button,
  .dl-warn button,
  .dl-save {
    min-height: 44px;
  }
  .dl-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  main .inspector .tabs button {
    min-height: 44px;
  }
  .dl-card select,
  .dl-card input[type='number'],
  .dl-pe select,
  .dl-pe input[type='number'] {
    min-height: 44px;
  }
  .dl-card .range-field input[type='range'],
  .dl-pe input[type='range'] {
    height: 44px;
  }
  .dl-card .switch-row {
    min-height: 44px;
  }
  .dl-card input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }
}
