.tpl-under { margin: 26px 0 0; }
.tpl-under[hidden] { display: none; }
.tpl-under-h { margin: 0 0 12px; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--dim); }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.tpl-card {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px 18px 16px;
  border-radius: var(--r-card, 16px); background: var(--card, #fff);
  box-shadow: 0 0 0 1px var(--line-soft), 0 1px 2px rgba(14, 26, 43, 0.04);
  transition: box-shadow 0.16s ease;
}
.tpl-card:hover { box-shadow: 0 0 0 1px var(--t300, #90E1C4), 0 10px 26px -16px rgba(21, 119, 92, 0.5); }
.tpl-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tpl-logo {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; padding: 7px;
  box-sizing: border-box; background: #fff; box-shadow: inset 0 0 0 1px var(--line-soft);
}
.tpl-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tpl-logo:has(> .ei) { padding: 0; box-shadow: none; }
.tpl-logo > .ei { width: 40px; height: 40px; border-radius: 11px; }
.tpl-logo > .ei-none { background-size: 20px; }
.tpl-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tpl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.tpl-slug { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--dim); }

.tpl-blurb { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); flex: 1 1 auto; }
.tpl-cmd {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 4px 4px 12px; border-radius: 10px;
  background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line-soft);
}
.tpl-cmd code {
  flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding: 6px 0;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text); background: none;
}
.tpl-cmd code::-webkit-scrollbar { display: none; }
.tpl-cmd code::before { content: "$ "; color: var(--dim); }
.tpl-copy {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; margin: 0;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.tpl-copy:hover { background: rgba(14, 26, 43, 0.06); color: var(--text); }
.tpl-copy:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.tpl-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
  stroke-linejoin: round; }
.tpl-copy .ok { display: none; }
.tpl-copy.is-copied { color: var(--t750, #136A52); }
.tpl-copy.is-copied .ok { display: block; }
.tpl-copy.is-copied .cp { display: none; }
.tpl-go {
  align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; margin: auto 0 0;
  border: 0; border-radius: 9px; background: var(--t50, #EAF7F1); color: var(--t800, #0F5A45); cursor: pointer;
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background 0.14s ease;
}
.tpl-go:hover { background: var(--t100, #D6F0E5); }
.tpl-go:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tpl-go.is-docs { background: none; color: var(--t750, #136A52); }
.tpl-go.is-docs:hover { text-decoration: underline; text-underline-offset: 3px; }
.reg-variants { display: grid; gap: 8px; margin: 2px 0 6px; }
.reg-variant { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-soft); }
.reg-variant:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--t500, #2FA67F); background: var(--t50, #EAF7F1); }
.reg-variant input { margin: 3px 0 0; accent-color: var(--t700, #15775C); }
.reg-variant b { display: block; font-size: 13.5px; color: var(--text); }
.reg-variant span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.reg-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.reg-note[hidden] { display: none; }
.reg-label[hidden], .reg-variants[hidden], .reg-variant[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { .tpl-card, .tpl-copy, .tpl-go { transition: none; } }
