/* Hallmark · page: WhatsApp template library (hub, industry and use-case pages)
 * macrostructure: Night hero → (tips) → filter bar + card grid → tips / browse → FAQ → closer
 * theme: "Night + Mint" (shared tokens) · signature interaction: filter chips + copy
 */
.lib-section { padding-block-start: var(--space-xl); }
.lib { display: grid; gap: var(--space-lg); }
.lib__bar { display: grid; gap: var(--space-sm); }
.lib__group { display: grid; gap: var(--space-2xs); }
.lib__label { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }
.lib__chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.lib__chips .chip-btn[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.lib__count { font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--color-muted); }
.lib__empty { padding: var(--space-lg); border-radius: var(--radius-lg); border: var(--rule-width) dashed var(--color-rule); text-align: center; color: var(--color-muted); }

/* Cards */
.tpl-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.tpl { display: grid; gap: var(--space-sm); padding: var(--space-md); border-radius: var(--radius-lg); border: var(--rule-width) solid var(--color-rule); background: var(--color-paper); scroll-margin-block-start: 6rem; }
.tpl[hidden] { display: none; }
.tpl:target { border-color: var(--color-ink); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.tpl.is-in { animation: tpl-in 320ms var(--ease-out) both; }
@keyframes tpl-in { from { opacity: 0; transform: translateY(6px); } }
.tpl__top { display: grid; gap: var(--space-2xs); }
.tpl__title { font-size: var(--text-md); line-height: 1.25; }
.tpl__tags { display: flex; flex-wrap: wrap; gap: var(--space-3xs); }
.tpl__cat, .tpl__ind { padding: 1px var(--space-2xs); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-strong); }
.tpl__cat { border: var(--rule-width) solid currentColor; }
.tpl__cat--utility { color: var(--color-success); }
.tpl__cat--marketing { color: var(--color-warning); }
.tpl__cat--authentication { color: var(--color-accent-text); }
.tpl__ind { background: var(--color-paper-2); color: var(--color-muted); }

.tpl__msg { display: grid; gap: 3px; padding: var(--space-sm); border-radius: var(--radius-md);
  background-color: var(--color-paper-3);
  background-image: radial-gradient(color-mix(in oklch, var(--color-ink) 8%, transparent) 1px, transparent 1.5px);
  background-size: 14px 14px; }
.tpl__bubble { display: grid; gap: var(--space-2xs); padding: var(--space-xs) var(--space-sm); border-radius: 12px; border-start-start-radius: 4px; background: var(--color-paper); font-size: var(--text-sm); line-height: 1.5; overflow-wrap: anywhere; box-shadow: 0 1px 1px color-mix(in oklch, var(--color-ink) 12%, transparent); }
.tpl__h { font-weight: var(--weight-strong); }
.tpl__f { font-size: var(--text-xs); color: var(--color-muted); }
.tpl__var { display: inline-block; padding: 0 3px; border-radius: 4px; background: var(--color-accent-soft); color: var(--color-accent-text); font-family: var(--font-mono); font-size: 0.85em; font-weight: var(--weight-strong); white-space: nowrap; }
.tpl__btns { display: grid; gap: 3px; }
.tpl__btns li { padding: var(--space-3xs) var(--space-2xs); border-radius: 10px; background: var(--color-paper); text-align: center; font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--color-accent-text); box-shadow: 0 1px 1px color-mix(in oklch, var(--color-ink) 12%, transparent); }
.tpl__samples { font-size: var(--text-xs); color: var(--color-muted); line-height: 1.8; }
.tpl__why { padding-inline-start: var(--space-xs); border-inline-start: 2px solid var(--color-rule); font-size: var(--text-xs); color: var(--color-muted); }
.tpl__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs); padding-block-start: var(--space-xs); border-block-start: var(--rule-width) dashed var(--color-rule); }
.tpl__actions .chip-btn.is-done { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.tpl__check { font-size: var(--text-sm); font-weight: var(--weight-strong); }

/* Tips */
.tips { display: grid; gap: var(--space-md); counter-reset: tip; }
.tip { position: relative; display: grid; gap: var(--space-2xs); padding: var(--space-md) var(--space-md) var(--space-md) 3.5rem; border-radius: var(--radius-lg); background: var(--color-paper-2); counter-increment: tip; }
.tip::before { content: counter(tip); position: absolute; inset-block-start: var(--space-md); inset-inline-start: var(--space-md); display: grid; place-items: center; inline-size: 1.75rem; block-size: 1.75rem; border-radius: 50%; background: var(--color-ink); color: var(--color-paper); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-strong); }
.tip > * { margin: 0; }
.tip__t { font-size: var(--text-md); }
.tip p { color: var(--color-muted); }
.tips__more { margin-block-start: var(--space-md); font-weight: var(--weight-strong); }

/* Browse */
.browse { display: grid; gap: var(--space-lg); }
.browse__t { font-size: var(--text-md); margin-block-end: var(--space-xs); }
.nav-cards { display: grid; gap: var(--space-2xs); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.nav-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); min-height: 2.75rem; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); border: var(--rule-width) solid var(--color-rule); background: var(--color-paper); color: var(--color-ink); font-weight: var(--weight-strong); text-decoration: none; transition: border-color 160ms var(--ease-out); }
.nav-card:hover { border-color: var(--color-ink); }
.nav-card:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.nav-card__n { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); }

@media (min-width: 48rem) {
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .browse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .lib__bar { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--space-xl); }
  .lib__bar > h2, .lib__bar > .lib__group { grid-column: 1; }
  .lib__bar > .lib__count { grid-column: 2; grid-row: 1; align-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  .tpl.is-in { animation: none; }
  .nav-card { transition: none; }
}
