/* ============================================================
   Design tokens — ported from jeanoh.org/styles.css. Keep this block in sync.
   ============================================================ */
:root {
  --bg: #fcfbf9;
  --fg: #1b1f26;
  --muted: #646a74;
  --faint: #9ca3ad;
  --rule: #e6e4df;
  --accent: #0b63a6;
  --paper: #ffffff;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;

  --measure: 85ch;
  --label: 180px;
  --gutter: 3rem;
  --maxw: calc(var(--label) + var(--gutter) + var(--measure));
  --topbar-h: 3.5rem;

  /* digest-only */
  --ink: var(--fg); --link: var(--accent); --link-hover: var(--accent); --hair: var(--rule); --panel: var(--paper);
  --set-entrepreneurship: #0b63a6; --set-ai_work: #0f766e; --set-orgs_inequality: #b45309; --pick: #b4432e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* author display rules (grid, flex) must not override the hidden attribute */
html { font-size: 17px; scroll-behavior: smooth; }   /* jeanoh.org renders at 17px (Bootstrap cosmo); match so rem sizes agree */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; padding: 0 16px; background-color: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; line-height: 1.15; color: var(--fg); }
p { margin: 0; }
.wrap { max-width: var(--maxw); margin-inline: auto; }

/* ============================================================
   Top bar and footer (as on jeanoh.org)
   ============================================================ */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(252, 251, 249, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); margin-inline: -16px; padding-inline: 16px; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--topbar-h); }
.brand { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--fg); }
.brand:hover { color: var(--fg); text-decoration: none; }
.topnav { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.topnav a { color: var(--muted); }
.topnav a:hover, .topnav a.on { color: var(--fg); text-decoration: none; }
.topnav a.on { box-shadow: inset 0 -1.5px 0 var(--accent); }
.topnav .ext { font-size: 0.8em; color: var(--faint); }
.footbar { margin-top: 5rem; border-top: 1px solid var(--rule); margin-inline: -16px; padding-inline: 16px; }
.footbar .wrap { padding-block: 1.25rem 2.5rem; }
.footbar .copy { font-size: 0.85rem; color: var(--muted); }

/* ============================================================
   Digest header
   ============================================================ */
.muted { color: var(--muted); }
.sep { color: var(--faint); margin: 0 0.3rem; user-select: none; }
.js-only { display: none; }
html.js .js-only { display: inline; }
html.js .no-js-only { display: none; }
button.linkish { background: none; border: none; padding: 0; margin: 0; font: inherit; font-size: inherit; color: var(--accent); cursor: pointer; }
button.linkish:hover { text-decoration: underline; text-underline-offset: 0.15em; }

.digest-head { padding-block: 3rem 1.5rem; }
.digest-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 4vw, 2.6rem); letter-spacing: -0.015em; line-height: 1.1; }
.digest-title a { color: inherit; }
.digest-title a:hover { text-decoration: none; }
.credit { margin: 0.6rem 0 1.4rem; font-size: 1.05rem; color: var(--muted); max-width: var(--measure); }
.issue-line { font-size: 0.95rem; color: var(--muted); margin: 0 0 1rem; }
.issue-line strong { color: var(--fg); font-weight: 600; }
.issue-nav { margin-left: 0.6rem; }
.issue-nav a { margin-right: 0.6rem; }
.subnav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; font-size: 0.9rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.55rem 0; margin-bottom: 1rem; }
.subnav a { color: var(--muted); }
.subnav a:hover { color: var(--fg); text-decoration: none; }
.badge { display: inline-block; min-width: 1.1em; padding: 0 0.3em; margin-left: 0.3em; border-radius: 1em; background: var(--accent); color: #fff; font-size: 0.7rem; text-align: center; vertical-align: 0.1em; }
.set-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; }
.chip { font: inherit; font-size: 0.82rem; padding: 0.15rem 0.7rem; border: 1px solid var(--rule); border-radius: 1rem; background: transparent; color: var(--fg); cursor: pointer; }
.chip .count { color: var(--muted); margin-left: 0.2em; }
.chip:hover { border-color: var(--muted); }
.chip.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.chip.is-on .count { color: rgba(255,255,255,0.8); }
.view-tools { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }
.legend-bar { display: inline-block; width: 3px; height: 0.9em; background: var(--pick); vertical-align: -0.1em; margin-right: 0.4em; }

/* ============================================================
   Sections: sticky label on the left, content on the right (as on jeanoh.org)
   ============================================================ */
section.cat, .about-page section, .cite-static, #results .results-issue { display: grid; grid-template-columns: var(--label) 1fr; gap: 1.5rem var(--gutter); padding-block: 2.5rem; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--topbar-h) + 0.5rem); }
section.cat > h2, #results .results-issue > h2, .cite-static > h2 { position: sticky; top: calc(var(--topbar-h) + 1rem); align-self: start; font-size: 1.5rem; line-height: 1.1; }
section.cat > h2 .count { display: block; font-family: var(--font-body); font-size: 0.85rem; color: var(--faint); margin-top: 0.3rem; }
.cat-body { min-width: 0; max-width: var(--measure); }
section.src { margin: 0; }

/* ============================================================
   Entries
   ============================================================ */
.Z3988 { display: none; }
.entry { position: relative; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) 9.5rem; gap: 0 1.1rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--topbar-h) + 1rem); }
section.src:first-child .entry:first-child, #entries.single .entry { border-top: 0; padding-top: 0; }
.entry.is-pick .entry-body { border-left: 3px solid var(--pick); padding-left: 0.8rem; margin-left: -0.83rem; }
.entry-ord { font-size: 0.8rem; color: var(--faint); line-height: 1.5; padding-top: 0.35rem; font-variant-numeric: tabular-nums; }
.entry-title { font-family: var(--font-display); font-size: 1.28rem; font-weight: 500; line-height: 1.25; margin: 0 0 0.25rem; text-wrap: balance; }
.entry-title a { color: var(--fg); }
.entry-title a:hover { color: var(--accent); text-decoration: none; }
.entry-authors { font-size: 0.98rem; color: var(--fg); line-height: 1.45; margin: 0 0 0.5rem; }
.entry-side { font-size: 0.82rem; line-height: 1.5; color: var(--muted); padding-top: 0.35rem; }
.entry-side > * { display: block; }
.entry-side .venue { color: var(--fg); font-style: italic; }
.entry-side .status { color: var(--faint); }
.entry-side .entry-links { margin-top: 0.35rem; }
.tag { display: block; font-size: 0.82rem; color: var(--muted); }
.tag-entrepreneurship { color: var(--set-entrepreneurship); }
.tag-ai_work { color: var(--set-ai_work); }
.tag-orgs_inequality { color: var(--set-orgs_inequality); }
.tag-pick { color: var(--pick); }
.entry-note { font-size: 0.92rem; color: var(--muted); font-style: italic; margin: 0 0 0.4rem; }
html.notes-hidden .entry-note { display: none; }
.version-note { font-size: 0.8rem; color: var(--pick); margin-left: 0.4em; }

details.abstract { font-size: 0.95rem; line-height: 1.55; margin: 0.1rem 0 0.2rem; }
details.abstract summary { list-style: none; cursor: pointer; color: var(--fg); }
details.abstract summary::-webkit-details-marker { display: none; }
.abstract-label { display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-right: 0.5em; }
details.abstract:not([open]) .abstract-teaser { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
details.abstract[open] .abstract-teaser { display: none; }
details.abstract:not([open]) summary::after { content: "more"; color: var(--accent); font-size: 0.82rem; }
details.abstract[open] summary::after { content: "less"; color: var(--accent); font-size: 0.82rem; margin-left: 0.5em; }
.abstract-full { margin-top: 0.2rem; }
.abstract-src { font-size: 0.75rem; color: var(--faint); margin: 0.2rem 0 0; }
.abstract-none { font-size: 0.85rem; color: var(--faint); font-style: italic; margin: 0.1rem 0 0.2rem; }
.entry-links { margin: 0; }
.entry.is-focused { outline: 2px solid var(--accent); outline-offset: 6px; }
.entry:target { animation: target-flash 2.5s ease-out; }
@keyframes target-flash { from { background: #fbf4dc; } to { background: transparent; } }
.empty, .run-line { font-size: 0.85rem; }
.cite-static pre { white-space: pre-wrap; font-size: 0.8rem; margin: 0.4rem 0; background: var(--paper); border: 1px solid var(--rule); padding: 0.6rem 0.8rem; overflow-x: auto; }

/* ============================================================
   Panels (dialogs)
   ============================================================ */
.overlay { position: fixed; inset: 0; background: rgba(27,31,38,0.32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 5rem 1rem 2rem; overflow-y: auto; }
.overlay[hidden] { display: none; }
.dialog { background: var(--paper); max-width: 600px; width: 100%; padding: 1.5rem 1.75rem 1.5rem; border-radius: 14px; box-shadow: 0 24px 60px rgba(27,31,38,0.22), 0 1px 0 rgba(27,31,38,0.04); font-size: 0.95rem; animation: dialog-in 0.18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.dialog-head h3 { margin: 0; font-size: 1.45rem; }
.dialog-close { width: 2rem; height: 2rem; border-radius: 50%; border: none; background: var(--bg); color: var(--muted); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.dialog-close:hover { background: var(--rule); color: var(--fg); }
.dialog label { display: block; margin: 0.35rem 0; }
.dialog input[type="search"], .dialog input[type="text"] { width: 100%; font: inherit; font-size: 0.95rem; padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); margin-top: 0.2rem; }
.dialog input[type="search"]:focus, .dialog input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,99,166,0.15); background: var(--paper); }
.dialog fieldset { border: none; padding: 0; margin: 0 0 1.1rem; }
.dialog legend { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0; margin-bottom: 0.45rem; }
.dialog fieldset label { display: inline-block; margin: 0.15rem 1rem 0.15rem 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.help { font-size: 0.82rem; color: var(--muted); margin: 0.3rem 0 0.8rem; }
.search-error { color: var(--pick); font-size: 0.85rem; }

/* pill toggles: the native checkbox is hidden, the label shows the state */
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pills legend { width: 100%; }
.dialog .pills label.pill { display: inline-flex; align-items: center; gap: 0.35em; margin: 0; padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--fg); font-size: 0.88rem; cursor: pointer; user-select: none; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill .count { font-size: 0.78rem; color: var(--faint); }
.dialog .pills label.pill:hover { border-color: var(--muted); }
.dialog .pills label.pill:has(input:checked) { background: var(--fg); border-color: var(--fg); color: var(--paper); }
.pill:has(input:checked) .count { color: rgba(255,255,255,0.7); }
.pill:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(11,99,166,0.25); }
.dialog .pills label.pill-entrepreneurship:has(input:checked) { background: var(--set-entrepreneurship); border-color: var(--set-entrepreneurship); }
.dialog .pills label.pill-ai_work:has(input:checked) { background: var(--set-ai_work); border-color: var(--set-ai_work); }
.dialog .pills label.pill-orgs_inequality:has(input:checked) { background: var(--set-orgs_inequality); border-color: var(--set-orgs_inequality); }

/* source checklist */
.source-search { margin-bottom: 0.4rem; }
.source-list { max-height: 11rem; overflow-y: auto; border: 1px solid var(--rule); border-radius: 8px; padding: 0.35rem 0.6rem; background: var(--bg); }
.source-list label { display: flex !important; align-items: center; gap: 0.5rem; margin: 0 !important; padding: 0.25rem 0.2rem; border-radius: 6px; font-size: 0.9rem; cursor: pointer; }
.source-list label:hover { background: rgba(27,31,38,0.04); }
.source-list label[hidden] { display: none !important; }
.source-list input { accent-color: var(--accent); margin: 0; }
.count { color: var(--faint); font-size: 0.8rem; }

/* switch */
.switch-row { display: inline-flex !important; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; margin: 0.2rem 0 0 !important; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { width: 2.3rem; height: 1.3rem; border-radius: 999px; background: var(--rule); position: relative; transition: background 0.15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 0.15rem; left: 0.15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.switch-row input:checked + .switch { background: var(--pick); }
.switch-row input:checked + .switch::after { transform: translateX(1rem); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(11,99,166,0.25); }

.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }
.btn { font: inherit; font-size: 0.9rem; font-weight: 500; padding: 0.45rem 1.1rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 999px; cursor: pointer; }
.btn:hover { filter: brightness(0.95); }
.btn-secondary { background: transparent; color: var(--muted); border-color: transparent; }
.btn-secondary:hover { color: var(--fg); background: var(--bg); filter: none; }
.issue-list { list-style: none; padding: 0; margin: 0; }
.issue-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }
.issue-list li:last-child { border-bottom: 0; }
.issue-list li.current a { font-weight: 600; }
.keys dt { float: left; clear: left; width: 4rem; font-weight: 600; }
.keys dd { margin: 0 0 0.2rem 4.5rem; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: 999px; z-index: 300; box-shadow: 0 8px 24px rgba(27,31,38,0.2); }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .dialog { animation: none; } }
#results .results-issue > h2 { font-size: 1.5rem; }

/* ============================================================
   Issues index, sources, about, AI guide
   ============================================================ */
.issues-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.issues-table th, .issues-table td { text-align: left; padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.issues-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.status-pill { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0 0.5em; border-radius: 1em; background: var(--rule); color: var(--fg); vertical-align: 0.1em; margin-left: 0.3em; }
.status-ok, .status-success { background: #dcefe0; color: #14532d; }
.status-error, .status-failed { background: #f8e0e0; color: #7f1d1d; }
.status-partial, .status-empty { background: #f7ecd6; color: #7c2d12; }
.sources-page-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.sources-page-list li { break-inside: avoid; padding: 0.2rem 0; }
.back-link { font-size: 0.95rem; }
.about-page { display: grid; gap: 0; }
.about-page h2 { font-size: 1.5rem; margin: 2.25rem 0 0.75rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.about-page p, .llms p, .llms li, .topics dd { max-width: var(--measure); }
.about-page p + p { margin-top: 0.8rem; }
.topics dt { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; margin-top: 0.8rem; }
.topics dd { margin: 0.1rem 0 0.4rem; color: var(--muted); }
.llms h2 { font-size: 1.5rem; margin: 2rem 0 0.6rem; }
.llm-entries li { margin-bottom: 1rem; }
.llms pre { background: var(--paper); border: 1px solid var(--rule); padding: 0.6rem 0.8rem; font-size: 0.85rem; white-space: pre-wrap; }
.cite-static { font-size: 0.95rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Mobile (breakpoints as on jeanoh.org)
   ============================================================ */
@media (max-width: 760px) {
  .brand { font-size: 1.05rem; white-space: nowrap; }
  .topnav { gap: 0.85rem; font-size: 0.82rem; }
  .topnav a.cv { display: none; }
  .digest-head { padding-block: 2rem 1rem; }
  section.cat, .about-page section, .cite-static, #results .results-issue { grid-template-columns: 1fr; gap: 1rem; padding-block: 2rem; }
  section.cat > h2, #results .results-issue > h2, .cite-static > h2 { position: static; }
  section.cat > h2 .count { display: inline; margin-left: 0.4em; }
  .entry { grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0 0.5rem; }
  .entry-side { grid-column: 2; padding-top: 0; margin-top: 0.3rem; }
  .entry-side > * { display: inline; }
  .entry-side > * + *::before { content: " · "; color: var(--faint); }
  .field-grid { grid-template-columns: 1fr; }
  .sources-page-list { columns: 1; }
}
@media print {
  .topbar, .subnav, .set-chips, .view-tools, .entry-links, .footbar, .overlay, .toast { display: none !important; }
  section.cat { grid-template-columns: 1fr; }
  section.cat > h2 { position: static; }
  details.abstract summary::after { display: none; }
  details.abstract:not([open]) .abstract-teaser { display: block; -webkit-line-clamp: unset; color: var(--fg); }
}
