/* delegatedto.ai — a quiet directory: layered charcoal surfaces, one cyan accent (the logo's
   "to"). Dark is the default. Colours are semantic tokens; components never use raw hex.
   Contrast (WCAG 2.2 AA) was checked for every text/surface pair below in both themes. */
:root {
  /* surfaces, back to front */
  --bg: #0b0d10;              /* page */
  --surface: #14181f;         /* cards, fields, panels */
  --surface-raised: #1c222b;  /* hover, elevated (menus, dialog) */
  --surface-high: #252c37;    /* hover on an elevated surface */
  --surface-sponsor: #191c21; /* paid placements: neutral charcoal, set apart from editorial */
  /* lines */
  --divider: #2b333f;         /* decorative only */
  --border-control: #6b7586;  /* boundaries that identify a control: ≥3:1 on every surface */
  /* text */
  --heading: #f4f6f8;
  --text: #d0d5dd;
  --text-muted: #929aa8;      /* secondary text and metadata: ≥4.5:1 on every surface */
  /* accent */
  --accent: #18b7ea;          /* fills: the newsletter call to action */
  --accent-hover: #4cc7f0;
  --on-accent: #0b0d10;       /* text on accent fills */
  --accent-text: #18b7ea;     /* links, selected controls, focus */
  --accent-soft: #0d212a;     /* tint behind selected or highlighted items */
  --focus: var(--accent-text);
  /* brand wordmark (brand/specifications.html) */
  --brand-name: #ffffff;
  --brand-to: #18b7ea;
  --brand-tld: #b9bec9;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --on-mark: #000;            /* text on the per-agent colour badges (always light fills) */
  --promo-surface: #0d2833;   /* the newsletter card: a cyan-tinted panel that stands out */
  --promo-border: #1d5468;
  --promo-field: #0b0d10;
  --grid-dot: #262d38;        /* the margin texture: dots on the logo's 24px grid */
  --grid-glow-peak: 0.11;     /* how bright a glowing cell gets at its peak */
  --logo-tile: #f4f6f8;       /* light tile behind agent logos, so colour and black logos both read */
  --logo-tile-edge: transparent;
  --font-sans: "Funnel Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Funnel Display", "Funnel Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-brand: "Space Grotesk", var(--font-display);
  --font-prompt: var(--font-mono);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f4f6f8;
  --surface-raised: #e9edf1;
  --surface-high: #dde2e8;
  --surface-sponsor: #eff0f2;
  --divider: #dde2e8;
  --border-control: #7d8794;
  --heading: #0b0d10;
  --text: #2b313a;
  --text-muted: #565d67;
  --accent: #18b7ea;
  --accent-hover: #0fa3d3;
  --on-accent: #0b0d10;
  --accent-text: #006a8c;
  --accent-soft: #e3f6fc;
  --brand-name: #111318;
  --brand-to: #007da5;
  --brand-tld: #5c626b;
  --shadow: 0 12px 32px rgba(11, 13, 16, 0.14);
  --promo-surface: #e0f5fc;
  --promo-border: #9fdcf2;
  --promo-field: #ffffff;
  --grid-dot: #d5dbe2;
  --grid-glow-peak: 0.16;
  --logo-tile: #ffffff;
  --logo-tile-edge: #dde2e8;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--bg);
  /* "Attention grid": dots on the logo's 24px pitch, in the margins (the frame covers the middle). */
  background-image: radial-gradient(circle at 12px 12px, var(--grid-dot) 1px, transparent 1.6px);
  background-size: 24px 24px;
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, .item-title, .tile-title, .next-title, .agent-row .name, .topic-row .name, .try-head b, .side-foot b { color: var(--heading); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul { list-style: none; padding: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono-label { font: 400 12px/1.5 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.signal { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* A few grid cells glow and fade, slowly, in the margins (app.js places them, only while invisible).
   Behind everything, opacity-only, and absent with reduced motion or without margins. */
.grid-glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.grid-glow span {
  position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 2px;
  background: var(--accent); opacity: 0; animation: grid-glow 9s ease-in-out infinite;
}
@keyframes grid-glow { 0%, 100% { opacity: 0; } 50% { opacity: var(--grid-glow-peak); } }
@media (prefers-reduced-motion: reduce) { .grid-glow { display: none; } }

/* ---------- frame ---------- */
.frame {
  max-width: 68rem; margin: 0 auto; background: var(--bg);
  border-left: 1px solid var(--divider); border-right: 1px solid var(--divider);
  min-height: 100vh;
}
.frame-grid { display: grid; grid-template-columns: 20rem minmax(0, 1fr); }
.frame-narrow { max-width: 48rem; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 40px 24px 32px; border-right: 1px solid var(--divider);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
/* Logo: brand/specifications.html. The files are trimmed to the artwork, so 264px here is the
   kit's 280px minimum; keep one cell pitch (~8px at this size) clear around it. */
.logo { display: block; width: 264px; max-width: 100%; height: auto; }
:root[data-theme="light"] .logo-dark, :root:not([data-theme="light"]) .logo-light { display: none; }
.brand a { display: block; width: fit-content; max-width: 100%; }
.wordmark { font: 600 1em/1 var(--font-brand); color: var(--brand-name); letter-spacing: 0; font-kerning: normal; }
.wordmark .wm-to { color: var(--brand-to); }
.wordmark .wm-tld { color: var(--brand-tld); }
.theme-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--border-control); color: var(--heading);
}
.toolbar .theme-btn { flex: none; width: 38px; height: 38px; }
.theme-btn:hover { background: var(--surface-raised); }
.theme-btn svg { width: 16px; height: 16px; }
:root:not([data-theme="light"]) .icon-sun, :root[data-theme="light"] .icon-moon { display: none; }
.tagline { margin-top: 14px; color: var(--text); font-size: 15px; line-height: 1.6; }
.tagline + .news-card { margin-top: 32px; }
.btn-cta, .btn-primary, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 8px 12px; font-size: 14px; line-height: 20px; white-space: nowrap;
}
/* The newsletter is the one cyan-filled action on a page. */
.btn-cta { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-cta:hover { background: var(--accent-hover); }
.btn-primary { background: var(--surface-raised); color: var(--heading); font-weight: 500; border: 1px solid var(--border-control); }
.btn-primary:hover { background: var(--surface-high); }
.btn-outline { border: 1px solid var(--divider); color: var(--text); }
.btn-outline:hover { border-color: var(--border-control); background: var(--surface); color: var(--heading); }
.btn-outline.is-on { border-color: var(--accent-text); color: var(--accent-text); background: var(--accent-soft); }
.btn-cta svg, .btn-primary svg, .btn-outline svg { width: 14px; height: 14px; }
/* newsletter card */
.news-card { background: var(--promo-surface); border: 1px solid var(--promo-border); border-radius: 14px; padding: 18px 16px 16px; }
.news-card h2 { font: 600 17px/1.3 var(--font-display); letter-spacing: -0.015em; color: var(--heading); }
.news-lead { margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--text); }
.news-card .subscribe { margin-top: 14px; }
.news-card > .btn-cta { margin-top: 14px; width: 100%; }
.news-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.news-foot a { margin-left: auto; display: inline-flex; align-items: center; min-height: 24px; color: var(--heading); text-decoration: underline; text-underline-offset: 3px; }
.news-foot a:hover { color: var(--accent-text); }
.subscribe { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.sub-row { display: flex; gap: 8px; min-width: 0; }
.sub-row[hidden] { display: none; }
.subscribe input[type="email"] {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--border-control); border-radius: 9px;
  background: var(--promo-field); color: var(--heading); font: 15px var(--font-sans);
}
.subscribe input[type="email"]::placeholder { color: var(--text-muted); }
.subscribe input[type="email"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.subscribe .btn-cta { flex: none; height: 42px; padding: 0 16px; border-radius: 9px; }
.subscribe .btn-cta:disabled { opacity: 0.7; cursor: progress; }
.sub-note { font-size: 13.5px; line-height: 1.5; color: var(--heading); }
.sub-note:empty { display: none; }
.sub-note a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.subscribe[data-state="error"] .sub-note::before { content: "Couldn't sign you up: "; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.news-side .sub-row { flex-direction: column; }
.news-side .subscribe input[type="email"] { flex: none; }
.news-side .subscribe .btn-cta { width: 100%; }
.news-box { margin-top: 48px; padding: 24px 22px; }
.news-box h2 { font-size: 19px; }
.news-box .news-lead, .news-box .subscribe { max-width: 34rem; }

/* live counters */
.stats { margin-top: 20px; padding: 14px 16px 16px; background: var(--surface); border-radius: 14px; }
.stats-head { display: flex; align-items: center; gap: 7px; font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.stats-head .updated { margin-left: auto; font-weight: 400; letter-spacing: 0; text-transform: none; }
.stats dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 10px; }
.stat { display: flex; flex-direction: column-reverse; gap: 1px; min-width: 0; }
.stat[hidden] { display: none; }
.stat dd { margin: 0; font: 600 20px/1.2 var(--font-display); color: var(--heading); font-variant-numeric: tabular-nums; }
.stat dd a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.stat dt { font-size: 12.5px; color: var(--text-muted); }
.stats-votes { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.stats-votes[hidden] { display: none; }
.stats-votes b { color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-submit { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--divider); }
.stats-submit p { font-size: 13.5px; color: var(--text); margin-bottom: 8px; }
.stats-submit .btn-outline { width: 100%; }
/* issues */
.issue-items { margin-top: 28px; }
.issue-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; font-size: 14px; }
.issue-nav a { display: inline-flex; align-items: center; min-height: 24px; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.issue-rows { margin-top: 28px; }
.issue-row { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 15px; }
.issue-row a { flex: none; width: 9.5rem; color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.issue-row span { color: var(--text-muted); min-width: 0; }
.promo { margin-top: 20px; background: var(--surface-sponsor); border-radius: 8px; padding: 14px 14px; font-size: 13.5px; line-height: 1.6; color: var(--text-muted); }
.promo .mono-label { font-size: 12px; }
.promo strong { display: block; color: var(--heading); font-weight: 500; font-size: 14px; margin: 4px 0 2px; }
.promo a.more { display: inline-block; margin-top: 6px; color: var(--accent-text); font-weight: 500; }
.side-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--divider); }
.side-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.side-head a { font: 12px var(--font-mono); color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.side-list a {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; margin: 0 -9px 1px; border-radius: 6px;
  font-size: 14px; color: var(--text);
}
.side-list a:hover { background: var(--surface); }
.side-list a.is-active { background: var(--surface-raised); color: var(--heading); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent-text); }
.side-list .n { margin-left: auto; font: 12px var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.side-list .show-all { color: var(--text-muted); font-size: 13px; }
.side-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--divider); font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.side-foot b { color: var(--text); font-weight: 500; }
.side-foot nav { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.side-foot nav a { color: var(--text-muted); }
.side-foot nav a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 2px; }
.filter-toggle { display: none; }

/* ---------- agent marks ---------- */
.mark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 5px; font: 600 9px/1 var(--font-mono); letter-spacing: -0.05em; color: var(--on-mark);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.mark-md { width: 20px; height: 20px; margin-top: 2px; }
.mark-sm { width: 18px; height: 18px; font-size: 8px; }
.mark-logo { background: var(--logo-tile); box-shadow: inset 0 0 0 1px var(--logo-tile-edge); }
.mark-logo img { width: 70%; height: 70%; display: block; }
.mark-hollow { border: 1px dashed var(--text-muted); color: var(--text-muted); box-shadow: none; }
.dot { width: 6px; height: 6px; border-radius: 2px; display: inline-block; flex: none; }
.dot-hollow { border: 1px solid var(--text-muted); }

/* ---------- section nav ---------- */
/* A band of its own: semibold display type, thin bars between items, the current page in cyan
   with an underline (so it isn't marked by colour alone). */
.site-nav {
  display: flex; align-items: stretch; min-height: 54px; padding: 0 24px; border-bottom: 1px solid var(--divider);
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { position: relative; display: inline-flex; align-items: center; padding: 0 16px; font: 600 16px var(--font-display); letter-spacing: -0.01em; color: var(--heading); }
.site-nav a:first-child { padding-left: 0; }
.site-nav a + a::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: var(--border-control); opacity: 0.6; }
.site-nav a:hover { color: var(--accent-text); }
.site-nav a[aria-current="page"] { color: var(--accent-text); box-shadow: inset 0 -2px 0 var(--accent-text); }
.site-nav a:focus-visible { outline-offset: -2px; }
.frame-narrow .site-nav { padding: 0 48px; }

/* ---------- main column ---------- */
.main { min-width: 0; padding-bottom: 96px; }
.toolbar {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 16px 24px 14px; border-bottom: 1px solid var(--divider);
}
.toolbar-row { display: flex; gap: 12px; align-items: center; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--border-control); border-radius: 8px; background: var(--surface);
}
.search:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.search svg { width: 14px; height: 14px; color: var(--text-muted); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--heading); font: 15px var(--font-sans); }
.search input::placeholder { color: var(--text-muted); }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { font: 11px var(--font-mono); color: var(--text-muted); border: 1px solid var(--divider); border-radius: 4px; padding: 2px 5px; }
.seg { display: flex; padding: 3px; border: 1px solid var(--border-control); border-radius: 8px; gap: 2px; background: var(--surface); }
.seg button { font: 13px var(--font-sans); color: var(--text-muted); padding: 5px 10px; border-radius: 5px; }
.seg button:hover { color: var(--heading); }
/* Selected: tinted fill, outline and weight, not hue alone. */
.seg button.is-on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-text); }
.chips { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.chip-btn {
  flex: none; border: 1px solid var(--divider); border-radius: 999px; padding: 4px 11px;
  font: 12px/1.5 var(--font-mono); color: var(--text);
}
.chip-btn:hover { border-color: var(--border-control); color: var(--heading); }
.chip-btn.is-on { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); font-weight: 500; }
.chip-btn.is-on::before { content: "✓ "; }

.section { padding: 20px 24px 20px; border-bottom: 1px solid var(--divider); }
.section:last-child { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; min-width: 0; }
.section-head .num { font: 12px var(--font-mono); color: var(--text-muted); }
.section-head h2 { font: 500 17px/1.5 var(--font-display); letter-spacing: -0.025em; white-space: nowrap; }
.section-head h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-head .kind { font: 12px var(--font-mono); color: var(--text-muted); }
.section-head .blurb { color: var(--text-muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.see-all { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--accent-text); font-size: 14px; font-weight: 500; }
.see-all svg { width: 14px; height: 14px; }
.see-all:hover { text-decoration: underline; text-underline-offset: 3px; }

/* top picks grid */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 12px 12px;
  background: var(--surface); border-radius: 10px;
  transition: background 0.15s;
}
.tile:hover { background: var(--surface-raised); }
.tile-votes { display: flex; align-items: center; gap: 6px; font: 12px var(--font-mono); color: var(--text-muted); min-height: 16px; font-variant-numeric: tabular-nums; }
.tile-votes svg { width: 11px; height: 11px; color: var(--text-muted); }
.tile-votes svg path { fill: currentColor; }
.tile-title { font-size: 15px; font-weight: 500; line-height: 1.35; flex: 1; }
.tile-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tile-actions { display: flex; }

/* signal panel */
.signal-panel { padding: 4px 0 0; }
.signal-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.signal-head h2 { font: 500 17px/1.375 var(--font-display); letter-spacing: -0.025em; }
.signal-head p { color: var(--text-muted); font-size: 14px; }
.signal-head p.mono-label { color: var(--text-muted); font-size: 12px; padding-top: 4px; flex: none; }

/* list items */
.items { display: flex; flex-direction: column; }
.item {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px; margin: 0 -8px; border-radius: 8px; transition: background 0.15s;
}
.item:hover { background: var(--surface); }
.item-body { min-width: 0; flex: 1; }
.item-title { font-size: 15px; font-weight: 500; line-height: 1.375; }
.item-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.item-summary {
  margin-top: 2px; font-size: 15px; line-height: 1.6; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-compact .item-summary { -webkit-line-clamp: 3; }
.how { margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--text); }
.how .label { font: 12px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-right: 4px; }
.how-lg { font-size: 16px; margin-top: 14px; }
.meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 12px/1.5 var(--font-mono); color: var(--text-muted); }
.meta-agent { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.meta-agent:hover { text-decoration: underline; text-underline-offset: 2px; }
.actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--divider); border-radius: 6px; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.btn-sm:hover { border-color: var(--border-control); background: var(--surface-raised); color: var(--heading); }
.btn-sm svg { width: 12px; height: 12px; }
.side-actions { display: flex; flex: none; gap: 2px; }
.vote {
  width: 44px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 6px; color: var(--text-muted); font: 12px/1 var(--font-mono); font-variant-numeric: tabular-nums;
}
.vote svg { width: 14px; height: 14px; }
.vote:hover { background: var(--surface-raised); color: var(--heading); }
/* Voted/saved: accent plus a filled icon, so the state isn't carried by colour alone. */
.vote.is-on { color: var(--accent-text); background: var(--accent-soft); }
.is-on > svg path { fill: currentColor; }
.vote-n:empty { display: none; }
.save {
  width: 44px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 6px; color: var(--text-muted); font-size: 11px; line-height: 1;
}
.save svg { width: 14px; height: 14px; }
.save:hover { background: var(--surface-raised); color: var(--heading); }
.save.is-on { color: var(--accent-text); background: var(--accent-soft); }
.day-head { margin: 18px 0 6px; }
.day-head:first-child { margin-top: 0; }
.empty { padding: 40px 0; color: var(--text-muted); font-size: 14px; }
.empty button { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* share menu */
.share-wrap { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 170px; padding: 4px;
  background: var(--surface-raised); border: 1px solid var(--divider); border-radius: 8px; box-shadow: var(--shadow);
}
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 5px; font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--surface-high); color: var(--heading); }

/* ---------- narrow pages (agents, categories, use cases) ---------- */
.topnav { display: flex; align-items: center; justify-content: space-between; padding: 24px 48px; border-bottom: 1px solid var(--divider); }
/* Leave room for the theme button on the narrowest phones. */
.topnav .logo { width: min(264px, calc(100vw - 104px)); }
.topnav-right { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
.topnav-right a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 3px; }
.page { padding: 52px 48px 96px; }
.eyebrow { font: 12px/1.5 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.eyebrow a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 2px; }
.page-title, .detail-title { margin-top: 14px; font: 500 30px/1.25 var(--font-display); letter-spacing: -0.025em; }
.page-lead, .detail-lead { margin-top: 18px; font-size: 18px; line-height: 1.6; color: var(--text-muted); }
.page-stats { margin-top: 18px; font: 12px var(--font-mono); color: var(--text-muted); }
.list-head { margin-top: 44px; padding-bottom: 12px; border-bottom: 1px solid var(--divider); font: 500 17px var(--font-display); letter-spacing: -0.02em; margin-bottom: 10px; }
.agent-rows { margin-top: 36px; }
.agent-row { display: flex; gap: 12px; padding: 12px 0; }
.agent-row .body { flex: 1; min-width: 0; }
.agent-row .name { font-weight: 500; }
.agent-row .name:hover { text-decoration: underline; text-underline-offset: 3px; }
.agent-row .desc { font-size: 15px; color: var(--text-muted); margin-top: 2px; }
.agent-row .often { font: 12px var(--font-mono); color: var(--text-muted); margin-top: 4px; }
.agent-row .n { font: 12px var(--font-mono); color: var(--text-muted); }
.done-with { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14.5px; color: var(--text-muted); }
.agent-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 3px; border: 1px solid var(--divider); border-radius: 6px;
  font: 12.5px var(--font-mono); color: var(--heading);
}
.agent-chip:hover { border-color: var(--border-control); background: var(--surface); }
.model-note { font: 12px var(--font-mono); color: var(--text-muted); }
.writeup { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--divider); }
.writeup h3 { margin: 18px 0 6px; }
.writeup h3:first-child { margin-top: 0; }
.writeup p { font-size: 16px; line-height: 1.7; color: var(--text); }
.try { margin-top: 28px; background: var(--surface); border-radius: 12px; padding: 18px; }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 15px; color: var(--text-muted); }
.try-head b { font-weight: 500; }
/* The "<> Copy prompt" pill (design P1); only in the details, so the cards invite a click. */
.prompt-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px;
  border: 1px solid var(--border-control); border-radius: 9px; font: 600 13.5px var(--font-sans); color: var(--heading);
}
.prompt-pill svg { width: 15px; height: 15px; }
.prompt-pill:hover { background: var(--surface-raised); }
.prompt-pill.is-copied { color: var(--accent-text); border-color: var(--accent-text); background: var(--accent-soft); }
.prompt { margin: 0; white-space: pre-wrap; word-wrap: break-word; font: 13.5px/1.7 var(--font-prompt); color: var(--heading); }
/* [placeholders] to fill in before using the prompt */
.prompt .ph { color: var(--accent-text); background: var(--accent-soft); border-radius: 4px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.try-hint { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.ph-key { color: var(--accent-text); background: var(--accent-soft); border-radius: 4px; padding: 1px 4px; font-family: var(--font-prompt); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; align-items: center; }
.vote-wide svg { width: 12px; height: 12px; }
.vote-wide [data-vote-n] { font-variant-numeric: tabular-nums; }
.source-line { margin-top: 18px; font: 13px/1.6 var(--font-mono); color: var(--text-muted); }
.source-line a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.fineprint { margin-top: 8px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.fineprint a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.chip { display: inline-block; font: 12px var(--font-mono); padding: 2px 8px; border: 1px solid var(--divider); border-radius: 999px; margin: 0 4px 4px 0; color: var(--text-muted); }
.browse-links { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.browse-links a { text-decoration: underline; text-underline-offset: 3px; color: var(--accent-text); }
.browse-links a:hover { text-decoration-thickness: 2px; }
.foot-links { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--divider); display: flex; flex-wrap: wrap; gap: 6px 20px; font: 12.5px var(--font-mono); color: var(--text-muted); }
.foot-links a { display: inline-flex; align-items: center; min-height: 24px; }
.foot-links a:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 2px; }
.topic-rows { margin-top: 32px; }
.topic-row { padding: 16px 0; border-bottom: 1px solid var(--divider); }
.topic-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.topic-row .name { font: 500 17px var(--font-display); letter-spacing: -0.02em; }
.topic-row .name:hover { text-decoration: underline; text-underline-offset: 3px; }
.topic-row .n { font: 12px var(--font-mono); color: var(--text-muted); }
.topic-row .desc { margin-top: 4px; font-size: 15px; color: var(--text-muted); }
.topic-row .often { margin-top: 4px; font: 12px var(--font-mono); color: var(--text-muted); }
.prose { margin-top: 24px; font-size: 16px; line-height: 1.7; }
.prose p, .prose ul { margin-top: 14px; }
.prose ul { list-style: disc; padding-left: 20px; }
.prose li { margin-top: 6px; }
.prose h2 { margin-top: 28px; font: 500 17px var(--font-display); letter-spacing: -0.02em; }
.prose a:not([class]) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.prose a:not([class]):hover { text-decoration-thickness: 2px; }
.related { margin-top: 48px; }

/* dialog */
dialog {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; margin: auto;
  background: var(--bg); color: var(--text); border: 1px solid var(--divider); border-radius: 14px; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(5, 6, 8, 0.72); }
dialog[open] { display: flex; flex-direction: column; }
.dialog-bar { display: flex; justify-content: flex-end; gap: 6px; padding: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--text-muted); }
.icon-btn:hover { background: var(--surface-raised); color: var(--heading); }
.icon-btn svg { width: 15px; height: 15px; }
.dialog-body { padding: 0 32px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.dialog-body .fineprint { display: none; }
.dialog-foot { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--divider); }
.dialog-foot:empty { display: none; }
.next { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; text-align: left; padding: 6px 8px; border-radius: 6px; }
.next:hover { background: var(--surface); }
.next-label { color: var(--text-muted); flex: none; }
.next-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.share-up .menu { top: auto; bottom: calc(100% + 6px); }
.dialog-body .detail-title { margin-top: 10px; font-size: 26px; }
.dialog-body .detail-lead { font-size: 17px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--heading); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 14px; transition: all 0.2s; z-index: 50;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sponsor bar ----------
   Paid placements sit on their own charcoal surface with a visible "Sponsored" label. The page
   reserves the bar's height (body padding) so it never covers content or controls. */
:root { --bar-h: 52px; }
body.sponsors-closed { --bar-h: 0px; }
body { padding-bottom: var(--bar-h); }
.sidebar { height: calc(100vh - var(--bar-h)); }
.sponsorbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: stretch; background: var(--surface-sponsor); border-top: 1px solid var(--divider);
}
body.sponsors-closed .sponsorbar { display: none; }
.sb-label { display: flex; align-items: center; padding: 0 16px; border-right: 1px solid var(--divider); font: 500 12px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); flex: none; }
.sb-viewport { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.sb-track { display: flex; align-items: center; width: max-content; animation: sb-scroll var(--sb-duration, 60s) linear infinite; }
.sb-copy { display: contents; }
.sponsorbar:hover .sb-track, .sponsorbar:focus-within .sb-track { animation-play-state: paused; }
@keyframes sb-scroll { to { transform: translateX(-50%); } }
.sb-item { display: inline-flex; align-items: center; gap: 10px; padding: 0 28px; white-space: nowrap; font-size: 14px; color: var(--text-muted); }
.sb-item b { color: var(--heading); font-weight: 600; }
.sb-item .wordmark { font-size: 15px; }
.sb-item:hover b, .sb-item:hover .wordmark { text-decoration: underline; text-underline-offset: 3px; }
/* Every sponsor mark sits in the same 24px box. */
.sb-mark, .sb-logo, .sb-plus { flex: none; width: 24px; height: 24px; border-radius: 6px; }
.sb-mark { display: inline-grid; place-items: center; border: 1px solid var(--divider); font: 600 10px var(--font-mono); color: var(--heading); text-transform: uppercase; }
.sb-slot { font-size: 13px; color: var(--text-muted); }
.dialog-body .detail-actions .share-wrap { display: none; }
.sb-plus { display: inline-grid; place-items: center; border: 1px dashed var(--border-control); font-size: 13px; color: var(--text); }
.sb-close { flex: none; width: 44px; display: grid; place-items: center; color: var(--text-muted); position: relative; z-index: 1; background: var(--surface-sponsor); }
.sb-close:hover { color: var(--heading); background: var(--surface-raised); }
.sb-close svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) {
  .sb-track { animation: none; }
  .sb-copy { display: none; }
  .sb-viewport { overflow-x: auto; scrollbar-width: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .frame { border: 0; }
  .frame-grid { display: block; }
  .sidebar { position: static; height: auto; overflow: visible; padding: 20px 24px 16px; border-right: 0; border-bottom: 1px solid var(--divider); }
  .tagline { margin-top: 8px; font-size: 14px; }
  .promo { display: none; }
  .stats dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat dd { font-size: 18px; }
  .tagline + .news-card { margin-top: 20px; }
  .filter-toggle {
    display: flex; width: 100%; margin-top: 10px; justify-content: space-between; align-items: center;
    border: 1px solid var(--border-control); color: var(--heading); background: var(--surface); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 500;
  }
  .filter-toggle span { font: 12px var(--font-mono); color: var(--text-muted); }
  .side-lists, .side-foot { display: none; }
  body.filters-open .side-lists { display: block; }
  .toolbar { position: static; padding: 16px 24px 14px; }
  .tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -24px; padding: 0 24px; scrollbar-width: none; }
  .tile { flex: 0 0 72%; scroll-snap-align: start; }
  .topnav { padding: 18px 20px; }
  .site-nav { padding-left: 24px; padding-right: 24px; }
  .frame-narrow .site-nav { padding: 0 20px; }
  .page { padding: 32px 20px 72px; }
}
@media (max-width: 640px) {
  .sidebar, .toolbar, .section, .site-nav { padding-left: 16px; padding-right: 16px; }
  .site-nav a { padding: 0 13px; font-size: 15px; }
  .site-nav a:first-child { padding-left: 0; }
  .tiles { margin: 0 -16px; padding: 0 16px; }
  .signal-panel { padding: 16px; margin: 0 -4px; }
  .section-head .blurb, .section-head .kind { display: none; }
  .page-title, .detail-title { font-size: 26px; }
  .page-lead, .detail-lead { font-size: 16px; }
  .d-row { grid-template-columns: 1fr; gap: 2px; }
  .dialog-body { padding: 0 18px 22px; }
  .dialog-foot { padding: 10px 14px; }
  :root { --bar-h: 46px; }
  .sb-label { padding: 0 10px; font-size: 11px; letter-spacing: 0.04em; }
  .sb-item { font-size: 13px; padding: 0 18px; }
  .topnav-right .count { display: none; }
  .search .kbd { display: none; }
  .stats dl { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
