.template-gallery-page { background: #f5f3ea; }
.template-banner { padding: clamp(34px, 6vw, 88px) 0; background: #102a26; color: #f8f6ea; }
.template-eyebrow { font-size: .82rem; font-weight: 720; letter-spacing: .075em; text-transform: uppercase; }
.template-banner .template-eyebrow { color: #dcf889; margin: 0 0 9px; }
.template-banner h1 { margin: 0; font-size: clamp(2.7rem, 8vw, 6.7rem); letter-spacing: -.075em; line-height: 1.02; }
.template-banner p:last-child { max-width: 670px; margin: 15px 0 0; color: #d3e2d6; font-size: clamp(1rem, 1.7vw, 1.19rem); }
.template-library { padding-top: 28px; padding-bottom: 64px; }
.template-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(128px,1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line, var(--hairline-color));
  border-radius: 12px;
  background: var(--paper, var(--body-bg));
}
.template-filter label { display: grid; gap: 5px; font-size: 13px; font-weight: 690; min-width: 0; }
.template-filter select, .template-filter input {
  width: 100%; min-width: 0; min-height: 43px; box-sizing: border-box;
  color: var(--ink, var(--body-fg)); background: var(--paper, var(--body-bg));
  border: 1px solid var(--strong-line, var(--border-color)); border-radius: 8px;
  font: inherit; font-weight: 450; padding: 6px 8px;
}
.template-filter > button { min-height: 43px; }
.template-count { margin: 0 0 13px; color: var(--slate, var(--body-quiet-color)); font-size: .88rem; font-weight: 620; }
.template-grid, .template-other-formats ul, .template-admin .template-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; list-style: none; margin: 0; padding: 0;
}
.template-grid > li, .template-other-formats li { list-style: none; min-width: 0; }
.template-card, .template-admin .template-card {
  display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0; padding: 0;
  border: 1px solid var(--line, var(--hairline-color)); border-radius: 14px; overflow: hidden;
  background: var(--paper, var(--body-bg));
}
.template-art, .template-detail-art {
  position: relative; display: grid; place-items: center; min-height: 118px; aspect-ratio: 1.55;
  background-color: #e8e8dc; background-image: radial-gradient(#bac4b7 1px, transparent 1px);
  background-size: 11px 11px; overflow: hidden;
}
.template-art::before, .template-detail-art::before { content: ""; width: 100%; padding-top: 64.5%; grid-area: 1/1; }
.template-art img, .template-detail-art img {
  position: absolute; inset: 7%; width: 86%; height: 86%; min-height: 0; object-fit: contain;
}
.template-art:hover img { filter: brightness(1.035); }
.template-card-body { padding: 12px 14px 14px; }
.template-card-body h2 { margin: 0; font-size: 1rem; line-height: 1.3; }
.template-card-body h2 a { color: var(--ink, var(--body-fg)); }
.template-card-body p { margin: 4px 0 0; color: var(--slate, var(--body-quiet-color)); font-size: .82rem; }
.template-use { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; margin-top: 5px; font-size: .85rem; font-weight: 690; }
.template-card-state { font-weight: 700; }
.template-empty { grid-column: 1 / -1; padding: 20px; border: 1px dashed var(--line, var(--hairline-color)); border-radius: 12px; }
.template-paging { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; margin-top: 25px; }
.template-paging a, .template-back { color: var(--blue, var(--link-fg)); font-weight: 680; }
.template-paging a { min-height: 44px; display: inline-flex; align-items: center; }
.template-detail, .template-studio { padding-block: 26px 52px; }
.template-detail-grid {
  display: grid; grid-template-columns: minmax(0, 1.24fr) minmax(0, .76fr);
  gap: clamp(18px, 5vw, 62px); align-items: center; margin-top: 18px;
}
.template-detail-grid h1 { font-size: clamp(2rem, 5vw, 4rem); margin: 6px 0 12px; letter-spacing: -.06em; line-height: 1.03; }
.template-detail-grid p { margin: 0 0 12px; }
.template-detail-grid .site-button { margin: 6px 6px 0 0; }
.template-detail-art { border-radius: 16px; }
.template-other-formats { margin-top: 30px; }
.template-other-formats ul { display: flex; flex-wrap: wrap; }
.template-other-formats a { display: inline-flex; padding: 9px 15px; border: 1px solid var(--line); border-radius: 9px; }
.template-admin-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.template-admin-actions .button { display: inline-flex; align-items: center; min-height: 42px; }
.template-admin .template-filter { grid-template-columns: minmax(144px, 1.25fr) repeat(4, minmax(94px,1fr)) auto; }
.template-studio-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 16px; }
.template-studio-heading h1 { margin: 0 0 3px; font-size: clamp(1.7rem, 4vw, 2.7rem); letter-spacing: -.055em; }
.template-studio-heading p { margin: 0; color: var(--slate); }
.template-publication { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1140px) {
  .template-admin .template-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 770px) {
  .template-filter, .template-admin .template-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-filter label:first-child { grid-column: 1/-1; }
  .template-grid, .template-admin .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .template-detail-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 420px) {
  .template-card-body { padding: 10px; }
  .template-art { min-height: 98px; }
}
