:root {
  --ink: #17201d;
  --muted: #64706b;
  --paper: #fbfaf5;
  --card: #ffffff;
  --line: #dfe4df;
  --green: #167a59;
  --green-dark: #0e5d43;
  --green-soft: #e5f3ec;
  --orange: #f08b3e;
  font-family: Inter, "Noto Sans", "Noto Sans Arabic", "Noto Sans Bengali", "Noto Sans Devanagari", "Noto Sans Georgian", "Noto Sans Hebrew", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial Unicode MS", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; border-radius: 8px; background: var(--ink); color: white; font-weight: 750; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #e27422; outline-offset: 3px; }
main:focus { outline: 0; }
.site-header, main, footer { width: min(1100px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { position: sticky; z-index: 30; top: 0; min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: flex; gap: .55rem; align-items: center; font-weight: 800; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.site-header nav { display: flex; gap: .3rem; overflow-x: auto; }
.site-header nav a { padding: .55rem .7rem; border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--green-dark); background: var(--green-soft); }
main { padding-block: clamp(2.5rem, 7vw, 5rem); min-height: calc(100vh - 190px); }
.hero { max-width: 780px; padding-block: 1rem 2.25rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.45rem, 7vw, 4.6rem); line-height: 1; letter-spacing: -.04em; }
.lede, .page-intro { max-width: 650px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; margin-top: 1.3rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
.hero-meta > span { display: inline-flex; align-items: center; gap: .45rem; }
.hero-meta a { color: var(--green-dark); text-underline-offset: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #21a36f; box-shadow: 0 0 0 4px rgb(33 163 111 / 12%); }
.source-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .85rem; }
.source-card { --source-accent: var(--green); position: relative; min-height: 126px; grid-column: span 2; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 1rem; overflow: hidden; padding: 1.15rem; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-decoration: none; box-shadow: 0 2px 0 rgb(23 32 29 / 2%); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.source-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--source-accent); content: ""; opacity: .85; }
.source-card:nth-child(4) { grid-column: 2 / span 2; }
.source-card:hover { transform: translateY(-3px); border-color: #afbbb5; box-shadow: 0 14px 32px rgb(30 54 45 / 9%); }
.source-card small, .source-card strong { display: block; }
.source-card small { margin-top: .2rem; color: var(--muted); }
.source-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--green-soft); color: var(--green-dark); font-size: 1.05rem; font-weight: 850; }
.source-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: color .16s ease, background .16s ease, transform .16s ease; }
.source-card:hover .source-arrow { color: var(--source-accent); background: #f0f3f1; transform: translateX(2px); }
.source-google { --source-accent: #2867c7; }
.source-google .source-icon { background: #e9f1ff; color: #1758b7; }
.source-x { --source-accent: #28322f; }
.source-x .source-icon { background: #edf0ef; color: #17201d; }
.source-reddit { --source-accent: #d44713; }
.source-reddit .source-icon { background: #fff0ea; color: #bd3707; }
.source-youtube { --source-accent: #d32626; }
.source-youtube .source-icon { background: #ffeded; color: #b91c1c; }
.source-tiktok { --source-accent: #087b6d; }
.source-tiktok .source-icon { background: #e5f5f2; color: #08675d; }
.home-intro { max-width: 760px; margin-top: 2.5rem; }
.home-intro h2 { margin: 0 0 .6rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.home-intro p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.page-heading { margin-bottom: 2rem; }
.source-note { margin: -.55rem 0 0; color: var(--muted); font-size: .82rem; }
.page-heading h1, .prose h1 { font-size: clamp(2.3rem, 6vw, 4.5rem); }
.trend-page { max-width: 800px; }
.filter { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.25rem; }
.filter-field { display: grid; gap: .35rem; }
.filter label { font-size: .85rem; font-weight: 750; }
.filter label span { color: var(--muted); font-size: .75rem; font-weight: 500; }
select, input, button { min-height: 44px; padding: .55rem .8rem; border: 1px solid #b9c2bd; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
select { min-width: min(280px, 100%); }
.keyword-field input { width: min(240px, 100%); }
button { border-color: var(--green); background: var(--green); color: white; font-weight: 750; cursor: pointer; }
button:hover { background: var(--green-dark); }
.htmx-indicator { display: none; color: var(--muted); font-size: .85rem; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.results { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.results-meta { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.results-meta strong { color: var(--ink); }
.results-actions { display: flex; align-items: center; gap: .85rem; }
.exact-time { color: #7a8580; }
.clear-link { color: var(--green-dark); font-weight: 750; text-underline-offset: 3px; }
.trend-group { padding: 1.25rem 1.35rem .55rem; border-bottom: 1px solid var(--line); }
.trend-group:last-child { border-bottom: 0; }
.trend-group h2 { margin: 0 0 .7rem; font-size: 1rem; line-height: 1.4; }
.group-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.group-heading h2 { margin: 0; }
.community-link { color: var(--ink); text-decoration-color: transparent; text-underline-offset: 3px; }
.community-link:hover { color: var(--green-dark); text-decoration-color: currentColor; }
.group-count { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.trend-list { margin: 0; padding: 0 0 0 2rem; }
.trend-item { padding: .68rem .25rem .68rem .15rem; border-bottom: 1px solid #edf0ed; line-height: 1.45; }
.trend-item:last-child { border-bottom: 0; }
.trend-item::marker { color: #7d8983; font-size: .82rem; font-variant-numeric: tabular-nums; }
.trend-item a { color: var(--green-dark); font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.trend-item a:hover { text-decoration-thickness: 2px; }
.show-all { margin: .8rem 0 .35rem 2rem; font-size: .86rem; }
.show-all a { color: var(--green-dark); font-weight: 750; text-underline-offset: 3px; }
.floating-back-to-top { position: fixed; z-index: 20; right: max(1rem, calc((100vw - 1100px) / 2)); bottom: 1.25rem; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #b7c6be; border-radius: 50%; background: var(--card); color: var(--green-dark); box-shadow: 0 8px 24px rgb(23 32 29 / 16%); font-size: 1.25rem; font-weight: 800; text-decoration: none; }
.floating-back-to-top:hover { border-color: var(--green); background: var(--green-soft); }
.floating-back-to-top[hidden] { display: none; }
.empty-state { padding: 2.5rem 1.1rem; text-align: center; color: var(--muted); }
.empty-state code { display: inline-block; padding: .55rem .75rem; border-radius: 8px; background: #eff2ef; color: var(--ink); }
.prose { max-width: 740px; }
.prose > p:not(.eyebrow), .notice { color: var(--muted); font-size: 1.08rem; line-height: 1.75; }
.notice { margin-top: 2rem; padding: 1rem 1.2rem; border-left: 4px solid var(--orange); background: #fff3e8; color: #71401c; }
.status-page { max-width: 800px; }
.status-list { display: grid; gap: .8rem; margin-top: 2rem; }
.status-card { padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.status-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.status-heading h2 { margin: 0; font-size: 1.05rem; }
.status-card p { margin: .65rem 0 0; color: var(--muted); font-size: .92rem; }
.status-badge { padding: .25rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.status-badge.healthy { background: var(--green-soft); color: var(--green-dark); }
.status-badge.warning { background: #fff0df; color: #814313; }
.status-card .status-warning { color: #814313; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
footer nav { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1rem; }
footer p { margin: 0; }
@media (max-width: 900px) {
  .source-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .source-card, .source-card:nth-child(4) { grid-column: span 2; }
  .source-card:nth-child(5) { grid-column: 2 / span 2; }
}
@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: .7rem; padding-block: 1rem; }
  .site-header nav { width: 100%; }
  .source-grid { grid-template-columns: 1fr; }
  .source-card, .source-card:nth-child(4), .source-card:nth-child(5) { min-height: 105px; grid-column: auto; }
  .filter { align-items: stretch; flex-direction: column; }
  select, .keyword-field input, .filter button { width: 100%; }
  .trend-group { padding-inline: 1rem; }
  .group-heading { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .results-meta, footer { align-items: flex-start; flex-direction: column; }
  .results-actions { align-items: flex-start; flex-direction: column; gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
