/* ===== Design tokens (colors sampled from the reference design: blue diagonal gradient, soft light page, white cards) ===== */
:root{
	/* default theme = Turkish red (flag red #e30a17) */
	--tpl-bg:#fff5f5;--tpl-surface:#fff;--tpl-ink:#2b0d10;--tpl-muted:#7d5558;--tpl-line:#f1d3d5;
	--tpl-primary:#b30812;--tpl-primary-2:#cf0a16;--tpl-primary-3:#e30a17;--tpl-primary-d:#8f0610;
	--tpl-accent:#e30a17;--tpl-accent-d:#b30812;--tpl-gold:#f5a623;
	--tpl-grad:linear-gradient(135deg,#b30812 0%,#e30a17 55%,#ef2a35 100%);--tpl-on-grad:#fff;
	--tpl-rgb:179,8,18;--tpl-thumb-bg:#f3d9db;--tpl-star-off:#e6c9cb;--tpl-text-2:#5c3236;--tpl-badge:rgba(80,4,10,.7);
	--tpl-radius:16px;--tpl-shadow:0 8px 24px rgba(var(--tpl-rgb),.10);--tpl-shadow-lg:0 18px 40px rgba(var(--tpl-rgb),.25);
}
html[data-tpl-theme="blue"]{
	--tpl-bg:#f5f8fc;--tpl-ink:#18283a;--tpl-muted:#5f7186;--tpl-line:#dde6f0;
	--tpl-primary:#105492;--tpl-primary-2:#1a6cb2;--tpl-primary-3:#2787d6;--tpl-primary-d:#0c4175;--tpl-accent:#2787d6;--tpl-accent-d:#1a6cb2;
	--tpl-grad:linear-gradient(135deg,#105492 0%,#1a6cb2 50%,#2787d6 100%);
	--tpl-rgb:16,84,146;--tpl-thumb-bg:#dbe5f0;--tpl-star-off:#c5d0dc;--tpl-text-2:#3d4f63;--tpl-badge:rgba(12,40,70,.65);
}
/* second theme: dark red */
html[data-tpl-theme="red"]{
	--tpl-bg:#fbf6f6;--tpl-ink:#2a1417;--tpl-muted:#7a5a5e;--tpl-line:#ecdcdc;
	--tpl-primary:#7a1020;--tpl-primary-2:#9c1a2f;--tpl-primary-3:#c42a40;--tpl-primary-d:#5e0b18;--tpl-accent:#c42a40;--tpl-accent-d:#9c1a2f;
	--tpl-grad:linear-gradient(135deg,#6a0d1c 0%,#8e1426 50%,#b81f33 100%);
	--tpl-rgb:122,16,32;--tpl-thumb-bg:#ead9d9;--tpl-star-off:#d8c6c8;--tpl-text-2:#5a3d41;--tpl-badge:rgba(60,10,18,.68);
}
html[data-tpl-theme="green"]{
	--tpl-bg:#f4f9f6;--tpl-ink:#14261e;--tpl-muted:#5a7468;--tpl-line:#dbe9e1;
	--tpl-primary:#0d4a35;--tpl-primary-2:#146a49;--tpl-primary-3:#1e8c61;--tpl-primary-d:#093526;--tpl-accent:#1e8c61;--tpl-accent-d:#146a49;
	--tpl-grad:linear-gradient(135deg,#0a3a28 0%,#0f5a3f 50%,#16805a 100%);
	--tpl-rgb:13,74,53;--tpl-thumb-bg:#d6e6dc;--tpl-star-off:#c4d6cb;--tpl-text-2:#3b5446;--tpl-badge:rgba(8,40,28,.66);
}
html[data-tpl-theme="navy"]{
	--tpl-bg:#f3f6fb;--tpl-ink:#101a2e;--tpl-muted:#566680;--tpl-line:#d9e1ef;
	--tpl-primary:#0b2a5b;--tpl-primary-2:#123a7a;--tpl-primary-3:#1f57b0;--tpl-primary-d:#071d41;--tpl-accent:#1f57b0;--tpl-accent-d:#123a7a;
	--tpl-grad:linear-gradient(135deg,#0a1f44 0%,#11306a 50%,#1b4a94 100%);
	--tpl-rgb:11,42,91;--tpl-thumb-bg:#d6deee;--tpl-star-off:#c3cde0;--tpl-text-2:#37466a;--tpl-badge:rgba(6,20,48,.68);
}
html[data-tpl-theme="orange"]{
	--tpl-bg:#fdf7f2;--tpl-ink:#2b1a0f;--tpl-muted:#7d6350;--tpl-line:#efe0d3;
	--tpl-primary:#a64b0b;--tpl-primary-2:#c2570f;--tpl-primary-3:#e0701c;--tpl-primary-d:#7e3607;--tpl-accent:#e0701c;--tpl-accent-d:#c2570f;
	--tpl-grad:linear-gradient(135deg,#8a3a08 0%,#b4500d 50%,#d96a14 100%);
	--tpl-rgb:166,75,11;--tpl-thumb-bg:#f0dfcf;--tpl-star-off:#dccbb9;--tpl-text-2:#5c4332;--tpl-badge:rgba(70,28,4,.68);
}
html[data-tpl-theme="black"]{
	--tpl-bg:#f3f4f6;--tpl-ink:#14161a;--tpl-muted:#666d78;--tpl-line:#dfe2e7;
	--tpl-primary:#15181d;--tpl-primary-2:#2a2f37;--tpl-primary-3:#4a525e;--tpl-primary-d:#0a0b0d;--tpl-accent:#4a525e;--tpl-accent-d:#2a2f37;
	--tpl-grad:linear-gradient(135deg,#050607 0%,#15181d 50%,#2a2f37 100%);
	--tpl-rgb:21,24,29;--tpl-thumb-bg:#dcdfe4;--tpl-star-off:#cdd1d7;--tpl-text-2:#3f454e;--tpl-badge:rgba(0,0,0,.7);
}
html[data-tpl-theme="brown"]{
	--tpl-bg:#fbf7f2;--tpl-ink:#2d2118;--tpl-muted:#7a6552;--tpl-line:#eadfd2;
	--tpl-primary:#7c4e2a;--tpl-primary-2:#9a653a;--tpl-primary-3:#b9824f;--tpl-primary-d:#5e3a1e;--tpl-accent:#b9824f;--tpl-accent-d:#9a653a;
	--tpl-grad:linear-gradient(135deg,#6f4325 0%,#96623a 50%,#b9824f 100%);
	--tpl-rgb:124,78,42;--tpl-thumb-bg:#eadbc9;--tpl-star-off:#d9c9b5;--tpl-text-2:#5a4636;--tpl-badge:rgba(60,38,20,.66);
}
html[data-tpl-theme="purple"]{
	--tpl-bg:#f8f5ff;--tpl-ink:#1f1633;--tpl-muted:#6b5f86;--tpl-line:#e6dcf7;
	--tpl-primary:#6d28d9;--tpl-primary-2:#7c3aed;--tpl-primary-3:#a855f7;--tpl-primary-d:#4c1d95;--tpl-accent:#a855f7;--tpl-accent-d:#7c3aed;
	--tpl-grad:linear-gradient(135deg,#5b1fb8 0%,#7c3aed 50%,#a855f7 100%);
	--tpl-rgb:109,40,217;--tpl-thumb-bg:#e4d9f6;--tpl-star-off:#d3c8ea;--tpl-text-2:#463a63;--tpl-badge:rgba(40,10,90,.66);
}
html[data-tpl-theme="pink"]{
	--tpl-bg:#fff6fa;--tpl-ink:#3a1224;--tpl-muted:#8a5c73;--tpl-line:#f5dbe7;
	--tpl-primary:#be185d;--tpl-primary-2:#db2777;--tpl-primary-3:#ec4899;--tpl-primary-d:#9d174d;--tpl-accent:#ec4899;--tpl-accent-d:#db2777;
	--tpl-grad:linear-gradient(135deg,#be185d 0%,#db2777 50%,#ec4899 100%);
	--tpl-rgb:190,24,93;--tpl-thumb-bg:#f7dce8;--tpl-star-off:#e8cdda;--tpl-text-2:#6a3a52;--tpl-badge:rgba(90,10,45,.66);
}
html[data-tpl-theme="turquoise"]{
	--tpl-bg:#f2fafa;--tpl-ink:#10282a;--tpl-muted:#55777a;--tpl-line:#d6eaea;
	--tpl-primary:#0b5f66;--tpl-primary-2:#0e7c82;--tpl-primary-3:#12a3a1;--tpl-primary-d:#08474d;--tpl-accent:#12a3a1;--tpl-accent-d:#0e7c82;
	--tpl-grad:linear-gradient(135deg,#0a565d 0%,#0e7c82 50%,#12a3a1 100%);
	--tpl-rgb:11,95,102;--tpl-thumb-bg:#d3e8e8;--tpl-star-off:#c2dada;--tpl-text-2:#365759;--tpl-badge:rgba(6,48,52,.66);
}
html[data-tpl-theme="gold"]{
	--tpl-bg:#fdfaf0;--tpl-ink:#2b2208;--tpl-muted:#7a6a3d;--tpl-line:#efe6c8;
	--tpl-primary:#7a5700;--tpl-primary-2:#a37300;--tpl-primary-3:#cf9a0a;--tpl-primary-d:#5a4000;--tpl-accent:#cf9a0a;--tpl-accent-d:#a37300;
	--tpl-grad:linear-gradient(135deg,#6b4b00 0%,#9a6f00 50%,#c9960c 100%);
	--tpl-rgb:122,87,0;--tpl-thumb-bg:#efe3bd;--tpl-star-off:#e0d4aa;--tpl-text-2:#5a4b1c;--tpl-badge:rgba(60,42,0,.68);
}
html[data-tpl-theme="slate"]{
	--tpl-bg:#f4f6f9;--tpl-ink:#18202c;--tpl-muted:#5f6b7c;--tpl-line:#dde2ea;
	--tpl-primary:#334155;--tpl-primary-2:#475569;--tpl-primary-3:#64748b;--tpl-primary-d:#1e293b;--tpl-accent:#64748b;--tpl-accent-d:#475569;
	--tpl-grad:linear-gradient(135deg,#1e293b 0%,#334155 50%,#52637a 100%);
	--tpl-rgb:51,65,85;--tpl-thumb-bg:#dde2ea;--tpl-star-off:#cbd2dc;--tpl-text-2:#3d4857;--tpl-badge:rgba(15,23,42,.68);
}
html[data-tpl-theme="silver"]{
	--tpl-bg:#f4f5f7;--tpl-ink:#1b222b;--tpl-muted:#677282;--tpl-line:#dfe2e7;
	--tpl-primary:#4b5563;--tpl-primary-2:#6b7280;--tpl-primary-3:#9ca3af;--tpl-primary-d:#374151;--tpl-accent:#9ca3af;--tpl-accent-d:#6b7280;
	--tpl-grad:linear-gradient(135deg,#9aa4b0 0%,#c2c9d2 50%,#e3e7ec 100%);--tpl-on-grad:#1b222b;
	--tpl-rgb:75,85,99;--tpl-thumb-bg:#dfe2e7;--tpl-star-off:#cfd4db;--tpl-text-2:#3f4856;--tpl-badge:rgba(31,41,55,.7);
}
/* crescent-and-star watermark in EVERY theme: light red behind the page (never changes the theme colors), soft white inside header / footer */
.tpl-body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2240 50 170 100%22%3E%3Cpath fill=%22%23e30a17%22 d=%22M134 63.34A50 50 0 1 0 134 136.66A40 40 0 1 1 134 63.34Z%22/%3E%3Cpath fill=%22%23e30a17%22 d=%22M154.00 100.00 L169.20 95.06 L169.20 79.08 L178.60 92.01 L193.80 87.07 L184.40 100.00 L193.80 112.93 L178.60 107.99 L169.20 120.92 L169.20 104.94Z%22/%3E%3C/svg%3E") no-repeat 80% 58%/min(125vw,1150px) auto;opacity:.11}
.tpl-header::after,.tpl-footer::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2240 50 170 100%22%3E%3Cpath fill=%22%23ffffff%22 d=%22M134 63.34A50 50 0 1 0 134 136.66A40 40 0 1 1 134 63.34Z%22/%3E%3Cpath fill=%22%23ffffff%22 d=%22M154.00 100.00 L169.20 95.06 L169.20 79.08 L178.60 92.01 L193.80 87.07 L184.40 100.00 L193.80 112.93 L178.60 107.99 L169.20 120.92 L169.20 104.94Z%22/%3E%3C/svg%3E") no-repeat 50% 50%/auto 190%;opacity:.14}
.tpl-header>*,.tpl-footer>*{position:relative;z-index:1}
*,*::before,*::after{box-sizing:border-box}
.tpl-body{margin:0;font:16px/1.7 "Segoe UI",system-ui,-apple-system,Roboto,Tahoma,Arial,sans-serif;color:var(--tpl-ink);background:var(--tpl-bg);-webkit-font-smoothing:antialiased}
.tpl-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.tpl-main{max-width:1100px;margin:0 auto;padding:12px 16px 6px}
.tpl-ad{position:relative;z-index:1;max-width:1100px;margin:8px auto;padding:0 16px;text-align:center;overflow:hidden;line-height:1.2}
.tpl-ad-foot{margin-top:6px;margin-bottom:8px}
.tpl-center{text-align:center}

/* ===== Header card: brand + description at the START side, ad 1 at the END side ===== */
.tpl-header,.tpl-footer{position:relative;width:calc(100% - 24px);max-width:1100px;margin-inline:auto;border-radius:22px;color:var(--tpl-on-grad);background-color:var(--tpl-primary);background-image:var(--tpl-grad);background-size:cover;background-position:center;background-repeat:no-repeat;box-shadow:var(--tpl-shadow-lg)}
.tpl-header{display:flex;align-items:center;justify-content:space-between;gap:28px;margin-top:16px;padding:26px 30px}
.tpl-header.has-bg{padding:54px 30px}
.tpl-header-main{min-width:0;text-align:start}
.tpl-brand{display:inline-block;font-size:2.7rem;font-weight:800;line-height:1.25;color:inherit;text-decoration:none}
.tpl-header-text{margin:4px 0 0;font-size:.98rem;opacity:.92}
.tpl-header.has-bg .tpl-brand,.tpl-header.has-bg .tpl-header-text{text-shadow:0 1px 6px rgba(0,0,0,.55)}
.tpl-header-ad{flex:0 1 auto;min-width:0;max-width:62%;margin-inline-start:auto;overflow:hidden;line-height:0;border-radius:12px}
@media (max-width:760px){
	.tpl-header{flex-direction:column;align-items:flex-start;gap:14px;padding:20px 18px}
	.tpl-header.has-bg{padding:40px 18px}
	.tpl-brand{font-size:2.1rem}
	.tpl-header-ad{max-width:100%;margin-inline-start:0}
}

/* language selector + color squares: under the description, aligned to the START side (left in LTR, right in RTL) */
.tpl-opts{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin-top:10px;justify-content:flex-start}
.tpl-langsel{width:6.9em;max-width:100%;padding:3px 3px 3px 6px;text-overflow:ellipsis;border:1px solid var(--tpl-line);border-radius:2px;background:#fff;color:var(--tpl-primary);font:inherit;font-size:.84rem;font-weight:600;line-height:1.5;cursor:pointer}
.tpl-langsel option{font-weight:600}
.tpl-langsel:hover{border-color:var(--tpl-primary-3)}
.tpl-swatches{display:grid;grid-template-columns:repeat(7,16px);gap:5px}
.tpl-swatch{width:16px;height:16px;padding:0;border:1px solid rgba(255,255,255,.9);border-radius:3px;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.35);transition:transform .15s}
.tpl-swatch:hover{transform:scale(1.18)}
.tpl-swatch[aria-pressed="true"]{outline:1.5px solid var(--tpl-on-grad);outline-offset:1px}
@media (pointer:coarse){.tpl-swatches{grid-template-columns:repeat(7,22px)}.tpl-swatch{width:22px;height:22px}.tpl-langsel{font-size:.92rem;padding:5px 4px 5px 7px}}
/* fallback row (only when the header is switched off) */
.tpl-langbar{position:relative;z-index:5;display:flex;justify-content:flex-end;width:calc(100% - 24px);max-width:1100px;margin:10px auto 0}
.tpl-langbar .tpl-opts{margin-top:0}
.tpl-langbar .tpl-swatch{border-color:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.25)}
.tpl-langbar .tpl-swatch[aria-pressed="true"]{outline-color:var(--tpl-ink)}

/* ===== Categories menu ===== */
.tpl-cats{position:relative;z-index:5;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:1100px;margin:14px auto 4px;padding:0 16px}
.tpl-cat{padding:8px 20px;border:1px solid var(--tpl-line);border-radius:12px;background:var(--tpl-surface);color:var(--tpl-primary);text-decoration:none;font-size:.92rem;font-weight:700;box-shadow:0 2px 8px rgba(var(--tpl-rgb),.08);transition:background .15s,color .15s,border-color .15s,transform .15s}
.tpl-cat:hover{background:var(--tpl-primary-2);border-color:var(--tpl-primary-2);color:#fff;transform:translateY(-1px)}
.tpl-cat.current{background:var(--tpl-grad);border-color:var(--tpl-primary-2);color:var(--tpl-on-grad)}

/* ===== Album title; the photo counter sits right above the photos (physical left) ===== */
.tpl-albumbar{margin:8px 0 12px;text-align:center}
.tpl-albumbar h1{margin:0;font-size:1.6rem;font-weight:800;color:var(--tpl-ink);unicode-bidi:plaintext}
.tpl-rangebar{direction:ltr;text-align:left;margin:0 0 6px}
.tpl-range{font-size:.8rem;color:var(--tpl-muted);font-variant-numeric:tabular-nums}
.tpl-intro{margin:0 0 12px;color:var(--tpl-text-2)}

/* ===== Grid: white framed cards, columns from the device profile, hover pop-out ===== */
.tpl-grid{display:grid;grid-template-columns:repeat(var(--tpl-cols,5),minmax(0,1fr));gap:12px}
.tpl-thumb{position:relative;display:block;aspect-ratio:4/3;border:3px solid #fff;border-radius:14px;overflow:hidden;background:var(--tpl-thumb-bg);box-shadow:var(--tpl-shadow);transition:transform .18s ease,box-shadow .18s ease}
.tpl-thumb img{width:100%;height:100%;object-fit:cover;display:block}
@media (hover:hover){.tpl-thumb:hover{transform:scale(1.07);box-shadow:0 14px 30px rgba(var(--tpl-rgb),.38);z-index:3}}
.tpl-views{position:absolute;right:6px;bottom:6px;display:inline-flex;align-items:center;gap:3px;padding:0 7px;border-radius:10px;background:var(--tpl-badge);color:#fff;font-size:11px;line-height:1.75;direction:ltr}
.tpl-views svg{width:11px;height:11px;fill:currentColor}

/* ===== Buttons that must always be clickable: kept above neighbours, whole box is the hit area ===== */
.tpl-nav,.tpl-pagination,.tpl-rating,.tpl-acts{position:relative;z-index:5}
.tpl-navbtn,.tpl-pagination .page-numbers,.tpl-act{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
a.tpl-navbtn,.tpl-pagination a.page-numbers{position:relative;cursor:pointer}
a.tpl-navbtn::after,.tpl-pagination a.page-numbers::after{content:"";position:absolute;inset:0;border-radius:inherit}
.tpl-navbtn.off{pointer-events:none}

/* ===== Pagination ===== */
.tpl-pagination{margin:18px 0 4px;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.tpl-pagination .page-numbers{min-width:44px;height:44px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--tpl-line);border-radius:12px;background:var(--tpl-surface);color:var(--tpl-primary);text-decoration:none;font-size:1.05rem;font-weight:700;box-shadow:0 2px 8px rgba(var(--tpl-rgb),.08);transition:background .15s,color .15s,transform .15s}
.tpl-pagination a.page-numbers:hover{background:var(--tpl-primary-2);border-color:var(--tpl-primary-2);color:#fff;transform:translateY(-1px)}
.tpl-pagination .current{background:var(--tpl-grad);border-color:var(--tpl-primary-2);color:var(--tpl-on-grad);box-shadow:0 6px 16px rgba(var(--tpl-rgb),.35)}
.tpl-pagination .dots{border:0;background:none;box-shadow:none;min-width:24px;padding:0}
.tpl-pagination svg{display:block;width:22px;height:22px;fill:currentColor}
html[dir="rtl"] .tpl-pagination .prev svg,html[dir="rtl"] .tpl-pagination .next svg{transform:scaleX(-1)}
@media (max-width:760px){ /* phones: a few numbers + arrows, always on ONE line */
	.tpl-pagination{flex-wrap:nowrap;gap:6px}
	.tpl-pagination .page-numbers{min-width:40px;height:42px;padding:0 8px}
}

/* ===== Photo page ===== */
.tpl-text{margin:8px 0 14px;padding:18px 22px;background:var(--tpl-surface);border-radius:var(--tpl-radius);border-inline-start:5px solid var(--tpl-primary-3);box-shadow:var(--tpl-shadow);color:var(--tpl-text-2)}
.tpl-text p{margin:0 0 .7em}
.tpl-text p:last-of-type{margin-bottom:0}
.tpl-text .tpl-ad{max-width:none;margin:14px 0 0;padding:0}
.tpl-figure{margin:6px 0 0;text-align:center}
.tpl-image{max-width:100%;height:auto;border:5px solid #fff;border-radius:18px;box-shadow:0 16px 40px rgba(var(--tpl-rgb),.25)}
.tpl-meta{display:flex;align-items:center;justify-content:center;gap:10px;margin:10px 0 6px;direction:ltr;font-size:.82rem;color:var(--tpl-muted)}
.tpl-num{letter-spacing:.06em;font-variant-numeric:tabular-nums}
.tpl-sep{opacity:.5}
.tpl-viewsline{display:inline-flex;align-items:center;gap:4px}
.tpl-viewsline svg{width:14px;height:14px;fill:currentColor}

/* action bar: one row of 7 on desktop */
.tpl-acts{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:12px 0}
.tpl-act{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:9px 2px;min-width:0;border:1px solid var(--tpl-line);border-radius:12px;background:var(--tpl-surface);color:var(--tpl-primary);font:inherit;font-size:11px;font-weight:700;line-height:1.2;text-align:center;text-decoration:none;cursor:pointer;box-shadow:0 2px 8px rgba(var(--tpl-rgb),.08);transition:background .15s,color .15s,border-color .15s,transform .15s}
.tpl-act svg{width:20px;height:20px;fill:currentColor;flex:none}
.tpl-act span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpl-act:hover{background:var(--tpl-primary-2);border-color:var(--tpl-primary-2);color:#fff;transform:translateY(-1px)}
.tpl-whatsapp:hover{background:#25d366;border-color:#25d366}
.tpl-facebook:hover{background:#1877f2;border-color:#1877f2}
.tpl-x:hover{background:#000;border-color:#000}
.tpl-telegram:hover{background:#229ed9;border-color:#229ed9}
@media (min-width:761px){.tpl-act{flex-direction:row;gap:7px;padding:11px 8px;font-size:13px}.tpl-act svg{width:18px;height:18px}}
@media (max-width:760px){ /* phones: row 1 = 4 share buttons, row 2 = copy / save / copy page link */
	.tpl-acts{grid-template-columns:repeat(12,minmax(0,1fr))}
	.tpl-act-s{grid-column:span 3;order:1}
	.tpl-act-a{grid-column:span 4;order:2}
}

/* rating */
.tpl-rating{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:12px 0}
.tpl-stars{display:inline-flex;flex-direction:row-reverse;direction:ltr}
.tpl-star{background:none;border:0;padding:0 2px;color:var(--tpl-star-off);cursor:pointer;-webkit-appearance:none;appearance:none;line-height:0;transition:color .12s,transform .12s}
.tpl-star svg{display:block;width:30px;height:30px;fill:currentColor}
.tpl-star.on{color:var(--tpl-gold)}
@media (hover:hover){
	.tpl-rating:not(.voted) .tpl-star:hover,.tpl-rating:not(.voted) .tpl-star:hover ~ .tpl-star{color:var(--tpl-gold)}
	.tpl-rating:not(.voted) .tpl-star:hover{transform:scale(1.15)}
}
.tpl-rating.voted .tpl-star{cursor:default}
.tpl-rating-label{color:var(--tpl-muted);font-size:.95rem}
.tpl-rating-msg{color:#1a7f37;font-size:.9rem}

/* previous / album / next */
.tpl-nav{display:flex;justify-content:center;align-items:center;gap:10px;margin:16px 0}
.tpl-navbtn{min-width:108px;padding:11px 18px;text-align:center;border:1px solid var(--tpl-line);border-radius:12px;background:var(--tpl-surface);color:var(--tpl-primary);text-decoration:none;font-weight:700;box-shadow:0 2px 8px rgba(var(--tpl-rgb),.08);transition:background .15s,color .15s,transform .15s}
a.tpl-navbtn:hover{background:var(--tpl-primary-2);border-color:var(--tpl-primary-2);color:#fff;transform:translateY(-1px)}
.tpl-navbtn.off{opacity:.35;box-shadow:none}
.tpl-navalbum{background:var(--tpl-grad);border-color:var(--tpl-primary-2);color:var(--tpl-on-grad)}
a.tpl-navalbum:hover{filter:brightness(1.1)}
.tpl-h2{font-size:1.15rem;font-weight:800;color:var(--tpl-ink);margin:20px 0 10px}

/* ===== Footer card: same gradient, white statistics cards, ad 5 below them ===== */
.tpl-footer{margin-top:20px;margin-bottom:16px;padding:26px 24px;text-align:center}
.tpl-footer.has-bg{padding:44px 24px}
.tpl-statsbox{max-width:1100px;margin:0 auto 14px}
.tpl-online{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 14px;font-size:1.05rem}
.tpl-online b{font-size:1.6rem;font-variant-numeric:tabular-nums}
.tpl-dot{width:16px;height:16px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 0 rgba(34,197,94,.75);animation:tplpulse 1.6s infinite;flex:none}
@keyframes tplpulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.75)}70%{box-shadow:0 0 0 12px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}
.tpl-stats-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.tpl-stat{padding:16px 6px 13px;border-radius:16px;background:#fff;color:var(--tpl-ink);border-top:4px solid var(--tpl-primary-3);box-shadow:0 10px 24px rgba(0,0,0,.18);text-align:center}
.tpl-stat{position:relative;overflow:hidden}
.tpl-stat::before{content:"";position:absolute;inset:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2240 50 170 100%22%3E%3Cpath fill=%22%23e30a17%22 d=%22M134 63.34A50 50 0 1 0 134 136.66A40 40 0 1 1 134 63.34Z%22/%3E%3Cpath fill=%22%23e30a17%22 d=%22M154.00 100.00 L169.20 95.06 L169.20 79.08 L178.60 92.01 L193.80 87.07 L184.40 100.00 L193.80 112.93 L178.60 107.99 L169.20 120.92 L169.20 104.94Z%22/%3E%3C/svg%3E") no-repeat 50% 50%/auto 135%;opacity:.05}
.tpl-stat>*{position:relative}
.tpl-stat b{display:block;font-size:2rem;line-height:1.2;font-weight:800;color:var(--tpl-primary);font-variant-numeric:tabular-nums}
.tpl-stat span{font-size:.85rem;font-weight:700;color:var(--tpl-muted)}
.tpl-footer .tpl-ad-in-footer{margin:16px auto 6px;padding:0}
.tpl-footer-text{margin:10px 0 0;opacity:.88;font-size:.95rem}
@media (max-width:700px){ /* phones: row 1 = photos + views, row 2 = saves + shares + visitors */
	.tpl-stats-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
	.tpl-stat{grid-column:span 2}
	.tpl-stat:nth-child(-n+2){grid-column:span 3}
	.tpl-stat b{font-size:1.55rem}
}

/* ===== Floating jump buttons ===== */
.tpl-jump{position:fixed;right:12px;inset-inline-end:12px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:8px;z-index:50}
.tpl-jump button{width:42px;height:42px;border:0;border-radius:12px;background:rgba(var(--tpl-rgb),.9);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 16px rgba(var(--tpl-rgb),.35);transition:background .15s,transform .15s}
.tpl-jump button:hover{background:var(--tpl-primary-3);transform:scale(1.06)}
.tpl-jump svg{width:26px;height:26px;fill:currentColor}
@media (max-width:520px){.tpl-jump button{width:36px;height:36px}.tpl-jump{right:6px;inset-inline-end:6px}}

/* ===== Full-screen viewer (touch): tap the image or the back button to close ===== */
.tpl-viewer{position:fixed;inset:0;background:#000;z-index:1000;display:none;flex-direction:column;align-items:center;justify-content:center}
.tpl-viewer.open{display:flex}
.tpl-viewer img{max-width:100%;max-height:calc(100% - 90px);object-fit:contain}
.tpl-wall{margin:16px;padding:13px 26px;border:0;border-radius:12px;background:#fff;color:#000;font:inherit;font-weight:800;cursor:pointer}
@media (hover:none){.tpl-image{cursor:zoom-in}}

/* hint after "set as wallpaper" */
.tpl-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:90%;padding:12px 18px;border-radius:12px;background:rgba(15,25,40,.96);color:#fff;font-size:.95rem;line-height:1.5;text-align:center;z-index:1100;box-shadow:0 8px 24px rgba(0,0,0,.4)}

/* Category article (shown above the photos of a category) */
.tpl-article{margin:0 0 16px;padding:18px 22px;background:var(--tpl-surface);border-radius:var(--tpl-radius);border-inline-start:5px solid var(--tpl-primary-3);box-shadow:var(--tpl-shadow);color:var(--tpl-text-2);line-height:1.8}
.tpl-article p{margin:0 0 .8em}
.tpl-article p:last-child{margin-bottom:0}
.tpl-article h2,.tpl-article h3{margin:.4em 0;color:var(--tpl-ink);font-size:1.1rem}
