/* StatPilot — shared design system */

:root {
  color-scheme: light dark;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --text: #0d1117;
  --muted: #4f5868;
  --faint: #6b7485;
  --line: #e4e7ee;
  --line-strong: #cfd5df;
  --accent: #0a7d5d;
  --accent-strong: #066449;
  --accent-soft: #e2f5ed;
  --on-accent: #ffffff;
  --indigo: #5b5bd6;
  --indigo-soft: #ecedfd;
  --danger: #c2410c;
  --radius-lg: 18px;
  --radius: 13px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 34px -20px rgba(16, 24, 40, 0.22);
  --ring: 0 0 0 4px rgba(11, 143, 106, 0.16);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10;
    --surface: #11151b;
    --surface-2: #171c24;
    --text: #e9edf3;
    --muted: #9aa4b2;
    --faint: #6b7585;
    --line: #1e2530;
    --line-strong: #2a3340;
    --accent: #34d399;
    --accent-strong: #6ee7b7;
    --accent-soft: #0f2b22;
    --on-accent: #03130e;
    --indigo: #8b8bff;
    --indigo-soft: #1b1c3b;
    --danger: #fb923c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -22px rgba(0, 0, 0, 0.85);
    --ring: 0 0 0 4px rgba(52, 211, 153, 0.18);
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c10;
  --surface: #11151b;
  --surface-2: #171c24;
  --text: #e9edf3;
  --muted: #9aa4b2;
  --faint: #6b7585;
  --line: #1e2530;
  --line-strong: #2a3340;
  --accent: #34d399;
  --accent-strong: #6ee7b7;
  --accent-soft: #0f2b22;
  --on-accent: #03130e;
  --indigo: #8b8bff;
  --indigo-soft: #1b1c3b;
  --danger: #fb923c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -22px rgba(0, 0, 0, 0.85);
  --ring: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent);
}
.brand-mark svg { width: 16px; height: 16px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.nav a, .nav .navtab {
  padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 550;
  background: none; border: 0; white-space: nowrap;
}
.nav a:hover, .nav .navtab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav .navtab[aria-selected="true"] { color: var(--text); background: var(--accent-soft); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--muted); margin-left: 6px; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- hero + forms ---------- */
.hero { padding: 44px 0 12px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0; }
h1.display {
  font-size: clamp(30px, 4.6vw, 48px); line-height: 1.04; letter-spacing: -0.035em;
  margin: 10px 0 12px; font-weight: 780;
}
.lede { color: var(--muted); font-size: 16.5px; max-width: 62ch; margin: 0 0 24px; }
.search {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 8px; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }
.search-field { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 0 12px; min-width: 0; height: 46px; }
.search-field svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-field input::placeholder { color: var(--faint); }
.search input[type="search"]::-webkit-search-cancel-button { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.seg {
  display: inline-flex; position: relative; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 8px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; color: var(--faint); font-size: 13px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-weight: 550; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.on { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ---------- status ---------- */
.status-box { padding: 26px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); margin-top: 24px; }
.status-box .s-msg { color: var(--muted); margin: 0 0 12px; font-size: 14.5px; }
.progress { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > span {
  display: block; height: 100%; width: 38%; border-radius: 99px;
  background: var(--accent);
  animation: slide 1.3s infinite ease-in-out;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(270%); } }
.alert {
  margin-top: 24px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: var(--danger);
}
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); margin-top: 24px; }
.empty-state h3 { color: var(--text); margin: 12px 0 4px; font-size: 17px; }
.empty-state svg { width: 56px; height: 56px; color: var(--faint); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 680; margin: 0; letter-spacing: -0.01em; }
.card-sub { color: var(--faint); font-size: 13px; margin: 2px 0 0; }
.section-title {
  display: flex; align-items: center; gap: 12px; margin: 44px 0 14px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }

/* ---------- profile ---------- */
.profile { padding: 0; overflow: hidden; }
.banner { height: 170px; background: var(--surface-2); position: relative; overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-body { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; padding: 0 22px 22px; margin-top: -46px; position: relative; z-index: 1; }
.avatar-xl { width: 92px; height: 92px; border-radius: 50%; border: 4px solid var(--surface); background: var(--surface-2); object-fit: cover; flex: none; }
.profile-info { flex: 1 1 280px; min-width: 0; margin-top: 56px; }
.name { font-weight: 720; font-size: 20px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.verified { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; }
.handle { color: var(--muted); font-size: 15px; }
.bio { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--faint); font-size: 13.5px; margin-top: 8px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row svg { width: 14px; height: 14px; }
.follow-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 56px; padding-bottom: 4px; }
.follow-stats b { display: block; font-size: 20px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.follow-stats span { color: var(--faint); font-size: 13px; }

/* ---------- kpis ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 16px 14px; box-shadow: var(--shadow); min-width: 0;
}
.kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 650; }
.kpi-value { font-size: 30px; font-weight: 760; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.kpi svg.spark { position: absolute; right: 12px; bottom: 12px; width: 92px; height: 32px; }
.kpi.hero { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.kpi.hero .kpi-label, .kpi.hero .kpi-sub { color: inherit; opacity: 0.8; }
.kpi.hero svg.spark path { stroke: var(--on-accent) !important; }

/* ---------- small stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 22px; }
.stat { padding: 13px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.stat-v { font-weight: 720; font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-l { color: var(--muted); font-size: 13px; }
.stat-s { color: var(--faint); font-size: 12px; }

/* ---------- donut ---------- */
.mix { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
@media (max-width: 480px) { .mix { grid-template-columns: 1fr; justify-items: center; } }
.donut-legend { display: grid; gap: 10px; min-width: 0; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend-row span.faint { font-size: 12.5px; }

/* ---------- takeaways ---------- */
.takeaways { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.takeaways li {
  position: relative; padding: 13px 14px 13px 40px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14.5px;
}
.takeaways li::before {
  content: ""; position: absolute; left: 15px; top: 19px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 12px));
  background: var(--text); color: var(--bg); padding: 7px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 550;
  white-space: nowrap; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5); transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip b { font-weight: 750; }

/* ---------- bars ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 84px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .lbl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-row .fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 420px) { .bar-row { grid-template-columns: 74px 1fr 70px; } }

/* ---------- content type tiles ---------- */
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 860px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }
.type-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); min-width: 0; }
.type-tile .t-name { font-size: 13px; font-weight: 650; color: var(--muted); display: flex; justify-content: space-between; }
.type-tile .t-er { font-size: 26px; font-weight: 760; letter-spacing: -0.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.type-tile .t-sub { font-size: 12.5px; color: var(--faint); }
.type-tile.best { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- heatmap ---------- */
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat { display: grid; grid-template-columns: 38px repeat(24, minmax(18px, 1fr)); gap: 4px; min-width: 560px; font-size: 12px; }
.heat .lbl { color: var(--muted); display: flex; align-items: center; font-weight: 550; }
.heat .hr { color: var(--faint); text-align: center; font-size: 11px; }
.heat .cell {
  height: 26px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) calc(var(--i, 0) * 100%), var(--surface-2));
  transition: transform .12s;
}
.heat .cell.empty { background: var(--surface-2); }
.heat .cell:hover { transform: scale(1.12); }
.ramp-row { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; margin-top: 12px; }
.ramp { height: 8px; width: 140px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); border: 1px solid var(--line); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.slot {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2);
}
.slot.best { border-color: var(--accent); background: var(--accent-soft); }
.slot .s-day { font-size: 13px; color: var(--muted); font-weight: 600; }
.slot .s-time { font-size: 22px; font-weight: 760; letter-spacing: -0.02em; }
.slot .s-er { font-size: 13px; color: var(--accent); font-weight: 650; }

/* ---------- tags ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; font-weight: 600;
}
.tag span { color: var(--faint); font-weight: 550; font-variant-numeric: tabular-nums; }
.tag em { font-style: normal; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- post cards ---------- */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .post-grid { grid-template-columns: 1fr 1fr; } }
.post {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, transform .15s;
}
.post:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.post p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post a.post-link { color: inherit; text-decoration: none; }
.post a.post-link:hover p { text-decoration: underline; text-decoration-color: var(--line-strong); }
.m-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; align-items: center; }
.m-row b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.er-badge { background: var(--accent-soft); color: var(--accent); padding: 3px 9px; border-radius: 999px; font-weight: 720; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.item-list li:first-child { border-top: 0; padding-top: 0; }
.item-list .snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); }
.item-list .score { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- table ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .search-field { flex: 1 1 240px; height: 40px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.toolbar .count { color: var(--faint); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.table-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.t th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); font-weight: 650; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 11px 12px; border-bottom: 1px solid var(--line);
}
.t th.sort { cursor: pointer; user-select: none; }
.t th.sort:hover { color: var(--text); }
.t th.sort[data-dir]::after { content: attr(data-dir); margin-left: 5px; color: var(--accent); }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t .num { text-align: right; }
.t td.txt { white-space: normal; min-width: 260px; max-width: 460px; }
.t td.txt a { color: var(--text); }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.original { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.pill.reply { color: var(--indigo); background: var(--indigo-soft); border-color: transparent; }

/* ---------- compare ---------- */
.compare td.win { color: var(--accent); font-weight: 750; }
.compare td.win::after { content: " ▲"; font-size: 11px; }

/* ---------- footer ---------- */
footer.foot { color: var(--faint); font-size: 13px; text-align: center; margin: 56px 0 28px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- skeleton ---------- */
.sk { border-radius: var(--radius); background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hint { color: var(--faint); font-size: 13px; margin: 8px 0 0; }
.hint a { color: var(--accent); }

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

/* ---------- SEO content ---------- */
.seo { margin-top: 56px; max-width: 760px; }
.section-h { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 12px; }
.seo h3 { font-size: 17px; margin: 22px 0 6px; letter-spacing: -0.01em; }
.seo p, .seo li { color: var(--muted); font-size: 15.5px; }
.seo p { margin: 0 0 12px; }
.seo-list { padding-left: 18px; margin: 0 0 12px; }
.seo-list li { margin: 8px 0; }
.seo b { color: var(--text); }
.seo a { color: var(--accent); }
.faq { border-top: 1px solid var(--line); padding-top: 8px; }
footer.foot p { margin: 6px 0; }
footer.foot a { color: var(--accent); }

/* ---------- spacing system ----------
   --gap: space between cards and grids. --section: space between sections.
   Cards inside grids take their spacing from the grid, so they never add their own margin. */
:root { --gap: 16px; --section: 48px; }
.card { margin-bottom: 0; }
#out > * + * { margin-top: var(--gap); }
#out > div:has(> .section-title) { margin-top: var(--section); }
#out > div:has(> .section-title):first-child { margin-top: 0; }
.section-title { margin: 0 0 var(--gap); }
.grid-2, .grid-3, .kpi-grid, .type-grid, .slot-grid { gap: var(--gap); }
.kpi-grid, .type-grid { margin-top: 0; }
.card-head { margin-bottom: var(--gap); }
.stats { margin-top: 0; }
.seo { margin-top: var(--section); }
@media (max-width: 719px) {
  :root { --gap: 12px; --section: 36px; }
}

/* phone header: keep brand, links and theme button on one line */
@media (max-width: 479px) {
  .topbar .wrap { gap: 6px; }
  .brand { font-size: 15px; }
  .nav { gap: 0; }
  .nav a, .nav .navtab { padding: 6px 8px; font-size: 13px; }
  .nav .nav-faq { display: none; }
  .icon-btn { margin-left: 2px; }
}

/* tool nav scrolls sideways on phones instead of pushing the page wider */
@media (max-width: 479px) {
  .nav { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .nav::-webkit-scrollbar { display: none; }
}


/* live badge: online now, visitors today, link to stats */
.badge-row { display: flex; justify-content: center; margin: 0 0 20px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); color: var(--muted); font-size: 14px; white-space: nowrap; text-decoration: none;
}
.live-badge:hover { border-color: var(--line-strong); text-decoration: none; }
.live-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: ping 2s infinite; flex: none; }
.live-badge .online { color: var(--accent); font-weight: 700; }
.live-badge .online b { font-weight: 800; font-variant-numeric: tabular-nums; }
.live-badge [data-live-today] { font-variant-numeric: tabular-nums; color: var(--muted); }
.live-badge .sep { color: var(--faint); }
.live-badge .go { color: var(--text); font-weight: 600; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
@media (max-width: 479px) {
  .live-badge { font-size: 13px; gap: 6px; padding: 7px 12px; white-space: normal; text-align: center; }
}
