:root {
  --bg: #f6f6f2;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #171717;
  --muted: #66645f;
  --line: #d9d6ce;
  --accent: #126a73;
  --accent-warm: #b55231;
  --good: #1f7a4d;
  --warn: #9a6700;
  --bad: #b42318;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 18px 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
}

.stat .k {
  font-size: 12px;
  color: var(--muted);
}

.stat .v {
  margin-top: 10px;
  font-size: 23px;
  font-weight: 700;
}

.coverage-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.coverage-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  background: var(--surface-soft);
}

.coverage-card strong {
  min-width: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.coverage-label,
.coverage-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.coverage-card.ok strong {
  color: var(--good);
}

.coverage-card.warn strong {
  color: var(--warn);
}

.coverage-card.signal {
  border-color: rgba(18, 106, 115, 0.3);
}

.coverage-card.official {
  border-color: rgba(31, 122, 77, 0.28);
}

.coverage-card.builders {
  border-color: rgba(181, 82, 49, 0.32);
}

.coverage-card.aggregate {
  border-color: rgba(102, 100, 95, 0.32);
}

.coverage-card.private {
  border-color: rgba(154, 103, 0, 0.3);
}

.primary-controls {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-size: 14px;
}

input:focus,
select:focus,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(18, 106, 115, 0.35);
  outline-offset: 2px;
}

.mode-hint {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.advanced-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.advanced-panel summary {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px 12px 42px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::before {
  content: "+";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-weight: 700;
}

.advanced-panel summary > span:first-child {
  min-width: 0;
}

.advanced-panel[open] summary::before {
  content: "-";
}

.advanced-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.advanced-content {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.mode-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
}

.mode-btn {
  min-height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
  font-size: 13px;
}

.mode-btn:first-child {
  border-left: 0;
}

.mode-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.all-dedupe {
  display: none;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  user-select: none;
}

.all-dedupe.show {
  display: inline-flex;
}

.all-dedupe input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.all-dedupe-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(23, 23, 23, 0.25);
  background: rgba(23, 23, 23, 0.16);
}

.all-dedupe input:checked + .all-dedupe-dot {
  border-color: rgba(18, 106, 115, 0.65);
  background: var(--accent);
}

.source-health {
  display: grid;
  gap: 10px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.health-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface-soft);
}

.health-metric strong {
  font-size: 18px;
}

.health-label {
  color: var(--muted);
  font-size: 12px;
}

.health-metric.ok strong {
  color: var(--good);
}

.health-metric.warn strong {
  color: var(--warn);
}

.health-metric.bad strong {
  color: var(--bad);
}

.health-empty,
.health-ok {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.health-ok {
  color: var(--good);
  border-style: solid;
  background: rgba(31, 122, 77, 0.06);
}

.health-issues {
  display: grid;
  gap: 8px;
}

.health-issue {
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(180, 35, 24, 0.04);
}

.health-issue-title {
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

.health-issue ul {
  margin: 7px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.site-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  font-size: 12px;
}

.pill.active {
  background: rgba(18, 106, 115, 0.11);
  border-color: rgba(18, 106, 115, 0.5);
  color: var(--accent);
  font-weight: 700;
}

.list-wrap,
.featured-wrap,
.waytoagi-wrap {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.list-head,
.featured-head,
.waytoagi-head {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.list-head h2,
.featured-head h2,
.waytoagi-head h2 {
  margin: 0;
  font-size: 20px;
}

#resultCount,
#featuredUpdatedAt,
#waytoagiUpdatedAt {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.news-list,
.site-group-list,
.source-group-list {
  display: grid;
}

.site-group {
  min-width: 0;
  border-top: 1px solid rgba(23, 23, 23, 0.08);
}

.site-group:first-child {
  border-top: 0;
}

.site-group-head,
.source-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(23, 23, 23, 0.08);
}

.site-group-head {
  background: rgba(18, 106, 115, 0.06);
}

.source-group-head {
  background: rgba(181, 82, 49, 0.05);
}

.site-group-head h3,
.source-group-head h3 {
  margin: 0;
  min-width: 0;
}

.site-group-head h3 {
  font-size: 16px;
}

.source-group-head h3 {
  font-size: 14px;
}

.site-group-head span,
.source-group-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.source-group {
  min-width: 0;
  border-top: 1px solid rgba(23, 23, 23, 0.06);
}

.source-group:first-child {
  border-top: 0;
}

.news-card {
  min-width: 0;
  padding: 13px 16px;
  border-top: 1px solid rgba(23, 23, 23, 0.08);
}

.news-card:first-child {
  border-top: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.site {
  font-weight: 700;
  color: #3f3d39;
}

.category,
.source {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}

.category {
  color: var(--ink);
  background: var(--surface-soft);
}

.category.kind-official {
  border-color: rgba(31, 122, 77, 0.34);
  color: var(--good);
}

.category.kind-newsletter {
  border-color: rgba(154, 103, 0, 0.34);
  color: var(--warn);
}

.category.kind-builders {
  border-color: rgba(181, 82, 49, 0.36);
  color: var(--accent-warm);
}

.category.kind-aggregate,
.category.kind-blogs,
.category.kind-aihub {
  color: var(--muted);
}

.time {
  margin-left: auto;
}

.title {
  min-width: 0;
  margin-top: 8px;
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.title-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
}

.title:hover {
  color: var(--accent);
}

.empty {
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}

.featured-tools,
.waytoagi-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.featured-refresh {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.featured-switch,
.waytoagi-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.featured-btn,
.waytoagi-btn {
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
}

.featured-btn:first-child,
.waytoagi-btn:first-child {
  border-left: 0;
}

.featured-btn.active,
.waytoagi-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.featured-meta,
.waytoagi-meta {
  padding: 12px 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.featured-meta a,
.waytoagi-meta a {
  color: var(--accent);
  text-decoration: none;
}

.featured-list,
.waytoagi-list {
  padding: 12px 16px 16px;
  display: grid;
  gap: 8px;
}

.featured-group {
  display: grid;
  gap: 8px;
}

.featured-group + .featured-group {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.featured-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.featured-group-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif, "Source Serif 4"), Georgia, serif;
  font-size: 16px;
  font-weight: 600;
}

.featured-item,
.waytoagi-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  text-decoration: none;
  border: 1px solid rgba(23, 23, 23, 0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink);
  background: var(--surface-soft);
}

.featured-item .d,
.waytoagi-item .d {
  color: var(--muted);
  font-size: 12px;
  padding-top: 3px;
}

.featured-text,
.waytoagi-text {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.featured-item .t,
.waytoagi-item .t {
  font-family: var(--font-serif, "Source Serif 4"), Georgia, serif;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.featured-item .s,
.waytoagi-item .s {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.featured-empty,
.featured-error {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

.featured-error {
  color: var(--bad);
}

.news-card .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono, "JetBrains Mono"), monospace;
}

.news-card .meta-row .time {
  margin-left: 0;
  font-variant-numeric: tabular-nums;
}

.news-card .meta-row .source {
  font-family: "Noto Sans SC", "Inter", sans-serif;
}

.news-card .meta-dot {
  color: rgba(23, 23, 23, 0.32);
}

.news-card .title {
  margin-top: 6px;
  font-weight: 600;
}

.news-card .summary {
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.news-card.curated {
  border-color: rgba(211, 120, 84, 0.28);
  background: rgba(252, 250, 245, 0.84);
}

.ai-search-status {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.ai-search-status.error {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.06);
  color: var(--bad);
}

.ai-settings-modal[hidden] {
  display: none;
}

.ai-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 23, 23, 0.28);
}

.ai-settings-panel {
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-paper);
  box-shadow: 0 24px 80px rgba(23, 23, 23, 0.18);
}

.ai-settings-head,
.ai-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.ai-settings-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.ai-settings-head h2 {
  margin: 0;
  font-size: 20px;
}

.ai-settings-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
}

.ai-settings-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.ai-setting-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.ai-setting-field input,
.ai-setting-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

.ai-settings-help {
  color: var(--accent-ink);
  text-decoration: none;
}

.ai-settings-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-settings-save,
.ai-settings-test {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 28px;
  background: var(--bg-card);
  color: var(--ink);
  font-weight: 600;
}

.ai-settings-save {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.load-more {
  display: block;
  margin: 18px auto 6px;
  padding: 10px 24px;
  border: 1px solid rgba(23, 23, 23, 0.18);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Serif 4", Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms ease-out, transform 200ms ease-out, border-color 200ms ease-out;
}

.load-more:hover {
  background: rgba(245, 240, 229, 0.72);
  border-color: rgba(23, 23, 23, 0.32);
  transform: translateY(-1px);
}

.load-more:active {
  transform: translateY(0);
  background: rgba(245, 240, 229, 0.92);
}

.load-more.is-collapse {
  color: var(--muted);
}

.waytoagi-empty,
.waytoagi-error {
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13px;
}

.waytoagi-empty {
  border: 1px dashed var(--line);
  color: var(--muted);
}

.waytoagi-error {
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.08);
  color: var(--bad);
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 12px 36px;
  }

  .primary-controls,
  .featured-head,
  .waytoagi-head {
    grid-template-columns: 1fr;
  }

  .advanced-panel summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats,
  .coverage-strip,
  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-hint,
  .advanced-summary,
  #resultCount,
  #featuredUpdatedAt,
  #waytoagiUpdatedAt {
    white-space: normal;
  }

  .time {
    margin-left: 0;
  }

  .featured-head,
  .waytoagi-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .stats,
  .coverage-strip,
  .health-grid {
    grid-template-columns: 1fr;
  }

  .featured-tools,
  .waytoagi-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .featured-item,
  .waytoagi-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .featured-item .d,
  .waytoagi-item .d {
    padding-top: 0;
  }
}

/* AI-News paper theme ----------------------------------------------------- */
:root {
  --bg: #faf9f5;
  --bg-paper: #faf9f5;
  --bg-paper-2: #f5f0e5;
  --bg-card: #fcfaf5;
  --surface: #fcfaf5;
  --surface-soft: #f5f0e5;
  --ink: #1f1b16;
  --ink-soft: #4a4239;
  --muted: #7a7165;
  --line: #e5ddc9;
  --line-strong: #c9bfa6;
  --accent: #cc785c;
  --accent-warm: #a35840;
  --accent-ink: #a35840;
  --accent-wash: #ecd7c8;
  --good: #5c8a5c;
  --warn: #c98f4e;
  --bad: #b85a4e;
  --radius: 6px;
  --font-serif: "Source Serif 4", "Noto Serif SC", Georgia, serif;
  --font-sans: "Inter", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

html,
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "calt", "liga";
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(204, 120, 92, 0.08), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(201, 143, 78, 0.08), transparent 30%),
    linear-gradient(180deg, var(--bg-paper) 0%, #f8f4eb 100%);
  background-attachment: fixed;
  background-size: 100% 100%;
}

body {
  position: relative;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  padding: 40px 20px 64px;
}

.hero {
  position: relative;
  display: block;
  padding: 36px 0 24px;
  border-bottom: 0;
  animation: paperFadeUp 700ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}

.hero-grid {
  display: block;
}

.hero-left {
  min-width: 0;
}

.paper-line path,
.section-kicker svg path,
.clock-icon circle,
.clock-icon path,
.search-icon circle,
.search-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clock-icon circle,
.clock-icon path,
.search-icon circle,
.search-icon path {
  stroke-width: 1.8;
}

.hero-title {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Serif 4", Georgia, serif;
  font-size: clamp(56px, 9vw, 88px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}

.title-type {
  display: inline-block;
  vertical-align: baseline;
  color: var(--ink);
  font-family: inherit;
  font-weight: 500;
  white-space: pre;
}

.type-caret {
  display: inline-block;
  margin-left: 0.08em;
  color: var(--accent, currentColor);
  font-family: "JetBrains Mono", var(--font-mono);
  font-size: 0.78em;
  font-weight: 500;
  line-height: 1;
  vertical-align: 0.06em;
  animation: typeCaretBlink 1s steps(2, start) infinite;
}

@keyframes typeCaretBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.hero-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.clock-icon {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.hero-search-block {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.hero-search {
  position: relative;
  display: block;
}

.hero-search input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 15px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--muted);
  pointer-events: none;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.search-mode-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.search-mode-btn,
.ai-settings-btn,
.ai-search-submit {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0 13px;
  font-size: 13px;
}

.search-mode-btn + .search-mode-btn {
  border-left: 1px solid var(--line);
}

.search-mode-btn.active {
  background: var(--ink);
  color: var(--bg-paper);
  font-weight: 600;
}

.ai-settings-btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.ai-search-submit {
  display: none;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.ai-search-submit.show {
  display: inline-flex;
}

.ai-search-submit:disabled {
  opacity: 0.58;
  cursor: wait;
}

.hero-modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-top: 22px;
}

.mode-label {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

.field-label {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  white-space: nowrap;
}

.mode-band {
  grid-column: 1 / 2;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(252, 250, 245, 0.78);
}

.mode-band .mode-switch {
  align-self: stretch;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.mode-band .mode-btn {
  min-height: 46px;
  padding: 0 22px;
}

.hero-modes .mode-hint {
  align-self: center;
  padding: 0 18px 0 0;
  text-align: right;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.hero-modes .all-dedupe {
  grid-column: 2 / 3;
  grid-row: 2;
  min-height: 46px;
}

.list-sources {
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.48);
}

.list-sources .site-pills {
  align-self: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.title-ai {
  display: inline-block;
  padding-right: 0;
  color: var(--accent);
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
  font-size: 1em;
  line-height: 1;
  letter-spacing: inherit;
}

.hero-sub {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.65;
}

#resultCount,
#waytoagiUpdatedAt,
.coverage-label,
.coverage-meta,
.health-label,
.time,
.advanced-summary,
.mode-hint {
  color: var(--muted);
}

.paper-line {
  margin: 34px 0 22px;
  color: var(--line-strong);
}

.paper-line svg {
  display: block;
  width: 100%;
  height: 18px;
}

.paper-line path,
.section-kicker svg path {
  stroke-width: 1.4;
}

.primary-controls,
.source-filter-row {
  display: grid;
  gap: 12px;
  align-items: end;
}

.primary-controls {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.source-filter-row {
  margin-top: 12px;
  grid-template-columns: 220px minmax(0, 1fr);
}

.search-field,
.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: lowercase;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(252, 250, 245, 0.84);
  color: var(--ink);
  font-family: var(--font-sans);
  box-shadow: none;
}

input::placeholder {
  color: rgba(122, 113, 101, 0.72);
}

input:focus,
select:focus,
button:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px var(--accent-wash);
}

.control-cluster {
  display: inline-flex;
  gap: 10px;
  align-items: end;
}

.mode-switch,
.featured-switch,
.waytoagi-switch {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.mode-btn,
.featured-btn,
.waytoagi-btn {
  border-color: var(--line);
  color: var(--ink-soft);
  transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
}

.mode-btn:hover,
.featured-btn:hover,
.waytoagi-btn:hover,
.pill:hover {
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.mode-btn.active,
.featured-btn.active,
.waytoagi-btn.active {
  background: var(--ink);
  color: var(--bg-paper);
  font-weight: 600;
}

.all-dedupe {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.all-dedupe-dot {
  border-color: var(--line-strong);
  background: var(--line);
}

.all-dedupe input:checked + .all-dedupe-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.mode-hint {
  align-self: end;
  padding-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.site-pills {
  align-self: end;
}

.pill {
  border-color: var(--line);
  border-radius: 4px;
  background: rgba(252, 250, 245, 0.8);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}

.pill.active {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.list-wrap,
.featured-wrap,
.waytoagi-wrap,
.advanced-panel,
.status-board {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(252, 250, 245, 0.78);
  box-shadow: none;
  overflow: hidden;
}

.list-wrap,
.featured-wrap,
.waytoagi-wrap {
  scroll-margin-top: 24px;
}

.featured-wrap,
.list-wrap {
  margin-top: 24px;
}

.list-head,
.featured-head,
.waytoagi-head {
  border-bottom-color: var(--line);
  background: var(--bg-paper-2);
}

.list-head h2,
.featured-head h2,
.waytoagi-head h2 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.news-card {
  background: transparent;
  border-top-color: var(--line);
  transition: border-color 200ms ease-out, transform 200ms ease-out, background-color 200ms ease-out;
}

.news-card:hover {
  border-color: var(--line-strong);
  background: rgba(245, 240, 229, 0.42);
  transform: translateY(-1px);
}

.meta-row {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.site {
  color: var(--ink-soft);
}

.category,
.source {
  border-color: var(--line);
  border-radius: 4px;
  background: rgba(245, 240, 229, 0.65);
}

.category.kind-official {
  border-color: rgba(92, 138, 92, 0.4);
  color: var(--good);
}

.category.kind-newsletter {
  border-color: rgba(201, 143, 78, 0.42);
  color: var(--warn);
}

.category.kind-builders {
  border-color: rgba(204, 120, 92, 0.42);
  color: var(--accent-ink);
}

.title {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  transition: color 180ms ease-out;
}

.title:hover {
  color: var(--accent-ink);
}

.title-sub {
  color: var(--muted);
  font-family: var(--font-sans);
}

.site-group {
  border-top-color: var(--line);
}

.site-group-head,
.source-group-head {
  border-bottom-color: var(--line);
}

.site-group-head {
  background: rgba(236, 215, 200, 0.34);
}

.source-group-head {
  background: rgba(245, 240, 229, 0.72);
}

.site-group-head h3,
.source-group-head h3 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
}

.source-group {
  border-top-color: rgba(229, 221, 201, 0.72);
}

.featured-meta a,
.waytoagi-meta a {
  color: var(--accent-ink);
}

.featured-item,
.waytoagi-item,
.stat,
.coverage-card,
.health-metric {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: none;
  transition: border-color 200ms ease-out, transform 200ms ease-out, background-color 200ms ease-out;
}

.featured-item:hover,
.waytoagi-item:hover,
.coverage-card:hover,
.health-metric:hover {
  border-color: var(--line-strong);
  background: rgba(245, 240, 229, 0.5);
  transform: translateY(-1px);
}

.featured-item,
.waytoagi-item {
  border-color: var(--line);
}

.featured-item .d,
.waytoagi-item .d {
  color: var(--muted);
  font-family: var(--font-mono);
}

.status-board {
  display: grid;
  gap: 18px;
  padding: 24px 28px 28px;
  background: rgba(245, 240, 229, 0.66);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: lowercase;
}

.section-kicker svg {
  width: 90px;
  height: 16px;
  color: var(--accent);
}

.stats,
.coverage-strip {
  grid-column: auto;
}

.stat .k,
.coverage-label,
.coverage-meta {
  font-family: var(--font-mono);
}

.stat .v,
.coverage-card strong,
.health-metric strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
}

.coverage-card.ok strong,
.health-metric.ok strong {
  color: var(--good);
}

.coverage-card.warn strong,
.health-metric.warn strong {
  color: var(--warn);
}

.health-metric.bad strong,
.health-issue-title {
  color: var(--bad);
}

.coverage-card.signal,
.coverage-card.official,
.coverage-card.builders,
.coverage-card.aggregate,
.coverage-card.private {
  border-color: var(--line);
}

.health-ok {
  border-color: rgba(92, 138, 92, 0.36);
  background: rgba(92, 138, 92, 0.08);
  color: var(--good);
}

.health-empty,
.waytoagi-empty {
  border-color: var(--line-strong);
  color: var(--muted);
}

.health-issue,
.waytoagi-error {
  border-color: rgba(184, 90, 78, 0.34);
  background: rgba(184, 90, 78, 0.07);
}

.advanced-panel summary {
  background: var(--bg-card);
}

.advanced-panel summary::before {
  border-color: var(--line-strong);
  border-radius: 4px;
}

.advanced-content {
  border-top-color: var(--line);
  background: rgba(250, 249, 245, 0.48);
}

.empty {
  color: var(--muted);
}

@keyframes paperFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 28px 14px 48px;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-modes {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-modes .all-dedupe {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .mode-band {
    grid-column: 1;
    width: 100%;
  }

  .primary-controls,
  .source-filter-row {
    grid-template-columns: 1fr;
  }

  .control-cluster {
    display: flex;
    flex-wrap: wrap;
  }

  .mode-hint {
    padding-bottom: 0;
  }

  .site-select-field {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(46px, 18vw, 58px);
  }

  .hero-sub {
    font-size: 16px;
  }

  .list-head,
  .waytoagi-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .type-caret {
    animation: none;
    opacity: 0;
  }
}
