.templates-page {
  --template-bg: #ffffff;
  --template-surface: #f7f7f5;
  --template-ink: #20211f;
  --template-muted: #646762;
  --template-line: #e5e6e1;
  --template-orange: #ea4325;
  --template-peach: #fff1e9;
  --template-soft: #fff9f5;
  color: var(--template-ink);
}

html.dark .templates-page {
  --template-bg: #0b0d12;
  --template-surface: #181d26;
  --template-ink: #f2f1ed;
  --template-muted: #a9aea9;
  --template-line: #2b303a;
  --template-orange: #ff795a;
  --template-peach: #271b19;
  --template-soft: #171519;
}

.templates-page [hidden] { display: none !important; }
.templates-page *, .templates-page *::before, .templates-page *::after { box-sizing: border-box; }
:where(.templates-main, .template-preview-dialog) :is(h1, h2, h3, p) { margin: 0; }
.templates-page a:focus-visible, .templates-page button:focus-visible, .templates-page input:focus-visible { outline: 3px solid var(--template-orange); outline-offset: 4px; }
.templates-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.templates-skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; padding: 12px 18px; background: var(--template-bg); color: var(--template-ink); border-radius: 8px; transform: translateY(-180%); }
.templates-skip-link:focus { transform: translateY(0); }
.templates-main { max-width: 1480px; margin: 0 auto; padding: 24px 36px 0; }
.templates-eyebrow { color: var(--template-orange); font-size: 11px; font-weight: 700; letter-spacing: .14em; line-height: 1.5; }
.templates-eyebrow > span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.templates-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; min-height: 455px; padding: 62px 54px 46px; border: 1px solid var(--template-line); border-radius: 28px; background: var(--template-soft); overflow: hidden; }
.templates-hero-copy { position: relative; z-index: 2; align-self: center; }
.templates-hero h1 { margin: 20px 0 0; color: var(--template-ink); font-size: clamp(36px, 3.8vw, 57px); font-weight: 700; line-height: 1.12; letter-spacing: -.055em; }
.templates-hero h1 em { color: var(--template-orange); font-style: normal; }
.templates-hero-description { max-width: 440px; margin-top: 22px; color: var(--template-muted); font-size: 15px; line-height: 1.75; }
.templates-hero-link { display: inline-flex; align-items: center; gap: 28px; margin-top: 28px; border-radius: 11px; background: #ea4325; color: #fff; padding: 13px 20px; font-size: 14px; font-weight: 700; transition: background .2s, transform .2s; }
.templates-hero-link:hover { background: #d63a1f; transform: translateY(-2px); }
.templates-hero-link > span { font-size: 20px; line-height: 1; }
.templates-document { scroll-padding-top: 110px; scroll-behavior: auto; }
.templates-toolbar button, #templateSearch { scroll-margin-top: 110px; }
.templates-hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 28px; }
.templates-hero-actions .templates-hero-link { margin-top: 0; }
.templates-editor-link { color: var(--template-ink); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.templates-hero-included { display: flex; align-items: center; gap: 6px; color: var(--template-muted); margin-top: 18px; font-size: 11px; }
.templates-hero-included svg { color: var(--template-orange); width: 17px; height: 17px; flex-shrink: 0; }
.templates-hero-art { position: relative; min-width: 0; align-self: center; height: 333px; }
.templates-hero-art::before { content: ''; position: absolute; inset: -5px 0 -12px 22px; border-radius: 50%; background: var(--template-peach); }
.hero-design { position: absolute; overflow: hidden; border-radius: 12px; background: var(--template-bg); border: 1px solid var(--template-line); box-shadow: 0 18px 38px -12px #4b292c30; }
.hero-design img { width: 100%; height: auto; display: block; }
.hero-design-back { width: 85%; top: 3px; right: -13px; transform: rotate(6deg); }
.hero-design-front { width: 90%; left: -9px; top: 103px; transform: rotate(-5deg); }
.hero-browser { display: flex; align-items: center; gap: 4px; height: 25px; padding: 0 10px; color: var(--template-muted); background: var(--template-bg); }
.hero-browser i { display: block; width: 4px; height: 4px; border-radius: 50%; background: #b7b5b1; }
.hero-browser span { flex: 1; text-align: center; font-size: 7px; letter-spacing: .05em; }
.hero-design-note { position: absolute; right: -15px; bottom: -7px; display: grid; padding: 17px 22px; border-radius: 12px; color: #fff; background: #ea4325; box-shadow: 0 10px 30px #ea432528; transform: rotate(7deg); }
.hero-design-note span { font-size: 10px; opacity: .9; }
.hero-design-note strong { padding-right: 28px; font-size: 16px; letter-spacing: -.02em; }
.hero-design-note svg { position: absolute; right: 10px; top: 24px; width: 30px; height: 30px; }
.hero-art-spark { position: absolute; left: -10px; top: 14px; color: var(--template-orange); font-size: 62px; line-height: 1; }
.templates-collection { padding: 64px 10px 0; scroll-margin-top: 94px; }
.templates-collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.templates-collection-heading h2 { margin-top: 9px; font-size: clamp(25px, 2.5vw, 35px); line-height: 1.2; font-weight: 700; letter-spacing: -.045em; color: var(--template-ink); }
.templates-collection-heading > p { color: var(--template-muted); font-size: 12px; line-height: 1.8; text-align: right; padding-bottom: 2px; }
.templates-toolbar { display: flex; gap: 20px; justify-content: space-between; align-items: center; margin-top: 30px; padding: 16px 0; border-top: 1px solid var(--template-line); border-bottom: 1px solid var(--template-line); }
.templates-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.templates-filters button { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-size: 12px; font-weight: 600; color: var(--template-muted); transition: background .2s, color .2s; }
.templates-filters button:hover { background: var(--template-surface); color: var(--template-ink); }
.templates-filters button[aria-pressed="true"] { background: var(--template-ink); color: var(--template-bg); }
.templates-search { position: relative; flex: 0 1 250px; min-width: 150px; }
.templates-search svg { position: absolute; width: 17px; height: 17px; top: 12px; left: 12px; color: var(--template-muted); pointer-events: none; }
.templates-search input { width: 100%; border: 1px solid var(--template-line); border-radius: 9px; background: var(--template-bg); color: var(--template-ink); font-family: inherit; font-size: 12px; padding: 11px 10px 11px 37px; }
.templates-search input::placeholder { color: var(--template-muted); }
.templates-result-count { min-height: 16px; margin: 18px 0 20px; font-size: 11px; color: var(--template-muted); }
.templates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; row-gap: 32px; }
.template-card { min-width: 0; overflow: hidden; border: 1px solid var(--template-line); border-radius: 17px; background: var(--template-bg); transition: border-color .2s, box-shadow .2s, transform .2s; }
.template-card:hover { transform: translateY(-4px); border-color: var(--template-orange); box-shadow: 0 15px 30px -17px #262e392e; }
.template-card-image-stage { background: var(--template-surface); padding: 19px 19px 0; }
.template-browser-frame { overflow: hidden; border: 1px solid #00000014; border-bottom: 0; border-radius: 9px 9px 0 0; box-shadow: 0 6px 18px #00000008; }
.template-browser-bar { height: 28px; display: flex; gap: 5px; align-items: center; background: var(--template-bg); padding: 0 10px; border-bottom: 1px solid var(--template-line); }
.template-browser-bar i { width: 5px; height: 5px; border-radius: 50%; background: var(--template-line); }
.template-browser-bar span { flex: 1; text-align: center; font-size: 8px; color: var(--template-muted); letter-spacing: .06em; padding-right: 25px; }
.template-card-image { display: block; aspect-ratio: 1600 / 822; object-fit: cover; object-position: top; width: 100%; transition: transform .35s; }
.template-card:hover .template-card-image { transform: scale(1.018); }
.template-card-body { position: relative; padding: 23px 25px 22px; background: var(--template-bg); }
.template-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.template-category { font-size: 10px; letter-spacing: .09em; font-weight: 600; color: var(--template-muted); text-transform: uppercase; }
.template-preview-kind { font-size: 9px; color: var(--template-muted); }
.template-preview-kind::before { content: ''; display: inline-block; height: 5px; width: 5px; background: #509c69; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.template-preview-kind.is-screenshot::before { background: #c5a271; }
.template-card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.template-card h3 { font-weight: 700; font-size: 24px; line-height: 1.3; letter-spacing: -.035em; color: var(--template-ink); }
.template-card-price { flex-shrink: 0; text-align: right; }
.template-card-price strong { display: block; font-size: 21px; line-height: 1.5; font-weight: 700; letter-spacing: -.03em; color: var(--template-ink); }
.template-card-price > span { display: block; font-size: 9px; color: var(--template-muted); }
.template-card-description { color: var(--template-muted); font-size: 12px; line-height: 1.7; margin-top: 10px; min-height: 41px; }
.template-card-included { display: flex; align-items: center; gap: 6px; padding: 16px 0; margin-top: 4px; font-size: 10px; color: var(--template-muted); }
.template-card-included svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--template-orange); }
.template-card-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.template-preview-button, .template-buy-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 11px 14px; border-radius: 9px; font-size: 12px; font-weight: 600; transition: background .2s, border-color .2s; }
.template-preview-button { border: 1px solid var(--template-line); color: var(--template-ink); background: var(--template-bg); }
.template-preview-button:hover { background: var(--template-surface); border-color: var(--template-muted); }
.template-preview-button svg { width: 14px; height: 14px; }
.template-buy-button { border: 1px solid #ea4325; background: #ea4325; color: #fff; }
.template-buy-button:hover { background: #d63a1f; border-color: #d63a1f; }
.template-buy-button:disabled { opacity: .5; cursor: not-allowed; }
.templates-status { grid-column: 1 / -1; min-height: 230px; text-align: center; padding: 50px 24px; border: 1px dashed var(--template-line); background: var(--template-surface); border-radius: 16px; }
.templates-status h3 { font-size: 20px; font-weight: 600; color: var(--template-ink); }
.templates-status p { margin-top: 8px; color: var(--template-muted); font-size: 13px; }
.templates-status button { margin-top: 20px; padding: 10px 18px; border-radius: 8px; background: var(--template-ink); color: var(--template-bg); font-weight: 600; font-size: 12px; }
.templates-loading-mark { display: inline-block; width: 24px; height: 24px; border: 2px solid var(--template-line); border-top-color: var(--template-orange); border-radius: 50%; margin-bottom: 18px; animation: templates-spin .8s linear infinite; }
@keyframes templates-spin { to { transform: rotate(360deg); } }
.templates-action-error { padding: 16px; color: var(--template-orange); border: 1px solid var(--template-orange); border-radius: 9px; font-size: 13px; margin-bottom: 20px; }
.templates-test-notice { padding: 18px 22px; margin-bottom: 24px; background: var(--template-peach); color: var(--template-ink); border: 1px solid var(--template-line); border-radius: 12px; font-size: 13px; line-height: 1.7; }
.templates-test-notice strong { display: block; font-weight: 600; margin-bottom: 3px; }
.templates-fulfillment { display: flex; align-items: center; gap: 22px; padding: 32px 35px; margin: 52px 10px 24px; background: var(--template-soft); border: 1px solid var(--template-line); border-radius: 17px; }
.templates-fulfillment-icon { width: 52px; height: 52px; flex-shrink: 0; display: grid; place-items: center; background: var(--template-peach); border-radius: 12px; color: var(--template-orange); }
.templates-fulfillment-icon svg { width: 32px; height: 32px; }
.templates-fulfillment > div:nth-child(2) { flex: 1; }
.templates-fulfillment h2 { color: var(--template-ink); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.templates-fulfillment p { max-width: 580px; color: var(--template-muted); font-size: 12px; line-height: 1.8; margin-top: 8px; }
.templates-fulfillment > a { flex-shrink: 0; color: var(--template-orange); font-size: 12px; font-weight: 600; }
.templates-fulfillment > a span { margin-left: 10px; }
.template-preview-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow-y: auto; color: var(--template-ink); background: var(--template-bg); border: 1px solid var(--template-line); border-radius: 18px; box-shadow: 0 30px 80px #00000050; }
.template-preview-dialog::backdrop { background: #10131bd4; backdrop-filter: blur(5px); }
.template-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 26px 15px; }
.template-preview-heading h2 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; }
.template-preview-close { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--template-surface); color: var(--template-ink); }
.template-preview-close svg { width: 19px; height: 19px; }
.template-preview-notice { margin: 0 26px 20px; padding: 12px 15px; background: var(--template-peach); color: var(--template-ink); font-size: 12px; border-radius: 8px; line-height: 1.6; }
.template-preview-image-wrap { margin: 0 26px; border: 1px solid var(--template-line); border-radius: 10px; overflow: hidden; background: var(--template-surface); }
.template-preview-image-wrap img { display: block; width: 100%; height: auto; }
.template-preview-caption { padding: 19px 26px 24px; color: var(--template-muted); font-size: 11px; }

@media (min-width: 1600px) { .templates-hero { min-height: 490px; } }
@media (max-width: 1100px) {
  .templates-main { padding: 22px 24px 0; }
  .templates-hero { padding: 46px 34px; gap: 25px; min-height: 420px; }
  .templates-hero-art { height: 280px; }
  .hero-design-front { top: 88px; }
  .hero-design-note { bottom: 6px; right: -6px; padding: 12px 16px; }
  .hero-design-note strong { font-size: 13px; }
  .hero-design-note svg { top: 16px; }
  .templates-hero h1 { font-size: 40px; }
  .templates-fulfillment { padding: 26px; gap: 17px; }
  .templates-fulfillment > a { max-width: 100px; }
  .templates-page header > div > nav { gap: 20px; font-size: 13px; }
}
@media (max-width: 1000px) {
  .templates-page header > div > nav { display: none; }
  .templates-page #menuBtn { display: flex; }
  .templates-page #mobileNav:not(.hidden) { display: block; }
}
@media (max-width: 760px) {
  .templates-main { padding: 16px 18px 0; }
  .templates-hero { grid-template-columns: 1fr; gap: 27px; padding: 35px 26px 28px; border-radius: 20px; }
  .templates-hero h1 { font-size: clamp(34px, 6.3vw, 45px); }
  .templates-hero-description { max-width: 490px; font-size: 14px; }
  .templates-hero-art { width: min(450px, 95%); height: 300px; justify-self: center; }
  .hero-design-front { top: 90px; }
  .hero-design-note { bottom: 2px; right: -8px; padding: 15px 20px; }
  .hero-design-note strong { font-size: 15px; }
  .templates-collection { padding: 42px 0 0; }
  .templates-collection-heading > p { display: none; }
  .templates-toolbar { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 24px; }
  .templates-search { flex: auto; }
  .templates-filters { gap: 4px; }
  .templates-filters button { padding: 8px 10px; }
  .templates-grid { gap: 22px; grid-template-columns: 1fr; }
  .template-card-image-stage { padding: 15px 15px 0; }
  .template-card-body { padding: 20px; }
  .templates-fulfillment { margin: 36px 0 15px; padding: 24px; flex-wrap: wrap; align-items: flex-start; gap: 16px; }
  .templates-fulfillment > div:nth-child(2) { flex-basis: calc(100% - 68px); }
  .templates-fulfillment > a { max-width: none; margin-left: 68px; }
  .templates-fulfillment h2 { font-size: 17px; }
}
@media (max-width: 430px) {
  .templates-main { padding: 12px 14px 0; }
  .templates-hero { padding: 30px 22px 22px; gap: 25px; }
  .templates-hero .templates-eyebrow { font-size: 9px; letter-spacing: .1em; }
  .templates-hero h1 { font-size: 35px; }
  .templates-hero-art { height: 225px; }
  .hero-design-front { left: -4px; top: 78px; }
  .hero-design-back { right: -4px; }
  .hero-design-note { bottom: -3px; right: -5px; padding: 11px 14px; }
  .hero-design-note strong { font-size: 12px; }
  .hero-design-note span { font-size: 8px; }
  .hero-design-note svg { top: 13px; width: 25px; height: 25px; }
  .hero-art-spark { font-size: 44px; }
  .templates-filters button { padding: 8px 9px; font-size: 11px; }
  .template-card-body { padding: 19px 18px; }
  .template-card h3 { font-size: 22px; }
  .template-card-price strong { font-size: 20px; }
  .templates-fulfillment { padding: 22px 19px; }
  .templates-fulfillment-icon { width: 40px; height: 40px; }
  .templates-fulfillment-icon svg { width: 26px; height: 26px; }
  .templates-fulfillment > div:nth-child(2) { flex-basis: calc(100% - 56px); }
  .templates-fulfillment > a { margin-left: 56px; }
  .template-preview-heading { padding: 20px 18px 15px; }
  .template-preview-heading h2 { font-size: 21px; }
  .template-preview-notice { margin: 0 18px 16px; }
  .template-preview-image-wrap { margin: 0 18px; }
  .template-preview-caption { padding: 16px 18px 20px; }
  .templates-page header > div { padding-right: 10px; padding-left: 12px; }
  .templates-page header #authNavGuest > a { padding-right: 7px; padding-left: 7px; }
  .templates-page header #authNavGuest { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .templates-loading-mark { animation: none; }
  .template-card:hover, .template-card:hover .template-card-image, .templates-hero-link:hover { transform: none; }
}
