body[data-content-page=templates] .content-main>header{display:flex;align-items:center;gap:24px;margin:0 0 28px;padding:0;border:0;background:transparent}
body[data-content-page=templates] .content-main>header>div{min-width:0;flex:1}
body[data-content-page=templates] .content-main>header>a{display:inline-flex;align-items:center;min-height:44px;font-size:14px;flex-shrink:0;color:#173f73}
body[data-content-page=templates] p{color:#355a85}
body[data-content-page=templates] .content-main>header p{font-size:14px}
body[data-content-page=templates] .filters{gap:8px;margin-bottom:28px;padding-bottom:18px;border-bottom:1px solid #173f7326}
body[data-content-page=templates] .filters button{min-height:44px;border-radius:12px;border:1px solid #173f7338;color:#173f73;background:#fffdf7;padding:8px 16px}
body[data-content-page=templates] .filters button[aria-pressed=true]{color:#173f73;background:#f2dce4;border-color:#bd8c9f}
body[data-content-page=templates] .theme{margin-bottom:36px}
body[data-content-page=templates] .theme h2{font-size:28px;color:#173f73}
body[data-content-page=templates] .description{font-size:13px}
body[data-content-page=templates] .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
body[data-content-page=templates] .card{border:1px solid #dfcbd1;border-radius:16px;background:#fffaf0;box-shadow:none;min-width:0}
body[data-content-page=templates] .card img{height:auto;aspect-ratio:1;object-fit:contain;padding:12px;background:#f8eaf0}
body[data-content-page=templates] .card:nth-child(3n+2) img{background:#f8eaf0}
body[data-content-page=templates] .card:nth-child(3n+3) img{background:#f8eaf0}
body[data-content-page=templates] .caption{padding:14px}
body[data-content-page=templates] .caption h3{font-size:17px;line-height:1.5;color:#173f73}
body[data-content-page=templates] .source{display:block;width:max-content;max-width:100%;margin:6px 0 0;font-size:11px;border-radius:4px}
body[data-content-page=templates] .edit{display:flex;align-items:center;justify-content:center;min-height:44px;border-radius:12px;border-color:#bd8c9f;background:#f2dce4;color:#173f73;font-size:14px;line-height:1.4;text-align:center;padding:8px}
body[data-content-page=templates] .edit:hover{background:#ead2dc}
body[data-content-page=templates] .note{font-size:13px;border-top:1px solid #173f7326;padding-top:20px}
@media(max-width:799px){body[data-content-page=templates] .content-main>header{display:block;margin-bottom:20px}body[data-content-page=templates] .content-main>header>a{margin-top:8px}body[data-content-page=templates] .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}body[data-content-page=templates] .caption{padding:10px}body[data-content-page=templates] .caption h3{font-size:15px}body[data-content-page=templates] .edit{font-size:13px}body[data-content-page=templates] .filters{flex-wrap:nowrap;overflow:auto;padding:4px 4px 16px}body[data-content-page=templates] .filters button{white-space:nowrap;padding:8px 12px;flex-shrink:0}body[data-content-page=templates] .card img{padding:6px}}

/* The gallery uses the same paper/pink surface as its template editor. */
body[data-content-page=templates] .content-main{max-width:1340px;margin-inline:auto}
body[data-content-page=templates] .content-main>header{align-items:flex-start;flex-wrap:wrap;padding:24px;border:1px solid #e4d9d5;border-radius:20px;background:#fffaf0}
body[data-content-page=templates] .content-main>header p{max-width:70ch;line-height:1.7}
body[data-content-page=templates] .content-main>header h1{font-size:clamp(28px,3vw,42px);line-height:1.3}
body[data-content-page=templates] .content-main>header>a{padding:8px 14px;border:1px solid #bd8c9f;border-radius:12px;background:#f2dce4;max-width:100%;white-space:normal}
body[data-content-page=templates] .filters button{font-size:14px;line-height:1.5}
body[data-content-page=templates] .filters button:hover{background:#f8eaf0}
body[data-content-page=templates] .filters button[aria-pressed=true]{background:#f2dce4;box-shadow:inset 0 0 0 1px #bd8c9f}
body[data-content-page=templates] .card{display:flex;flex-direction:column}
body[data-content-page=templates] .card img{max-height:340px;padding:18px}
body[data-content-page=templates] .caption{display:flex;flex-direction:column;flex:1;gap:6px;padding:18px}
body[data-content-page=templates] .caption h3{font-family:'Yuanti SC',STYuanti,'Avenir Next',sans-serif;font-size:16px;font-weight:600;overflow-wrap:anywhere}
body[data-content-page=templates] .caption p{margin:0 0 8px;font-size:13px;line-height:1.6}
body[data-content-page=templates] .edit{margin-top:auto;font-weight:500}
body[data-content-page=templates] .source{color:#713944;background:#f2dce4;font-family:inherit;font-weight:400}
body[data-content-page=templates] :is(a,button):focus-visible{outline:2px solid #173f73;outline-offset:3px}
@media(max-width:799px){body[data-content-page=templates] .content-main>header{padding:18px}body[data-content-page=templates] .card img{padding:10px}body[data-content-page=templates] .caption{padding:12px}body[data-content-page=templates] .content-main>header>a{margin-top:14px}}
@media(max-width:420px){body[data-content-page=templates] .grid{grid-template-columns:minmax(0,1fr)}body[data-content-page=templates] .card img{height:250px;aspect-ratio:auto}body[data-content-page=templates] .caption{padding:16px}}
