.templates-page .page-title { align-items: center; gap: 24px; }
.templates-page .page-title p:not(.eyebrow) { color: var(--muted, #6c727f); font-size: 16px; line-height: 1.7; margin-top: 14px; }
.gallery-controls { border: 1px solid var(--border, #e5e7eb); border-radius: 18px; padding: 22px; background: var(--surface, #fff); margin: 32px 0 20px; }
.gallery-filter-row { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 22px; }
.gallery-filter-row label { display: grid; gap: 9px; font-size: 12px; font-weight: 600; }
.gallery-filter-row input, .gallery-filter-row select { min-width: 0; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border,#d9dde4); background: var(--surface,#fff); color: inherit; font: inherit; font-size: 14px; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.theme-swatches button { display: grid; place-items: center; min-height: 44px; width: 44px; border: 2px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; }
.theme-swatches button[aria-pressed=true] { border-color: var(--coral,#ed5167); }
.theme-swatches span { display: grid; place-items: center; border: 5px solid; border-radius: 50%; width: 28px; height: 28px; }
.theme-swatches i { width: 7px; height: 7px; border-radius: 50%; }
.gallery-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 13px; }
.gallery-summary > span { color: var(--muted,#6c727f); }
.original-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
.original-template { min-width: 0; background: var(--surface,#fff); border: 1px solid var(--border,#e5e7eb); border-radius: 16px; overflow: hidden; }
.template-image-button { display: block; border: 0; background: #eff0f3; width: 100%; padding: 24px 28px; cursor: zoom-in; overflow: hidden; }
.template-image-button img { display: block; width: 100%; height: auto; aspect-ratio: 210/297; object-fit: contain; object-position: top; box-shadow: 0 6px 22px #2533471a; transition: transform .22s; }
.template-image-button:hover img { transform: translateY(-4px); }
.original-template-copy { padding: 22px; }
.original-template-copy h2 { font-size: 22px; margin: 8px 0; }
.original-template-copy > p:not(.eyebrow) { font-size: 14px; color: var(--muted,#6c727f); line-height: 1.6; min-height: 45px; margin-bottom: 18px; }
.original-template-copy .primary { width: 100%; justify-content: center; }
.gallery-footnote { margin: 28px 0; font-size: 13px; line-height: 1.8; color: var(--muted,#6c727f); }
#template-detail { width: min(860px,calc(100vw - 28px)); max-height: calc(100dvh - 36px); border: 1px solid var(--border,#e5e7eb); border-radius: 18px; padding: 0; color: inherit; background: var(--surface,#fff); }
#template-detail::backdrop { background: #162132a8; backdrop-filter: blur(4px); }
.template-detail-heading, .template-detail-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 24px; }
.template-detail-heading { position: sticky; top: 0; background: var(--surface,#fff); border-bottom: 1px solid var(--border,#e5e7eb); z-index: 1; }
.template-detail-heading h2 { margin: 5px 0 0; }
#detail-image, .detail-extra-image { display: block; max-width: calc(100% - 48px); width: 600px; height: auto; margin: 24px auto; box-shadow: 0 8px 30px #172b431f; }
.template-detail-footer { position: sticky; bottom: 0; background: var(--surface,#fff); border-top: 1px solid var(--border,#e5e7eb); }
.template-detail-footer p { font-size: 13px; line-height: 1.6; flex: 1; }
.template-detail-footer .primary { flex-shrink: 0; }
.design-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.design-heading a { font-size: 12px; }
.design-intent { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 16px 20px; border: 1px solid #ed516760; border-radius: 12px; background: #ed516709; margin: 14px 0; line-height: 1.6; }
#design-ordering { margin-top: 12px; line-height: 1.6; }
.section-lane { color: var(--muted,#6c727f); font-size: 12px; margin: 0 0 10px; }
.template-preview-shell { width: 100%; overflow: auto; min-height: 100px; border: 1px solid var(--border,#e5e7eb); background: #e9eaee; border-radius: 5px; }
#preview-canvas { position: relative; }
#resume-frame { display: block; border: 0; position: absolute; top: 0; left: 0; transform-origin: top left; background: white; color-scheme: light; }
.preview-zoom-label { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-left: auto; }
#preview-zoom { border: 1px solid var(--border,#d9dde4); border-radius: 6px; padding: 8px; min-height: 36px; background: var(--surface,#fff); color: inherit; }
.preview-toolbar { flex-wrap: wrap; gap: 10px; }
.dark .gallery-controls, .dark .original-template, .dark #template-detail, .dark .template-detail-heading, .dark .template-detail-footer { background: #1a202c; border-color: #333d4c; }
.dark .gallery-filter-row input, .dark .gallery-filter-row select, .dark #preview-zoom { background: #222c3a; color: #eee; border-color: #465163; }
.dark .template-image-button, .dark .template-preview-shell { background: #111824; }
.dark .templates-page .page-title p:not(.eyebrow), .dark .original-template-copy > p:not(.eyebrow), .dark .gallery-footnote, .dark .gallery-summary > span { color: #aeb9cb; }
@media(max-width:1100px) { .original-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; } }
@media(max-width:600px) { .gallery-filter-row { grid-template-columns: 1fr; gap: 15px; } .gallery-controls { padding: 16px; margin-top: 22px; } .original-gallery { grid-template-columns: 1fr; } .gallery-summary { align-items: flex-start; flex-direction: column; gap: 5px; } .templates-page .page-title { align-items: flex-start; flex-direction: column; } .original-template-copy > p:not(.eyebrow) { min-height: 0; } .template-image-button { padding: 22px 32px; } .template-detail-heading,.template-detail-footer { padding: 14px 16px; } .template-detail-footer { flex-direction: column; align-items: stretch; gap: 10px; } #detail-image, .detail-extra-image { max-width: calc(100% - 24px); margin: 12px auto; } .design-heading, .design-intent { align-items: flex-start; flex-direction: column; } .preview-toolbar { font-size: 10px; } }
@media(prefers-reduced-motion:reduce) { .template-image-button img { transition: none; } }

.section-actions button { min-height: 44px; }

#pdf-pages { max-width: 100%; overflow-x: auto; }
#pdf-pages figure { max-width: none; }
@media(max-width:900px) { .editor-panel, .editor-preview { scroll-margin-top: 145px; } }
@media(max-width:600px) { .theme-swatches { flex-wrap: nowrap; overflow-x: auto; padding: 4px 0; } .theme-swatches button { flex-shrink: 0; } }
