/* Notes Pensive — design tokens, components and app shell. The single source of truth for the
   look (TASKS.md slice 18). Dark theme uses the redesign brief's tokens exactly
   (docs/design/private-pensive-redesign-brief.md); light theme is derived to the same 4.5:1 text
   contrast rule. app/tests/test_contrast.py checks every text/background pair below in both
   themes, so retune a value here and run it. */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@600;700&display=swap');

/* ── tokens: light (the default, and what renders without JavaScript) ── */
:root {
  --color-bg: #f5f6f8;            /* page */
  --color-bg-sidebar: #eceef2;    /* left nav, phone tab bar */
  --color-bg-rail: #f0f2f5;       /* right rail */
  --color-surface: #ffffff;       /* cards */
  --color-surface-hover: #f4f7fd;
  --color-control-bg: #e9ecf1;    /* segmented-control track */
  --color-control-active: #d8deea;/* active segment, neutral groups */
  --color-nav-active: #dfe7f7;    /* active sidebar item */
  --color-border: #dcdfe5;        /* layout dividers */
  --color-border-card: #d5dae3;   /* card borders, card footer divider */
  --color-border-card-hover: #aab4c6;
  --color-input-bg: #ffffff;
  --color-input-border: #c4cbd6;
  --color-text: #161a22;          /* primary text */
  --color-text-2: #343b48;        /* body text in the rail */
  --color-text-muted: #4a5262;    /* card source line */
  --color-text-meta: #586173;     /* metadata, section labels */
  --color-nav-text: #3b4352;
  --color-accent: #2b5bc8;        /* primary buttons, active states, Journal */
  --color-accent-hover: #2350b3;
  --color-on-accent: #ffffff;     /* text on accent fills */
  --color-link: var(--color-accent);
  --color-type-journal: var(--color-accent);
  --color-type-podcast: #985a00;
  --color-type-book: #12734d;     /* also the "shared" visibility badge */
  --color-danger: #b91c1c;
  --color-pill-bg: #e9ecf1;
  --color-pill-text: #3b4352;
  --color-divider: var(--color-border);
  --color-overlay: rgba(10, 12, 16, 0.5);

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-segment: 7px;
  --radius-control: 10px;         /* buttons, inputs */
  --radius-card: 12px;
  --radius-pill: 999px;
  --radius-md: var(--radius-control);  /* older name, still used inline in a few templates */

  --touch: 44px;                  /* minimum touch-target height */

  --shadow-sm: 0 1px 2px rgba(16, 20, 28, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 20, 28, 0.22);
}

/* ── tokens: dark (the brief's values) ── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #131418;
  --color-bg-sidebar: #0f1013;
  --color-bg-rail: #16181d;
  --color-surface: #1c2230;
  --color-surface-hover: #222a3a;
  --color-control-bg: #1a1d24;
  --color-control-active: #2a3242;
  --color-nav-active: #1d2433;
  --color-border: #23262e;
  --color-border-card: #2a3242;
  --color-border-card-hover: #3a4558;
  --color-input-bg: #181a20;
  --color-input-border: #2a2f3a;
  --color-text: #eceef2;
  --color-text-2: #c3c9d4;
  --color-text-muted: #a3abba;
  --color-text-meta: #8b94a6;
  --color-nav-text: #b7becb;
  --color-accent: #7aa7ff;
  --color-accent-hover: #a9c6ff;
  --color-on-accent: #0c1424;
  --color-type-podcast: #f2b45c;
  --color-type-book: #6fd3a4;
  --color-danger: #f87171;
  --color-pill-bg: #232a38;
  --color-pill-text: #b7becb;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55; font-weight: 400;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 var(--space-2);
}
h1 { font-size: 44px; font-weight: 700; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-link); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-hover); }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption { font-size: 12px; margin-top: var(--space-1); color: var(--color-text-meta); }
.text-muted { color: var(--color-text-meta); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
[hidden] { display: none !important; }
/* Read by screen readers, not shown - e.g. "(opens in a new tab)" on the podcast Listen link. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.danger { color: var(--color-danger); border-color: var(--color-danger); }

/* Page-level eyebrow ("PRIVATE PENSIVE" etc.) - distinct from .card-kicker, which labels one
   card. Brief: 12px Barlow semibold, 2px letter-spacing, accent. */
.page-eyebrow {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--color-accent); margin-bottom: 6px;
}

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 0 16px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 1.2;
  color: var(--color-text); background: transparent;
  border: 1px solid var(--color-input-border); border-radius: var(--radius-control);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn svg { display: block; flex-shrink: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); }
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: var(--color-on-accent); }
.btn-secondary:hover { background: var(--color-control-bg); color: var(--color-text); }
.btn-secondary:active { background: var(--color-control-active); }
.btn-ghost { color: var(--color-link); border-color: transparent; padding-inline: 10px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); color: var(--color-link); }
.btn-icon { width: var(--touch); padding: 0; border-color: transparent; }
.btn-icon:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.btn-icon:active { background: color-mix(in srgb, currentColor 18%, transparent); }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ── forms ── */
.field { margin-bottom: var(--space-3); }
.field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--color-text-2); }
.input {
  width: 100%; min-height: var(--touch); padding: 8px 14px; font: inherit; font-size: 15px;
  color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border); border-radius: var(--radius-control);
}
.input::placeholder { color: var(--color-text-meta); }
.input:hover { border-color: var(--color-border-card-hover); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 96px; resize: vertical; padding-top: 10px; }
.radio { display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.radio .dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--color-input-border); }
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Segmented control: a track with pill segments. Active segment is an accent fill by default;
   add .seg-neutral for secondary groups (brief: control-active fill). No underlines. */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px;
  background: var(--color-control-bg); border: 1px solid var(--color-border); border-radius: var(--radius-control);
}
.seg-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-segment);
  font-size: 14px; color: var(--color-nav-text); text-decoration: none; cursor: pointer;
}
.seg-opt:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); color: var(--color-text); }
.seg-opt.active, .seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-on-accent); font-weight: 600; }
.seg-neutral .seg-opt.active, .seg-neutral .seg-opt:has(input:checked) { background: var(--color-control-active); color: var(--color-text); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 1px; }

/* ── cards ── */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: 18px; background: var(--color-surface);
  border: 1px solid var(--color-border-card); border-radius: var(--radius-card);
}
.card-kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--color-accent);
}
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 22px; line-height: 1.15; color: var(--color-text);
}
.card-body { margin: 0; font-size: 14px; color: var(--color-text-muted); flex: 1; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-meta); }
/* Structured note text (app/services/note_formatting.py's <p>/<ul> output). */
.note-text p { margin: 0 0 var(--space-2); }
.note-text ul { margin: 0 0 var(--space-2); padding-left: 1.2em; }
.note-text p:last-child, .note-text ul:last-child { margin-bottom: 0; }
.note-text li { margin-bottom: 2px; }

/* Entry cards (TASKS.md slice 18.3, per the redesign brief): Private Pensive and a community's
   shared entries render the same card (_entry_card.html). Truncation stays scoped to .entry-card,
   not .card, or it would clip note bodies and search snippets. */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.entry-card { min-height: 190px; height: 100%; }
.entry-card .card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.entry-card .card-body { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto; }
.card-kicker { display: inline-flex; align-items: center; gap: 8px; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.type-journal { color: var(--color-type-journal); }
.type-podcast { color: var(--color-type-podcast); }
.type-book { color: var(--color-type-book); }
.card-footer {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--color-border-card); font-size: 13px; color: var(--color-text-meta);
  white-space: nowrap;
}
.card-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-badge svg { flex-shrink: 0; }
.card-badge.is-shared { color: var(--color-type-book); }
/* Overlays on a card in the grid: the export checkbox (selection mode) and a saved entry's
   Remove. They sit in the card's top-right corner, outside the card's link, since a form can't
   live inside an <a>. */
.entry-card-wrap { position: relative; }
.entry-select { position: absolute; top: 14px; right: 14px; z-index: 1; width: 20px; height: 20px; accent-color: var(--color-accent); }
.entry-remove { position: absolute; top: 8px; right: 8px; z-index: 1; margin: 0; }
.entry-remove.beside-select { right: 42px; }
.btn.btn-compact { min-height: 32px; padding: 0 10px; font-size: 13px; }
a.card { color: inherit; text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
a.card:hover, a.card:focus-visible {
  background: var(--color-surface-hover); border-color: var(--color-border-card-hover);
  transform: translateY(-2px); color: inherit;
}
@media (prefers-reduced-motion: reduce) { a.card:hover, a.card:focus-visible { transform: none; } }
.elev-sm { box-shadow: var(--shadow-sm); }

/* ── tags (pills) ── */
.tag {
  display: inline-flex; align-items: center; font-size: 12px; padding: 4px 10px;
  border-radius: var(--radius-pill); background: var(--color-pill-bg); color: var(--color-pill-text);
}
.tag-accent { color: var(--color-link); }
.tag-neutral { color: var(--color-pill-text); }

/* Filter chips (Private Pensive's Type/Visibility row until slice 18.3 turns them into
   segmented controls). */
.tag.filter-tag {
  min-height: 36px; padding: 0 14px; justify-content: center; font-size: 14px;
  text-decoration: none; background: var(--color-control-bg); color: var(--color-nav-text);
}
.tag.filter-tag:hover { color: var(--color-text); }
.filter-tag.tag-accent { background: var(--color-accent); color: var(--color-on-accent); font-weight: 600; }
/* The mockup's 36px segments sit inside a 46px track, which suits a mouse. Below desktop width
   each segment and filter chip is a touch target on its own, so it gets the full 44px. Kept after
   both rules it overrides - same specificity, so source order decides. */
@media (max-width: 899px) {
  .seg-opt, .tag.filter-tag { min-height: var(--touch); }
}

/* Topics token input (Add/Edit entry): a chip per topic plus a small "add" field. */
.token-input { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.token-chips { display: contents; }
.tag.token-chip { gap: 6px; }
.token-chip-remove {
  background: none; border: 0; padding: 4px; margin: -4px; cursor: pointer;
  font-size: 13px; line-height: 1; color: inherit; opacity: 0.7;
}
.token-chip-remove:hover { opacity: 1; }
.token-add-input { flex: 1 1 140px; min-width: 140px; }

/* ── tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--color-text-meta); padding: 10px var(--space-2); border-bottom: 1px solid var(--color-border);
}
.table td { padding: 10px var(--space-2); border-bottom: 1px solid var(--color-border); }
.table tbody tr:hover { background: var(--color-surface-hover); }
/* Below tablet width a multi-column table can't fit - opt in with .table-responsive (plus a
   data-label on each td) to render each row as a stacked label:value card. */
@media (max-width: 899px) {
  .table-responsive thead { display: none; }
  .table-responsive, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive tr {
    background: var(--color-surface); border: 1px solid var(--color-border-card); border-radius: var(--radius-card);
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3);
  }
  .table-responsive td { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); border-bottom: none; }
  .table-responsive td::before {
    content: attr(data-label); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--color-text-meta);
  }
}

.row-actions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; }

/* ── Private Pensive: page header, toolbar, date groups (TASKS.md slice 18.3) ── */
.collection-title { margin: 0; line-height: 1.05; }
.collection-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.toolbar-spacer { flex-grow: 1; }
.seg-icons .seg-opt { padding: 0 10px; }
.btn.btn-square { width: var(--touch); padding: 0; }
.entry-group + .entry-group { margin-top: 32px; }
@media (min-width: 900px) {
  .collection-table { table-layout: fixed; }
  .collection-table .col-select { width: 44px; }
  .collection-table .col-type { width: 120px; }
  .collection-table .col-source { width: 22%; }
  .collection-table .col-notes { width: 72px; }
  .collection-table .col-visibility { width: 130px; }
  .collection-table .col-added { width: 110px; }
  .collection-table td { overflow: hidden; text-overflow: ellipsis; }
}
.group-header {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--color-border);
}
.group-header h2 { margin: 0; font-size: 22px; }
.group-meta { color: var(--color-text-meta); font-size: 14px; }

/* ── Private Pensive layout: main column plus right rail (TASKS.md 18.4-18.5). The page opts out
   of .content's padding and width cap (base.html's content_class block) so the rail can run to
   the window's edge and full height, as in the brief. The rail wraps below the main column once
   there's no room for both. ── */
.content.content-with-rail { padding: 0; max-width: none; flex: 1; display: flex; }
.collection-layout { display: flex; flex-wrap: wrap; flex: 1; min-width: 0; }
.collection-main { flex: 999 1 520px; min-width: 0; padding: 32px; }
.collection-rail {
  flex: 1 1 300px; max-width: 360px; min-width: 0; display: flex; flex-direction: column; gap: 24px;
  padding: 32px 28px 28px; background: var(--color-bg-rail); border-left: 1px solid var(--color-border);
}
.rail-label {
  margin: 0; font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--color-text-meta);
}
/* Fixed height so the synthesis card's top lines up with the first row of entry cards in the
   main column (the brief's purpose for it). The mockup used 200px; this layout's header and
   toolbar spacing puts the first card row 6px higher, so 194px here. Measured, not guessed. */
.week-metrics { height: 194px; display: flex; flex-direction: column; justify-content: space-between; }
.week-metrics-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.week-streak { font-size: 14px; color: var(--color-text-2); }
.week-streak strong { font-family: var(--font-heading); font-weight: 700; font-size: 20px; color: var(--color-text); }
.week-days { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; list-style: none; }
.week-day { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-square {
  display: block; width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 8px;
  background: var(--color-pill-bg); border: 1px solid var(--color-input-border);
}
.week-square.is-on { background: var(--color-accent); border-color: var(--color-accent); }
.week-square.is-today { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.week-day-label { font-size: 12px; color: var(--color-text-meta); }
.week-types { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.week-type { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.week-type-label { width: 70px; color: var(--color-text-2); }
.week-bar { flex-grow: 1; height: 8px; border-radius: 4px; overflow: hidden; background: var(--color-pill-bg); }
.week-bar-fill { display: block; height: 100%; border-radius: 4px; background: currentColor; }
.week-type-count { width: 18px; text-align: right; font-weight: 600; color: var(--color-text); }
.synthesis-card { min-height: 190px; }
.synthesis-summary { margin: 0; font-size: 14px; line-height: 1.5; color: var(--color-text-2); }
.synthesis-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.synthesis-link {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border-card);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
@media (max-width: 899px) {
  .collection-main { padding: 24px; }
  .collection-rail { max-width: none; border-left: 0; border-top: 1px solid var(--color-border); padding: 24px; }
  .week-metrics { height: auto; gap: 16px; }
}
@media (max-width: 599px) {
  .collection-main { padding: 20px 16px; }
  .collection-rail { padding: 20px 16px; }
}

/* Dropdown menus on <details data-menu> (sort menu). The account menu below opens upward. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { transition: transform 0.15s; }
.menu[open] > summary svg { transform: rotate(180deg); }
.menu .menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 190px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border-card);
  border-radius: var(--radius-control); box-shadow: var(--shadow-lg);
}
.menu .menu-list a {
  display: flex; align-items: center; min-height: var(--touch); padding: 0 12px; border-radius: 8px;
  color: var(--color-text); text-decoration: none; font-size: 14px;
}
.menu .menu-list a:hover { background: var(--color-control-bg); color: var(--color-text); }
.menu .menu-list a[aria-current] { font-weight: 600; color: var(--color-link); }
/* "Merge into..." on the entry page (TASKS.md 18.6): the dropdown holds a small form. */
.merge-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: var(--space-4); }
.merge-pair .card { flex: 1 1 260px; max-width: 420px; }
.merge-arrow { font-size: 24px; color: var(--color-text-meta); }
.merge-effects { max-width: 68ch; padding-left: 1.2em; color: var(--color-text-2); }
.merge-effects li { margin-bottom: 8px; }
.merge-warning { color: var(--color-text); font-weight: 500; }
.merge-menu .menu-list.merge-form { left: 0; right: auto; min-width: 300px; max-width: min(420px, 90vw); gap: 10px; padding: 14px; }
.merge-form label { font-size: 13px; font-weight: 500; color: var(--color-text-2); }
@media (max-width: 599px) {
  .collection-toolbar { gap: 8px; }
  .collection-toolbar .toolbar-spacer { display: none; }
  .menu .menu-list { left: 0; right: auto; }
}

/* ── Signed-out pages: the landing page (TASKS.md slice 20), plus the sign-in screens' heading.
   The illustrations reuse the app's own card, week and synthesis classes; only layout lives
   here. ── */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-header, .public-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 32px;
}
.public-header { border-bottom: 1px solid var(--color-border); }
.public-footer { margin-top: auto; border-top: 1px solid var(--color-border); font-size: 14px; color: var(--color-text-meta); }
.public-footer a { font-weight: 600; text-decoration: none; }
.public-header-spacer { flex-grow: 1; }
.public-brand {
  font-family: var(--font-heading); font-weight: 700; font-size: 26px; color: var(--color-text);
  text-decoration: none;
}
.public-brand:hover { color: var(--color-text); }
.public-brand-small { font-size: 18px; }
.btn.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }

.landing { width: 100%; max-width: 1200px; margin: 0 auto; padding: 72px 32px 96px; display: flex; flex-direction: column; gap: 112px; }
.landing-section { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.landing-section.is-reversed { flex-wrap: wrap-reverse; }
.landing-text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.landing-hero .landing-text { gap: 20px; }
.landing-text p, .landing-lede { margin: 0; max-width: 56ch; font-size: 18px; line-height: 1.6; color: var(--color-text-2); }
.landing h1 { margin: 0; font-size: 56px; line-height: 1.04; }
.landing-label {
  margin: 0; font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--color-accent);
}
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.landing-hero .landing-actions { margin-top: 8px; }
.landing-visual { flex: 1 1 460px; min-width: 0; }
.landing-panel {
  display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 16px;
  background: var(--color-bg-rail); border: 1px solid var(--color-border-card);
}
.landing-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.landing-panel-title { font-family: var(--font-heading); font-weight: 700; font-size: 24px; }
.landing-panel-meta { font-size: 13px; color: var(--color-text-meta); }
.landing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.landing-grid .entry-card { min-height: 150px; padding: 16px; }
.landing-grid .card-title { font-size: 19px; }
.landing-stack { display: flex; flex-direction: column; gap: 12px; }
.landing-link-field {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-control); background: var(--color-input-bg); border: 1px solid var(--color-accent);
}
.landing-link-field svg { color: var(--color-text-meta); flex-shrink: 0; }
.landing-link-field span { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.landing-note {
  display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 14px;
  border-radius: var(--radius-control); background: var(--color-bg-rail); border: 1px solid var(--color-border-card);
  font-size: 15px; line-height: 1.5; color: var(--color-text-2);
}
.landing-note-meta { font-size: 12px; color: var(--color-text-meta); }
.landing-note-quote { padding-left: 12px; border-left: 2px solid var(--color-accent); font-style: italic; color: var(--color-text); }
.landing-synthesize { display: flex; flex-wrap: wrap; gap: 16px; }
.landing-synthesize > * { flex: 1 1 220px; min-width: 0; }
.landing-export { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; }
.landing-export-count { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-text-2); }
.landing-check {
  width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: var(--color-on-accent);
}
.landing-export-file { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--color-text-meta); }
.landing-export-button { margin-left: auto; pointer-events: none; }
.landing-week {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--radius-card);
  background: var(--color-bg-rail); border: 1px solid var(--color-border-card);
}
.landing-week .week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
/* Up Next and Gather on the landing page (2026-10-22, docs/design/landing-page/new-features/). */
.landing-queue { display: flex; flex-direction: column; border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border-card); }
.landing-queue-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--color-border-card); }
.landing-queue-item:last-child { border-bottom: 0; }
.landing-queue-number { width: 18px; text-align: right; font-family: var(--font-heading); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--color-text-meta); }
.landing-queue-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.landing-queue-main .card-title { font-size: 19px; }
.landing-queue-source { font-size: 12px; color: var(--color-link); }
.landing-queue-start {
  flex-shrink: 0; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: var(--radius-control); border: 1px solid var(--color-input-border); font-size: 13px; font-weight: 600;
}
.landing-events { display: flex; flex-direction: column; border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border-card); }
.landing-event { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--color-border-card); }
.landing-event:last-child { border-bottom: 0; }
.landing-event-date {
  flex-shrink: 0; width: 50px; display: flex; flex-direction: column; align-items: center; padding: 4px 0;
  border: 1px solid var(--color-border-card); border-radius: 8px;
}
.landing-event-date.is-tbd { border-style: dashed; }
.landing-event-month { font-size: 11px; font-weight: 600; color: var(--color-type-podcast); }
.landing-event-day { font-size: 20px; font-weight: 700; line-height: 1.2; }
.landing-event-date.is-tbd .landing-event-day { font-size: 15px; color: var(--color-text-meta); }
.landing-event-sub { font-size: 11px; color: var(--color-text-meta); }
.landing-event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.landing-event-title { font-weight: 600; }
.landing-event-answer { flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--color-nav-active); color: var(--color-link); }
.landing-discussion { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--color-surface); border: 1px solid var(--color-border-card); }
.landing-discussion-head { display: flex; align-items: center; gap: 8px; }
.landing-discussion-title { flex: 1; font-family: var(--font-heading); font-weight: 600; font-size: 19px; }
.landing-post { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.landing-post .avatar { width: 30px; height: 30px; font-size: 12px; }
.landing-post-main { display: flex; flex-direction: column; gap: 2px; line-height: 1.45; color: var(--color-text-2); min-width: 0; }
.landing-post-main strong { color: var(--color-text); }
.landing-post-when { font-size: 12px; color: var(--color-text-meta); }
.landing-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; padding: 40px;
  border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border-card);
}
.landing-cta .landing-text { flex-basis: 360px; gap: 8px; }
.landing-cta h2 { margin: 0; font-size: 36px; font-weight: 700; }
.landing-cta p { font-size: 16px; }
@media (max-width: 599px) {
  .public-header, .public-footer { padding: 12px 16px; }
  .public-header .btn { padding: 0 12px; }
  /* No room for both buttons beside the wordmark; the hero's "Start your Pensive", just below,
     goes to the same place. */
  .public-header .btn-primary { display: none; }
  .landing { padding: 40px 16px 64px; gap: 72px; }
  .landing h1 { font-size: 40px; }
  .landing-section { gap: 32px; }
  .landing-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-cta { padding: 24px; }
}

/* Admin: landing page interest totals (slice 20). */
.interest-card { margin: var(--space-4) 0; gap: 12px; }
.interest-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.interest-totals div { padding: 12px; border-radius: var(--radius-control); background: var(--color-bg-rail); border: 1px solid var(--color-border-card); }
.interest-totals dt { font-size: 12px; color: var(--color-text-meta); }
.interest-totals dd { margin: 4px 0 0; font-family: var(--font-heading); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; }

/* Sign-in and create-account (slice 20): a heading, and the link between the two screens. */
.auth-title { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.auth-subtitle { margin: 0 0 var(--space-3); font-size: 14px; }
.auth-switch { margin: var(--space-4) 0 0; text-align: center; font-size: 14px; color: var(--color-text-meta); }
.auth-switch a { font-weight: 600; }

/* ══ app shell ══════════════════════════════════════════════════════════════ */
body.app { display: flex; min-height: 100vh; }

/* Sidebar (desktop; a drawer at tablet width). */
.rail {
  width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px; padding: 24px 16px;
  background: var(--color-bg-sidebar); border-right: 1px solid var(--color-border);
}
.rail-brand {
  font-family: var(--font-heading); font-weight: 700; font-size: 26px; padding: 0 12px;
  color: var(--color-text); text-decoration: none;
}
.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-nav a, .rail-utility {
  display: flex; align-items: center; gap: 12px; min-height: var(--touch); padding: 0 12px;
  border-radius: 8px; color: var(--color-nav-text); text-decoration: none; font-size: 15px;
}
.rail-nav a:hover, .rail-utility:hover { background: var(--color-control-bg); color: var(--color-text); }
.rail-nav .nav-num { font-size: 12px; letter-spacing: 1px; color: var(--color-text-meta); }
.rail-nav a.active {
  background: var(--color-nav-active); color: var(--color-text); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}
.rail-nav a.active .nav-num { color: var(--color-accent); }
.rail-spacer { flex-grow: 1; }
.rail-utility { gap: 10px; color: var(--color-text-meta); font-size: 14px; }
.rail-utility.active { color: var(--color-text); background: var(--color-nav-active); }

/* Account menu: a <details> disclosure so it works without JavaScript; base.html's script adds
   Esc and click-outside to close it. Opens upward from the sidebar's foot. */
.account-menu { position: relative; }
.account-menu > summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-control);
  cursor: pointer; list-style: none; color: var(--color-text);
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { background: var(--color-control-bg); }
.account-avatar {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
  background: var(--color-nav-active); color: var(--color-text);
}
.account-name { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu > summary svg { color: var(--color-text-meta); flex-shrink: 0; }
.account-menu-list {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 40;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--color-surface); border: 1px solid var(--color-border-card);
  border-radius: var(--radius-control); box-shadow: var(--shadow-lg);
}
.account-menu-list a, .account-menu-list button {
  display: flex; align-items: center; min-height: var(--touch); padding: 0 12px; width: 100%;
  border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px;
  color: var(--color-text); text-decoration: none; text-align: left; cursor: pointer;
}
.account-menu-list a:hover, .account-menu-list button:hover { background: var(--color-control-bg); color: var(--color-text); }
.account-menu-list form { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
}
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 32px; }
.topbar-brand { font-family: var(--font-heading); font-weight: 700; font-size: 22px; color: var(--color-text); text-decoration: none; }
.topbar-brand:hover { color: var(--color-accent); }
/* The phone top bar's account menu (product review, 2026-10-18): hidden until phone width, opens
   downward from the top bar instead of upward from the sidebar's foot. */
.topbar-account { display: none; }
.topbar-account > summary { min-height: var(--touch); min-width: var(--touch); padding: 0; justify-content: center; border: 0; }
.topbar-account .account-menu-list { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; width: 220px; }
.account-menu-name {
  padding: 8px 12px 6px; font-size: 13px; color: var(--color-text-meta);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-form { flex: 1 1 320px; max-width: 520px; margin: 0; }
.search-field {
  display: flex; align-items: center; gap: 10px; height: var(--touch); padding: 0 14px;
  background: var(--color-input-bg); border: 1px solid var(--color-input-border); border-radius: var(--radius-control);
}
.search-field:focus-within { border-color: var(--color-accent); }
.search-field svg { color: var(--color-text-meta); flex-shrink: 0; }
.search-field input {
  flex-grow: 1; min-width: 0; border: 0; background: transparent; color: var(--color-text);
  font: inherit; font-size: 15px; outline: none;
}
.search-field input::placeholder { color: var(--color-text-meta); }
.topbar-spacer { flex-grow: 1; }
.topbar-stats { color: var(--color-text-meta); font-size: 14px; white-space: nowrap; }
.btn.theme-toggle { width: var(--touch); padding: 0; color: var(--color-nav-text); border-color: var(--color-input-border); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
.btn-new-entry { padding: 0 18px; font-size: 15px; }

.content { padding: 32px; width: 100%; max-width: 1200px; }

/* ── responsive shell (SPEC.md §7): phone <=599px, tablet 600-899px, desktop >=900px.
   The sidebar is always in the DOM with `hidden` set; forcing it visible past its breakpoint
   means the drawer state never has to be reset on resize. ── */
.nav-toggle, .search-toggle, .topbar-brand { display: none; }
@media (min-width: 900px) {
  .rail[hidden] { display: flex !important; }
}
@media (min-width: 600px) {
  #search-form[hidden] { display: block !important; }
}
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }
  .rail {
    position: fixed; top: 0; left: 0; z-index: 30; height: 100vh;
    transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg);
  }
  .rail:not([hidden]) { transform: translateX(0); }
  .rail-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 25; background: var(--color-overlay); }
  .content { padding: 24px; }
  .topbar-inner { padding: 14px 24px; }
}
@media (max-width: 599px) {
  .search-toggle { display: inline-flex; }
  .topbar-inner { padding: 10px 16px; gap: 8px; }
  /* Phone (SPEC.md §8): the bottom tab bar replaces the drawer, so the hamburger goes; New Entry
     and search move to the tab bar and the Search screen; the stats line hides. */
  .nav-toggle, .search-form, .btn-new-entry, .topbar-stats, .topbar-spacer { display: none !important; }
  .topbar-brand { display: flex; align-items: center; min-height: var(--touch); margin-right: auto; }
  .topbar-account { display: block; }
  .content { padding: 20px 16px; }
  body:not(.is-takeover) .content { padding-bottom: 92px; }
  body.is-takeover .content { padding-bottom: 100px; }
  /* Entry detail / Add entry / Search render their own takeover header instead. */
  body.is-takeover .topbar { display: none; }
}

/* ── phone bottom tab bar (SPEC.md §8.2); hidden on takeover screens ── */
.tab-bar { display: none; }
@media (max-width: 599px) {
  body:not(.is-takeover) .tab-bar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--color-bg-sidebar); border-top: 1px solid var(--color-border);
  }
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 56px; padding: 8px 0;
  color: var(--color-text-meta); text-decoration: none; background: none; border: 0;
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
}
.tab:hover { color: var(--color-text); }
.tab.on { color: var(--color-accent); }
.tab-icon { display: block; width: 20px; height: 20px; }
.tab-primary .tab-icon {
  width: 32px; height: 24px; padding: 2px 6px; border-radius: 8px;
  background: var(--color-accent); color: var(--color-on-accent);
}

/* ── phone screens (SPEC.md §8.4) ── */
.mobile-takeover-header { display: none; }
.save-entry-bar { display: none; }
@media (max-width: 599px) {
  body.is-takeover .mobile-takeover-header {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; margin: -20px -16px var(--space-4); padding: 0 var(--space-4);
    border-bottom: 1px solid var(--color-border); background: var(--color-bg-sidebar);
  }
  /* Filter chips scroll sideways instead of wrapping (opt in with .chip-row). */
  .row-actions.chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip-row .filter-tag { flex-shrink: 0; }

  /* Entry detail: the takeover header's back link replaces "← Pensive"; quick capture is the
     only mode and sits in a fixed bottom bar. */
  .desktop-back-link, .capture-mode-toggle { display: none; }
  .structured-capture { display: none !important; }
  .quick-capture-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4);
    background: var(--color-bg-sidebar); border-top: 1px solid var(--color-border);
  }
  .quick-capture-bar .field { flex: 1; margin: 0; }
  .quick-capture-bar .quick-locator-field { display: none; }
  .quick-capture-bar textarea.input { min-height: var(--touch); }
  .quick-capture-bar .field > label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }

  /* Add/Edit entry: the takeover header carries the title and .save-entry-bar the actions. */
  .desktop-only-heading, .row-actions.desktop-only-actions { display: none; }
  .visibility-option {
    display: flex; width: 100%; padding: var(--space-3); margin-bottom: var(--space-2);
    border: 1px solid var(--color-border-card); border-radius: var(--radius-control);
  }
  .visibility-option:has(input:checked) { border-color: var(--color-accent); background: var(--color-surface-hover); }
  body.is-takeover .save-entry-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    padding: var(--space-3) var(--space-4); background: var(--color-bg-sidebar); border-top: 1px solid var(--color-border);
  }
  .save-entry-bar .btn { height: 52px; font-size: 16px; }
}

/* Entry detail / Add entry two-column layout; the aside drops below at tablet width. */
.entry-columns { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.entry-columns-main { flex: 1 1 420px; min-width: 0; }
.entry-columns-aside { flex: 1 1 260px; max-width: 320px; }
@media (max-width: 899px) { .entry-columns-aside { flex: 1 1 100%; max-width: none; } }
/* Adding from a link (docs/design/paste-link/): on phones and tablets the "Add from a link" card
   leads the page, above the form, instead of "Faster ways in" at the very bottom of the stacked
   sidebar where the keyboard covered it. Wider screens keep the sidebar card. */
.link-first, .link-first-divider { display: none; }
@media (max-width: 899px) {
  .link-first { display: flex; margin-bottom: var(--space-3); }
  .link-first h3 { margin: 0; font-size: 22px; }
  .link-first-paste { min-height: 56px; font-size: 17px; gap: 10px; }
  .link-first-type { display: flex; flex-direction: column; gap: 6px; }
  .link-first-type[hidden] { display: none; }
  .link-first-type label { font-size: 13px; color: var(--color-text-2); }
  .link-first-row { display: flex; gap: 8px; }
  .link-first-row .input { flex: 1; min-width: 0; min-height: 48px; }
  .link-first-row .btn { min-height: 48px; }
  .link-first .btn-ghost { align-self: center; }
  .link-first-divider { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--space-4); font-size: 13px; }
  .link-first-divider::before, .link-first-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
  .faster-ways { display: none; }
}

/* Public Pensive feed row (avatar / content / actions); actions drop below at phone width. */
.public-feed-actions { display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; }
@media (max-width: 599px) {
  .public-feed-row { grid-template-columns: 32px 1fr; }
  .public-feed-actions { grid-column: 1 / -1; flex-direction: row; margin-top: var(--space-2); }
  .public-feed-actions > * { flex: 1; }
}

/* ── community events (TASKS.md slice 22; docs/design/community-events/OptionB) ── */
button.seg-opt { border: 0; background: transparent; font: inherit; font-size: 14px; }
.section-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-6); padding-bottom: 10px; border-bottom: 1px solid var(--color-border);
}
.section-head h3 { margin: 0; }
.section-head .section-count { font-size: 14px; color: var(--color-text-meta); }
.section-head .toolbar-spacer { flex: 1; }
.event-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.event-row {
  display: flex; align-items: center; gap: 18px; padding: 16px 18px;
  background: var(--color-surface); border: 1px solid var(--color-border-card); border-radius: var(--radius-card);
}
.event-date {
  width: 64px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 8px 0;
  background: var(--color-bg); border: 1px solid var(--color-border-card); border-radius: var(--radius-control);
}
.event-date-month { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; color: var(--color-accent); }
.event-date-day { font-family: var(--font-heading); font-weight: 700; font-size: 30px; line-height: 1; }
.event-date-weekday { font-size: 11px; color: var(--color-text-meta); }
.event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.event-title {
  font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 1.15;
  color: var(--color-text); text-decoration: none; overflow-wrap: anywhere;
}
.event-title:hover { color: var(--color-accent); }
.event-meta { font-size: 14px; color: var(--color-text-muted); overflow-wrap: anywhere; }
.event-meta a { font-weight: 600; text-decoration: none; }
.event-manage { display: flex; gap: var(--space-4); font-size: 14px; }
.event-manage a { font-weight: 600; text-decoration: none; }
.event-people { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-meta); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-right: -6px; border: 2px solid var(--color-surface); }
.avatar {
  width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; background: var(--color-control-active); color: var(--color-text);
}
.avatar-stack + span { margin-left: 10px; }
.event-rsvp { flex: none; }
.event-rsvp form { margin: 0; }
.event-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; color: var(--color-text-meta); }
.event-pager .toolbar-spacer { flex: 1; }
.notice {
  margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); max-width: 64ch; font-size: 14px;
  border: 1px solid var(--color-accent); border-radius: var(--radius-md); color: var(--color-text);
}
.notice-warn { border-color: var(--color-type-podcast); }

/* Events with a date or time to be decided (TASKS.md slice 29) */
.event-date-tbd { border-style: dashed; }
.event-date-tbd .event-date-day { font-size: 15px; color: var(--color-text-meta); }
.event-group-label { margin: var(--space-3) 0 var(--space-1); font-size: 14px; color: var(--color-text-2); }
.event-tbd-notice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.event-tbd-notice span { flex: 1 1 16rem; }
.event-date-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); max-width: 420px; }
.event-date-preview { margin: var(--space-1) 0 0; font-size: 13px; color: var(--color-type-book); }

/* Communities page "Coming up" and All upcoming events (TASKS.md slice 28) */
.coming-up { margin-bottom: var(--space-6); }
.coming-up-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.coming-up-all { font-size: 14px; font-weight: 600; text-decoration: none; }
.event-community { align-self: flex-start; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--color-link); }

/* Private Pensive's "Show 25 more" (TASKS.md slice 27) */
.show-more { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin: var(--space-6) 0 var(--space-4); }
.show-more p { margin: 0; font-size: 13px; }
@media (max-width: 640px) { .show-more .btn { width: 100%; } }
#more { scroll-margin-top: 88px; } /* clears the sticky header */

/* Community members: leaving, removing, moderators (TASKS.md slice 26) */
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: var(--color-surface); }
.btn-danger:hover { background: color-mix(in srgb, var(--color-danger) 88%, black); color: var(--color-surface); }
.btn-ghost.danger { color: var(--color-danger); }
.btn-ghost.danger:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); color: var(--color-danger); }
.member-list { list-style: none; padding: 0; margin: 0; max-width: 600px; }
.members-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); max-width: 600px; margin-top: var(--space-6); }
.members-head h3 { margin: 0; }
.member-controls { display: inline-flex; align-items: center; gap: 2px; }
.member-controls[hidden] { display: none; }
p.member-controls { display: block; }
@media (max-width: 640px) {
  /* Controls on their own line under the name, lined up, so rows don't wrap unevenly. */
  .member-row .member-controls { flex-basis: 100%; padding-left: 38px; }
}
.member-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2);
  min-height: var(--touch); padding: 4px 0; border-bottom: 1px solid var(--color-divider);
}
.member-row form { margin: 0; }
.member-initials {
  flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--color-divider); font: 10px ui-monospace, Menlo, monospace;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}
.member-name { flex: 1 1 12rem; min-width: 0; }
.member-confirm { margin: var(--space-2) 0 var(--space-3); max-width: 600px; }
.member-confirm-title { font-weight: 600; margin: 0 0 var(--space-2); }
.member-confirm ul { margin: 0 0 var(--space-3); padding-left: 18px; color: var(--color-text-2); font-size: 14px; line-height: 1.5; }
.member-confirm-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.member-successors { border: 0; margin: 0 0 var(--space-3); padding: 0; }
.member-successors legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--color-text-2); }
.member-successors label { display: flex; align-items: center; gap: 10px; min-height: var(--touch); cursor: pointer; }
.member-leave { margin-top: var(--space-3); padding-inline: 0; }
.member-leave-hint { margin-top: var(--space-3); font-size: 14px; }
.email-switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 4px;
  border: 0; background: none; color: var(--color-text-2); font: inherit; font-size: 14px; cursor: pointer;
}
.email-switch-track {
  position: relative; width: 36px; height: 20px; flex: none; border-radius: var(--radius-pill);
  background: var(--color-control-active); border: 1px solid var(--color-input-border);
}
.email-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-text-meta); transition: left 0.15s;
}
.email-switch[aria-checked="true"] .email-switch-track { background: var(--color-accent); border-color: var(--color-accent); }
.email-switch[aria-checked="true"] .email-switch-track::after { left: 18px; background: var(--color-on-accent); }
.email-switch:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: var(--radius-md); }
@media (prefers-reduced-motion: reduce) { .email-switch-track::after { transition: none; } }
.event-layout { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .event-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.event-facts { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.event-facts dt { color: var(--color-text-meta); }
.event-facts dd { margin: 0; overflow-wrap: anywhere; }
.rsvp-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: var(--space-4) 0; padding: 16px 18px;
  background: var(--color-surface); border: 1px solid var(--color-border-card); border-radius: var(--radius-card);
}
.rsvp-panel h3 { margin: 0; font-size: 16px; font-family: var(--font-body); }
.attendee-group { display: flex; flex-direction: column; gap: 8px; }
.attendee-group + .attendee-group { margin-top: var(--space-4); }
.attendee-label { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: var(--color-text-meta); }
.attendee { display: flex; align-items: center; gap: 10px; }
.community-jump { display: none; }
.event-form-grid { display: grid; gap: 0 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 599px) {
  .event-row { flex-wrap: wrap; gap: 12px 14px; }
  .event-rsvp, .event-rsvp .seg, .rsvp-panel form, .rsvp-panel .seg { width: 100%; }
  .event-rsvp .seg, .rsvp-panel .seg { display: flex; }
  .event-rsvp .seg-opt, .rsvp-panel .seg-opt { flex: 1; }
  .event-manage a { display: inline-flex; align-items: center; min-height: var(--touch); }
  .community-jump { display: flex; margin: var(--space-3) 0 0; }
  .community-jump .seg-opt { flex: 1; }
  .event-form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .event-form-grid .field:first-child { grid-column: 1 / -1; }
}

/* ── Admin -> Accounts (TASKS.md slice 23; docs/design/admin-accounts/) ── */
.admin-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.admin-head h2 { margin: 0; }
.admin-head .toolbar-spacer { flex: 1; }
.admin-invite {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; margin: 0 0 var(--space-4);
  padding: 14px 16px 2px; background: var(--color-bg-rail); border: 1px solid var(--color-border); border-radius: var(--radius-card);
}
.admin-invite .field { flex: 1 1 180px; }
.admin-invite .field:first-child { flex-grow: 2; }
.admin-invite-actions { display: flex; gap: 8px; margin-bottom: var(--space-4); }
.admin-section {
  margin-bottom: var(--space-4); background: var(--color-bg-rail);
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
}
.admin-section-head {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px;
  cursor: pointer; list-style: none; border-radius: var(--radius-card);
}
.admin-section-head::-webkit-details-marker, .account > summary::-webkit-details-marker { display: none; }
.admin-section-head::before { content: "▸"; color: var(--color-text-meta); font-size: 13px; width: 1em; }
.admin-section[open] > .admin-section-head::before { content: "▾"; }
.admin-section-head h3 { margin: 0; font-size: 22px; }
.admin-section-head:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.admin-section-meta { margin-left: auto; font-size: 13px; color: var(--color-text-meta); }
.admin-section-body { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; min-width: 0;
  background: var(--color-surface); border: 1px solid var(--color-border-card); border-radius: var(--radius-control);
}
.stat-label { font-size: 13px; color: var(--color-text-muted); }
.stat-value { font-family: var(--font-heading); font-weight: 700; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--color-text-meta); }
.admin-daily summary { cursor: pointer; color: var(--color-link); font-weight: 600; font-size: 14px; width: max-content; min-height: var(--touch); display: flex; align-items: center; }
.admin-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.admin-search { flex: 0 1 340px; margin: 0; }
.admin-search .input { width: 100%; }
.account-table { border: 1px solid var(--color-border); border-radius: var(--radius-control); overflow: hidden; }
.account-row {
  display: grid; gap: 12px; align-items: center; min-height: 52px; padding: 0 14px;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.8fr) 80px 116px 120px minmax(0, 1.3fr) 84px;
  font-size: 14px;
}
.account-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-header {
  min-height: 40px; background: var(--color-control-bg); font-size: 12px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase; color: var(--color-text-meta);
}
.account { border-top: 1px solid var(--color-border); }
.account > summary { cursor: pointer; list-style: none; }
.account > summary:hover, .account[open] > summary { background: var(--color-surface); }
.account > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.account-name { font-weight: 600; }
.account-email, .account-role { color: var(--color-text-2); }
.account-last, .account-methods { color: var(--color-text-muted); }
.account-manage { justify-self: end; }
.account-manage > span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border-card); font-size: 13px; font-weight: 600; color: var(--color-text);
}
.account .when-open, .account[open] .when-closed { display: none !important; }
.account-chevron { display: none; }
.account-notice { margin: 0; border-radius: 0; border-width: 1px 0 0; max-width: none; background: var(--color-surface); padding: 10px 18px; }
.account[open] .when-open { display: inline-flex !important; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.status-active { color: var(--color-type-book); background: color-mix(in srgb, var(--color-type-book) 16%, transparent); }
.status-invited { color: var(--color-type-podcast); background: color-mix(in srgb, var(--color-type-podcast) 16%, transparent); }
.status-deactivated { color: var(--color-text-muted); background: var(--color-pill-bg); }
.account-panel {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px;
  padding: 16px 18px 18px; background: var(--color-surface); border-top: 1px solid var(--color-border-card);
}
.account-group { display: flex; flex-direction: column; gap: 10px; margin: 0; min-width: 0; }
.account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.account-save { display: flex; align-items: flex-end; }
.account-credential { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.account-credential > span { flex: 1; display: flex; flex-direction: column; }
.account-credential form { margin: 0; }
.account-group .row-actions { margin: 0; }
/* Features in trial (TASKS.md slice 33.0): the Access column also holds each feature's switch. */
.account-groups { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.trial-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 14px; }
.trial-switch-text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; }
.trial-switch-text .text-muted { font-size: 13px; }
.trial-tag {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 8px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600; color: var(--color-link); background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}
.trial-feature {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 0;
  border-top: 1px solid var(--color-border-card); font-size: 14px;
}
.trial-feature:first-child { border-top: 0; padding-top: 0; }
.trial-feature-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; color: var(--color-text-2); }
.trial-feature-text strong { color: var(--color-text); }
.account-group .row-actions form { margin: 0; }
.admin-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--color-text-meta); }
.admin-pager .toolbar-spacer { flex: 1; }
@media (max-width: 899px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-panel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  /* Phone (docs/design/admin-accounts/Phone.dc.html): two lines per account - name and status,
     then email and last sign-in - all the same height. */
  .admin-section-head, .admin-section-body { padding-left: 14px; padding-right: 14px; }
  .admin-search { flex-basis: 100%; }
  .account-header { display: none; }
  .account-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name status" "email last";
    gap: 2px 10px; min-height: 60px; padding: 8px 12px;
  }
  .account-name { grid-area: name; }
  .account-status { grid-area: status; justify-self: end; }
  .account-email { grid-area: email; font-size: 13px; }
  .account-last { grid-area: last; font-size: 12px; justify-self: end; }
  .account-role, .account-methods, .account-manage { display: none; }
  /* Phone: the Manage button is hidden, so a chevron says the row opens. */
  .account-row { grid-template-columns: minmax(0, 1fr) auto 14px; grid-template-areas: "name status chev" "email last chev"; }
  .account-chevron { display: block; grid-area: chev; justify-self: end; width: 8px; height: 8px;
    border-right: 2px solid var(--color-text-meta); border-bottom: 2px solid var(--color-text-meta);
    transform: rotate(-45deg); }
  .account[open] .account-chevron { transform: rotate(45deg); }
  .account-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ── Admin -> Content (TASKS.md slice 24): same table as Accounts, rows link to the entry ── */
.admin-search-wide { display: flex; gap: 8px; flex: 0 1 460px; }
.admin-search-wide .input[type="search"] { flex: 2 1 200px; }
.admin-search-wide select.input { flex: 1 1 140px; width: auto; }
.content-row {
  display: grid; gap: 12px; align-items: center; min-height: 52px; padding: 0 14px; font-size: 14px;
  grid-template-columns: minmax(0, 2.4fr) 110px minmax(0, 1fr) 124px 60px 110px;
}
.content-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-row.account-header { font-size: 12px; }
.content-link { border-top: 1px solid var(--color-border); color: var(--color-text); text-decoration: none; }
.content-link:hover { background: var(--color-surface); color: var(--color-text); }
.content-link:hover .content-title { color: var(--color-accent); }
.content-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.content-title { font-weight: 600; }
.content-type { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.content-owner { color: var(--color-text-2); }
.content-notes { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.content-added { color: var(--color-text-muted); }
.vis-public { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.vis-community { color: var(--color-type-book); background: color-mix(in srgb, var(--color-type-book) 16%, transparent); }
.vis-private { color: var(--color-text-muted); background: var(--color-pill-bg); }
@media (max-width: 599px) {
  .admin-search-wide { flex-basis: 100%; }
  .content-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title vis" "meta added";
    gap: 2px 10px; min-height: 60px; padding: 8px 12px;
  }
  .content-title { grid-area: title; }
  .content-visibility { grid-area: vis; justify-self: end; }
  .content-type { grid-area: meta; font-size: 12px; }
  .content-added { grid-area: added; justify-self: end; font-size: 12px; }
  .content-owner, .content-notes, .content-row.account-header { display: none; }
  /* The type and visibility filters each fill a row instead of wrapping one option onto a line of its own. */
  .admin-toolbar .seg { display: flex; flex-wrap: nowrap; width: 100%; box-sizing: border-box; }
  .admin-toolbar .seg-opt { flex: 1 1 auto; padding: 0 6px; font-size: 13px; }
}

/* Comments (TASKS.md slice 30; docs/design/comments/). */
.comments { display: flex; flex-direction: column; gap: var(--space-3); max-width: 720px; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.comments-head h3 { margin: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment .avatar { width: 36px; height: 36px; font-size: 13px; }
.comment:target, .comment:focus { outline: 2px solid var(--color-accent); outline-offset: 4px; border-radius: var(--radius-md); }
.comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.comment-meta .text-muted { font-size: 13px; }
.comment-body { line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.comment-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.comment-actions form { margin: 0; }
.comment-edit { display: flex; flex-direction: column; gap: var(--space-2); }
.comment-remove > summary { list-style: none; }
.comment-remove > summary::-webkit-details-marker { display: none; }
.comment-remove[open] > summary { display: none; }
.comment-remove-confirm { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 14px; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-danger); border-radius: var(--radius-md); }
.comment-status { margin: 0; min-height: 1em; font-size: 14px; color: var(--color-type-book); }
.comment-status:empty { display: none; }
.comment-form { display: flex; flex-direction: column; gap: var(--space-2); }
.comment-form label { font-size: 14px; color: var(--color-text-muted); }
.comment-form-foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.comments-closed { margin: 0; padding: var(--space-3); color: var(--color-text-muted); border: 1px dashed var(--color-border-card-hover); border-radius: var(--radius-md); }
.field-error { margin: 0; font-size: 14px; color: var(--color-danger); }
.old-notes-notice { margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); max-width: 64ch; font-size: 14px; border: 1px solid var(--color-border-card); border-radius: var(--radius-md); background: var(--color-surface-hover); }
.comment-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-muted); }
.comment-reported { font-size: 13px; padding: 0 8px; }
.reported-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.reported-item { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-border-card); border-radius: var(--radius-md); background: var(--color-surface); }
.reported-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.reported-body { margin: 0; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.count-pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-on-accent); }
.comments-earlier { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.comments.discussion { max-width: none; margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--color-border-card); border-radius: var(--radius-card); background: var(--color-surface); }
.comments.discussion .comments-head { justify-content: flex-start; }
.discussion-new { font-size: 13px; font-weight: 600; color: var(--color-accent); }

/* Activity on your shared entries (TASKS.md slice 30.4; docs/design/comments/Rail.dc.html). */
.activity-dot { width: 8px; height: 8px; flex: none; margin-top: 7px; border-radius: 50%; background: transparent; }
.activity-dot.is-new, .activity-banner .activity-dot { background: var(--color-accent); }
.activity-banner { display: none; align-items: center; gap: 10px; min-height: 48px; margin: var(--space-3) 0 0; padding: 0 14px; border-radius: var(--radius-control); background: var(--color-nav-active); color: var(--color-text); text-decoration: none; }
.activity-banner .activity-dot { margin-top: 0; }
.activity-banner > span:nth-child(2) { flex: 1; }
@media (max-width: 899px) { .activity-banner { display: flex; } }
.rail-activity { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.rail-activity-head { display: flex; align-items: center; gap: 8px; }
.rail-activity-head .rail-label { margin: 0; flex: 1; }
.rail-activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rail-activity-item { display: flex; gap: 8px; font-size: 14px; line-height: 1.4; }
.rail-activity-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.rail-activity-preview { color: var(--color-text-muted); }
.rail-activity-when { font-size: 12px; color: var(--color-text-meta); }
.rail-activity-all { font-size: 14px; font-weight: 600; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.rail-activity-empty { margin: 0; font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }
.activity-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; max-width: 820px; border: 1px solid var(--color-border-card); border-radius: var(--radius-card); background: var(--color-surface); }
.activity-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.activity-item:last-child { border-bottom: 0; }
.activity-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.activity-preview { font-size: 14px; color: var(--color-text-muted); }
.activity-when { font-size: 13px; color: var(--color-text-meta); white-space: nowrap; }

/* Likes (TASKS.md slice 31). */
.entry-likes { margin: var(--space-2) 0 var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.like-form { margin: 0; }
.like-button { display: inline-flex; align-items: center; gap: 6px; }
.like-button[aria-pressed="true"] { color: var(--color-danger); border-color: var(--color-danger); }
.like-button[aria-pressed="true"] .like-heart { fill: currentColor; }
.like-count { font-variant-numeric: tabular-nums; padding-left: 2px; }
.likers > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.likers > summary::-webkit-details-marker { display: none; }
.likers-list { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; border: 1px solid var(--color-border-card); border-radius: var(--radius-md); background: var(--color-surface); }
.likers-none { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

/* Up Next (TASKS.md slice 32; docs/design/up-next/). */
.rail-up-next {
  display: flex; align-items: center; gap: 10px; min-height: var(--touch); margin-top: 10px; padding: 0 12px;
  border-top: 1px solid var(--color-border); padding-top: 10px; color: var(--color-nav-text); text-decoration: none; font-size: 14px;
}
.rail-up-next span:first-of-type { flex: 1; }
.rail-up-next:hover { color: var(--color-text); }
.rail-up-next.active { color: var(--color-text); font-weight: 600; }
.rail-count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-pill-text); }
.up-next { max-width: 900px; }
/* A row, not .card's column: in a column the input's 280px flex-basis became its height. */
.up-next-add { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--space-4); }
.up-next-add .input { flex: 1 1 280px; min-width: 0; min-height: 48px; }
.up-next-add .btn { min-height: 48px; }
.up-next-add .field-error { flex-basis: 100%; }
.up-next-already { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: none; }
.up-next-already form { margin: 0; }
.up-next-status { min-height: 1.4em; margin: var(--space-3) 0 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.up-next-status form { margin: 0; }
.up-next-empty { padding: var(--space-5, 24px); border: 1px dashed var(--color-border-card-hover); border-radius: var(--radius-card); background: var(--color-surface); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.up-next-empty p { margin: 0; color: var(--color-text-muted); line-height: 1.5; max-width: 60ch; }
.up-next-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: var(--space-3) 0; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-input-border); background: var(--color-surface); color: var(--color-nav-text); text-decoration: none; font-size: 14px; }
.chip.is-on { background: var(--color-text); border-color: var(--color-text); color: var(--color-surface); }
.up-next-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border-card); border-radius: var(--radius-card); background: var(--color-surface); }
.up-next-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
.up-next-item:last-child { border-bottom: 0; }
.up-next-item:target, .up-next-item:focus { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.up-next-number { width: 22px; text-align: right; font-family: var(--font-heading); font-weight: 600; font-size: 22px; color: var(--color-text-meta); line-height: 1.2; }
.up-next-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.up-next-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.up-next-kind { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.up-next-kind.kind-book { color: var(--color-type-book); }
.up-next-kind.kind-podcast { color: var(--color-type-podcast); }
.up-next-kind.kind-topic { color: var(--color-accent); }
.up-next-title { font-family: var(--font-heading); font-weight: 600; font-size: 20px; }
.up-next-byline { font-size: 14px; color: var(--color-text-muted); }
.up-next-why { font-size: 14px; line-height: 1.45; color: var(--color-text-2); }
.up-next-why-form { display: flex; gap: 8px; flex-wrap: wrap; }
.up-next-why-form .input { flex: 1 1 220px; }
.up-next-why-toggle { align-self: flex-start; min-height: 32px; padding: 0 4px; font-size: 13px; }
.up-next-source { font-size: 13px; }
.up-next-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.up-next-actions form { margin: 0; }
.up-next-more > summary svg { transition: none; }
.up-next-more[open] > summary svg { transform: none; }
.menu-item { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--color-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--color-control-bg); }
.up-next-more .menu-list form { margin: 0; }
.up-next-done { margin-top: var(--space-5, 24px); }
.up-next-done > summary { cursor: pointer; font-weight: 600; min-height: var(--touch); display: flex; align-items: center; }
.up-next-done ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.up-next-done li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.up-next-toggle { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 599px) {
  .up-next-item { flex-wrap: wrap; }
  .up-next-actions { width: 100%; padding-left: 36px; }
  .up-next-actions > .btn:first-child { margin-right: auto; }
}
.entry-social { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.entry-social .entry-likes { margin: 0; }
.up-next-toggle { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.up-next-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.up-next-button.is-on { color: var(--color-type-book); border-color: var(--color-type-book); }
.pensive-up-next { display: none; align-items: center; gap: 6px; margin-top: var(--space-2); }
/* Desktop has the sidebar link; the button is for narrower screens, where the sidebar is a menu or a tab bar. */
@media (max-width: 899px) { .pensive-up-next { display: inline-flex; } }

/* An Up Next item's page (owner request 2026-10-22; docs/design/up-next/ItemEpisode.dc.html). */
.up-next-title { color: var(--color-text); text-decoration: none; }
.up-next-title:hover { color: var(--color-accent); text-decoration: underline; }
.up-next-page { max-width: 900px; display: flex; flex-direction: column; gap: var(--space-4); }
.up-next-hero { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.up-next-cover { width: 160px; height: 160px; object-fit: cover; border-radius: var(--radius-card); flex: none; background: var(--color-control-bg); }
.up-next-hero-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.up-next-page-title { margin: 0; font-family: var(--font-heading); font-weight: 600; font-size: 34px; line-height: 1.1; }
.up-next-page-byline { font-size: 16px; color: var(--color-text-2); }
.up-next-chips { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.up-next-chips li { font-size: 13px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--color-pill-bg); color: var(--color-pill-text); }
.up-next-page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.up-next-page-actions form { margin: 0; }
.up-next-why-card { gap: 6px; }
.up-next-why-card .rail-label { margin: 0; }
.up-next-about { display: flex; flex-direction: column; gap: 8px; }
.up-next-about h2 { margin: 0; font-size: 22px; }
.up-next-description { margin: 0; line-height: 1.6; max-width: 70ch; color: var(--color-text-2); white-space: pre-line; overflow-wrap: anywhere; }
.up-next-full > summary { cursor: pointer; font-weight: 600; color: var(--color-link); min-height: 40px; display: flex; align-items: center; }
.up-next-full[open] > summary { display: none; }
.up-next-full[open] { margin-top: -8px; }
.up-next-episodes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border-card); border-radius: var(--radius-card); background: var(--color-surface); }
.up-next-episodes li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.up-next-episodes li:last-child { border-bottom: 0; }
.up-next-episodes li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up-next-episodes form { margin: 0; }
.up-next-episode-title { font-weight: 600; }
.up-next-facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.up-next-facts dt { color: var(--color-text-meta); }
.up-next-facts dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 599px) {
  .up-next-cover { width: 96px; height: 96px; }
  .up-next-page-title { font-size: 26px; }
  .up-next-page-actions > * { flex: 1 1 100%; }
  .up-next-page-actions .btn { width: 100%; justify-content: center; }
}
.up-next-about:has(.up-next-full[open]) > .up-next-description { display: none; }

/* ── Search (TASKS.md slice 7): filters, then one ranked list with a badge column. ── */
.search-filters { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; margin: var(--space-3) 0 var(--space-4); }
.search-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.search-filter-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-meta); }
.search-filter .seg { flex-wrap: wrap; }
.seg-count { font-size: 12px; opacity: 0.75; margin-left: 2px; }
.search-count { margin: 0 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); font-size: 14px; color: var(--color-text); }
.search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.search-row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border-card); border-radius: var(--radius-card); padding: 14px 18px;
}
.search-badge { align-self: start; justify-self: start; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; background: var(--color-control-active); color: var(--color-text); }
.search-badge-note { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.search-row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search-row-title { font-size: 17px; font-weight: 600; color: var(--color-text); text-decoration: none; overflow-wrap: anywhere; }
.search-row-title:hover { text-decoration: underline; }
.search-row-title:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 2px; }
.search-row-from { font-size: 13px; color: var(--color-text-meta); }
.search-row-snippet { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.search-row mark, .search-more mark { background: color-mix(in srgb, #f2c14e 45%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; font-weight: 600; }
.search-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--color-accent); min-height: 32px; display: flex; align-items: center; }
.search-more ul { margin: var(--space-2) 0 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.search-empty { display: flex; flex-direction: column; gap: var(--space-3); max-width: 64ch; }
.search-shortcut kbd { font: inherit; font-weight: 600; padding: 1px 6px; border: 1px solid var(--color-border); border-radius: 4px; }
@media (max-width: 599px) {
  .search-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: 12px 14px; }
  .search-row-title { font-size: 16px; }
  .search-shortcut { display: none; }
  .search-filter .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
}

/* ── Settings (TASKS.md slice 9, mockup A): panels in two columns, one on a phone. ── */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5, 20px); align-items: start; margin-top: var(--space-4); max-width: 1100px; }
.settings-panel h3 { margin: 0 0 var(--space-3); }
.settings-panel form { display: flex; flex-direction: column; gap: var(--space-4); }
.settings-identity { display: flex; gap: var(--space-3); align-items: center; font-size: 13px; }
.settings-avatar { width: 48px; height: 48px; font-size: 18px; flex-shrink: 0; }
.settings-facts { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.settings-facts div { display: flex; flex-direction: column; gap: 2px; }
.settings-facts dt { font-size: 13px; color: var(--color-text-meta); }
.settings-facts dd { margin: 0; overflow-wrap: anywhere; }
.settings-group { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.settings-group legend { font-size: 14px; color: var(--color-text-meta); padding: 0; margin-bottom: var(--space-2); }
.settings-group .seg { align-self: flex-start; flex-wrap: wrap; }
.settings-hint { font-size: 13px; margin: 0; }
.settings-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.settings-saved { font-size: 14px; color: var(--color-link); }
.settings-status { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; }
.settings-on { font-weight: 600; color: var(--color-link); }
.settings-off { font-weight: 600; color: var(--color-text-meta); }
@media (max-width: 899px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
.settings-panel:focus { outline: none; }
.settings-panel:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Who sees a note (owner decision, 2026-10-22). */
.note-visibility { border: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.note-visibility legend { font-size: 13px; color: var(--color-text-meta); padding: 0; margin-bottom: var(--space-2); }
.note-visibility .seg { align-self: flex-start; flex-wrap: wrap; }
.note-only-me { align-self: center; white-space: nowrap; }

/* People (TASKS.md slice 33.1; docs/design/people/). Private to its owner. */
/* Straight under Up Next, rather than the rail's 28px gap between groups. */
.rail-people { border-top: 0; margin-top: -28px; padding-top: 0; }
.people { max-width: 1100px; }
.people h2 { margin: 4px 0 0; }
.people-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; }
.people-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.people-actions form { margin: 0; }
.people-private { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; color: var(--color-text-2); }
.people .notice { margin-top: var(--space-3); }
.people-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: var(--color-link); background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
}
.people-avatar-lg { width: 60px; height: 60px; font-size: 22px; }
.people-member-tag {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius-md); font-size: 12px; font-weight: 600;
  color: var(--color-link); background: color-mix(in srgb, var(--color-accent) 14%, transparent);
}
.people-empty { margin-top: var(--space-4); gap: 16px; }
.people-empty-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.people-empty-points > div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--color-text-2); }
.people-empty-points strong { color: var(--color-text); font-size: 15px; }
.people-suggest { margin-top: var(--space-4); }
.people-suggest h3 { font-size: 15px; margin: 0 0 8px; }
.people-suggest-list { display: flex; flex-wrap: wrap; gap: 8px; }
.people-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 14px 0 4px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-input-border); background: var(--color-surface); color: var(--color-text); text-decoration: none; font-size: 14px;
}
.people-chip .people-avatar { width: 32px; height: 32px; font-size: 13px; }
.people-everyone { margin-top: var(--space-4); }
.people-toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 12px; }
.people-toolbar h3 { margin: 0; flex: 1 1 auto; font-size: 17px; }
.people-find { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.people-find .input { width: auto; }
.people-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border-card); border-radius: var(--radius-control); background: var(--color-surface); }
.people-row {
  display: grid; grid-template-columns: 36px minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--color-border-card); font-size: 14px;
}
.people-row:first-child { border-top: 0; }
.people-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.people-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.people-row-name a { font-weight: 600; font-size: 15px; color: var(--color-text); text-decoration: none; }
.people-row-name a:hover { text-decoration: underline; }
.people-row-rhythm, .people-row-topics { color: var(--color-text-2); }
@media (max-width: 699px) {
  .people-row { grid-template-columns: 36px minmax(0, 1fr); }
  .people-row { row-gap: 2px; }
  .people-row-when, .people-row-rhythm, .people-row-topics { grid-column: 2; }
}
.person-back { display: inline-flex; align-items: center; min-height: var(--touch); font-size: 14px; }
.person-title { display: flex; gap: 14px; align-items: center; }
.person-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; color: var(--color-text-2); }
.person-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin-top: var(--space-4); }
.person-main { flex: 999 1 480px; min-width: 0; }
.person-main h3 { margin: 0 0 12px; font-size: 17px; }
.person-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.person-panel { gap: 8px; font-size: 14px; color: var(--color-text-2); }
.person-panel h3 { margin: 0; font-size: 15px; color: var(--color-text); }
.person-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.person-about { margin: 0; white-space: pre-line; line-height: 1.5; }
.person-form-page { max-width: 760px; }
.person-form { margin-top: var(--space-3); }
.person-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.field-help { display: block; margin-top: 6px; font-size: 13px; color: var(--color-text-meta); }
.person-dates { border: 0; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person-dates legend { font-size: 13px; font-weight: 500; color: var(--color-text-2); margin-bottom: 6px; padding: 0; }
.person-date-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.person-date-row .input { width: auto; }
.person-date-row .input:first-of-type { flex: 1 1 180px; }
.person-date-day { width: 5em !important; }
.person-date-year { width: 6em !important; }
.person-date-yearly { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); font-size: 14px; }
.person-form-actions { display: flex; gap: 8px; align-items: center; }
.person-remove { margin-top: var(--space-3); }
.people-row-when { display: flex; flex-direction: column; gap: 2px; color: var(--color-text-2); }
.people-section-title { margin: 0 0 12px; font-size: 17px; }
.people-coming { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; border-top: 1px solid var(--color-border-card); font-size: 14px; }
.people-coming:first-child { border-top: 0; }
.people-coming form { margin: 0; }
.people-coming.is-overdue { background: color-mix(in srgb, var(--color-type-podcast) 7%, var(--color-surface)); }
.people-coming-day { width: 120px; font-weight: 600; }
.people-coming-what { flex: 1 1 240px; }
/* A person's timeline (TASKS.md slice 33.1, part 2). */
.engagement-quick { gap: 10px; margin-bottom: var(--space-4); }
.engagement-quick-label { font-weight: 600; font-size: 14px; }
.engagement-quick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.engagement-quick-row .seg { flex-wrap: wrap; }
.engagement-quick-date { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--color-text-2); }
.engagement-quick-date .input { width: auto; }
.engagement-toolbar { margin-bottom: 10px; }
.engagement-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 12px; }
.engagement { gap: 8px; font-size: 14px; color: var(--color-text-2); }
.engagement-planned { border-style: dashed; }
.engagement-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--color-text); }
.engagement-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-md); background: var(--color-pill-bg); color: var(--color-pill-text); }
.engagement-badge.badge-planned { color: var(--color-type-podcast); background: color-mix(in srgb, var(--color-type-podcast) 14%, transparent); }
.engagement-badge.badge-skipped { color: var(--color-text-muted); }
.engagement-note { margin: 0; white-space: pre-line; line-height: 1.5; }
.engagement-entry { font-size: 14px; }
.engagement-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.engagement-actions form { margin: 0; }
.engagement-who {
  display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto;
  padding: 6px 10px; border: 1px solid var(--color-input-border); border-radius: var(--radius-control); background: var(--color-input-bg);
}
.engagement-who-option { display: flex; align-items: center; gap: 8px; min-height: var(--touch); font-size: 14px; }
/* Keep in touch (TASKS.md slice 33.1, part 3). */
.rail-count-due, .count-pill-due { color: var(--color-type-podcast); background: color-mix(in srgb, var(--color-type-podcast) 14%, var(--color-surface)); }
.people-section-note { font-weight: 400; font-size: 14px; }
.people-status { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; min-height: 0; font-size: 14px; }
.people-status form { margin: 0; }
.people-due { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.people-due-card { gap: 6px; font-size: 13px; }
.people-due-name { display: flex; align-items: center; gap: 10px; }
.people-due-name a { font-weight: 600; font-size: 16px; color: var(--color-text); text-decoration: none; }
.people-due-why { font-weight: 600; color: var(--color-type-podcast); }
.people-due-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.people-due-actions form { margin: 0; }
.people-row-rhythm.is-due { color: var(--color-type-podcast); font-weight: 600; }
.rail-people-soon { gap: 2px; padding: 12px 14px; text-decoration: none; color: var(--color-text); font-size: 14px; }
.rail-people-when { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-link); }
.rail-people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 14px; }
.rail-people-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--touch); border-bottom: 1px solid var(--color-border); color: var(--color-text-2); }
.rail-people-list li:last-child { border-bottom: 0; }
.rail-people-list li > a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.rail-people-due { color: var(--color-type-podcast); }
.rail-people-date { font-size: 13px; color: var(--color-text-meta); }
.people-banner { margin-top: var(--space-2); }
.person-add-details { text-decoration: none; color: var(--color-text-2); }
.person-add-details strong { color: var(--color-link); }

