.tpl-intro {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.2rem;
  align-items: center;
  background: #e6e0f0;
  border-radius: 14px;
  padding: clamp(1.8rem, 5vw, 4.4rem);
  margin-bottom: 2rem;
  overflow: hidden;
}
.tpl .tpl-intro h1,
.tpl .tpl-detail h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -0.06em;
  margin: 0 0 1rem;
}
.tpl-intro p,
.tpl-detail section > p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 34rem;
}
.featured-art {
  justify-self: center;
  width: min(90%, 15rem);
  transform: rotate(-7deg);
  outline-offset: 8px;
  filter: drop-shadow(2px 5px 5px #2d1b3f25);
}
.artwork-example {
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 7px;
}
.tpl-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 1rem 0 1.4rem;
  gap: 1.5rem;
}
.tpl-tabs a {
  font-weight: 700;
  padding: 0.8rem 0.1rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tpl-tabs a[aria-current] {
  border-color: var(--ink);
}
.tpl-filters {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}
.tpl-filters label {
  display: grid;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
}
.tpl-filters label:first-child {
  min-width: 14rem;
  flex: 1;
}
.tpl-filters select,
.tpl-filters input {
  min-height: 43px;
}
.layout-grid,
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.layout-card,
.artwork-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow 0.16s;
}
.layout-card:hover,
.artwork-card:hover {
  box-shadow: 0 4px 15px #18231b15;
}
.paper-stage,
.tpl-sheet {
  background: #efefea;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  min-height: 11rem;
}
.paper-stage img,
.tpl-sheet img {
  display: block;
  width: auto;
  height: 8.25rem;
  max-width: 95%;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px #16181230);
}
.layout-caption,
.artwork-card h2,
.artwork-card p {
  padding: 0 0.95rem;
}
.layout-caption {
  padding-top: 0.85rem;
  padding-bottom: 1rem;
}
.layout-caption h3,
.artwork-card h2 {
  font: 700 1.08rem/1.3 var(--body);
  margin: 0.2rem 0 0.3rem;
}
.layout-caption p,
.artwork-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.artwork-sample {
  display: grid;
  place-items: center;
  height: 12.6rem;
  background: #efefea;
  padding: 1.5rem;
}
.artwork-sample .artwork-example {
  width: auto;
  max-width: 94%;
  height: 95%;
  filter: drop-shadow(0 2px 2px #1112);
}
.artwork-card h2 {
  margin-top: 1rem;
}
.artwork-card p {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tpl-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: clamp(1.5rem, 5vw, 4rem);
}
.tpl-sheet {
  border-radius: 12px;
  min-height: 27rem;
}
.tpl-sheet img {
  height: 22rem;
}
.tpl .tpl-detail h1 {
  font-size: clamp(1.8rem, 3.6vw, 3.4rem);
  margin-top: 0.5rem;
}
.tpl-detail h2,
.tpl-spec h2 {
  font: 720 1.45rem var(--body);
  margin: 1.8rem 0 0.85rem;
}
.tpl-download {
  border-top: 1px solid var(--line);
  margin-bottom: 1.45rem;
}
.tpl-download a {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  align-items: center;
  padding: 0.9rem 0.3rem;
  text-decoration: none;
}
.tpl-download a:hover {
  background: var(--paper);
}
.tpl-download span {
  font-size: 0.84rem;
}
.tpl-spec {
  max-width: 50rem;
}
.tpl-spec dl {
  margin: 0;
}
@media (max-width: 800px) {
  .tpl-filters {
    gap: 0.65rem;
  }
  .tpl-intro {
    gap: 1rem;
  }
  .layout-grid,
  .artwork-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tpl-detail {
    grid-template-columns: 1fr;
  }
  .tpl-sheet {
    min-height: 15rem;
  }
  .tpl-sheet img {
    height: 12rem;
  }
}
@media (max-width: 520px) {
  .tpl-intro {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 1.4rem 0.9rem;
  }
  .tpl-intro p {
    font-size: 0.86rem;
  }
  .tpl-intro h1 {
    font-size: 2rem;
  }
  .tpl-tabs {
    gap: 1rem;
    font-size: 0.89rem;
  }
  .tpl-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .tpl-filters label:first-child,
  .tpl-filters button {
    grid-column: 1/-1;
  }
  .tpl-filters label,
  .tpl-filters select {
    min-width: 0;
    width: 100%;
  }
  .artwork-sample {
    height: 8.9rem;
    padding: 1rem 0.55rem;
  }
  .paper-stage {
    padding: 0.6rem;
    min-height: 8.5rem;
  }
  .paper-stage img {
    height: 7rem;
  }
  .layout-caption {
    padding: 0.65rem;
  }
  .layout-caption h3,
  .artwork-card h2 {
    font-size: 0.94rem;
  }
  .layout-caption p,
  .artwork-card p {
    font-size: 0.75rem;
  }
  .tpl-download a {
    grid-template-columns: 3.4rem 1fr auto;
  }
}
