/* =====================================================================
   Review Sri Lanka theme — main stylesheet
   Tokens → base → layout → components → templates → responsive
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
	--brand: #f97316;
	--brand-strong: color-mix(in srgb, var(--brand) 82%, #000);
	--brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
	--brand-softer: color-mix(in srgb, var(--brand) 6%, transparent);
	--brand-text: color-mix(in srgb, var(--brand) 78%, #000);
	--on-brand: #fff;

	--bg: #f6f6f7;
	--surface: #ffffff;
	--surface-2: #f3f4f6;
	--surface-3: #e9ebef;
	--border: #e5e7eb;
	--border-strong: #d4d7dd;
	--text: #111318;
	--text-2: #3b4150;
	--muted: #6b7280;
	--thumb-bg: #ffffff;

	--star: #f59e0b;
	--star-empty: #d9dce2;
	--green: #15803d;
	--green-bg: #dcfce7;
	--amber: #b45309;
	--amber-bg: #fef3c7;
	--red: #b91c1c;
	--red-bg: #fee2e2;
	--gold: #d4a017;
	--silver: #9aa3ae;
	--bronze: #c07a3a;

	--radius: 14px;
	--radius-sm: 10px;
	--radius-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(16, 18, 24, .06);
	--shadow: 0 1px 2px rgba(16, 18, 24, .05), 0 6px 20px -8px rgba(16, 18, 24, .12);
	--shadow-lg: 0 24px 60px -20px rgba(16, 18, 24, .28), 0 2px 6px rgba(16, 18, 24, .06);
	--ring: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);

	--container: 1320px;
	--gutter: 24px;
	--header-h: 68px;
	--font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Sinhala", "Iskoola Pota", Arial, sans-serif;

	color-scheme: light;
}

html[data-theme="dark"] {
	--brand-strong: color-mix(in srgb, var(--brand) 88%, #fff);
	--brand-soft: color-mix(in srgb, var(--brand) 16%, transparent);
	--brand-softer: color-mix(in srgb, var(--brand) 8%, transparent);
	--brand-text: color-mix(in srgb, var(--brand) 80%, #fff);

	--bg: #0b0d12;
	--surface: #13161d;
	--surface-2: #191d26;
	--surface-3: #222734;
	--border: #242a36;
	--border-strong: #333a4a;
	--text: #eef0f4;
	--text-2: #c7ccd6;
	--muted: #8f98a9;
	--thumb-bg: #f4f5f7;

	--star-empty: #3a4050;
	--green: #4ade80;
	--green-bg: rgba(34, 197, 94, .14);
	--amber: #fbbf24;
	--amber-bg: rgba(245, 158, 11, .14);
	--red: #f87171;
	--red-bg: rgba(239, 68, 68, .14);

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
	--shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -10px rgba(0, 0, 0, .6);
	--shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .4);

	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); letter-spacing: -.015em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 1000; background: var(--surface); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 1.7em; padding: 0 .5em; height: 1.55em;
	border-radius: 999px; background: var(--surface-2); color: var(--muted);
	font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 820px; }
.section { padding-top: 56px; padding-bottom: 56px; }
.section-tight { padding-top: 28px; padding-bottom: 48px; }
.site-main { min-height: 60vh; }

/* ---------- Buttons ---------- */
.tbtn {
	display: inline-flex; align-items: center; justify-content: center; gap: .45em;
	height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
	font-weight: 700; font-size: .92rem; cursor: pointer; white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.tbtn:active { transform: translateY(1px); }
.tbtn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
.tbtn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
html[data-theme="dark"] .tbtn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.tbtn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.tbtn-ghost:hover { border-color: var(--brand); color: var(--brand-text); }
.tbtn-sm { height: 36px; padding: 0 14px; font-size: .85rem; border-radius: 10px; }
.icon-btn {
	display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
	border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand-text); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: .85rem; }
.link-btn:hover { color: var(--brand-text); }

html[data-theme="dark"] .when-light, html:not([data-theme="dark"]) .when-dark { display: none; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 60;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -18px rgba(0,0,0,.35); }
.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 16px -6px var(--brand); }
.brand.hide-name .brand-name { display: none; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav .menu { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.main-nav .menu > li { position: relative; }
.main-nav .menu a {
	display: block; padding: 8px 12px; border-radius: 10px;
	color: var(--text-2); font-weight: 600; font-size: .93rem; white-space: nowrap;
}
.main-nav .menu a:hover { color: var(--text); background: var(--surface-2); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a, .main-nav .current-menu-ancestor > a { color: var(--brand-text); background: var(--brand-soft); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; list-style: none; margin: 6px 0 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: block; }
.nav-add { display: none; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-search { width: 280px; }
.header-search .ls-field { background: var(--surface-2); border-color: transparent; }
.header-search .ls-field:focus-within { background: var(--surface); }
.search-toggle, .nav-toggle { display: none; }
.nav-toggle .when-open { display: none; }
.nav-open .nav-toggle .when-open { display: block; }
.nav-open .nav-toggle .when-closed { display: none; }

.account { position: relative; }
.account-btn { padding: 0; border-radius: 999px; overflow: hidden; }
.dropdown {
	position: absolute; right: 0; top: calc(100% + 8px); width: 250px; z-index: 70;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow-lg); padding: 6px;
}
.dropdown-head { display: flex; flex-direction: column; padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-size: .9rem; overflow: hidden; }
.dropdown-head .muted { font-size: .8rem; text-overflow: ellipsis; overflow: hidden; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.dropdown a:hover { background: var(--surface-2); color: var(--text); }

.avatar {
	--h: 24;
	display: inline-grid; place-items: center; flex-shrink: 0;
	width: 38px; height: 38px; border-radius: 999px;
	background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 32%);
	font-weight: 800; font-size: .8rem; letter-spacing: .02em;
}
html[data-theme="dark"] .avatar { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 80% 80%); }
.avatar.sm { width: 38px; height: 38px; }

.ad-row { padding-top: 18px; padding-bottom: 6px; }
.ad-slot { text-align: center; }
.ad-slot .widget { margin: 0 auto; }
.ad-slot .widget + .widget { margin-top: 16px; }

/* ---------- Live search ---------- */
.ls { position: relative; width: 100%; }
.ls-field {
	position: relative; display: flex; align-items: center; gap: 10px;
	background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
	height: 40px; padding: 0 8px 0 12px;
	transition: border-color .15s, box-shadow .15s;
}
.ls-field:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.ls-ico { color: var(--muted); flex-shrink: 0; }
.ls-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: .92rem; }
.ls-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ls-input::placeholder { color: var(--muted); }
.ls-kbd { font-family: inherit; font-size: .72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; background: var(--surface-2); }
.ls-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand); animation: spin .7s linear infinite; display: none; }
.ls.is-loading .ls-spinner { display: block; }
.ls.is-loading .ls-kbd { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.ls-xl .ls-field { height: 66px; border-radius: 18px; padding: 0 9px 0 22px; gap: 14px; box-shadow: var(--shadow-lg); border-color: var(--border); }
.ls-xl .ls-input { font-size: 1.12rem; font-weight: 500; }
.ls-xl .ls-submit { height: 48px; padding: 0 26px; border-radius: 12px; font-size: 1rem; }
.ls-xl .ls-field:focus-within { box-shadow: var(--ring), var(--shadow-lg); }

.ls-panel {
	position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 80;
	background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
	box-shadow: var(--shadow-lg); padding: 8px; max-height: min(72vh, 560px); overflow: auto;
	text-align: left; overscroll-behavior: contain;
}
.header-search .ls-panel { width: min(520px, 92vw); left: auto; right: 0; }
.ls-sec + .ls-sec { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.ls-label { display: block; padding: 6px 10px 4px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ls-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 8px; }
.ls-cat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .86rem; }
.ls-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--text); }
.ls-item.is-active, .ls-row:hover, .ls-cat:hover, .ls-all:hover { background: var(--brand-softer); color: var(--text); }
.ls-cat.is-active, .ls-cat:hover { background: var(--brand-soft); }
.ls-thumb { width: 46px; height: 46px; flex-shrink: 0; border-radius: 10px; background: var(--thumb-bg); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.ls-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ls-thumb.is-empty { background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.ls-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ls-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-branch { font-style: normal; font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; margin-left: 4px; }
.ls-meta { display: flex; align-items: center; gap: 6px; font-size: .82rem; white-space: nowrap; overflow: hidden; }
.ls-meta b { font-weight: 700; }
.ls-meta .dot { color: var(--muted); }
.ls-all { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 6px; padding: 11px; border-radius: 12px; font-weight: 700; font-size: .9rem; color: var(--brand-text); border-top: 1px solid var(--border); }
.ls-empty { padding: 18px 14px; color: var(--muted); font-size: .92rem; }

/* ---------- Stars / pills / bars ---------- */
.rstars {
	--s: 15px;
	position: relative; display: inline-block; flex-shrink: 0;
	width: calc(var(--s) * 5); height: var(--s);
	background: var(--star-empty);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2.5 2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z'/%3E%3C/svg%3E") 0 0 / var(--s) var(--s) repeat-x;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2.5 2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z'/%3E%3C/svg%3E") 0 0 / var(--s) var(--s) repeat-x;
}
.rstars-fill { position: absolute; inset: 0 auto 0 0; background: var(--star); }
.rstars.sm { --s: 13px; }
.rstars.lg { --s: 20px; }
.star-glyph { color: var(--star); margin-left: 2px; font-size: .8em; }

.rating-line { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--text-2); min-width: 0; }
.rating-line .rating-num { color: var(--text); font-weight: 800; }
.rating-line .rating-count { color: var(--muted); white-space: nowrap; }
.rating-line.is-empty { color: var(--muted); font-style: italic; }

.pill {
	display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
	font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0;
	background: var(--surface-2); color: var(--muted);
}
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-red { background: var(--red-bg); color: var(--red); }
.pill-muted { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); }
.pill-new { background: var(--brand-soft); color: var(--brand-text); }

.bar { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand); }
.bar-fill.tier-green { background: var(--green); }
.bar-fill.tier-amber { background: var(--star); }
.bar-fill.tier-red { background: var(--red); }

/* ---------- Chips / tabs ---------- */
.chip {
	display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
	border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
	color: var(--text-2); font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap;
	transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.is-active .count { background: color-mix(in srgb, var(--bg) 20%, transparent); color: var(--bg); }
.chip .count { margin-right: -8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ---------- Panels / section heads ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); min-width: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-head h2, .sec-head h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.28rem; font-weight: 800; }
.sec-head h3 { font-size: 1.05rem; }
.sec-head h2 .ico, .sec-head h3 .ico { color: var(--brand); }
.sec-head h2 a { color: inherit; }
.sec-head h2 a:hover { color: var(--brand-text); }
.sec-head p { margin: 0; width: 100%; }
.sec-head .more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.sec-head-sm { margin-bottom: 10px; }
.empty-note { color: var(--muted); padding: 14px 0; margin: 0; }

/* ---------- Hero (home) ---------- */
.hero { position: relative; z-index: 5; padding: 76px 0 64px; border-bottom: 1px solid var(--border); background: var(--surface); }
html[data-theme="dark"] .hero { background: var(--bg); }
.hero-glow {
	position: absolute; inset: -40% -10% auto; height: 520px; pointer-events: none;
	background:
		radial-gradient(40% 60% at 50% 40%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
		radial-gradient(30% 40% at 20% 20%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%);
	filter: blur(10px);
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-bg::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
	background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
	background-size: 48px 48px;
	-webkit-mask-image: radial-gradient(60% 70% at 50% 30%, #000, transparent 75%);
	mask-image: radial-gradient(60% 70% at 50% 30%, #000, transparent 75%);
}
.hero-inner { position: relative; z-index: 2; max-width: 860px; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; font-size: .82rem; margin-bottom: 20px; }
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.7rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.06; margin-bottom: 16px; }
.hero-text { font-size: clamp(1rem, 1.6vw, 1.18rem); color: var(--muted); max-width: 620px; margin: 0 auto 32px; }
.hero .ls { max-width: 760px; margin: 0 auto; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; font-size: .88rem; }
.hero-chips .chip { height: 32px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 36px; margin: 36px 0 0; }
.hero-stats div { display: flex; flex-direction: column-reverse; align-items: center; }
.hero-stats dt { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Home split ---------- */
.home-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.home-split.is-single { grid-template-columns: 1fr; }

/* ---------- Rank list ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-row {
	display: grid; grid-template-columns: 30px 48px minmax(0, 1fr) 150px; align-items: center; gap: 14px;
	padding: 10px 12px; border-radius: 14px; position: relative;
	transition: background .15s;
}
.rank-row:hover { background: var(--surface-2); }
.rank-num { font-weight: 800; font-size: 1.05rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank-row.is-medal .rank-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; color: #fff; font-size: .9rem; }
.rank-row.m1 .rank-num { background: var(--gold); }
.rank-row.m2 .rank-num { background: var(--silver); }
.rank-row.m3 .rank-num { background: var(--bronze); }
.rank-thumb, .mini-thumb, .stack-thumb {
	display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
	width: 48px; height: 48px; border-radius: 12px; background: var(--thumb-bg); border: 1px solid var(--border);
}
.rank-thumb img, .mini-thumb img, .stack-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.rank-thumb.is-empty, .mini-thumb.is-empty, .stack-thumb.is-empty, .l-card-thumb.is-empty, .podium-thumb.is-empty { background: var(--brand-soft); color: var(--brand-text); font-weight: 800; }
.rank-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.rank-name { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rank-name:hover { color: var(--brand-text); }
.rank-meta { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; row-gap: 0; }
.rank-cat { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.rank-score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rank-score .bar { width: 100%; }
.rank-list-sm .rank-row { grid-template-columns: 26px 40px minmax(0, 1fr); gap: 12px; padding: 8px 10px; }
.rank-list-sm .rank-thumb { width: 40px; height: 40px; border-radius: 10px; }
.rank-list-sm .rank-row.is-medal .rank-num { width: 26px; height: 26px; font-size: .8rem; }
.rank-list-lg .rank-row { padding: 12px 14px; }

/* ---------- Review cards ---------- */
.review-stack { display: flex; flex-direction: column; gap: 12px; }
.review-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.panel .review-card { background: var(--surface-2); border-color: transparent; }
.review-card-head { display: flex; align-items: center; gap: 10px; }
.review-card-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.review-card-who b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-card-who .muted { font-size: .78rem; }
.review-card-rating { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.review-card-text { margin: 0; color: var(--text-2); font-size: .92rem; line-height: 1.55; }
.review-card-on { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: .8rem; font-weight: 600; }
.review-card-on span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-card-on:hover { border-color: var(--brand); color: var(--brand-text); }
.review-card-on .mini-thumb { width: 24px; height: 24px; border-radius: 999px; font-size: .6rem; }
.review-card-on .mini-thumb img { padding: 2px; }

/* ---------- Category groups ---------- */
.cat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.cat-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.cat-group:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.cat-group-head { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--text); }
.cat-group-head:hover { background: var(--brand-softer); color: var(--text); }
.cat-group-name { font-weight: 800; flex: 1; line-height: 1.25; }
.cat-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); flex-shrink: 0; overflow: hidden; }
.cat-ico.has-img { background: var(--thumb-bg); border: 1px solid var(--border); }
.cat-ico.has-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-children { list-style: none; margin: 0; padding: 4px 0 2px; border-top: 1px solid var(--border); }
.cat-children a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: .92rem; font-weight: 500; }
.cat-children a:hover { background: var(--surface-2); color: var(--brand-text); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 30px 0 28px; }
html[data-theme="dark"] .page-hero { background: linear-gradient(180deg, var(--surface), var(--bg)); }
.page-hero-sm { padding: 22px 0 20px; }
.page-title { display: flex; align-items: center; gap: 12px; font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; margin: 6px 0 8px; }
.page-title .ico { color: var(--brand); }
.page-lead { color: var(--muted); font-size: 1.04rem; max-width: 760px; margin: 0; }
.page-search { margin-top: 20px; max-width: 760px; }
.page-search .ls-xl .ls-field { height: 58px; box-shadow: var(--shadow); }
.page-search .ls-xl .ls-submit { height: 42px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .84rem; color: var(--muted); }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs a:hover { color: var(--brand-text); }
.crumbs .ico { opacity: .6; }
.crumbs [aria-current] { color: var(--text-2); font-weight: 600; }

.cat-hero-row { display: flex; align-items: center; gap: 16px; }
.cat-hero-row .cat-ico { width: 60px; height: 60px; border-radius: 16px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.stat-row div { display: flex; flex-direction: column-reverse; padding: 10px 16px; border-radius: 12px; background: var(--surface-2); min-width: 110px; }
.stat-row dt { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-row dd { margin: 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Podium ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 26px 0 8px; }
.podium-card {
	position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px;
	padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
	color: var(--text); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.podium-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.podium-card.p1 { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 60%); }
.podium-card.p2 { border-color: color-mix(in srgb, var(--silver) 55%, var(--border)); }
.podium-card.p3 { border-color: color-mix(in srgb, var(--bronze) 55%, var(--border)); }
.podium-place { position: absolute; top: -11px; left: 14px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: #fff; }
.p1 .podium-place { background: var(--gold); }
.p2 .podium-place { background: var(--silver); }
.p3 .podium-place { background: var(--bronze); }
.podium-thumb { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 14px; background: var(--thumb-bg); border: 1px solid var(--border); overflow: hidden; font-size: 1.3rem; }
.podium-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.podium-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.podium-name { font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.podium-score { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.podium-score small { font-size: .55em; margin-left: 1px; }
.podium-score.tier-green { color: var(--green); }
.podium-score.tier-amber { color: var(--amber); }
.podium-score.tier-red { color: var(--red); }

.notice-bar { display: grid; grid-template-columns: auto 1fr 160px; align-items: center; gap: 12px; margin: 24px 0 4px; padding: 14px 18px; border-radius: var(--radius); background: var(--brand-softer); border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent); color: var(--text-2); font-size: .92rem; }
.notice-bar .ico { color: var(--brand); }

/* ---------- Category layout ---------- */
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding: 24px 0 56px; }
.cat-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.admin-bar .cat-aside { top: calc(var(--header-h) + 48px); }
.cta-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; background: var(--brand-softer); border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); }
.cta-panel p { margin: 0 0 10px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-field, .sort-field select {
	display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.filter-field { flex: 1; min-width: 200px; color: var(--muted); }
.filter-field:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.filter-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; color: var(--text); }
.sort-field select { padding-right: 30px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text); appearance: none; -webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238f98a9' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center; }
.sort-field select:focus { border-color: var(--brand); outline: 0; box-shadow: var(--ring); }

.listing-group + .listing-group { margin-top: 32px; }
.listing-group .sec-head h2 { font-size: 1.12rem; }

/* ---------- Listing card ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.l-card {
	position: relative; display: flex; flex-direction: column; min-width: 0;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
	overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.l-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.l-card-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.l-card-link:focus-visible { outline-offset: -3px; }
.l-card-media { position: relative; padding: 10px 10px 0; }
.l-card-thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--thumb-bg); border: 1px solid var(--border); overflow: hidden; font-size: 1.6rem; }
.l-card-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px 16px; }
.rank-badge { position: absolute; top: 18px; left: 18px; padding: 2px 9px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .75rem; font-weight: 800; }
.l-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.l-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.l-card-title { margin: 0; font-size: .98rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-card:hover .l-card-title { color: var(--brand-text); }
.l-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.l-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Top rated page ---------- */
.top-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.top-aside { display: flex; flex-direction: column; gap: 16px; }
.how-box h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.how-box h3 .ico { color: var(--brand); }
.legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .pill { min-width: 64px; justify-content: center; }

.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px; display: flex; flex-direction: column; }
.board-head { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--text); border-bottom: 1px solid var(--border); margin-bottom: 4px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.board-head:hover { background: var(--brand-softer); color: var(--text); }
.board-title { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.board-title .muted { font-size: .8rem; }
.board-go { color: var(--muted); }
.board-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; font-size: .84rem; font-weight: 700; border-top: 1px solid var(--border); }

.pending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pending-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.pending-item:hover { border-color: var(--brand); color: var(--text); }
.pending-item .cat-ico { width: 36px; height: 36px; border-radius: 10px; }
.pending-body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pending-body b { font-size: .92rem; }
.pending-cta { font-size: .8rem; font-weight: 800; color: var(--brand-text); padding: 5px 10px; border-radius: 999px; background: var(--brand-soft); }

/* ---------- All categories page ---------- */
.cat-block + .cat-block { margin-top: 34px; }
.cat-block .sec-head h2 .cat-ico { width: 36px; height: 36px; border-radius: 10px; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-tile:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.cat-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo-stack { display: flex; }
.logo-stack .stack-thumb { width: 42px; height: 42px; border-radius: 999px; box-shadow: 0 0 0 3px var(--surface); font-size: .75rem; }
.logo-stack .stack-thumb + .stack-thumb { margin-left: -10px; }
.cat-tile-foot { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tile-foot .ico { color: var(--gold); flex-shrink: 0; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-card:not(.has-post-thumbnail)::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #facc15)); }
.post-card-link { position: absolute; inset: 0; z-index: 2; }
.post-card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.eyebrow { display: inline-block; align-self: flex-start; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-text); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }
.post-card-title { margin: 0; font-size: 1.12rem; font-weight: 800; }
.post-card:hover .post-card-title { color: var(--brand-text); }
.post-card-excerpt { margin: 0; color: var(--muted); font-size: .93rem; }

.post-hero { padding: 40px 0 30px; }
.post-layout { padding-top: 32px; padding-bottom: 56px; max-width: 820px; }
.post-layout.has-side { max-width: var(--container); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.post-layout.has-side .post-main { max-width: 760px; }
.post-cover { margin: 0 0 28px; }
.post-cover img { border-radius: var(--radius-lg); display: block; width: 100%; }
.post-nav { display: flex; justify-content: space-between; gap: 20px; margin: 40px 0; padding-top: 24px; border-top: 1px solid var(--border); font-weight: 700; }
.post-nav .next { margin-left: auto; text-align: right; }

/* ---------- Prose (entry content) ---------- */
.entry-content { font-size: 1.04rem; line-height: 1.75; color: var(--text-2); }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.8em; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.6em; }
.entry-content a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius); }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand); color: var(--text); font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; }
.home-content { max-width: 820px; }
.small-prose { font-size: .92rem; line-height: 1.6; }
.app-page .entry-content { font-size: 1rem; line-height: 1.6; }
.app-page .entry-content > * + * { margin-top: 0; }

/* Forms (contact forms, comments, plugin forms fall back to these) */
.entry-content input[type="text"], .entry-content input[type="email"], .entry-content input[type="url"], .entry-content input[type="tel"],
.entry-content input[type="password"], .entry-content input[type="number"], .entry-content input[type="search"], .entry-content select, .entry-content textarea,
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
	border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: .98rem;
	transition: border-color .15s, box-shadow .15s;
}
.entry-content textarea, .comment-form textarea { min-height: 130px; resize: vertical; }
.entry-content input:focus, .entry-content select:focus, .entry-content textarea:focus, .comment-form input:focus, .comment-form textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--ring); }
.entry-content label, .comment-form label { font-weight: 600; font-size: .92rem; color: var(--text); }
.entry-content input[type="submit"], .entry-content button[type="submit"], .comment-form .submit, .wp-block-button__link, .wpcf7-submit, .wpforms-submit {
	display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border: 0; border-radius: 12px;
	background: var(--brand) !important; color: var(--on-brand) !important; font-weight: 700; cursor: pointer; text-decoration: none;
}
.entry-content input[type="submit"]:hover, .entry-content button[type="submit"]:hover, .comment-form .submit:hover { background: var(--brand-strong) !important; }

/* Comments */
.comments { margin-top: 40px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-meta img { border-radius: 999px; float: left; margin-right: 12px; }

/* Pagination */
.pagination { margin-top: 32px; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.page-numbers { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; }
.page-numbers.current { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* Empty state / 404 */
.empty-state { text-align: center; max-width: 620px; margin: 30px auto; padding: 40px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty-state > .ico { color: var(--brand); margin-bottom: 8px; }
.empty-state .page-search { margin: 24px auto 0; text-align: left; }
.big-404 { font-size: 6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 0 0 10px; color: var(--brand); }

/* Widgets */
.widget { margin-bottom: 20px; }
.widget-title { font-size: 1rem; font-weight: 800; margin-bottom: 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.aside-widgets .widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: var(--surface); border-top: 1px solid var(--border); }
html[data-theme="dark"] .site-footer { background: #0e1016; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding-top: 48px; padding-bottom: 36px; }
.footer-about p { color: var(--muted); font-size: .93rem; margin: 14px 0 18px; max-width: 380px; }
.footer-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--text-2); font-size: .93rem; font-weight: 500; }
.footer-links a:hover { color: var(--brand-text); }
.footer-bottom { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; padding-bottom: 22px; color: var(--muted); font-size: .85rem; }
.footer-bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (min-width: 1025px) and (max-width: 1280px) {
	.header-search { display: none; position: absolute; right: 0; top: calc(var(--header-h) - 6px); width: 420px; }
	.search-open .header-search { display: block; }
	.search-toggle { display: inline-grid; }
	.header-inner { position: relative; }
}
@media (max-width: 1180px) {
	.cat-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 1024px) {
	:root { --gutter: 20px; }
	.search-toggle, .nav-toggle { display: inline-grid; }
	.header-search {
		display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
		width: auto; padding: 10px var(--gutter) 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
	}
	.search-open .header-search { display: block; }
	.header-search .ls-field { height: 46px; }
	.header-search .ls-panel { width: auto; left: 0; right: 0; }
	.header-inner { position: relative; }
	.main-nav {
		display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
		flex-direction: column; align-items: stretch; gap: 8px; padding: 12px var(--gutter) 18px;
		background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
		max-height: calc(100vh - var(--header-h)); overflow: auto;
	}
	.nav-open .main-nav { display: flex; }
	.main-nav .menu { flex-direction: column; }
	.main-nav .menu a { padding: 12px 14px; font-size: 1rem; }
	.main-nav .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; margin: 0; background: transparent; }
	.nav-add { display: inline-flex; height: 46px; }
	.header-add { display: none; }

	.home-split, .top-layout, .cat-layout, .post-layout.has-side { grid-template-columns: 1fr; }
	.cat-aside { position: static; }
	.podium { grid-template-columns: 1fr; gap: 18px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
	:root { --gutter: 16px; --header-h: 60px; }
	.brand-name { font-size: 1rem; }
	.brand-logo { height: 34px; }
	.header-inner { gap: 10px; }
	.header-actions { gap: 6px; }
	.icon-btn { width: 38px; height: 38px; }
	.section { padding-top: 36px; padding-bottom: 36px; }
	.hero { padding: 44px 0 40px; }
	.hero-title { font-size: 2rem; }
	.ls-xl .ls-field { height: 56px; padding: 0 6px 0 16px; border-radius: 16px; }
	.ls-xl .ls-submit { width: 44px; height: 44px; padding: 0; font-size: 0; }
	.ls-xl .ls-submit::before { content: ""; width: 20px; height: 20px; background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
	.ls-xl .ls-input { font-size: 1rem; }
	.hero-chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
	.hero-chips::-webkit-scrollbar { display: none; }
	.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 26px; }
	.hero-stats dd { font-size: 1.15rem; }
	.hero-stats dt { font-size: .62rem; letter-spacing: .04em; }
	.panel { padding: 16px; border-radius: var(--radius); }
	.rank-row { grid-template-columns: 26px 42px minmax(0, 1fr) auto; gap: 10px; padding: 8px 6px; }
	.rank-row .rank-thumb { width: 42px; height: 42px; }
	.rank-score .bar { display: none; }
	.rank-cat { display: none; }
	.listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.l-card-media { padding: 8px 8px 0; }
	.l-card-thumb img { padding: 8px; }
	.l-card-body { padding: 10px; gap: 5px; }
	.l-card-score { top: 14px; right: 14px; height: 22px; font-size: .72rem; padding: 0 7px; }
	.l-card-title { font-size: .9rem; }
	.l-card .rating-line { flex-wrap: wrap; gap: 2px 6px; font-size: .8rem; }
	.l-card .rstars { --s: 12px; }
	.l-card-meta { display: none; }
	.boards, .pending-grid, .cat-tiles, .post-grid, .cat-groups { grid-template-columns: 1fr; }
	.stat-row div { min-width: 0; flex: 1 1 40%; }
	.cat-hero-row .cat-ico { width: 48px; height: 48px; }
	.notice-bar { grid-template-columns: auto 1fr; }
	.notice-bar .bar { grid-column: 1 / -1; }
	.footer-grid { grid-template-columns: 1fr; gap: 26px; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }
	.toolbar .filter-field { flex-basis: 100%; }
	.toolbar .sort-field { flex: 1; }
	.toolbar .sort-field select { width: 100%; }
	.podium-card { grid-template-columns: 60px minmax(0, 1fr) auto; }
	.podium-thumb { width: 60px; height: 60px; }
	.podium-score { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Block widgets in footer / sidebars */
.footer-col .widget { margin-bottom: 18px; }
.footer-col .widget h2, .footer-col .widget .wp-block-heading, .footer-col .widget-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 12px; }
.footer-col .widget li { border: 0; padding: 4px 0; }
.footer-col .widget a { color: var(--text-2); font-size: .93rem; }
.footer-col .widget a:hover { color: var(--brand-text); }

/* Collapsed category groups (parent category pages) */
.listing-group.is-collapsed .l-extra { display: none; }
.is-filtering .listing-group.is-collapsed .l-extra:not([hidden]) { display: flex; }
.is-filtering .show-all { display: none; }
.listing-group:not(.is-collapsed) .show-all { display: none; }
.show-all { margin: 14px auto 0; display: flex; }

/* Narrow side columns: rating drops under the name */
.cat-aside .review-card-head, .listing-aside .review-card-head { flex-wrap: wrap; }
.cat-aside .review-card-rating { margin-left: 48px; width: calc(100% - 48px); }

/* Score pill sits on the logo so the title gets the full width */
.l-card-score { position: absolute; top: 18px; right: 18px; box-shadow: 0 2px 8px -2px rgba(0,0,0,.18); }
.l-card-score.pill-green { background: color-mix(in srgb, var(--green) 14%, #fff); color: #15803d; }
.l-card-score.pill-amber { background: color-mix(in srgb, #f59e0b 18%, #fff); color: #b45309; }
.l-card-score.pill-red { background: color-mix(in srgb, #ef4444 14%, #fff); color: #b91c1c; }
.l-card-score.pill-muted { background: #fff; color: #6b7280; border-color: #d4d7dd; }
.l-card-score.pill-new { background: #fff; color: #c2410c; }
.l-card .rating-line { flex-wrap: wrap; row-gap: 2px; }
.chip-row + section, .chip-row + .sec-head { margin-top: 22px; }

/* Hardening: neutralise global form/list styles from plugins or leftover CSS */
.ls .ls-input, .ls .ls-input:focus {
	border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0 !important;
	padding: 0 !important; margin: 0 !important; height: 100% !important; min-height: 0 !important; width: auto !important;
	border-radius: 0 !important; -webkit-appearance: none; appearance: none; color: var(--text) !important;
}
.filter-field input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important; }
.site-footer ul, .main-nav ul, .cat-children, .rank-list, .legend { list-style: none; margin-left: 0; padding-left: 0; }
.site-footer a, .main-nav a, .cat-children a, .rank-name, .chip, .tag { text-decoration: none; }
.footer-title { font-size: .78rem !important; line-height: 1.4; }
