/*
Theme Name: ICR Theme
Description: Lightweight, mobile-first theme for the cricket rankings site. Requires the ICR Core plugin. Design based on the FCS theme.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: icr
*/

/* Dark is the default look; light is opt-in via the header toggle (html[data-theme="light"]). */
:root {
	--bg: #090807;
	--header: #0c0a09;
	--surface: #0f0d0c;
	--surface-2: #1c1917;
	--text: #fafaf9;
	--muted: #a8a29e;
	--line: #211e1d;
	--brand: #16a34a;
	--brand-hover: #15803d;
	--brand-ink: #ffffff;
	--brand-text: #4ade80;
	--brand-soft: rgba(22, 163, 74, .14);
	--accent: #ef4444;
	--accent-soft: rgba(239, 68, 68, .08);
	--gold: #eab308;
	--radius: 10px;
	--shadow: none;
	--font: Inter, "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color-scheme: dark;
}

html[data-theme="light"] {
	--bg: #f0f0f0;
	--header: #ffffff;
	--surface: #ffffff;
	--surface-2: #f5f5f4;
	--text: #0c0a09;
	--muted: #57534e;
	--line: #e7e5e4;
	--brand-text: #15803d;
	--brand-soft: rgba(22, 163, 74, .1);
	--accent: #dc2626;
	--accent-soft: rgba(220, 38, 38, .05);
	--gold: #ca8a04;
	--shadow: 0 1px 2px rgba(12, 10, 9, .05);
	color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
a:hover { text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3.5vw, 1.9rem); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
h2 { font-size: 1.2rem; margin-top: 1.5em; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.site-header { background: var(--header); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
/* Brand left, menu centred, theme button right. */
.site-header .wrap { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 20px; min-height: 56px; }
.site-header .brand { justify-self: start; }
.site-header .theme-toggle { justify-self: end; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); white-space: nowrap; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); position: relative; flex: none; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .18); }
.brand-mark::after { content: ""; position: absolute; top: 3px; bottom: 3px; left: 11px; border-left: 2px dotted rgba(255, 255, 255, .8); transform: rotate(35deg); }
.brand b { display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; justify-content: center; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 6px 8px; white-space: nowrap; font-size: .9rem; font-weight: 500; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); text-decoration-color: var(--accent); }
.theme-toggle { flex: none; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .moon, html[data-theme="light"] .theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .moon { display: block; }

main { padding: 24px 0 48px; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }
.lede { color: var(--muted); max-width: 70ch; }
.updated { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 16px; }
.updated b { color: var(--text); font-weight: 600; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--brand); color: var(--brand-ink); padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; border: 0; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn::after { content: "→"; }

.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.hero .lede { margin: 14px auto 18px; font-size: 1.02rem; }

.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 36px 0 12px; }
.section-title h2 { margin: 0; }
.section-title a { font-size: .88rem; color: var(--brand-text); }

.band { background: color-mix(in srgb, var(--text) 4%, transparent); border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 16px; }
.band h2 { margin-top: 0; font-size: 1.3rem; }
.band p { color: var(--muted); max-width: 72ch; }
.band h3 { font-size: 1.02rem; margin: 22px 0 4px; }
.band a { color: var(--brand-text); }
.home-faq { padding-bottom: 32px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.q { background: var(--brand-soft); color: var(--brand-text); }

/* Team logos and player initials */
.logo { border-radius: 50%; background: var(--surface-2); object-fit: contain; flex: none; }
.logo--empty, .avatar { display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700; color: var(--muted); border-radius: 50%; background: var(--surface-2); flex: none; }
.avatar { width: 32px; height: 32px; font-size: .72rem; letter-spacing: .02em; border: 1px solid var(--line); }

/* Jump links */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.chips a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; color: var(--muted); text-decoration: none; background: var(--surface); }
.chips a:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* Top-5 card on the home page */
.rcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.rcard-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rcard-head h3 { margin: 0; font-size: .95rem; }
.rcard-head small { color: var(--muted); font-size: .74rem; }
.rcard table { font-size: .88rem; }
.rcard td { padding: .55rem .5rem; }
.rcard td:first-child { padding-left: 16px; }
.rcard td:last-child { padding-right: 16px; }
.rcard tr:first-child td { background: var(--brand-soft); }
.rcard tr:first-child .nm b { color: var(--brand-text); }
.rcard .more { margin-top: auto; display: block; padding: 11px 16px; font-size: .84rem; font-weight: 600; color: var(--brand-text); text-decoration: none; border-top: 1px solid var(--line); }
.rcard .more::after { content: " →"; }
.rcard .more:hover { background: var(--surface-2); }

/* Name cell: logo/avatar + name + small sub-line */
.nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nm b { font-weight: 600; display: block; line-height: 1.25; }
.nm small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .76rem; }
.nm > span { min-width: 0; }

/* Ranking table */
.ptable td, .ptable th { padding: .6rem .5rem; }
.ptable .pos { width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .pos small { color: var(--muted); font-weight: 600; }
.ptable tbody tr:hover td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.ptable tr.top td { background: var(--brand-soft); }
.ptable tr.top .nm b { color: var(--brand-text); }
.ptable tr.cut td { border-bottom: 2px dashed color-mix(in srgb, var(--accent) 75%, transparent); }
.ptable .rt { font-weight: 700; font-size: .95rem; }
.ptable .best { color: var(--muted); font-size: .8rem; max-width: 260px; }
.ptable .tm { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.ptable[hidden], .ptable tr[hidden] { display: none; }
.ptable-key { font-size: .78rem; color: var(--muted); margin: 10px 0 0; }
.mv { font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv.up { color: var(--brand-text); }
.mv.down { color: var(--accent); }
.mv.same { color: var(--muted); }
.mv.new { color: var(--gold); }
.table-wrap { overflow-x: auto; }

/* Format / gender / category switcher */
.switch { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.switch .filter { margin-left: auto; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 8px 0 16px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 12px; color: var(--muted); white-space: nowrap; font-size: .9rem; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 14px; border-radius: 7px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.filter { flex: 1 1 220px; max-width: 320px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.filter::placeholder { color: var(--muted); }

/* No. 1 spotlight */
.leader { display: flex; align-items: center; gap: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 18px; }
.leader .big { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.leader .who { flex: 1; min-width: 0; }
.leader .eyebrow { color: var(--accent); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.leader .who b { display: block; font-size: 1.2rem; }
.leader .who small { color: var(--muted); font-size: .84rem; }
.leader .score { text-align: right; flex: none; }
.leader .score b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.leader .score small { color: var(--muted); font-size: .74rem; }
.leader .avatar, .leader .logo { width: 48px; height: 48px; font-size: .95rem; }

.hubs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.hubs a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); font-weight: 600; font-size: .88rem; text-decoration: none; transition: border-color .15s; }
.hubs a small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; margin-top: 2px; }
.hubs a:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.hubs a.on { border-color: var(--accent); }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.note { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: .88rem; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--header); padding: 32px 0 24px; font-size: .85rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.site-footer h4 { color: var(--text); margin: 0 0 10px; font-size: .88rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 5px 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.disclaimer { border-top: 1px solid var(--line); padding-top: 16px; font-size: .78rem; }
.entry-content { max-width: 75ch; }
.entry-content a { color: var(--brand-text); text-decoration-color: currentColor; text-decoration-thickness: 1px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
body.home main { padding-bottom: 0; }
@media (max-width: 720px) {
	.site-header .wrap { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; }
	.nav { justify-content: flex-start; } /* scrollable row on phones: start at the left */
	.theme-toggle { margin-left: auto; }
	.nav { order: 3; flex-basis: 100%; margin: 0 -8px; padding-bottom: 4px; }
}
@media (max-width: 560px) {
	.hide-sm { display: none; }
	.ptable td, .ptable th { padding: .55rem .35rem; }
	.ptable .avatar { display: none; }
	.leader { flex-wrap: wrap; padding: 16px; gap: 12px; }
	.leader .big { font-size: 1.9rem; }
	.leader .who { flex-basis: calc(100% - 120px); }
	.leader .score { text-align: left; flex-basis: 100%; display: flex; gap: 8px; align-items: baseline; }
	.leader .score b { font-size: 1.3rem; display: inline; }
	.filter { max-width: none; }
}

/* ------------------------------- Profiles ------------------------------- */
.ptable tr:target td { background: var(--accent-soft); }
.leader .who b a { color: inherit; }
.nm a { color: inherit; }
.nm small a { color: var(--muted); }

.profile { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.profile > .avatar, .profile > .logo { width: 72px; height: 72px; font-size: 1.4rem; }
.profile h1 { margin: 0 0 6px; }
.profile .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .9rem; }
.profile .sub .tm { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }

.rgrid th, .rgrid td { padding: .7rem .5rem; }
.rgrid thead th { font-size: .8rem; }
.rgrid tbody th { color: var(--text); font-weight: 600; font-size: .9rem; }
.rk { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-decoration: none; }
.rk b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.rk b small { font-size: .8rem; color: var(--muted); }
.rk > small { color: var(--muted); font-size: .74rem; }
.rk.one b { color: var(--brand-text); }
.rk.none { color: var(--muted); }
a.rk:hover b { text-decoration: underline; text-decoration-color: var(--accent); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 12px; text-decoration: none; display: block; color: var(--text); border: 1px solid transparent; }
a.stat:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.stat b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); display: block; }
.stat.one b { color: var(--brand-text); }

.hist { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.hist h3 { font-size: .86rem; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.spark { width: 100%; height: 72px; color: var(--brand-text); display: block; }

.squad { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.squad li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.squad li:last-child { border-bottom: 0; }
.squad small { color: var(--muted); white-space: nowrap; }
.squad .c { font-size: .66rem; font-weight: 800; background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 5px; margin-left: 6px; }

.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.results li:last-child { border-bottom: 0; }
.results .meta { font-size: .76rem; color: var(--muted); }
.results .sides { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; }
.results .sides span { display: inline-flex; gap: 6px; align-items: center; }
.results .sides .w { font-weight: 700; }
.results .res { font-size: .84rem; }
.res.W { color: var(--brand-text); } .res.L { color: var(--accent); }

.show-sm { display: none !important; }
@media (max-width: 560px) { .show-sm { display: flex !important; } }
.cols-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
@media (max-width: 560px) {
	.profile > .avatar, .profile > .logo { width: 56px; height: 56px; font-size: 1.1rem; }
	.rk b { font-size: 1rem; }
}

/* ------------------------------ Comparison ------------------------------ */
.cmp-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 20px; }
.cmp-form select { flex: 1 1 220px; max-width: none; }
.cmp-form .vs, .cmp-head .vs { color: var(--muted); font-weight: 700; font-size: .85rem; }
.cmp { padding: 0; overflow: hidden; }
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cmp-who { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.cmp-who.b { flex-direction: row-reverse; text-align: right; }
.cmp-who b { display: block; font-size: 1.05rem; }
.cmp-who small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.cmp-who.b small { justify-content: flex-end; }
.cmp-who .avatar { width: 44px; height: 44px; font-size: .85rem; }
.cmp-table th[scope="row"] { text-align: center; color: var(--muted); font-weight: 500; font-size: .82rem; width: 34%; }
.cmp-table td { width: 33%; font-weight: 600; }
.cmp-table td:first-child { text-align: left; padding-left: 16px; }
.cmp-table td:last-child { padding-right: 16px; }
.cmp-table td.win { color: var(--brand-text); }
.cmp-table tr.grp th { text-align: left; padding: 14px 16px 6px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); border-bottom: 1px solid var(--line); }
@media (max-width: 560px) {
	.cmp-head { grid-template-columns: 1fr; text-align: left; }
	.cmp-head .vs { display: none; }
	.cmp-who.b { flex-direction: row; text-align: left; }
	.cmp-who.b small { justify-content: flex-start; }
	.cmp-table td, .cmp-table th[scope="row"] { font-size: .8rem; padding: .5rem .3rem; }
}

/* ------------------------------ Predictor ------------------------------- */
.pred-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.pred-pick label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.pred-pick select { max-width: none; color: var(--text); }
.pr-matches { display: grid; gap: 8px; }
.pr-match { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.pr-match small { grid-column: 1 / -1; color: var(--muted); font-size: .74rem; margin-bottom: -2px; }
.pr-match button { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; min-width: 0; }
.pr-match button:hover { border-color: var(--muted); }
.pr-match button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pr-match .d { color: var(--muted); font-weight: 500; }
.pr-match .d.on { background: #57534e; border-color: #57534e; color: #fff; }
.pr-match .x { border: 0; background: transparent; color: var(--muted); padding: 9px 6px; }
.wi-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: .82rem; color: var(--text); background: var(--surface-2); cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.pr-summary { margin: 0; }
@media (max-width: 560px) {
	.pr-match button { font-size: .8rem; padding: 8px 6px; gap: 5px; }
	.pr-match button .logo { display: none; }
}

/* -------------------------------- Search -------------------------------- */
.search-results { list-style: none; margin: 8px 0 0; padding: 0; max-width: 640px; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; }
.search-results a:hover, .search-results li.on a { background: var(--surface-2); }
.search-results b { display: block; font-weight: 600; }
.search-results small { color: var(--muted); font-size: .78rem; }
.search-results .none { padding: 9px 12px; color: var(--muted); font-size: .9rem; }

/* Editorial pages */
.entry-content h1 { margin-bottom: .8em; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content ul { padding-left: 20px; }
.entry-content li { margin: 6px 0; }
.entry-content p, .entry-content li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }

/* Generated copy */
.prose { max-width: 78ch; }
.prose p { color: color-mix(in srgb, var(--text) 86%, var(--muted)); line-height: 1.7; }
.prose a { color: var(--brand-text); text-decoration-color: color-mix(in srgb, var(--brand-text) 40%, transparent); text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose.lead p:first-child { font-size: 1.02rem; }
.ptable + .ptable, .table-wrap .sub-h { margin-top: 0; }
.list-h { margin: 28px 0 10px; font-size: 1.1rem; }

/* Pager under long tables */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0; font-size: .84rem; }
.pager[hidden] { display: none; }
.pager .count { color: var(--muted); }
.pager .btns { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pager button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--muted); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { color: var(--muted); padding: 0 4px; }

/* Home hero search */
.hero-search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto 10px; padding: 6px 6px 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: left; transition: border-color .15s; }
.hero-search:focus-within { border-color: var(--accent); }
.hero-search > svg { color: var(--muted); flex: none; }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.02rem; padding: 10px 4px; outline: none; }
.hero-search input::placeholder { color: var(--muted); }
.hero-search input::-webkit-search-cancel-button { cursor: pointer; }
.hero-search .btn { flex: none; }
.hero-search .search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-width: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); z-index: 30; }
.hero-try { color: var(--muted); font-size: .84rem; margin: 0 0 16px; }
.hero-try a { color: var(--brand-text); }
@media (max-width: 560px) {
	.hero-search .btn { display: none; }
	.hero-search input { font-size: 1rem; }
}
