/*
 * Built-in templates "Standard" and "Kompakt" (task 7). Everything is scoped to .sr-tpl so theme styles
 * outside the ranking stay untouched. The accent comes from the panel as CSS custom properties
 * on the section (GkoRankingTemplates::cssVars), the defaults below are a fallback.
 * Layout follows the width of the ranking itself (container queries), not the screen: a theme with a sidebar
 * gets the phone layout in a narrow column. Browsers without container queries get the phone layout.
 */
.sr-tpl {
	--sr-accent: #24568a;
	--sr-accent-ink: #fff;
	--sr-accent-text: #24568a;
	--sr-accent-hover: #1d456e;
	--sr-ink: #1d2733;
	--sr-muted: #55626f;
	--sr-line: #dde3e9;
	--sr-soft: #f4f6f8;
	--sr-good: #17734f;
	--sr-bad: #b3261e;
	--sr-radius: 10px;
	color: var(--sr-ink);
	font-size: 16px;
	line-height: 1.55;
	min-width: 0;
	container: sr-tpl / inline-size;
	position: relative;
}
.sr-tpl *, .sr-tpl *::before, .sr-tpl *::after { box-sizing: border-box; }
.sr-tpl img { max-width: 100%; height: auto; border: 0; box-shadow: none; }
.sr-tpl h2 { margin: 2em 0 .75em; line-height: 1.25; }
.sr-tpl > h2:first-of-type { margin-top: 1em; }
.sr-tpl p { margin: 0; }
.sr-tpl a:focus-visible, .sr-tpl summary:focus-visible, .sr-tpl [tabindex]:focus-visible { outline: 3px solid #d48800; outline-offset: 2px; }
.sr-tpl-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-tpl-muted, .sr-tpl-note { color: var(--sr-muted); }
.sr-tpl-note { margin: 10px 0 0; font-size: 13px; }

/* Summary: "Zaktualizowano" and the verdict (GkoRankingPresentation::summaryHtml). */
.sr-tpl .sr-ranking-summary { margin: 0 0 20px; padding: 14px 18px; border-left: 4px solid var(--sr-accent); border-radius: 0 var(--sr-radius) var(--sr-radius) 0; background: var(--sr-soft); }
.sr-tpl .sr-ranking-summary p { margin: 0 0 6px; }
.sr-tpl .sr-ranking-summary p:last-child { margin-bottom: 0; }
.sr-tpl .sr-updated { color: var(--sr-muted); font-size: 13px; }
.sr-tpl .sr-verdict { font-size: 16px; }

/* Table of contents. */
.sr-tpl-toc { margin: 0 0 20px; padding: 12px 18px; border: 1px solid var(--sr-line); border-radius: var(--sr-radius); }
.sr-tpl-toc__title { font-weight: 700; margin-bottom: 4px !important; }
.sr-tpl-toc ol { margin: 0; padding-left: 1.4em; }
.sr-tpl-toc li { margin: 2px 0; }
.sr-tpl-toc a { color: var(--sr-accent-text); }

/* Buttons (affiliate links). */
.sr-tpl .sr-tpl-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 2px solid var(--sr-accent); border-radius: 8px; background: var(--sr-accent); color: var(--sr-accent-ink) !important; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none !important; white-space: nowrap; box-shadow: none; }
.sr-tpl .sr-tpl-button:hover { background: var(--sr-accent-hover); border-color: var(--sr-accent-hover); }
.sr-tpl .sr-tpl-button--ghost { background: transparent; color: var(--sr-accent-text) !important; }
.sr-tpl .sr-tpl-button--ghost:hover { background: var(--sr-soft); border-color: var(--sr-accent); }

/* Badges, score and user rating (GkoRankingPresentation helpers). */
.sr-tpl .sr-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.sr-tpl .sr-badges li::before { content: none; }
.sr-tpl .sr-badge { margin: 0; padding: 1px 8px; border: 1px solid var(--sr-accent-text); border-radius: 999px; color: var(--sr-accent-text); font-size: 12px; font-weight: 600; line-height: 1.6; background: #fff; }
.sr-tpl .sr-badge-popular, .sr-tpl .sr-badge-cheapest { background: var(--sr-accent); border-color: var(--sr-accent); color: var(--sr-accent-ink); }
.sr-tpl .sr-score { font-size: 14px; line-height: 1.3; }
.sr-tpl .sr-score strong { font-size: 22px; }
.sr-tpl .sr-score-details { margin-top: 4px; font-size: 13px; }
.sr-tpl .sr-score-details summary { color: var(--sr-accent-text); cursor: pointer; }
.sr-tpl .sr-score-details ul { margin: 6px 0; padding-left: 18px; }
.sr-tpl .sr-score-details li { margin: 2px 0; }
.sr-tpl .sr-score-details a { color: var(--sr-accent-text); }
.sr-tpl .sr-score-missing, .sr-tpl .sr-user-rating { color: var(--sr-muted); font-size: 13px; }
.sr-tpl .sr-user-rating { margin: 4px 0 0; }

/* Ranking list: cards on phones, table-like rows from 760px. */
.sr-tpl ol.sr-tpl-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--sr-line); }
.sr-tpl ol.sr-tpl-list > li { margin: 0; padding: 0; }
.sr-tpl ol.sr-tpl-list > li::before { content: none; }
.sr-tpl .sr-tpl-item { display: grid; grid-template-columns: 40px 72px minmax(0, 1fr); grid-template-areas: "rank photo main" "score score score" "buy buy buy" "more more more"; gap: 10px 12px; align-items: start; padding: 16px 0 !important; border-bottom: 1px solid var(--sr-line); }
.sr-tpl-item__rank { grid-area: rank; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sr-tpl-rank { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sr-soft); font-weight: 700; }
.sr-tpl-item--top .sr-tpl-rank { background: var(--sr-accent); color: var(--sr-accent-ink); }
.sr-tpl-move { display: inline-flex; line-height: 1; }
.sr-tpl-move svg { fill: currentColor; }
.sr-tpl-move--up { color: var(--sr-good); }
.sr-tpl-move--down { color: var(--sr-bad); }
.sr-tpl-move--same { color: var(--sr-muted); }
.sr-tpl-item__photo { grid-area: photo; }
.sr-tpl-item__photo img { display: block; width: 72px; height: 72px; object-fit: contain; }
.sr-tpl-item__main { grid-area: main; min-width: 0; }
.sr-tpl-item__name { font-weight: 700; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.sr-tpl-item__producer { color: var(--sr-muted); font-size: 13px; }
.sr-tpl dl.sr-tpl-keyspecs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; font-size: 13px; }
.sr-tpl-keyspecs div { display: flex; gap: 4px; }
.sr-tpl dl.sr-tpl-keyspecs dt { margin: 0; color: var(--sr-muted); font-weight: 400; }
.sr-tpl dl.sr-tpl-keyspecs dt::after { content: ":"; }
.sr-tpl dl.sr-tpl-keyspecs dd { margin: 0; font-weight: 600; }
.sr-tpl-item__score { grid-area: score; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.sr-tpl-item__score .sr-score-details { flex-basis: 100%; }
.sr-tpl-item__buy { grid-area: buy; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.sr-tpl-item__buy .sr-tpl-button { margin-left: auto; }
.sr-tpl-price { font-size: 19px; font-weight: 700; white-space: nowrap; }
.sr-tpl-price small { font-size: 13px; font-weight: 400; color: var(--sr-muted); }
.sr-tpl-offers-count { color: var(--sr-muted); font-size: 13px; }
.sr-tpl-item__more { grid-area: more; }

/* Kompakt: smaller rows, details inside the row. */
.sr-tpl--kompakt .sr-tpl-item { padding: 12px 0 !important; }
.sr-tpl--kompakt .sr-tpl-item__photo img { width: 56px; height: 56px; }
.sr-tpl--kompakt .sr-tpl-rank { width: 30px; height: 30px; font-size: 14px; }
.sr-tpl--kompakt .sr-score strong { font-size: 18px; }
.sr-tpl-item__more > summary { display: inline-block; padding: 4px 0; color: var(--sr-accent-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.sr-tpl-item__body { padding: 6px 0 4px; }
.sr-tpl ol.sr-tpl-cheap { margin: 0; padding: 0; list-style: none; }
.sr-tpl ol.sr-tpl-cheap > li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--sr-line); }
.sr-tpl ol.sr-tpl-cheap > li::before { content: none; }
.sr-tpl-cheap__name { flex: 1 1 220px; font-weight: 600; }

@container sr-tpl (min-width: 720px) {
	.sr-tpl .sr-tpl-item { grid-template-columns: 44px 96px minmax(0, 1fr) 150px 150px; grid-template-areas: "rank photo main score buy" "rank photo more more more"; gap: 6px 18px; }
	.sr-tpl-item__photo img { width: 96px; height: 96px; }
	.sr-tpl-item__score { display: block; }
	.sr-tpl-item__buy { flex-direction: column; align-items: flex-end; text-align: right; }
	.sr-tpl-item__buy .sr-tpl-button { margin-left: 0; }
	.sr-tpl--kompakt .sr-tpl-item { grid-template-columns: 36px 64px minmax(0, 1fr) 140px 150px; }
	.sr-tpl--kompakt .sr-tpl-item__photo img { width: 64px; height: 64px; }
}

/* Detailed product card (Standard: Najlepsze, Najtańsze). */
.sr-tpl-card { margin: 0 0 28px; padding: 18px; border: 1px solid var(--sr-line); border-radius: var(--sr-radius); background: #fff; }
.sr-tpl .sr-tpl-card__title { margin: 0 0 14px; font-size: 20px; line-height: 1.3; }
.sr-tpl-card__no { color: var(--sr-accent-text); }
.sr-tpl-card__head { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.sr-tpl-card__photo img { display: block; width: 200px; height: 200px; margin: 0 auto; object-fit: contain; }
.sr-tpl-card__facts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sr-tpl-card__facts .sr-badges { margin-top: 0; }
.sr-tpl-card__desc { margin-top: 16px; overflow-wrap: anywhere; }
@container sr-tpl (min-width: 600px) {
	.sr-tpl-card__head { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; }
}

/* Details: pros and cons, opinions, specification, shops. */
.sr-tpl .sr-tpl-subhead { margin: 18px 0 8px; font-size: 16px; line-height: 1.3; }
.sr-tpl-proscons { display: grid; grid-template-columns: 1fr; gap: 12px; }
@container sr-tpl (min-width: 600px) { .sr-tpl-proscons { grid-template-columns: 1fr 1fr; } }
.sr-tpl-proscons__col { padding: 2px 14px 10px; border-radius: var(--sr-radius); background: var(--sr-soft); }
.sr-tpl-proscons__col ul { margin: 0; padding: 0; list-style: none; }
.sr-tpl-proscons__col li { position: relative; margin: 4px 0; padding-left: 22px; }
.sr-tpl-proscons__col li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.sr-tpl-proscons__col--pros li::before { content: "+"; color: var(--sr-good); }
.sr-tpl-proscons__col--cons li::before { content: "–"; color: var(--sr-bad); }
.sr-tpl-opinions__list { display: grid; grid-template-columns: 1fr; gap: 12px; }
@container sr-tpl (min-width: 600px) { .sr-tpl-opinions__list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.sr-tpl .sr-opinion { margin: 0; padding: 12px 14px; border: 0; border-left: 4px solid var(--sr-accent); border-radius: 0 var(--sr-radius) var(--sr-radius) 0; background: var(--sr-soft); font-size: 15px; font-style: normal; quotes: none; }
.sr-tpl .sr-opinion::before, .sr-tpl .sr-opinion::after { content: none; }
.sr-tpl .sr-opinion p { margin: 0 0 6px; }
.sr-tpl .sr-opinion footer { color: var(--sr-muted); font-size: 13px; }
.sr-tpl .sr-opinions-summary { margin: 0 0 12px; font-size: 15px; }
.sr-tpl .sr-opinions-summary__note { display: block; color: var(--sr-muted); font-size: 13px; }
.sr-tpl table.sr-tpl-spec-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14px; }
.sr-tpl table.sr-tpl-spec-table th, .sr-tpl table.sr-tpl-spec-table td { padding: 8px 10px; border: 0; border-bottom: 1px solid var(--sr-line); text-align: left; vertical-align: top; overflow-wrap: anywhere; background: none; }
.sr-tpl table.sr-tpl-spec-table th { width: 42%; color: var(--sr-muted); font-weight: 600; }
.sr-tpl-specs--extra { margin-top: 14px; }
.sr-tpl-source a { color: inherit; text-decoration: underline; }
.sr-tpl-more-specs summary { margin-top: 8px; color: var(--sr-accent-text); font-size: 14px; font-weight: 600; cursor: pointer; }
.sr-tpl ul.sr-tpl-shops__list { margin: 8px 0 0; padding: 0; list-style: none; }
.sr-tpl .sr-tpl-shop { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--sr-line); }
.sr-tpl .sr-tpl-shop::before { content: none; }
.sr-tpl-shop__dealer img { display: block; width: auto; max-width: 110px; height: 32px; object-fit: contain; }
.sr-tpl-shop__name { font-weight: 700; }
.sr-tpl-shop__rating, .sr-tpl-shop__avail, .sr-tpl-shop__desc { display: block; color: var(--sr-muted); font-size: 13px; }
.sr-tpl-shop__avail { color: var(--sr-good); font-weight: 600; }
.sr-tpl-shop__buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sr-tpl-shop__price { font-size: 18px; font-weight: 700; white-space: nowrap; }
@container sr-tpl (min-width: 600px) {
	.sr-tpl .sr-tpl-shop { grid-template-columns: 170px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
	.sr-tpl-shop__buy { justify-content: flex-end; }
}

/* TOP 3 comparison: scrolls horizontally on phones, first column stays visible. */
.sr-tpl-compare { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--sr-line); border-radius: var(--sr-radius); }
.sr-tpl table.sr-tpl-compare__table { width: 100%; min-width: 560px; margin: 0; border-collapse: collapse; font-size: 14px; }
.sr-tpl table.sr-tpl-compare__table th, .sr-tpl table.sr-tpl-compare__table td { padding: 10px 12px; border: 0; border-bottom: 1px solid var(--sr-line); text-align: left; vertical-align: top; background: #fff; }
.sr-tpl table.sr-tpl-compare__table thead th { vertical-align: bottom; font-weight: 700; }
.sr-tpl table.sr-tpl-compare__table thead img { display: block; width: 80px; height: 80px; margin-bottom: 6px; object-fit: contain; }
.sr-tpl table.sr-tpl-compare__table tbody th { position: sticky; left: 0; z-index: 1; width: 150px; color: var(--sr-muted); font-weight: 600; background: var(--sr-soft); }
.sr-tpl table.sr-tpl-compare__table tbody tr:last-child td, .sr-tpl table.sr-tpl-compare__table tbody tr:last-child th { border-bottom: 0; }

/* Editorial ranking from an engine package (templates/paczka.php, task 17). */
/* The theme may justify text and bullet lists; the editorial view keeps its own. */
.sr-tpl.sr-pkg p, .sr-tpl.sr-pkg li { text-align: left; }
.sr-tpl.sr-pkg .sr-pkg-criteria li, .sr-tpl.sr-pkg .sr-pkg-best li { list-style: none; }
.sr-pkg-byline { margin: 0 0 12px; color: var(--sr-muted); font-size: 14px; }
.sr-pkg-result { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--sr-line); border-left: 4px solid var(--sr-accent); border-radius: var(--sr-radius); background: var(--sr-soft); }
.sr-pkg-result h2 { margin-top: 0; }
.sr-pkg-best { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sr-pkg-best span { display: inline-block; min-width: 12em; color: var(--sr-muted); font-size: 14px; }
.sr-pkg-labels { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sr-pkg-label { padding: 1px 8px; border: 1px solid var(--sr-line); border-radius: 99px; font-size: 13px; }
.sr-pkg-label--cena { border-color: var(--sr-accent); color: var(--sr-accent-text); }
.sr-pkg-note { margin: 6px 0; }
.sr-pkg-args { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 4px 16px; margin: 6px 0; font-size: 14px; }
.sr-pkg-args ul { margin: 0; padding-left: 18px; }
.sr-pkg-plus li::marker { content: "+ "; color: #1f7a4d; font-weight: 700; }
.sr-pkg-minus li::marker { content: "- "; color: #a33a2b; font-weight: 700; }
.sr-pkg-cmp { margin: 6px 0 0; color: var(--sr-muted); font-size: 14px; }
.sr-pkg-score { margin: 0; text-align: center; }
.sr-pkg-score b { font-size: 26px; } .sr-pkg-score span { color: var(--sr-muted); } .sr-pkg-score small { display: block; color: var(--sr-muted); font-size: 12px; }
.sr-pkg-criteria { padding: 0; list-style: none; display: grid; gap: 12px; }
.sr-pkg-crit-head { display: flex; justify-content: space-between; gap: 8px; }
.sr-pkg-bar { display: block; height: 6px; margin: 4px 0; border-radius: 3px; background: var(--sr-line); }
.sr-pkg-bar i { display: block; height: 100%; border-radius: 3px; background: var(--sr-accent); }
.sr-pkg-faq { padding: 8px 0; border-bottom: 1px solid var(--sr-line); }
.sr-pkg-faq summary { cursor: pointer; font-weight: 700; }
.sr-pkg-method { color: var(--sr-muted); font-size: 14px; }

@media print {
	.sr-tpl .sr-tpl-button { border: 1px solid #000; background: none; color: #000 !important; }
	.sr-tpl-compare { overflow: visible; }
}
