.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.template-card {
  display: block;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.template-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}
.template-card.selected {
  border: 2px solid var(--highlight);
}
.auto-template {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  text-align: left;
}
.auto-template strong {
  font-size: 14px;
  font-weight: 500;
}
.auto-template span {
  font-size: 13px;
  color: var(--muted);
}
.auto-template.selected {
  border-color: var(--highlight);
  background: var(--accent-soft);
}
.template-art {
  height: 155px;
  position: relative;
  overflow: hidden;
  padding: 18px 22px;
}
.template-art:before {
  content: "";
  position: absolute;
  width: 95px;
  height: 132px;
  right: 31px;
  top: 40px;
  transform: rotate(-8deg);
  border-radius: 5px;
  background: linear-gradient(145deg, #5c615f, #c1b7aa);
  box-shadow: 0 12px 20px #0002;
}
.template-art:after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -35px;
  top: -45px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.25;
}
.template-art .art-tag {
  position: relative;
  font:
    8px/1.5 Georgia,
    serif;
  letter-spacing: 1.5px;
  opacity: 0.65;
}
.template-art strong {
  display: block;
  position: relative;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 1px;
  margin-top: 13px;
  z-index: 1;
}
.template-art .art-line {
  position: relative;
  width: 34px;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
  margin-top: 13px;
}
.template-art .art-photo {
  position: absolute;
  right: 29px;
  top: 28px;
  width: 97px;
  height: 141px;
  transform: rotate(-6deg);
  object-fit: cover;
  border-radius: 4px;
  filter: saturate(0.75);
  box-shadow: 0 12px 24px #0003;
  z-index: 0;
}
.template-card[data-id="insight"] .template-art {
  background: #ede6d8;
  color: #343d37;
}
.template-card[data-id="launch"] .template-art {
  background: radial-gradient(ellipse at 80% 100%, #6c5199, #272330 75%);
  color: #e8d9ff;
}
.template-card[data-id="launch"] .template-art:before {
  background: linear-gradient(135deg, #b1a2cb, #382c4c);
  width: 74px;
  height: 110px;
  border-radius: 14px;
  top: 57px;
  right: 42px;
}
.template-card[data-id="space"] .template-art {
  background: #e5e5df;
  color: #595b50;
}
.template-card[data-id="space"] .template-art:before {
  background: linear-gradient(
    90deg,
    #bab8ab 40%,
    #d7d1be 40%,
    #d7d1be 45%,
    #aaa896 45%
  );
  transform: rotate(0);
  width: 122px;
  height: 132px;
  right: 12px;
}
.template-card[data-id="explainer"] .template-art {
  background: #dce9e8;
  color: #385e64;
}
.template-card[data-id="explainer"] .template-art:before {
  background: linear-gradient(130deg, #a2c5c3, #e4e9db);
  transform: rotate(8deg);
}
.template-card[data-id="story"] .template-art {
  background: linear-gradient(120deg, #634554, #b9999c);
  color: #f8e9e5;
}
.template-card[data-id="story"] .template-art:before {
  background: linear-gradient(90deg, #a78c91, #655358);
  width: 130px;
  transform: rotate(4deg);
}
.template-card[data-id="pulse"] .template-art {
  background: radial-gradient(ellipse at 90% 70%, #599184, #203b35 78%);
  color: #d3eee0;
}
.template-card[data-id="pulse"] .template-art:before {
  background: transparent;
  box-shadow: none;
  border: 1px solid #a0d5be70;
  border-radius: 50%;
  transform: rotate(30deg);
  width: 120px;
}
.template-card:hover .art-photo {
  animation: cardfloat 2.5s ease-in-out infinite;
}
@keyframes cardfloat {
  50% {
    transform: translateY(-5px) rotate(-3deg);
  }
}
.template-description {
  padding: 14px 15px;
}
.template-description strong {
  font-size: 14px;
  font-weight: 500;
}
.template-description small {
  display: block;
  color: var(--faint);
  font-size: 13px;
  margin-top: 4px;
}
.template-description p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.template-art strong {
  white-space: pre-line;
}
.works-grid,
.assets-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.work-card,
.asset-card {
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  min-width: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.work-card:hover,
.asset-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
}
.work-art {
  aspect-ratio: 9 / 16;
  height: auto;
  position: relative;
  background: #e9eef5;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.work-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.work-placeholder {
  color: var(--accent);
  font-size: 16px;
}
.work-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 2px 7px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 5px;
  background: #ffffffeb;
}
.work-info {
  padding: 14px;
}
.work-info strong,
.asset-card strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 500;
}
.work-info small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.asset-card img {
  width: 100%;
  height: 195px;
  object-fit: cover;
  object-position: center 30%;
}
.asset-card strong {
  padding: 12px 14px 0;
}
.asset-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  padding: 5px 14px 14px;
}
