/* Chargerhead — component styles. Every value comes from tokens.css; nothing here re-declares a token. */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-text); font-size: 16px; line-height: 26px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.ch-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ch-container { width: 100%; max-width: calc(var(--container-max) + 2 * var(--space-5)); margin: 0 auto; padding: 0 var(--space-5); }
@media (max-width: 719px) { .ch-container { padding: 0 var(--space-4); } }

/* ---- type helpers ---- */
.ch-kicker { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--charge-ink); margin: 0; }
.ch-icon { flex: none; display: inline-block; vertical-align: middle; }

/* ---- Logo ---- */
.ch-logo { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; line-height: 0; }
.ch-logo svg { display: block; overflow: visible; }
.ch-logo-ring { stroke: var(--charge); }
.ch-logo-ink { fill: currentColor; stroke: currentColor; }
.ch-logo-ink-stroke { stroke: currentColor; }
.ch-logo-word { fill: currentColor; }

/* ---- Button ---- */
.ch-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-family: var(--font-text); font-size: 14px; line-height: 20px; font-weight: 600; height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.ch-btn--sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.ch-btn--lg { height: 48px; padding: 0 var(--space-5); font-size: 16px; }
.ch-btn--icon { width: 40px; padding: 0; }
.ch-btn--icon.ch-btn--sm { width: 32px; }
.ch-btn--block { width: 100%; }
.ch-btn--primary { background: var(--charge); color: var(--on-charge); }
.ch-btn--primary:hover { background: var(--charge-ink); color: var(--surface-raised); }
.ch-btn--secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.ch-btn--secondary:hover { border-color: var(--ink); }
.ch-btn--ghost { background: transparent; color: var(--ink); }
.ch-btn--ghost:hover { background: var(--surface-sunken); }
.ch-btn--inverse { background: var(--on-inverse); color: var(--surface-inverse); }
.ch-btn:disabled { opacity: .45; cursor: not-allowed; }
.ch-btn:disabled:hover { background: transparent; }

/* ---- Badge ---- */
.ch-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-muted); white-space: nowrap; }
.ch-badge--charge { background: var(--charge-soft); color: var(--charge-ink); }
.ch-badge--spark { background: var(--spark-soft); color: var(--spark); }
.ch-badge--spark-solid { background: var(--spark); color: var(--on-spark); }
.ch-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-muted); }
.ch-badge-dot { width: 7px; height: 7px; border-radius: var(--radius-pill); background: currentColor; animation: ch-pulse 1.6s ease-in-out infinite; }
@keyframes ch-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ch-badge-dot { animation: none; } }

/* ---- Tag ---- */
.ch-tag { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); font-family: var(--font-text); font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; cursor: default; white-space: nowrap; }
a.ch-tag, button.ch-tag { cursor: pointer; }
a.ch-tag:hover, button.ch-tag:hover { border-color: var(--line-strong); }
.ch-tag.is-active { background: var(--charge-soft); border-color: var(--charge-ink); color: var(--charge-ink); }
.ch-tag--sm { height: 24px; padding: 0 var(--space-2); font-size: 12px; font-weight: 600; }
.ch-tag-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-subtle); }
.ch-tag.is-active .ch-tag-count { color: var(--charge-ink); }

/* ---- SourceMeta ---- */
.ch-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .01em; color: var(--ink-subtle); min-width: 0; }
.ch-meta-source { color: var(--ink-muted); font-weight: 600; }
.ch-meta-sep { opacity: .7; }
.ch-meta-ext { color: var(--ink-subtle); }
.ch-avatar { display: inline-grid; place-items: center; flex: none; border-radius: var(--radius-sm); background: var(--surface-inverse); color: var(--on-inverse); font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; overflow: hidden; line-height: 1; }
.ch-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Thumb ---- */
.ch-thumb { position: relative; margin: 0; width: 100%; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-sunken); }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ch-thumb--ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ch-ph-ring { fill: none; stroke: var(--line); stroke-width: 4; }
.ch-ph-accent { fill: none; stroke: var(--charge); stroke-width: 4; stroke-dasharray: 48 200; stroke-linecap: round; }
.ch-thumb-label { position: absolute; left: var(--space-3); bottom: var(--space-3); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-raised); padding: 2px var(--space-2); border-radius: var(--radius-sm); }
.ch-thumb-credit { position: absolute; right: var(--space-2); bottom: var(--space-2); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--on-inverse); background: var(--scrim); padding: 2px 6px; border-radius: 4px; }

/* ---- HeadlineCard ---- */
.ch-card { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ch-card-body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ch-card-kicker { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.ch-card-title { margin: 0; font-family: var(--font-display); color: var(--ink); text-wrap: pretty; }
.ch-card-link { text-decoration: none; color: inherit; }
.ch-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.ch-card:hover .ch-card-link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--charge); }
.ch-card-link:focus-visible { outline: none; }
.ch-card-link:focus-visible::after { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.ch-card-dek { margin: 0; color: var(--ink-muted); font-size: 16px; line-height: 26px; }
.ch-card-coverage { position: relative; z-index: 2; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--charge-ink); text-decoration: none; }
.ch-card-coverage:hover { text-decoration: underline; }
.ch-card .ch-card-media { flex: none; }

.ch-card--standard .ch-card-title { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.ch-card--standard .ch-card-dek { font-size: 14px; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.ch-card--lead { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.ch-card--lead .ch-card-body { gap: var(--space-3); }
.ch-card--lead .ch-card-title { font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.02em; }
.ch-card--lead .ch-card-dek { font-size: 18px; line-height: 28px; }
@media (max-width: 899px) {
  .ch-card--lead { grid-template-columns: 1fr; gap: var(--space-4); }
  .ch-card--lead .ch-card-title { font-size: 30px; line-height: 36px; }
}

.ch-card--feature .ch-card-title { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -.015em; }
.ch-card--feature { gap: var(--space-4); }

.ch-card--row { flex-direction: row; align-items: flex-start; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.ch-card--row .ch-card-body { flex: 1; }
.ch-card--row .ch-card-media { width: 96px; }
.ch-card--row .ch-thumb { border-radius: var(--radius-md); }
.ch-card--row .ch-card-title, .ch-card--compact .ch-card-title, .ch-card--ranked .ch-card-title { font-size: 17px; line-height: 23px; font-weight: 600; letter-spacing: -.005em; }
.ch-card--row .ch-card-link::after, .ch-card--compact .ch-card-link::after, .ch-card--ranked .ch-card-link::after { border-radius: 0; }

.ch-card--compact { gap: var(--space-2); padding: var(--space-4) 0; border-top: 1px solid var(--line); }

.ch-card--ranked { flex-direction: row; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.ch-card-rank { flex: none; width: 36px; font-family: var(--font-mono); font-size: 22px; line-height: 23px; font-weight: 700; color: var(--charge-ink); letter-spacing: -.02em; }

/* ---- StoryCluster ---- */
.ch-cluster { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.ch-cluster-head { display: flex; flex-direction: column; gap: var(--space-2); }
.ch-cluster-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.ch-cluster-summary { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 22px; }
.ch-cluster-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ch-cluster-list li { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3) 0; border-top: 1px solid var(--line); }
.ch-cluster-link { font-weight: 600; font-size: 15px; line-height: 22px; text-decoration: none; color: var(--ink); }
.ch-cluster-link:hover { text-decoration: underline; text-decoration-color: var(--charge); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ch-cluster-more { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--charge-ink); text-decoration: none; }
.ch-cluster-more:hover { text-decoration: underline; }

/* ---- SectionHeader ---- */
.ch-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-3); border-bottom: 2px solid var(--ink); margin-bottom: var(--space-5); }
.ch-section-title { margin: 0; display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.ch-section-title .ch-icon { color: var(--charge-ink); }
.ch-section-action { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--charge-ink); text-decoration: none; white-space: nowrap; }
.ch-section-action:hover { text-decoration: underline; }

/* ---- PageHeader ---- */
.ch-page-head { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-7) 0 var(--space-6); }
.ch-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; color: var(--ink-subtle); }
.ch-crumbs a { color: var(--ink-muted); text-decoration: none; font-weight: 600; }
.ch-crumbs a:hover { text-decoration: underline; }
.ch-page-head-row { display: flex; align-items: flex-end; gap: var(--space-5); }
.ch-page-head-text { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ch-page-title { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.ch-page-title.is-display { font-size: 56px; line-height: 60px; letter-spacing: -.025em; }
.ch-page-dek { margin: 0; max-width: var(--measure); font-size: 20px; line-height: 30px; color: var(--ink-muted); }
.ch-page-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.ch-page-actions { display: flex; gap: var(--space-2); flex: none; }
@media (max-width: 719px) {
  .ch-page-head { padding: var(--space-6) 0 var(--space-5); }
  .ch-page-head-row { flex-direction: column; align-items: flex-start; }
  .ch-page-title { font-size: 30px; line-height: 36px; }
  .ch-page-title.is-display { font-size: 40px; line-height: 46px; }
  .ch-page-dek { font-size: 18px; line-height: 28px; }
}

/* ---- BreakingBar ---- */
.ch-breaking { background: var(--spark-soft); color: var(--ink); }
.ch-breaking-inner { display: flex; align-items: center; gap: var(--space-4); min-height: 44px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.ch-breaking-list { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-6); overflow: hidden; min-width: 0; }
.ch-breaking-list li { display: flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; min-width: 0; }
.ch-breaking-list a { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.ch-breaking-list a:hover { text-decoration: underline; }
.ch-breaking-src { font-family: var(--font-mono); font-size: 12px; color: var(--spark); font-weight: 500; }
@media (max-width: 719px) { .ch-breaking-list li + li { display: none; } }

/* ---- SearchField ---- */
.ch-search { position: relative; display: flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-2) 0 var(--space-3); background: var(--surface-sunken); border: 1px solid transparent; border-radius: var(--radius-md); color: var(--ink-subtle); }
.ch-search:focus-within { border-color: var(--focus-ring); background: var(--surface-raised); box-shadow: 0 0 0 1px var(--focus-ring); }
.ch-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.ch-search input::placeholder { color: var(--ink-subtle); }
.ch-search input::-webkit-search-cancel-button { display: none; }
.ch-kbd { font-family: var(--font-mono); font-size: 11px; line-height: 16px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-subtle); }
.ch-search--lg { height: 60px; padding: 0 var(--space-2) 0 var(--space-4); background: var(--surface-raised); border-color: var(--line-strong); border-radius: var(--radius-lg); }
.ch-search--lg input { font-size: 18px; }

/* ---- Input (newsletter etc.) ---- */
.ch-input { height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); font: inherit; font-size: 15px; min-width: 0; }
.ch-input::placeholder { color: var(--ink-subtle); }
.ch-input:focus { outline: 2px solid var(--focus-ring); outline-offset: 0; border-color: var(--focus-ring); }

/* ---- Tabs ---- */
.ch-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ch-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); cursor: pointer; white-space: nowrap; }
.ch-tab:hover { color: var(--ink); }
.ch-tab.is-active { color: var(--ink); }
.ch-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--charge); }
.ch-tab-count { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-subtle); background: var(--surface-sunken); padding: 0 6px; border-radius: var(--radius-pill); }

/* ---- Pagination ---- */
.ch-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) 0; border-top: 1px solid var(--line); }
.ch-pager-nums { display: flex; align-items: center; gap: 4px; }
.ch-pager-num { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px; border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink-muted); text-decoration: none; }
.ch-pager-num:hover { background: var(--surface-sunken); color: var(--ink); }
.ch-pager-num.is-active { background: var(--surface-inverse); color: var(--on-inverse); }
.ch-pager-gap { color: var(--ink-subtle); padding: 0 4px; }
.ch-pager--more { flex-direction: column; justify-content: center; border-top: 0; }
.ch-pager-note { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-subtle); }

/* ---- NewsletterSignup ---- */
.ch-news { display: flex; flex-direction: column; gap: var(--space-4); }
.ch-news-text { display: flex; flex-direction: column; gap: var(--space-2); }
.ch-news-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.ch-news-body { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.ch-news-form { display: flex; gap: var(--space-2); }
.ch-news-form .ch-input { flex: 1; }
.ch-news-done { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-weight: 600; color: var(--charge-ink); }
.ch-news--panel { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface-inverse); color: var(--on-inverse); }
.ch-news--panel .ch-kicker { color: var(--on-inverse); opacity: .8; }
.ch-news--panel .ch-news-body { color: var(--on-inverse); opacity: .85; }
.ch-news--panel .ch-input { background: var(--surface-inverse); color: var(--on-inverse); border-color: var(--on-inverse); }
.ch-news--panel .ch-input::placeholder { color: var(--on-inverse); opacity: .7; }
.ch-news--panel .ch-news-done { color: var(--on-inverse); }
.ch-news--panel .ch-input:focus { outline-color: var(--charge); border-color: var(--charge); }
.ch-news--inline { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-6); padding: var(--space-5) var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-raised); }
.ch-news--inline .ch-news-form { flex: 0 1 440px; }
@media (max-width: 719px) { .ch-news--inline { flex-direction: column; align-items: stretch; padding: var(--space-5); } .ch-news-form { flex-direction: column; } }

/* ---- SourceCard ---- */
.ch-source { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ch-source-top { display: flex; align-items: center; gap: var(--space-3); }
.ch-source-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-source-name { margin: 0; font-family: var(--font-display); font-size: 17px; line-height: 23px; font-weight: 600; }
.ch-source-name a { text-decoration: none; }
.ch-source-name a:hover { text-decoration: underline; }
.ch-source-domain { font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.ch-source-desc { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.ch-source-stats { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; color: var(--ink-subtle); }
.ch-source-stats strong { color: var(--ink); font-family: var(--font-mono); }
.ch-source-topics { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---- Plughead (mascot) ---- */
.ch-plughead { display: block; flex: none; overflow: visible; }
.ch-plughead-body { fill: var(--ink); }
.ch-plughead-head { fill: var(--charge); }
.ch-plughead-face { fill: var(--on-charge); stroke: var(--on-charge); }

/* ---- EmptyState ---- */
.ch-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-4); }
.ch-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-pill); background: var(--charge-soft); color: var(--charge-ink); margin-bottom: var(--space-2); }
.ch-empty-mascot { margin-bottom: var(--space-2); }
.ch-empty-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; }
.ch-empty-body { margin: 0; max-width: 46ch; color: var(--ink-muted); }
.ch-empty-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-top: var(--space-2); }

/* ---- SiteHeader ---- */
.ch-header { background: var(--surface-raised); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.ch-header-bar { display: flex; align-items: center; gap: var(--space-5); height: var(--header-height); }
.ch-header-search { flex: 1; max-width: 480px; margin: 0 auto; }
.ch-header-actions { display: flex; align-items: center; gap: var(--space-2); }
.ch-header-menu { display: none; }
.ch-nav-list { list-style: none; margin: 0 auto; display: flex; gap: var(--space-5); overflow-x: auto; scrollbar-width: none; }
.ch-nav-link { position: relative; display: inline-flex; align-items: center; height: 44px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); text-decoration: none; white-space: nowrap; }
.ch-nav-link:hover { color: var(--ink); }
.ch-nav-link.is-active { color: var(--ink); }
.ch-nav-link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--charge); }
@media (max-width: 899px) {
  .ch-header-search, .ch-header-cta { display: none; }
  .ch-header-menu { display: inline-flex; margin-left: calc(-1 * var(--space-2)); }
  .ch-header-bar { gap: var(--space-2); }
  .ch-header-bar .ch-logo { margin-right: auto; }
  .ch-nav { display: none; border-top: 1px solid var(--line); }
  .ch-nav.is-open { display: block; }
  .ch-nav-list { flex-direction: column; gap: 0; }
  .ch-nav-link { height: 48px; }
  .ch-nav-link.is-active::after { top: 12px; bottom: 12px; left: auto; right: 0; width: 3px; height: auto; border-radius: 3px 0 0 3px; }
}

/* ---- SiteFooter ---- */
.ch-footer { background: var(--surface-sunken); border-top: 1px solid var(--line); margin-top: var(--space-8); }
.ch-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); padding-top: var(--space-7); padding-bottom: var(--space-6); }
.ch-footer-brand p { margin: var(--space-3) 0 0; max-width: 36ch; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.ch-footer-col .ch-kicker { color: var(--ink-subtle); margin-bottom: var(--space-3); }
.ch-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ch-footer-col a { font-size: 14px; line-height: 20px; color: var(--ink); text-decoration: none; }
.ch-footer-col a:hover { text-decoration: underline; }
.ch-footer-legal { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding-top: var(--space-4); padding-bottom: var(--space-5); border-top: 1px solid var(--line); font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
@media (max-width: 719px) { .ch-footer-grid { grid-template-columns: 1fr 1fr; } .ch-footer-brand { grid-column: 1 / -1; } }

/* ---- Error pages ---- */
.ch-err { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-7); padding: var(--space-8) 0 var(--space-7); }
.ch-err-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); max-width: 720px; }
.ch-err-mascot { width: 240px; height: 240px; }
@media (max-width: 719px) { .ch-err { grid-template-columns: 1fr; gap: var(--space-5); padding-top: var(--space-6); } .ch-err-mascot { order: -1; width: 120px; height: 120px; } }

/* ---- Page layout helpers used by the templates ---- */
.ch-main { padding-bottom: var(--space-7); }
.ch-band { padding-top: var(--space-7); }
.ch-grid { display: grid; gap: var(--space-6) var(--space-5); }
.ch-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ch-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-with-rail { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-width); gap: var(--space-7); align-items: start; }
.ch-rail { display: flex; flex-direction: column; gap: var(--space-6); position: sticky; top: var(--space-5); }
.ch-stack { display: flex; flex-direction: column; }
.ch-row-wrap { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ch-prose { max-width: var(--measure); font-size: 16px; line-height: 26px; }
.ch-prose h2 { font-family: var(--font-display); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; margin: var(--space-6) 0 var(--space-2); }
.ch-prose p { margin: 0 0 var(--space-4); color: var(--ink-muted); }
.ch-prose a { color: var(--charge-ink); font-weight: 600; }
.ch-prose ul { margin: 0 0 var(--space-4); padding-left: var(--space-5); color: var(--ink-muted); }
.ch-prose li { margin-bottom: var(--space-2); }
.ch-prose code { font-family: var(--font-mono); font-size: .9em; }
.ch-consent a { color: var(--charge-ink); font-weight: 600; }
@media (max-width: 1079px) { .ch-with-rail { grid-template-columns: 1fr; } .ch-rail { position: static; } .ch-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) { .ch-grid--2, .ch-grid--3, .ch-grid--4 { grid-template-columns: 1fr; } }

/* Analytics consent banner */
.ch-consent { position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); z-index: 50; max-width: 560px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.ch-consent p { margin: 0; flex: 1 1 240px; font-size: 14px; line-height: 22px; }
.ch-consent-actions { display: flex; gap: var(--space-2); margin-left: auto; }
.ch-link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.ch-link-btn[hidden] { display: none; }
