/* Lenci · Design Studio, pro layer (v3/design-pro.js): the Templates gallery, the logo / extra-photo cards, the export quality chips,
   the brand-colour badge and the proofreading panel. Builds on design.css + studio.css tokens; logical properties only (RTL mirrors). */
#tab-templates .dg-ico { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7.5' height='9' rx='1.5'/%3E%3Crect x='13.5' y='3' width='7.5' height='5' rx='1.5'/%3E%3Crect x='13.5' y='11' width='7.5' height='10' rx='1.5'/%3E%3Crect x='3' y='15' width='7.5' height='6' rx='1.5'/%3E%3C/svg%3E"); }

/* ------------------------------------------------------------------ templates */
.dp-filters { gap: 10px; }
.dp-filters .dg-chips { flex-wrap: wrap; }
.dp-filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.dp-tcard { min-width: 0; display: grid; grid-template-rows: auto auto auto; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); box-shadow: var(--edge), 0 14px 34px rgba(0,0,0,.3); overflow: hidden; transition: transform var(--t), border-color var(--t); }
.dp-tcard:hover { transform: translateY(-2px); border-color: rgba(139,92,246,.55); }
.dp-tframe { position: relative; background: var(--check), #15151f; aspect-ratio: 1 / 1; }
.dp-tframe canvas { position: absolute; inset: 12px; display: block; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; filter: drop-shadow(0 10px 22px rgba(0,0,0,.45)); }
.dp-tmeta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 14px 0; min-width: 0; }
.dp-tmeta h3 { margin: 0; font-family: var(--display); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-tsize { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.dp-tsize bdi, #tp-sizes bdi { font-family: var(--mono); }
.dp-tacts { display: flex; gap: 8px; padding: 10px 14px 14px; }
.dp-tacts .primary { flex: 1 1 auto; }

/* ------------------------------------------------------------------ logo + extra photos */
.dp-logo-row { align-items: center; }
.dp-logo-thumb { width: 52px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--check), #23232f; padding: 4px; }
.dp-logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
#ds-logo-pos, #ds-logo-variant { flex-wrap: wrap; }
.dp-font-note { font-size: 11.5px; }
.dp-extra { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-extra:empty { display: none; }
.dp-extra-item { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.dp-extra-item canvas { display: block; width: 100%; height: 100%; }
.dp-extra-item .dg-x { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; }

/* ------------------------------------------------------------------ quality chips, the 2K note */
.dp-quality { flex: 1 1 100%; flex-wrap: wrap; }
.dp-quality .chip { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .dp-quality .chip { direction: rtl; }
.dp-hd-note { font-size: 12px; }

/* ------------------------------------------------------------------ brand-colour badge */
.dp-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.dp-check[hidden] { display: none; }
.dp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-family: var(--display); font-size: 12px; font-weight: 700; }
.dp-badge.on, .dp-badge.neutral { color: var(--ok); background: var(--ok-bg); }
.dp-badge.drift { color: var(--warn); background: var(--warn-bg); }
.dp-swatches { display: inline-flex; gap: 3px; }
.dp-swatches i { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.dp-swatches.brand i { border-radius: 50%; }
.dp-vs { font-size: 11.5px; }

/* ------------------------------------------------------------------ proofreading */
.dp-proof { gap: 10px; }
.dp-proof-ok { margin: 0; color: var(--ok); font-weight: 600; font-size: 13px; }
.dp-fix { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.dp-fix-label { font-family: var(--display); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .dp-fix-label { letter-spacing: 0; }
.dp-fix-old { color: var(--bad); text-decoration-thickness: 1px; font-size: 13px; overflow-wrap: anywhere; }
.dp-fix-new { color: var(--ok); text-decoration: none; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.dp-fix-reasons { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-fix-reasons i { font-style: normal; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: rgba(139,92,246,.16); color: #ddd6fe; }
.dp-fix-acts { display: flex; gap: 6px; margin-block-start: 4px; }

@media (max-width: 600px) {
  .dp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dp-tframe { padding: 8px; }
  .dp-tmeta { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px 0; }
  .dp-tacts { padding: 8px 10px 10px; }
}

/* the spec editor: a taller list-lines field must not push its row neighbours' inputs down */
#ds-spec .dg-spec-grid > .dg-field { align-content: start; }
