.templates-page,
.intake-template-library {
  --library-ink: #191529;
  --library-muted: #5a5570;
  --library-border: #e1ddeb;
  --library-action: #4534c5;
  --library-tint: #f2effd;
}
.template-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  padding: clamp(20px, 3.5vw, 53px);
  margin-block: clamp(16px, 2.2vw, 32px) clamp(34px, 4vw, 64px);
  background: #f3f1e7;
  border-radius: 12px 38px 12px 12px;
}
.template-intro-copy {
  display: grid;
  justify-items: start;
  gap: clamp(14px, 1.6vw, 23px);
}
.template-intro h1 {
  margin: 0;
  color: #15284a;
  font-size: clamp(2.7rem, 5vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: -0.07em;
  font-weight: 560;
  text-wrap: balance;
}
.template-intro h1 em {
  display: block;
  color: #274eae;
  font:
    normal 1.15em / 0.93 "Instrument Serif",
    Georgia,
    serif;
  letter-spacing: -0.045em;
}
.template-intro p {
  max-inline-size: 45ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.55;
}
.template-highlights {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: end;
  gap: clamp(7px, 1.3vw, 19px);
}
.template-feature {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  min-inline-size: 0;
  aspect-ratio: 0.83;
  padding: clamp(10px, 1.3vw, 21px);
  overflow: hidden;
  border-radius: 8px 36px 8px 8px;
  color: white;
  background: #18392e;
  text-decoration: none;
}
.template-feature:first-child {
  margin-block-end: 15%;
}
.template-feature:last-child {
  border-radius: 42% 42% 8px 8px;
}
.template-feature::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, #121d27ed, transparent 75%);
}
.template-feature img {
  position: absolute;
  z-index: -2;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.template-feature > span {
  display: grid;
  line-height: 1.12;
  gap: 5px;
}
.template-feature small {
  font-weight: 580;
  font-size: clamp(0.76rem, 1.1vw, 0.9rem);
}
.template-feature strong {
  font:
    normal clamp(1.25rem, 2.2vw, 2.1rem) / 1 "Instrument Serif",
    Georgia,
    serif;
}
.template-feature > svg {
  flex: none;
  margin-block-end: 3px;
}
.template-feature:hover img {
  transform: scale(1.04);
}
html[data-catalogue-thumbnail],
html[data-catalogue-thumbnail] body {
  overflow: hidden;
  scrollbar-width: none;
}
html[data-catalogue-thumbnail] ::-webkit-scrollbar {
  display: none;
}
.template-section {
  scroll-margin-top: 100px;
  padding-block-end: clamp(60px, 9vw, 126px);
}
.template-section h2 {
  margin: 0 0 24px;
  color: var(--library-ink);
  font-size: clamp(1.9rem, 4vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 490;
}
.template-controls {
  display: grid;
  gap: 16px;
  margin-block-end: 18px;
}
@media (min-width: 1060px) {
  .templates-page .template-controls {
    grid-template-columns: auto minmax(0, 680px);
    align-items: end;
  }
  .templates-page .template-profile {
    align-self: end;
  }
  .templates-page .template-count {
    grid-column: 1 / -1;
  }
}
.template-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.template-profile button {
  padding: 8px 15px;
  border: 1px solid var(--library-border);
  border-radius: 100px;
  color: var(--library-ink);
  background: #fff;
  font: inherit;
  cursor: pointer;
}
.template-profile button[aria-pressed="true"] {
  border-color: var(--library-action);
  color: #fff;
  background: var(--library-action);
}
.template-search {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
  max-inline-size: 680px;
}
.template-search > div {
  display: grid;
  gap: 5px;
  min-inline-size: 0;
}
.template-search label {
  color: var(--library-ink);
  font-size: 0.86rem;
  font-weight: 560;
}
.template-search input,
.template-search select {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 9px 12px;
  border: 1px solid var(--library-border);
  border-radius: 8px;
  color: var(--library-ink);
  background: #fff;
  font: inherit;
  font-weight: 400;
}
.template-search select {
  appearance: none;
  padding-inline-end: 2.5rem;
}
.template-search > div:has(select) {
  position: relative;
}
.template-search > div:has(select)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset-inline-end: 1rem;
  inset-block-end: 19px;
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
.template-count {
  margin: 0;
  color: var(--library-muted);
  font-size: 0.84rem;
}
.template-count:empty {
  display: none;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.6vw, 30px);
}
.template-card {
  display: flex;
  min-inline-size: 0;
  flex-direction: column;
  padding: 7px;
  border: 1px solid var(--library-border);
  border-radius: 12px;
  color: var(--library-ink);
  background: #fff;
  transition: border-color 160ms ease;
}
.template-card:hover,
.template-card:focus-within {
  border-color: #b3a9df;
}
.template-card-body {
  display: flex;
  align-items: flex-start;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: clamp(13px, 1.55vw, 21px);
}
.template-sector {
  color: var(--library-muted);
  font-size: 0.76rem;
  font-weight: 570;
}
.template-card-body h3 {
  margin: 0;
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  font-weight: 610;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.template-card-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--library-muted);
  line-height: 1.55;
}
.template-features {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}
.template-features li {
  padding: 4px 8px;
  border-radius: 5px;
  color: #433a5f;
  background: #f3f0f9;
  font-size: 0.73rem;
  line-height: 1.25;
}
.template-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 12px;
  inline-size: 100%;
  margin-block-start: auto;
  padding-block-start: 9px;
}
.template-actions a {
  color: var(--library-action);
  font-size: 0.84rem;
  font-weight: 620;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.template-demo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.template-visual {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border: 1px solid #22202d1c;
  border-radius: 11px;
}
.template-cover {
  position: relative;
  overflow: clip;
  aspect-ratio: 14 / 11;
  background: var(--template-page, #f3f0fa);
}
.template-cover img,
.template-cover iframe {
  position: absolute;
  inset: 0;
  display: block;
  border: 0;
  pointer-events: none;
}
.template-cover img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.template-cover iframe {
  transform: scale(var(--cover-scale));
  transform-origin: top left;
  opacity: 0;
}
.template-cover:where([data-cover-ready]) iframe {
  opacity: 1;
}
.template-preview-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-block-size: 39px;
  padding: 7px 11px;
  border-block-start: 1px solid #21182e13;
  color: var(--library-muted);
  background: #f8f7fb;
  font-size: 0.74rem;
  line-height: 1.25;
  text-decoration: none;
}
.template-preview-link::after {
  position: absolute;
  inset: 0;
  content: "";
}
.template-preview-link:focus-visible {
  outline-offset: -3px;
}
.template-preview-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 4px;
  color: var(--library-ink);
  font-weight: 640;
  text-align: end;
}
.template-preview-link:hover .template-preview-badge {
  color: var(--library-action);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.template-recommend {
  margin-block-end: 20px;
}
.intake-template-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.intake-template-card:has(input:checked) {
  border-color: var(--library-action);
  box-shadow: 0 0 0 1px var(--library-action);
}
.template-radio {
  display: flex;
  gap: 8px;
  flex: 1;
  padding: 11px 6px 7px;
  cursor: pointer;
}
.template-radio > input {
  flex-shrink: 0;
  inline-size: 18px;
  block-size: 18px;
  margin: 2px 0 0;
  accent-color: var(--library-action);
}
.template-radio-copy {
  display: grid;
  gap: 4px;
}
.template-radio-copy small {
  color: var(--library-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.template-more {
  margin-block: 16px 0;
}
.intake-template-library + .field {
  margin-block-start: 24px;
}
.template-preview-page {
  --template-preview-action-space: calc(76px + env(safe-area-inset-bottom));
  padding-block-end: var(--template-preview-action-space);
}
.template-preview-heading {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.template-preview-bar {
  position: fixed;
  z-index: 100000;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px clamp(14px, 3vw, 40px) calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid #e1ddeb;
  color: #191529;
  background: #fff;
  font:
    500 0.93rem / 1.2 system-ui,
    sans-serif;
}
.template-preview-name {
  text-align: center;
}
.template-preview-bar a {
  justify-self: start;
  padding: 8px 9px;
  color: #4534c5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.template-preview-bar a:last-child {
  justify-self: end;
  border-radius: 8px;
  padding-inline: 12px;
  background: #4534c5;
  color: #fff;
  text-decoration: none;
}
@media (max-width: 940px) {
  .templates-page .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .template-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-highlights {
    width: 100%;
    grid-template-columns: 1.1fr 1fr;
  }
  .template-feature {
    aspect-ratio: 1.3;
  }
  .template-feature:first-child {
    margin-block-end: 3%;
  }
}
@media (max-width: 540px) {
  .template-intro h1 {
    font-size: clamp(2.1rem, 10vw, 3.3rem);
  }
  .template-grid,
  .templates-page .template-grid {
    grid-template-columns: 1fr;
  }
  .template-search {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-preview-bar {
    grid-template-columns: 1fr 1fr;
    font-size: 0.82rem;
  }
  .template-preview-name {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .template-card,
  .template-feature img {
    transition: none;
  }
}

.intake-panel legend {
  scroll-margin-block-start: 88px;
}
@media (max-width: 480px) {
  .intake-steps button {
    justify-content: center;
    min-block-size: 40px;
  }
  .intake-steps .step-name {
    display: none;
  }
}

html:has(.template-reader) {
  scrollbar-gutter: stable;
}
html:has(.template-reader[open]) {
  overflow: hidden;
}
.template-reader {
  inline-size: min(1440px, calc(100% - 32px));
  block-size: min(900px, calc(100dvh - 32px));
  max-inline-size: none;
  max-block-size: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e4def1;
  border-radius: 20px;
  color: #191529;
  background: #fff;
  box-shadow: 0 24px 100px rgb(21 13 48 / 0.29);
}
.template-reader::backdrop {
  background: rgb(24 18 46 / 0.64);
}
.template-reader-sheet {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  block-size: 100%;
}
.template-reader-header,
.template-reader-footer {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 2vw, 28px);
}
.template-reader-header {
  grid-template-columns: minmax(0, 1fr) auto 44px;
  border-bottom: 1px solid #e7e1f0;
}
.template-reader-header p,
.template-reader-footer p {
  margin: 0;
  color: #58536b;
  font-size: 0.82rem;
}
.template-reader-header h2 {
  margin: 2px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.65rem);
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.template-reader-devices {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f0edf8;
}
.template-reader-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px clamp(10px, 2vw, 28px);
  border-block-end: 1px solid #e7e1f0;
  background: #faf9fc;
}
.template-reader-devices button,
.template-reader-pages button,
.template-reader-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #373147;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.template-reader-close {
  inline-size: 44px;
  block-size: 44px;
  border-color: #e6dff1;
}
.template-reader-devices button[aria-pressed="true"],
.template-reader-pages button[aria-pressed="true"],
.template-reader-close:hover {
  border-color: #e2dbf1;
  color: #4534c5;
  background: #fff;
}
.template-reader-pages button:hover {
  color: #4534c5;
  background: #f0edf8;
}
.template-reader-pages button[hidden] {
  display: none;
}
.template-reader-stage {
  display: grid;
  place-items: stretch center;
  overflow: hidden;
  min-block-size: 0;
  background: #eeeaf7;
}
.template-reader-stage iframe {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  background: #fff;
}
.template-reader-stage[data-device="phone"] {
  padding-inline: 8px;
}
.template-reader-stage[data-device="phone"] iframe {
  inline-size: min(100%, 390px);
  box-shadow: 0 0 24px rgb(41 24 85 / 0.14);
}
.template-reader-footer {
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid #e7e1f0;
}
.template-reader-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 20px;
}
.template-reader-actions a:not(.button) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4534c5;
  font-size: 0.83rem;
  font-weight: 550;
  text-underline-offset: 3px;
}
.template-reader-actions .button {
  min-block-size: 42px;
  padding-block: 9px;
  font-size: 0.86rem;
}
html:has(.template-frame-page) {
  overscroll-behavior: contain;
}
@media (max-width: 720px) {
  .template-reader {
    inline-size: 100%;
    block-size: 100dvh;
    max-inline-size: 100vw;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .template-reader-header {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    padding: max(5px, env(safe-area-inset-top)) 12px 5px;
  }
  .template-reader-header p {
    display: none;
  }
  .template-reader-pages {
    padding-block: 3px;
  }
  .template-reader-pages button {
    flex: 1 1 auto;
    min-block-size: 42px;
    padding-inline: 5px;
  }
  .template-reader-devices,
  .template-reader-footer p {
    display: none;
  }
  .template-reader-footer {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 6px max(6px, env(safe-area-inset-bottom));
  }
  .template-reader-actions {
    gap: 9px;
  }
  .template-reader-actions a:not(.button) {
    inline-size: 44px;
    min-block-size: 44px;
    flex: 0 0 auto;
    justify-content: center;
    border: 1px solid #e4def1;
    border-radius: 8px;
  }
  .template-reader-actions a:not(.button) span {
    display: none;
  }
  .template-reader-actions .button {
    flex: 1 1 auto;
    justify-content: center;
    min-block-size: 44px;
  }
  .template-reader-stage[data-device="phone"] {
    padding-inline: 0;
  }
  .template-reader-stage[data-device="phone"] iframe {
    box-shadow: none;
  }
}

[data-template-style="clear"]{--template-page:#f6f6f3}
[data-template-style="editorial"]{--template-page:#f7f3ea}
[data-template-style="bold"]{--template-page:#101728}
[data-template-style="warm"]{--template-page:#fff8f2}
[data-template-style="search-retail"]{--template-page:#ffffff}
[data-template-style="quiet-catalogue"]{--template-page:#f4f4f2}
[data-template-style="premium-shop"]{--template-page:#0e0c0a}
[data-template-style="industrial"]{--template-page:#f2efe6}
[data-template-style="service"]{--template-page:#f8fafc}
[data-template-style="photographic"]{--template-page:#f3f1ea}
[data-template-style="cinematic"]{--template-page:#0b0b0c}
[data-template-style="corporate"]{--template-page:#f5f7fa}
[data-template-style="recruitment-2026"]{--template-page:#f5f3ec}
[data-template-style="recruitment-monochrome-2026"]{--template-page:#ffffff}
[data-template-style="aurora-glass"]{--template-page:#f4f3fb}
[data-template-style="kinetic-type"]{--template-page:#efede6}
[data-template-style="bento-studio"]{--template-page:#f2f2ef}
[data-template-style="organic-morph"]{--template-page:#f6efe9}
[data-template-style="retro-chrome"]{--template-page:#e8eaef}
[data-template-style="playful-pop"]{--template-page:#fff6e5}
[data-template-style="sunlit-arches"]{--template-page:#f4ebdc}
[data-template-style="blueprint"]{--template-page:#eef2f6}
[data-template-style="riso-print"]{--template-page:#f3eee3}
[data-template-style="velocity"]{--template-page:#ffffff}
[data-template-style="restaurant-orderpad"]{--template-page:#faf3e5}
[data-template-style="automotive-instrument"]{--template-page:#f0f1ed}
[data-template-style="care-pathways"]{--template-page:#f7faf6}
[data-template-style="learning-notebook"]{--template-page:#fffdf4}
[data-template-style="finance-ledger"]{--template-page:#f7f8f1}
[data-template-style="property-panorama"]{--template-page:#f7f3ef}
[data-template-style="fitness-pulse"]{--template-page:#f4f5ef}
[data-template-style="travel-horizon"]{--template-page:#f2f8f4}
[data-template-style="culture-playbill"]{--template-page:#fbf0dc}
[data-template-style="energy-grid"]{--template-page:#f5f8fd}
[data-template-style="community-circle"]{--template-page:#fcf4e8}
[data-template-style="garden-almanac"]{--template-page:#f5f3e7}
[data-template-style="agency-lettered"]{--template-page:#f5f4ed}
[data-template-style="celebration-vow"]{--template-page:#fcf7ef}
[data-template-style="media-edition"]{--template-page:#faf3e5}
[data-template-style="security-watch"]{--template-page:#faf3e5}
[data-template-style="kitchen-pantry"]{--template-page:#fff4df}
[data-template-style="fashion-studio"]{--template-page:#faf8f4}
[data-template-style="beauty-ritual"]{--template-page:#fbf1ee}
[data-template-style="pet-companion"]{--template-page:#faf5e7}
[data-template-style="family-playroom"]{--template-page:#fff4dd}
[data-template-style="electronics-signal"]{--template-page:#f4f7fc}
[data-template-style="grocer-market"]{--template-page:#faf7e9}
[data-template-style="building-yard"]{--template-page:#f4f1e9}
[data-template-style="sport-club"]{--template-page:#f7f4ee}
[data-template-style="wedding-keepsake"]{--template-page:#faf7ef}
[data-template-style="cycle-commute"]{--template-page:#f3f3eb}
[data-template-style="solar-roofshop"]{--template-page:#edf1f0}
[data-template-style="occasion-giftcards"]{--template-page:#fff3e8}
[data-template-style="houseplant-room"]{--template-page:#f5f5e9}
[data-template-style="fashion-workwear"]{--template-page:#f2eee6}
[data-template-style="perfume-notes"]{--template-page:#f3eff8}
[data-template-style="cookware-pans"]{--template-page:#f5eee2}
[data-template-style="luw-energie"]{--template-page:#fbf8f0}
[data-template-style="buitentekst"]{--template-page:#f7f2e8}
[data-template-style="zichtwerk"]{--template-page:#faf7f0}