/* Self-hosted so the page has no third-party dependency and no render-blocking
   round trip. Same four faces as knewman23.github.io, byte for byte. */
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/plex-mono-400.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/plex-mono-500.woff2") format("woff2"); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/plex-mono-600.woff2") format("woff2"); font-weight:600; font-style:normal; font-display:swap; }

/* ============================================================
   Daily News

   Colour tokens, the dark band, the breadcrumbs and the theme
   toggle are lifted verbatim from knewman23.github.io/styles.css
   and ai-frontier/site/style.css, so all three sites are one
   system and a visitor moving between them sees one page.

   Light-first. Dark is a token swap, never a fork: --card is
   still "the surface above --bg" in both, so no component below
   carries a dark branch.

   The one project-local addition is the --alert family, for the
   things this app has and a portfolio index does not: a failed
   run, a stale handle, an error line in a log.
   ============================================================ */

:root {
  color-scheme: light;
  --bg:      #fbfbf9;
  --card:    #ffffff;
  --sunken:  #f5f5f2;
  --ink:     #0e0f11;
  --ink-2:   #2c2e33;
  --soft:    #5c5f67;
  --faint:   #71747c;
  --line:    #e2e2df;
  --line-2:  #cfcfcb;
  --accent:  #1f4ed8;
  --on-accent: #ffffff;
  --ok:      #0f7a4a;
  --warn:    #85670f;
  --dot-warn:#d9a020;
  --alert:   #b3261e;
  --alert-bg:rgba(179,38,30,.07);
  --alert-line:rgba(179,38,30,.28);
  --band-bg: #0e0f11;
  --band-ink:#ffffff;
  --band-dim:#8b8f98;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --gut: 40px;
  --max: 74rem;
  --drawer-width: 21rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:      #0b0c0e;
  --card:    #13151a;
  --sunken:  #0f1116;
  --ink:     #edeef1;
  --ink-2:   #d2d4da;
  --soft:    #9a9da6;
  --faint:   #7b7e88;
  --line:    #22252c;
  --line-2:  #2e323b;
  --accent:  #8b9bff;
  --on-accent: #0b0c0e;
  --ok:      #55d4a0;
  --warn:    #e2b357;
  --dot-warn:#e2b357;
  --alert:   #ff8a80;
  --alert-bg:rgba(255,138,128,.09);
  --alert-line:rgba(255,138,128,.26);
  --band-bg: #06070a;
  --band-ink:#ffffff;
  --band-dim:#7e828d;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }   /* stop iOS inflating text in landscape */

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;               /* long ids and urls must not widen the page */
}

body.drawer-open { overflow: hidden; }      /* the page must not scroll behind the drawer */

a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- band ---------------------------------------------------------------

   Dark in both themes, as on the index and on ai-frontier. It is the constant
   that makes moving between the three sites feel like one place, so it does
   not take part in the token swap. */

.band {
  background: var(--band-bg);
  color: var(--band-ink);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #23262d;
}

.band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.crumbs {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--band-dim);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
}

.crumbs a { color: var(--band-dim); text-decoration: none; }
.crumbs a:hover { color: var(--band-ink); }
.crumbs b { color: var(--band-ink); font-weight: 500; }
.crumbs .sep { padding: 0 .55em; color: #4b515c; }

.crumbs .here {
  color: var(--band-ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.band-tools { display: flex; align-items: center; gap: 12px; flex: none; }

/* --- theme toggle (the same component as the index) ---------------------- */

.theme {
  background: transparent;
  border: 1px solid #33373f;
  color: var(--band-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  flex: none;
}

.theme:hover { color: var(--band-ink); border-color: #4b515c; }
.theme:focus-visible { outline: 2px solid var(--band-dim); outline-offset: 2px; }
.theme svg { width: 12px; height: 12px; }

/* Show the icon for the theme you'd switch TO. */
.theme .i-dark  { display: inline; }
.theme .i-light { display: none; }
:root[data-theme="dark"] .theme .i-dark  { display: none; }
:root[data-theme="dark"] .theme .i-light { display: inline; }

/* --- masthead ----------------------------------------------------------- */

/* The portfolio's identity grid: the name on the left, a mono caption block on
   the right. Here the right-hand column is the artwork instead. */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 16rem);
  align-items: end;
  gap: 0 2.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.25rem, 6vw, 4rem) var(--gut) clamp(1.75rem, 4vw, 2.75rem);
}

.masthead h1 {
  margin: 0;
  font: 700 clamp(2.1rem, 5.4vw, 3.1rem)/1.02 var(--sans);
  letter-spacing: -.035em;
}

.updated {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.updated:empty { display: none; }   /* no stray gap before the first run */

/* Transparent-background line art, so it takes the page's own background in
   light mode. In dark mode the strokes are inverted rather than the file being
   swapped: one asset, and #000 inverts to #fff, which sits within a shade of
   --ink. A browser that drops the filter still shows the drawing. */
.crest {
  display: block;
  width: 100%;
  max-width: 16rem;
  height: auto;                    /* never force the page to scroll sideways */
  justify-self: end;
  opacity: .9;
}

:root[data-theme="dark"] .crest { filter: invert(1); }

/* The shared sign-off crest, the same mark the other three sites carry.
   Deliberately a separate class from the masthead .crest above: that one is
   sized by the header grid, this one is a fixed 132px. Below about 110px the
   engraving's lines merge into a smudge. Light carries more opacity than
   dark, because black at 42% on off-white is a ghost where white at 42% on
   near-black is not. */
.crest-wrap { padding-top: 3rem; text-align: center; }
.crest-wrap a { display: inline-block; line-height: 0; }
.footer-crest {
  display: block; width: 132px; height: auto;
  opacity: .55; transition: opacity .16s ease;
}
.crest-wrap a:hover .footer-crest { opacity: .8; }
/* Only [data-theme="dark"], with no prefers-color-scheme companion. Unlike
   the other three sites this one has no OS-dark palette: it stays light
   until the visitor toggles. Inverting on prefers-color-scheme alone would
   put a white crest on a light page for anyone with a dark OS who has not
   touched the toggle. */
:root[data-theme="dark"] .footer-crest { filter: invert(1); opacity: .42; }

/* --- toolbar ------------------------------------------------------------ */

.toolbar {
  position: sticky;
  top: 45px;                        /* the band's 44px min-height plus its border */
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.6rem var(--gut);
}

.search { flex: 1 1 auto; min-width: 0; max-width: 34rem; }

.search input {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  -webkit-appearance: none;
}

.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* The active tag lives in the toolbar so the filter state is visible once the
   drawer has closed over the chip that set it. */
.active-filter {
  flex: none;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.active-filter::after { content: " ✕"; }

.publish-status {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}

.publish-status:empty { display: none; }
.publish-status.published { color: var(--ok); }
.publish-status.failed { color: var(--alert); font-weight: 500; cursor: help; }

.menu-button {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--soft);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.menu-button:hover { border-color: var(--ink); color: var(--ink); }
.menu-button[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* --- layout: sidebar on desktop, drawer on phones ------------------------ */

/* Desktop is the base case: the panels are a persistent left rail, and the
   menu button and scrim do not exist. Everything drawer-shaped is confined to
   the narrow-window block near the bottom of this file, so the two behaviours
   cannot bleed into each other. */
.layout {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 3rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gut) 2rem;
  align-items: start;
}

.drawer {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.drawer-head { display: none; }        /* no "Browse" title or close button here */
.menu-button { display: none; }
.scrim { display: none; }

/* --- panels -------------------------------------------------------------

   Not cards. The rail is a column of labelled sections divided by hairlines,
   the way the portfolio's stack list and section heads are drawn. */

.panel {
  margin: 0;
  padding: 0;
}

.panel-title {
  margin: 0 0 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

details.panel > .panel-title { cursor: pointer; }

.count, .badge { letter-spacing: .1em; }

.badge[hidden] { display: none; }

.badge {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0 0.3rem;
  border: 1px solid var(--alert-line);
  border-radius: 2px;
  background: var(--alert-bg);
  color: var(--alert);
  font-size: 9.5px;
  text-align: center;
}

/* --- day list ----------------------------------------------------------- */

/* The cap still earns its place: one expanded month is up to 31 rows. It is no
   longer the only thing between the reader and the whole archive, though. */
.days { max-height: 40vh; overflow-y: auto; }

.month + .month { border-top: 1px solid var(--line); }

.month-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.4rem 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  list-style: none;                       /* the default marker, replaced below */
}

.month-head::-webkit-details-marker { display: none; }

.month-head::before {
  content: "▸";
  flex: none;
  font-size: 0.7rem;
  color: var(--line-2);
  transition: transform 120ms ease;
}

.month[open] > .month-head::before { transform: rotate(90deg); color: var(--accent); }
.month-head:hover { color: var(--ink); }

.month-label { flex: 1; min-width: 0; }

/* Only while collapsed: an open month shows its days, which is a better count
   than a number. */
.month-count { font-weight: 400; }
.month[open] > .month-head .month-count { display: none; }

.month-days { list-style: none; margin: 0 0 0.5rem; padding: 0; }

.days button {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  width: 100%;
  padding: 0.32rem 0.5rem;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.days button:hover { background: var(--sunken); color: var(--ink); }

.days button[aria-current="true"] {
  border-left-color: var(--accent);
  background: var(--sunken);
  color: var(--ink);
  font-weight: 600;
}

.days .topics { font-family: var(--mono); color: var(--faint); font-size: 10px; letter-spacing: .08em; }
.days .flag { color: var(--dot-warn); font-weight: 700; }

/* --- chips -------------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; font-family: var(--mono); }

.chip {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--sunken);
  color: var(--soft);
  font: inherit;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.chip:hover { border-color: var(--ink); color: var(--ink); }

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* The skipped chip is not a topic, so it does not look like one until used. */
.chip.skipped-chip {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
  color: var(--faint);
}

.chip.skipped-chip[aria-pressed="true"] {
  background: var(--soft);
  border-color: var(--soft);
  border-style: solid;
  color: var(--bg);
}

/* --- sources ------------------------------------------------------------ */

.sources { list-style: none; margin: 0 0 0.7rem; padding: 0; font-size: 0.85rem; }

.sources li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.sources .handle { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.sources li.off .handle { color: var(--faint); text-decoration: line-through; }
.sources .stale { color: var(--dot-warn); cursor: help; }

.icon-button {
  border: 0;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  cursor: pointer;
}

.icon-button:hover { color: var(--alert); }

.add { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.add input {
  flex: 1 1 6rem;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
}

.add input::placeholder { color: var(--faint); }

.add button, .notes-save {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.add button:hover, .notes-save:hover { filter: brightness(1.12); }

.error {
  flex: 1 0 100%;
  margin: 0.25rem 0 0;
  color: var(--alert);
  font-size: 0.75rem;
}

/* --- runs --------------------------------------------------------------- */

.runs { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
.runs > li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }

.run-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  width: 100%;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.run-dot { flex: none; font-size: 0.7rem; }
.run-dot.ok { color: var(--ok); }
.run-dot.warn { color: var(--dot-warn); }
.run-dot.bad { color: var(--alert); }
.run-meta { margin-left: auto; font-family: var(--mono); color: var(--faint); font-size: 10px; letter-spacing: .08em; }

.run-detail { margin: 0.3rem 0 0.4rem; padding-left: 1rem; }
.run-detail li { color: var(--alert); font-size: 0.75rem; }

/* Skipped topics are the filter working, not failures, so they are not red. */
.run-detail .skipped li { color: var(--faint); }

.run-log-button {
  border: 0; background: none; padding: 0;
  color: var(--accent); font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
}

.run-log-button:hover { text-decoration: underline; }

.log-view {
  max-height: 20rem;
  overflow: auto;
  margin: 0.45rem 0 0;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--sunken);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-view .line-warn { color: var(--warn); }
.log-view .line-error { color: var(--alert); font-weight: 500; }

/* --- main pane ---------------------------------------------------------- */

.main { min-width: 0; }

.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.75rem;
}

.day-head h2 {
  margin: 0;
  font: 600 clamp(1.5rem, 3.2vw, 1.9rem)/1.12 var(--sans);
  letter-spacing: -.022em;
}

.day-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.warn-banner {
  flex: 1 0 100%;
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--alert-line);
  border-left: 2px solid var(--alert);
  border-radius: 3px;
  background: var(--alert-bg);
  color: var(--soft);
  font-size: 0.85rem;
}

/* The file carries an `# July 28, 2026` title so it reads standalone in an
   editor. On the page the day header already says that, so hide the duplicate
   rather than removing it from the markdown. */
.article > h1 { display: none; }

/* Long-form reading, so the body is serif at a fixed measure — the same
   divergence ai-frontier makes from the index for the same reason. */
.article {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.article p, .article ul, .article ol, .article blockquote { max-width: 40rem; }

.article h2 {
  margin: 3.25rem 0 0.2rem;
  font: 600 1.3125rem/1.3 var(--sans);
  letter-spacing: -.012em;
  color: var(--ink);
}

/* The wrapper variants are for live mode, where .topic-head sits between the
   article and each heading. Both spellings are listed rather than one rewritten,
   because the static build has no wrapper. */
/* `>` matters: in live mode every h2 is the first child of its own .topic-head
   wrapper, so an unscoped `h2:first-child` zeroes the gap above every story,
   not just the first one. The wrapped first case is the fourth selector. */
.article > h1 + h2,
.article > h2:first-child,
.article > h1 + .topic-head > h2,
.article > .topic-head:first-child > h2 { margin-top: 0; }

/* The renderer emits `tags:` / `sources:` as the paragraph directly after each
   headline. Styling it as a byline keeps it out of the reading line.

   Both spellings again: in live mode .topic-head wraps the heading, so the
   byline is the wrapper's sibling and `h2 + p` never matches it. */
.article h2 + p,
.article .topic-head + p {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

.article h2 + p a,
.article .topic-head + p a { color: var(--soft); text-decoration: none; }
.article h2 + p a:hover,
.article .topic-head + p a:hover { color: var(--accent); }

.article p { margin: 0 0 1.15rem; }
.article a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.article strong { color: var(--ink); font-weight: 650; }
.article em { color: var(--soft); }

.article pre, .article table {
  display: block;
  max-width: 100%;
  overflow-x: auto;          /* wide content scrolls in its own box */
}

.article pre {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.article code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.1em 0.34em;
}

.article pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Live mode wraps each generated h2 and its skip button in this row. The button
   is a sibling rather than a child of the heading so the heading keeps its role
   in the accessibility tree; this is what puts it back on the same line. */
.topic-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Quiet until the topic is hovered: one of these sits on every headline in the
   feed, and at full contrast they would read as part of the news. */
.skip-topic {
  flex: none;
  padding: 0.15rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.4;
  opacity: 0;
  cursor: pointer;
}

.topic-head:hover .skip-topic,
.skip-topic:focus-visible { opacity: 1; }

.skip-topic:hover { border-color: var(--alert-line); color: var(--alert); }
.skip-topic[disabled] { opacity: 1; color: var(--faint); cursor: default; }

/* Touch has no hover, so the control would be unreachable if it stayed hidden. */
@media (hover: none) {
  .skip-topic { opacity: 1; }
}

.restore-topic {
  margin-top: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}

.restore-topic:hover { border-color: var(--accent); }
.restore-topic[disabled] { color: var(--faint); border-color: var(--line); cursor: default; }

.skipped-list { list-style: none; margin: 0; padding: 0; }
.skipped-headline { font-family: var(--sans); font-weight: 600; font-size: 1rem; color: var(--ink); }

.skipped-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.skipped-list .why {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --- older / newer ------------------------------------------------------ */

.day-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.day-nav-side {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.day-nav-side.newer { text-align: right; align-items: flex-end; }

.day-nav-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.day-nav-date { font-family: var(--sans); font-weight: 600; letter-spacing: -.012em; }

button.day-nav-side:hover { text-decoration: underline; }

/* Either end of the archive: present, so the other side does not move. */
.day-nav-side.end { color: var(--faint); cursor: default; }
.day-nav-side.end:hover { text-decoration: none; }

/* --- journal ------------------------------------------------------------ */

.journal {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.journal h3 {
  margin: 0 0 0.65rem;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}

.journal textarea {
  display: block;
  width: 100%;
  max-width: 40rem;
  min-height: 8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
}

.journal textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.journal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.status.saved { color: var(--ok); }
.status.failed { color: var(--alert); }

/* --- search results ----------------------------------------------------- */

.hits { list-style: none; margin: 0; padding: 0; }
.hits li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.hits li:last-child { border-bottom: 1px solid var(--line); }

.hit-head {
  border: 0; background: none; padding: 0;
  color: var(--ink); font-family: var(--sans); font-weight: 600; font-size: 1.0312rem;
  letter-spacing: -.012em;
  text-align: left; cursor: pointer;
}

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

.hit-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.hit-snippet { margin: 0.35rem 0 0; max-width: 40rem; color: var(--soft); font-size: 0.9375rem; }

.empty { color: var(--faint); font-style: italic; }

/* --- footer -------------------------------------------------------------

   ai-frontier's footer.page component, carrying the index's identity links.
   All three sites close on the same mono row. */

footer.page {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

footer.page .footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem var(--gut) 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem 1.75rem;
}

footer.page .links { display: flex; flex-wrap: wrap; gap: 0.7rem 1.5rem; }
footer.page a { color: var(--soft); text-decoration: none; }
footer.page a:hover { color: var(--accent); }

/* --- phones: the rail becomes a slide-out drawer -------------------------- */

@media (max-width: 46rem) {
  :root { --gut: 22px; }

  /* Single column, and the aside leaves the flow entirely so the reading
     column is not squeezed. */
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 1.5rem var(--gut) 2rem;
  }

  .menu-button { display: block; }

  /* Stacked rather than pushed apart: the links wrap onto their own rows at
     this width anyway, and space-between then strands the copyright alone. */
  footer.page .footer-inner { justify-content: flex-start; }

  /* Centred on phones: with the rail gone there is no left edge for the title
     to align to, so the artwork and the title read as a masthead instead. */
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 1.25rem 0;
  }

  .masthead h1 { font-size: clamp(2.5rem, 11vw, 3.25rem); }
  .updated { font-size: 11px; }

  .crest { justify-self: center; max-width: min(17rem, 68vw); order: -1; }

  .drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 40;
    gap: 1.25rem;
    width: min(var(--drawer-width), 88vw);
    height: 100dvh;
    padding: 1rem 1.15rem 2rem;
    overflow-y: auto;
    background: var(--card);
    border-left: 1px solid var(--line);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .28);
  }

  /* The drawer scrolls itself, so a second scroller nested inside it fights the
     touch gesture — a drag near the day list moves the wrong thing. The month
     sections already bound the height, so let it run naturally here. */
  .drawer .days { max-height: none; overflow-y: visible; }

  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
  }

  .drawer-head h2 {
    margin: 0;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--faint);
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(6, 7, 10, .55);
  }

  /* [hidden] has to be restated: the explicit display values above would
     otherwise keep the drawer and scrim on screen. */
  .drawer[hidden], .scrim[hidden] { display: none; }

  @media (prefers-reduced-motion: no-preference) {
    .drawer:not([hidden]) { animation: slide-in 180ms ease-out; }
    .scrim:not([hidden]) { animation: fade-in 180ms ease-out; }
  }

  .days { max-height: 45vh; }

  .toolbar-inner { padding: 0.5rem var(--gut); gap: 0.5rem; }
  .article h2 { font-size: 1.1875rem; margin-top: 2.6rem; }
  .journal textarea { min-height: 6.5rem; }
}

@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }

/* Touch pointers get real tap targets. The 44px floor is Apple's guidance and
   the icon buttons are nowhere near it by default. */
@media (hover: none) and (pointer: coarse) {
  .icon-button { min-width: 2.5rem; min-height: 2.5rem; font-size: 1.1rem; }
  .menu-button { width: 2.75rem; height: 2.75rem; }
  .chip { padding: 0.45rem 0.7rem; font-size: 10px; }
  .days button { min-height: 2.5rem; }
  .add button, .notes-save { padding: 0.6rem 0.95rem; }
  .search input, .add input { font-size: 1rem; }  /* under 16px makes iOS zoom on focus */
}

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

/* --- the book outline (live only) ---------------------------------------- */

.book-open {
  margin-top: 10px;
  width: 100%;
  font: 500 .78rem/1 var(--sans);
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

.book-part { margin-bottom: 12px; }

.book-part-title {
  font: 600 .72rem/1.3 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}

.book-threads { list-style: none; margin: 0; padding: 0; }

.book-threads li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 0;
  font: .8rem/1.4 var(--sans);
  color: var(--ink-2);
}

.book-thread-count {
  min-width: 2.2em;
  text-align: right;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--faint);
}

.book-part-full { margin: 0 0 32px; }

.book-part-heading {
  font: 600 1.05rem/1.3 var(--sans);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.book-thread-list { list-style: none; margin: 0; padding: 0; }

.book-thread {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  margin-bottom: 8px;
  padding: 10px 12px;
}

.book-thread summary { cursor: pointer; }
.book-thread summary::-webkit-details-marker { display: none; }

.book-thread-head {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
}

.book-thread-title { font: 600 .92rem/1.4 var(--sans); color: var(--ink); }

.book-thread-meta, .book-thread-why {
  font: .76rem/1.5 var(--sans);
  color: var(--faint);
}

.book-thread-why { margin: 6px 0 0; }

/* Provenance. One handle behind a thread is that account's preoccupation, not
   a theme, and the warning is the part that has to be hard to miss. */
.book-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.book-handle {
  font: .7rem/1 var(--mono);
  color: var(--soft);
  background: var(--sunken);
  border-radius: 999px;
  padding: 4px 8px;
}

.book-warning {
  font: 500 .7rem/1 var(--sans);
  color: var(--alert);
  background: var(--alert-bg);
  border: 1px solid var(--alert-line);
  border-radius: 999px;
  padding: 4px 8px;
}

.book-items { list-style: none; margin: 10px 0 0; padding: 0; }

.book-items li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  font: .82rem/1.5 var(--sans);
  color: var(--ink-2);
}
