/* Thumbnail Tester & Previewer */
.tp-wrap { max-width: 1240px; }
.tp-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.tp-controls { padding: 18px; display: flex; flex-direction: column; gap: 13px; }

/* ── drop zones ─────────────────────────────── */
.tp-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-soft);
  transition: border-color .18s, background .18s;
  user-select: none;
}
.tp-drop:hover, .tp-drop.over, .tp-drop:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-soft));
  outline: none;
}
.tp-drop-ico { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.tp-drop b { display: block; font-size: .95rem; }
.tp-drop small { color: var(--muted); font-size: .78rem; }
.tp-drop-b { padding: 13px 14px; }
.tp-drop-b .tp-drop-ico { font-size: 1.15rem; }

/* ── checks ─────────────────────────────────── */
.tp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-check {
  font-size: .8rem;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.tp-check.tp-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 32%, var(--line)); }
.tp-check.tp-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, var(--line)); }
.tp-check.tp-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); }

.tp-status { font-size: .85rem; color: var(--muted); }
.tp-status.error { color: var(--danger); }
.tp-opt { color: var(--muted-2); font-weight: 400; font-size: .78rem; }
.tp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-check-lbl {
  display: flex; align-items: center; gap: 8px;
  font-size: .88rem; color: var(--text); cursor: pointer;
}
.tp-check-lbl input { accent-color: var(--accent); }
.tp-swap { font-size: .84rem; align-self: flex-start; }
.tp-controls textarea { resize: vertical; font-size: .88rem; line-height: 1.5; }

/* ── preview stage ──────────────────────────── */
.tp-previews { min-width: 0; }
.tp-trunc {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 12%, var(--card));
  border: 1px solid color-mix(in srgb, var(--warn) 36%, var(--line));
  color: var(--warn);
  font-size: .87rem;
  line-height: 1.5;
}
.tp-stage {
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border: 1px solid var(--line);
}
/* The stage carries its own palette so the previews look like the interface they
   imitate rather than like the rest of this page. */
.tp-stage.tp-dark { background: #0f0f0f; --tpText: #f1f1f1; --tpMuted: #aaa; --tpLine: #272727; }
.tp-stage.tp-light { background: #fff; --tpText: #0f0f0f; --tpMuted: #606060; --tpLine: #e5e5e5; }

.tp-block-head { display: flex; align-items: baseline; gap: 10px; }
.tp-block-head h3 {
  margin: 0; font-size: .95rem; color: var(--tpText);
  font-family: var(--font);
}
.tp-size { font-size: .74rem; color: var(--tpMuted); font-variant-numeric: tabular-nums; }
.tp-note { margin: 3px 0 12px; font-size: .8rem; color: var(--tpMuted); line-height: 1.5; }
.tp-block + .tp-block { border-top: 1px solid var(--tpLine); padding-top: 22px; }

/* Placement widths are the whole point of this tool, so they must never be squeezed to
   fit a phone. The row scrolls instead — the search card alone is 830px wide. */
.tp-cards {
  display: flex; gap: 22px; flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.tp-card { max-width: 100%; }
.tp-card.tp-row { display: flex; gap: 10px; align-items: flex-start; }
.tp-body { flex: none; max-width: 100%; }

.tp-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1a;
  flex: none;
  max-width: 100%;
}
.tp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  color: #777; font-size: .75rem; border: 1px dashed #444;
}
.tp-dur {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(0,0,0,.8); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 3px 4px; border-radius: 4px;
}
.tp-prog {
  position: absolute; left: 0; right: 40%; bottom: 0;
  height: 3px; background: #f00;
}

.tp-body { min-width: 0; padding-top: 8px; }
.tp-card.tp-row .tp-body { padding-top: 0; }
.tp-title {
  color: var(--tpText);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font);
}
.tp-title-sm { font-size: 13px; font-weight: 500; }
/* A measured overflow, not a character count — see flagTruncation(). */
.tp-title.tp-cut { box-shadow: inset 0 -2px 0 color-mix(in srgb, #ffb020 70%, transparent); }
.tp-metaline { color: var(--tpMuted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.tp-desc { color: var(--tpMuted); font-size: 12px; margin-top: 7px; line-height: 1.45; }


.tp-disclaimer { margin: 12px 2px 0; font-size: .78rem; color: var(--muted-2); }

@media (max-width: 940px) {
  .tp-layout { grid-template-columns: minmax(0, 1fr); }
  .tp-stage { padding: 16px; }
  .tp-cards { gap: 16px; }
}
