/* TSquirrel — styles.css */
:root:not([data-theme="dark"]) {
  --brand: #2c5f2e;
  --brand-mid: #3d7a40;
  --brand-light: #52a653;
  --brand-pale: #e8f5e9;
  --accent: #e07b39;
  --accent-pale: #fff3eb;
  --acorn: #b5651d;
  --card-bg: #fff;
  --page-bg: #f5f3ef;
  --muted: #7a7068;
  --border: #e2ddd6;
  --tag-bg: #efece7;
  --category-active-bg: #2c5f2e;
  --category-active-color: #fff;

  /* Rebind Pico's primary tokens to the brand green — Pico ships its own
     blue (#0172ad) for every button/link/outline, which clashes with the
     hand-styled green branding used elsewhere (nav, badges, pills). This
     makes the two "primary" colors one, sitewide. */
  --pico-primary: var(--brand);
  --pico-primary-background: var(--brand);
  --pico-primary-border: var(--brand);
  --pico-primary-underline: rgba(44, 95, 46, 0.5);
  --pico-primary-hover: #1f451f;
  --pico-primary-hover-background: #1f451f;
  --pico-primary-hover-border: #1f451f;
  --pico-primary-hover-underline: #1f451f;
  --pico-primary-focus: rgba(82, 166, 83, 0.5);
  --pico-primary-inverse: #fff;
}

html { background: var(--page-bg); }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: var(--page-bg); padding-bottom: 4.5rem; min-height: 100vh; }

/* Public pages keep a magazine-width column (matches the original mockup at
   720px) instead of Pico's default, which grows to 1450px on wide desktops —
   at that width single-column cards and hero text stretched into overly long
   lines. Capped at 980px, with the feed becoming a 2-column grid below,
   uses the extra space without losing the tighter proportions. Admin pages
   opt out via the more specific `.admin-body main.container` rule below. */
main.container, footer.container { max-width: 980px; }

/* Nav */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}
.site-nav {
  max-width: 980px;
  margin: 0 auto;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-body .site-nav { max-width: min(1440px, 96vw); }
.logo { display: inline-flex; align-items: center; gap: .4rem; color: var(--brand) !important; text-decoration: none; }
.logo-icon { font-size: 1.6rem; line-height: 1; }
.logo-wrap { display: flex; flex-direction: column; line-height: 1; }
.logo-text { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.logo-tagline { display: block; font-size: .65rem; font-weight: 400; color: var(--muted); opacity: .75; letter-spacing: .04em; }
.nav-count { font-size: .75rem; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* Squirrel intro */
.chatter { font-size: .85rem; color: var(--muted); font-style: italic; margin: .25rem 0 .75rem; }
.chatter strong { color: var(--brand); font-style: normal; }

/* Section label */
.section-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 1.1rem 0 .5rem; display: flex; align-items: center; gap: .4rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }


/* Category bar */
.category-bar { margin: 1rem 0; overflow: hidden; }
.category-scroll {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-pill {
  flex-shrink: 0;
  padding: .3rem .75rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 500;
  background: var(--tag-bg);
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: background .15s;
}
.category-pill.active, .category-pill:hover {
  background: var(--category-active-bg);
  color: var(--category-active-color);
  border-color: var(--category-active-bg);
}
.pill-count { font-size: .75rem; opacity: .7; }

/* Story feed */
.story-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  align-items: stretch;
}
@media (min-width: 760px) {
  .story-feed { grid-template-columns: repeat(2, 1fr); }
}
/* "Loading more…" trigger spans both columns instead of squeezing into one */
#load-more { grid-column: 1 / -1; }

.story-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  height: 100%;
  /* Grid tracks default to min-width:auto (min-content); without this a card
     refuses to shrink below its content width and overflows the container. */
  min-width: 0;
  transition: box-shadow .15s;
}
.story-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.story-link { text-decoration: none; color: inherit; display: block; height: 100%; }

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-bottom: .4rem;
  font-size: .78rem;
  color: var(--muted);
}
.story-category {
  background: var(--brand);
  color: #fff;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.story-sources {
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .72rem;
  font-weight: 600;
}
.story-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 .4rem;
  color: #111827;
}
.story-summary {
  font-size: .88rem;
  color: #374151;
  line-height: 1.5;
  margin: 0 0 .5rem;
}
.story-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .5rem;
  margin-top: auto;
  padding-top: .5rem;
}
.story-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.story-tag {
  font-size: .75rem;
  color: var(--muted);
  background: var(--tag-bg);
  padding: .1rem .4rem;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.story-tag:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}
.story-time {
  color: var(--muted);
  font-size: .75rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* Story detail */
.story-detail { max-width: 720px; margin: 0 auto; }
.story-end-nav { margin-top: 2rem; text-align: center; }

/* ── Keep digging (related stories) ── */
.keep-digging {
  max-width: 720px; margin: 0 auto;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: .85rem; box-shadow: 0 2px 10px rgba(26, 22, 18, .05);
}
.keep-digging-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.keep-digging-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .5rem; margin: 0 -.5rem; border-radius: 10px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .15s, transform .15s;
}
.keep-digging-row:hover { background: var(--page-bg); transform: translateX(2px); }
.keep-digging-row:last-child { border-bottom: none; padding-bottom: .55rem; }
.keep-digging-icon { font-size: 1.3rem; flex-shrink: 0; width: 32px; text-align: center; }
.keep-digging-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.keep-digging-take { font-size: .82rem; color: var(--brand); font-style: italic; }
.keep-digging-title { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keep-digging-arrow { margin-left: auto; color: var(--muted); flex-shrink: 0; }

.story-detail-header {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(26, 22, 18, .05);
}
.story-detail-header h1 { font-size: 1.4rem; line-height: 1.35; margin: .5rem 0; }
.story-summary-large { font-size: .95rem; color: #374151; line-height: 1.6; margin: .75rem 0; }

.source-list { display: flex; flex-direction: column; gap: .5rem; }
.source-list h3 { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.source-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  font-size: .88rem;
  transition: background .1s;
}
.source-item:hover { background: #f9fafb; }
.source-name {
  font-size: .75rem;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}
.source-title { color: #111827; line-height: 1.3; }
.source-time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.source-arrow { color: var(--muted); }

/* Archive list */
.archive-list { display: flex; flex-direction: column; gap: .5rem; }
.archive-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .25rem 1rem;
  padding: .9rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.archive-item:hover { background: #f9fafb; }
.archive-item-title { font-size: .95rem; font-weight: 600; color: #111827; line-height: 1.35; }
.archive-item-desc {
  grid-column: 1 / 2;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.archive-item-arrow { grid-row: 1 / 3; align-self: center; color: var(--muted); }

/* Mobile tweaks */
@media (max-width: 600px) {
  .story-title { font-size: .95rem; }
  .nav-count { display: none; }
  .source-item .source-name { display: none; }
  .source-item .source-time { display: none; }
}

/* ── Card layout with thumbnail ── */
.card-inner {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  align-items: stretch;
  height: 100%;
}
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thumb {
  order: -1;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-nuts  { background: #dbeafe; }
.thumb-world { background: #dcfce7; }
.thumb-acorn { background: #fef9c3; }
.thumb-sci   { background: #ede9fe; }
.thumb-fire  { background: #fce7f3; }

@media (max-width: 460px) {
  .thumb { font-size: 1.9rem; }
}

/* ── Badges ── */
.badge {
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .12rem .4rem; border-radius: 4px; white-space: nowrap;
}
.badge-cat-nuts  { background: #2563eb22; color: #1d4ed8; }
.badge-cat-world { background: #16a34a22; color: #15803d; }
.badge-cat-acorn { background: #ca8a0422; color: #92400e; }
.badge-cat-sci   { background: #7c3aed22; color: #6d28d9; }
.badge-cat-fire  { background: #db277722; color: #be185d; }
.badge-sources { background: var(--accent-pale); color: var(--accent); }
.badge-hot { background: #fee2e2; color: #b91c1c; }

.card-take-note {
  font-size: .82rem;
  color: var(--brand-mid);
  line-height: 1.45;
  margin: -.1rem 0 .45rem;
}

/* ── Take-led card hook (Prototype A) ── */
.card-take-hook {
  font-size: .95rem; font-weight: 600; color: var(--brand);
  line-height: 1.4; margin: 0 0 .3rem; font-style: italic;
}
.card-take-attr {
  display: block; font-size: .68rem; font-weight: 500; font-style: normal;
  color: var(--brand-mid); margin-top: .2rem;
}
.story-title-secondary {
  font-size: .82rem; font-weight: 500; color: var(--muted);
  margin: 0 0 .35rem; -webkit-line-clamp: 2;
}

/* ── Featured strip ── */
.card-featured {
  display: block; background: #2d6e34; color: #fff; border-radius: 16px;
  padding: 1rem 1.1rem; text-decoration: none; margin: .25rem 0 .5rem;
  position: relative; overflow: hidden;
}
.card-featured::before {
  content: '🐿️'; position: absolute; right: -8px; bottom: -14px;
  font-size: 5rem; opacity: .15; line-height: 1; transform: scaleX(-1);
}
.card-featured.has-image {
  background-size: cover; background-position: center;
}
.card-featured.has-image::before { display: none; }
.card-featured.has-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,40,25,.55) 0%, rgba(20,40,25,.85) 100%);
  z-index: 0;
}
.card-featured.has-image > * { position: relative; z-index: 1; }
.featured-eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; margin-bottom: .5rem; }
.featured-title { font-size: 1.15rem; font-weight: 800; line-height: 1.3; margin-bottom: .5rem; }
.featured-summary { font-size: .84rem; opacity: .88; line-height: 1.55; margin-bottom: .75rem; }
.featured-footer { display: flex; align-items: center; justify-content: space-between; }
.featured-sources { font-size: .73rem; opacity: .8; }
.featured-pill { font-size: .72rem; font-weight: 700; background: rgba(255,255,255,.2); padding: .2rem .6rem; border-radius: 99px; color: #fff; }

/* ── Admin: article picker (attach source articles) ── */
.article-picker {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--pico-muted-border-color, var(--border));
  border-radius: .5rem;
  padding: .25rem .75rem;
}
.article-picker-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .5rem 0;
  margin: 0;
  border-bottom: 1px solid var(--pico-muted-border-color, var(--border));
  font-weight: normal;
  cursor: pointer;
}
.article-picker-row:last-child { border-bottom: none; }
.article-picker-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: .15rem 0 0;
}
.article-picker-text { flex: 1; min-width: 0; line-height: 1.4; }
.article-picker-source {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--brand, var(--pico-primary));
  text-transform: uppercase;
  letter-spacing: .02em;
}
.article-picker-title { font-size: .9rem; color: inherit; }
.article-picker-view {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  align-self: center;
  text-decoration: none;
  color: var(--accent, var(--pico-primary));
  border: 1px solid var(--border, var(--pico-muted-border-color));
  border-radius: .35rem;
  padding: .15rem .5rem;
}
.article-picker-view:hover { background: var(--accent-pale, rgba(0,0,0,.05)); }

/* ── Admin: story image picker ── */
.image-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .6rem;
}
.image-picker-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  width: 96px;
  padding: .4rem;
  border: 2px solid var(--border, var(--pico-muted-border-color));
  border-radius: .5rem;
  cursor: pointer;
  font-weight: normal;
  text-align: center;
}
.image-picker-option:has(input:checked) {
  border-color: var(--accent, var(--pico-primary));
  background: var(--accent-pale, rgba(0,0,0,.04));
}
.image-picker-option input[type="radio"] { margin: 0 0 .3rem; }
.image-picker-thumb {
  width: 72px;
  height: 48px;
  border-radius: .35rem;
  overflow: hidden;
  background: var(--pico-muted-border-color, #eee);
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-picker-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.image-picker-option small { font-size: .65rem; color: var(--pico-muted-color); line-height: 1.2; }
.image-picker-none {
  width: 72px; height: 48px; border-radius: .35rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--pico-muted-border-color, #eee);
  font-size: .68rem; color: var(--pico-muted-color); text-align: center;
}

/* ── Admin: data tables (stories, signals) ── */
/* Pico tables are 100% width with no wrapping/scroll guard — long topic phrases,
   joined source-name lists, and stacked action buttons can blow out .container's
   fixed width. Wrap tables in .table-scroll so overflow scrolls internally instead
   of breaking page layout, and let individual cells wrap instead of forcing width. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1rem;
}
.table-scroll table { min-width: 640px; }
.table-scroll th, .table-scroll td { word-break: break-word; }
.table-scroll td.nowrap, .table-scroll th.nowrap { white-space: nowrap; }
.table-scroll td form { margin: 0; }
.table-scroll td form button { width: auto; margin: 0; padding: .25rem .7rem; font-size: .82rem; white-space: nowrap; }

.admin-actions {
  display: grid;
  grid-template-columns: 6.5rem 6.5rem;
  gap: .4rem;
  align-items: center;
  justify-content: end;
  margin-left: auto;
}
.admin-actions form { display: flex; margin: 0; }
.admin-actions button, .admin-actions a[role="button"] {
  width: 100%;
  padding: .3rem .5rem;
  font-size: .82rem;
  margin: 0;
  white-space: nowrap;
  text-align: center;
}

/* Bulk action bar on stories page: flex row, wraps cleanly on narrow screens.
   Keep separate from .admin-actions table-cell grid to avoid clipped selects
   and overlapping count text. */
.admin-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .6rem;
  align-items: center;
  margin: .75rem 0;
}
.admin-bulk-actions label,
.admin-bulk-actions .hint {
  margin: 0;
}
.admin-bulk-actions #bulk-action-select,
.admin-bulk-actions #bulk-apply-btn {
  width: auto;
  margin: 0;
}
.admin-bulk-actions #bulk-action-select {
  min-width: 14rem;
  max-width: 100%;
}
.admin-bulk-actions #bulk-selected-count {
  white-space: nowrap;
}

/* Standalone action groups (e.g. story-edit "Actions" section) — a single
   row of buttons, not a column-aligned table grid like .admin-actions. */
.admin-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.admin-actions-row form { display: flex; margin: 0; }
.admin-actions-row button {
  width: auto;
  margin: 0;
  padding: .3rem .8rem;
  font-size: .85rem;
  white-space: nowrap;
}

.signal-sources {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.signal-source-tag {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--tag-bg);
  border-radius: 4px;
  padding: .1rem .4rem;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN CONSOLE — dense, operator-tool aesthetic.
   Scoped to .admin-body so the public reader site is untouched.
   Pico's defaults (large buttons, loose tables, big headings) read
   as "blocky" for a data-dense internal tool — this tightens
   everything up and gives numeric/status data a distinct monospace
   treatment instead of leaning on Pico's default button/table look.
   ══════════════════════════════════════════════════════════════ */

.admin-body {
  --admin-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --admin-line: #dcd6cc;
  --admin-row-alt: #faf8f4;
  --pico-spacing: .9rem;
  --pico-form-element-spacing-vertical: .44rem;
  --pico-form-element-spacing-horizontal: .58rem;
  --pico-typography-spacing-vertical: .78rem;
  font-size: .9rem;
}

.admin-body main.container {
  padding-top: 1.25rem;
  max-width: min(1440px, 96vw);
}

/* Compact heading rhythm — Pico's h1 is huge and sits far from content */
.admin-body h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0 0 .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.admin-body h2 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 1.6rem 0 .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--admin-line);
}

/* Back link — small, quiet, not a full paragraph */
.admin-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: .85rem;
}
.admin-back:hover { color: var(--brand); }

/* Toolbar row: title + primary action, replaces ad-hoc inline flex styles */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.admin-toolbar h1 { margin-bottom: 0; }

.admin-meta {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.admin-meta strong { color: #111827; font-weight: 600; }

/* Tab-style filters, replacing plain "A · B · C" text links */
.admin-tabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.admin-tab {
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--admin-line);
  background: var(--card-bg);
}
.admin-tab:hover { color: var(--brand); border-color: var(--brand-light); }
.admin-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Compact buttons — Pico's role="button" is padded like a marketing CTA */
.admin-body button,
.admin-body [role="button"] {
  font-size: .8rem;
  padding: .34rem .8rem;
  line-height: 1.25;
  border-radius: 6px;
  --pico-box-shadow: none;
}

.admin-main-submit {
  width: auto !important;
  max-width: fit-content;
  flex: 0 0 auto;
  min-width: 8.75rem;
  display: inline-flex;
  justify-content: center;
}
.admin-save-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.admin-save-status {
  color: var(--brand);
  font-size: .8rem;
  font-weight: 600;
}
.admin-save-status.is-error { color: #b91c1c; }
.admin-save-status.has-message { animation: admin-status-expire 3s ease forwards; }
@keyframes admin-status-expire {
  0%, 85% { opacity: 1; }
  100% { opacity: 0; }
}
.admin-body .admin-danger,
.admin-body button.admin-danger {
  color: #b91c1c;
  border-color: #b91c1c;
}
.admin-body .admin-danger:hover { background: #fef2f2; }

/* Inline label + input + button rows (e.g. create-token form) */
.admin-inline-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.1rem;
}
.admin-inline-form input { max-width: 380px; margin: 0; }
/* Pico buttons default to width:100%/display:block, which blows up inside
   a flex row — pin them back to content width here. */
.admin-inline-form button {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

/* Dense data tables — Pico ships ~.75rem/1rem cell padding + 1rem font */
.admin-body table { font-size: .82rem; }
.admin-body table thead th {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--admin-row-alt);
  padding: .4rem .5rem;
}
.admin-body table td {
  padding: .34rem .5rem;
  vertical-align: middle;
}
.admin-body table tbody tr:nth-child(even) { background: var(--admin-row-alt); }
.admin-body table .mono,
.admin-body table td.nowrap {
  font-family: var(--admin-mono);
  font-variant-numeric: tabular-nums;
  font-size: .76rem;
}

/* Status pills — replace bare emoji + text in status columns */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .12rem .5rem;
  border-radius: 99px;
  white-space: nowrap;
}
.status-pill.is-published { background: #dcfce7; color: #15803d; }
.status-pill.is-draft     { background: #fef9c3; color: #92400e; }
.status-pill.is-hidden    { background: #f1f0ec; color: var(--muted); }
.status-pill.is-active    { background: #dcfce7; color: #15803d; }
.status-pill.is-revoked   { background: #f1f0ec; color: var(--muted); }
.status-pill.is-new       { background: #dbeafe; color: #1d4ed8; }
.status-pill.is-reviewed  { background: #ede9fe; color: #6d28d9; }
.status-pill.is-used      { background: #dcfce7; color: #15803d; }
.status-pill.is-dismissed { background: #f1f0ec; color: var(--muted); }
a.status-pill { text-decoration: underline; text-underline-offset: 2px; }
a.status-pill.is-published:hover { background: #bbf7d0; }

.admin-row-faded { opacity: .5; }

/* Alert boxes — replace one-off inline-styled <article> blocks */
.admin-alert {
  border-left: 3px solid var(--admin-line);
  padding: .6rem .85rem;
  margin: 0 0 1rem;
  border-radius: 0 6px 6px 0;
  font-size: .85rem;
}
.admin-alert.is-success { border-color: #15803d; background: #f0fdf4; }
.admin-alert.is-error   { border-color: #b91c1c; background: #fef2f2; }
.admin-alert code {
  display: block;
  margin-top: .45rem;
  font-size: .88rem;
  word-break: break-all;
}

/* Compact fieldsets/legends on the story editor */
.admin-body fieldset {
  padding: .85rem 1rem;
  margin: 0 0 1rem;
  border-radius: 8px;
}
.admin-body legend {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 0 .4rem;
}
.admin-body legend small { text-transform: none; letter-spacing: 0; font-weight: 400; }

.admin-body input:not([type="radio"]):not([type="checkbox"]),
.admin-body textarea,
.admin-body select {
  font-size: .86rem;
  line-height: 1.25;
  min-height: 2.2rem;
  padding: .34rem .56rem;
}

.admin-body input[type="radio"],
.admin-body input[type="checkbox"] {
  min-height: 0;
  padding: 0;
}

.admin-body label {
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .62rem;
}

.signal-evidence { margin: .25rem 0 .5rem; }
.signal-evidence-row {
  margin: .3rem 0;
  font-size: .85em;
  line-height: 1.4;
  word-break: break-word;
}

/* ── Admin signals: card layout (replaces cramped table) ── */
.signals-stack {
  display: grid;
  gap: .8rem;
}

.signal-card {
  background: var(--card-bg);
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  padding: .75rem .85rem;
}

.signal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .45rem;
}

.signal-topic {
  margin: 0;
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: #1a1612;
}

.signal-subject {
  margin: 0 0 .52rem;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.35;
}

.signal-head-badges {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.signal-strength {
  font-size: .73rem;
  color: var(--muted);
  border: 1px solid var(--admin-line);
  border-radius: 99px;
  padding: .14rem .5rem;
  white-space: nowrap;
}

.signal-meta-row {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin: 0 0 .55rem;
}

.signal-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .73rem;
  color: var(--muted);
  background: var(--admin-row-alt);
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  padding: .12rem .42rem;
}

a.signal-meta-chip {
  text-decoration: none;
}

a.signal-meta-chip:hover {
  color: var(--brand);
  border-color: var(--brand-light);
}

.signal-card .signal-sources {
  margin-bottom: .6rem;
}

.signal-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  align-items: center;
  margin-bottom: .55rem;
}

.signal-card-actions form {
  margin: 0;
  display: inline-flex;
}

.signal-card-actions button,
.signal-card-actions a[role="button"] {
  margin: 0;
  white-space: nowrap;
}

.signal-details {
  border-top: 1px dashed var(--admin-line);
  margin-top: .2rem;
  padding-top: .4rem;
}

.signal-details > summary {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.signal-evidence-thumb {
  border-radius: 6px;
  vertical-align: middle;
  margin-right: .35rem;
}

.signal-evidence-source,
.signal-evidence-date {
  color: var(--muted);
}

.story-title-cell a { margin-right: .35rem; }

.story-flag {
  display: inline-block;
  font-size: .66rem;
  font-weight: 600;
  color: #4b5563;
  background: #eceff3;
  border: 1px solid #d5dbe3;
  border-radius: 99px;
  padding: .08rem .42rem;
  white-space: nowrap;
}
.story-flag-review {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}
.admin-review-banner {
  font-size: .82rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: .5rem .7rem;
  margin: .5rem 0 0;
}
.admin-review-banner.is-hidden { display: none; }

/* ── Suggested sources (Radar-proposed, awaiting editor review) ── */
.story-suggestions:empty { display: none; }
.story-suggestions h2 { display: flex; align-items: center; gap: .5rem; }
.suggestion-count {
  font-size: .7rem; font-weight: 700; color: #92400e;
  background: #fef3c7; border: 1px solid #fde68a; border-radius: 99px;
  padding: .05rem .5rem;
}
.suggestion-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.suggestion-item {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem; border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px;
}
.suggestion-thumb { border-radius: 6px; flex-shrink: 0; object-fit: cover; }
.suggestion-body { flex: 1; min-width: 0; }
.suggestion-head { display: flex; gap: .5rem; align-items: baseline; font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.suggestion-source { font-weight: 600; }
.suggestion-title { display: block; font-weight: 600; text-decoration: none; color: var(--brand); }
.suggestion-desc { font-size: .8rem; color: var(--muted); margin: .3rem 0 0; }
.suggestion-actions { display: flex; flex-direction: column; gap: .35rem; flex-shrink: 0; }
.suggestion-actions form { margin: 0; }
.suggestion-actions button { margin: 0; padding: .3rem .7rem; font-size: .78rem; white-space: nowrap; }
.suggestion-accept { color: #15803d; border-color: #86efac; }

/* ── Admin: source material (reporting to synthesize in the story editor) ── */
.source-material {
  list-style: none;
  margin: .4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.source-material-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .8rem;
  align-items: start;
  padding: .7rem .8rem;
  border: 1px solid var(--admin-line);
  border-radius: 6px;
  background: #fff;
}
.source-material-thumb {
  width: 88px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.source-material-body { min-width: 0; }
.source-material-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .15rem;
}
.source-material-source {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand);
}
.source-material-date {
  font-size: .7rem;
  color: var(--muted);
}
.source-material-title {
  display: inline-block;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.3;
  margin-bottom: .2rem;
}
.source-material-desc {
  margin: 0;
  font-size: .84rem;
  line-height: 1.45;
  color: #3f4a3f;
}
.source-material-detach { margin: 0; align-self: center; }
.source-material-detach button { margin: 0; width: auto; white-space: nowrap; }

@media (max-width: 640px) {
  .source-material-item { grid-template-columns: 1fr; }
  .source-material-thumb { width: 100%; height: 140px; }
  .source-material-detach { justify-self: start; }
}

@media (max-width: 860px) {
  .signal-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .signal-head-badges {
    justify-content: flex-start;
  }
}

/* ── Story hero ── */
.story-hero {
  width: 100%; height: 160px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 4.5rem; margin-bottom: .85rem; overflow: hidden;
  position: relative;
  box-shadow: 0 6px 18px rgba(26, 22, 18, .1);
}
.story-hero img { width: 100%; height: 100%; object-fit: cover; }
.story-back-link {
  position: absolute; top: .65rem; left: .65rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(20, 18, 15, .55);
  backdrop-filter: blur(4px);
  color: #fff; text-decoration: none;
  font-size: .78rem; font-weight: 600;
  padding: .35rem .7rem; border-radius: 99px;
  transition: background .15s;
}
.story-back-link:hover { background: rgba(20, 18, 15, .75); }

/* ── Squirrel's Take ── */
.squirrel-take {
  background: var(--brand-pale); border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0; padding: .7rem .85rem; margin: .5rem 0 .75rem;
}
.squirrel-take-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-mid); margin-bottom: .25rem; }
.squirrel-take-text { font-size: .88rem; color: var(--brand); font-style: italic; line-height: 1.5; }

/* ── Why it matters ── */
.why-it-matters {
  background: var(--accent-pale); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: .7rem .85rem; margin: 0 0 .75rem;
}
.why-it-matters-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .25rem; }
.why-it-matters-text { font-size: .88rem; color: var(--brand); line-height: 1.5; }

/* ── Forest mood ── */
.sentiment-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: .85rem; margin-bottom: .75rem; box-shadow: 0 2px 10px rgba(26, 22, 18, .05); }
.sentiment-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.sentiment-bar { height: 8px; border-radius: 99px; background: linear-gradient(to right, #ef4444 0%, #f59e0b 40%, #22c55e 100%); margin-bottom: .35rem; position: relative; }
.sentiment-needle { position: absolute; top: -4px; width: 16px; height: 16px; background: #fff; border: 2px solid var(--brand); border-radius: 50%; transform: translateX(-50%); }
.sentiment-meta { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.sentiment-reading { font-size: .82rem; font-weight: 600; color: var(--brand); margin-top: .3rem; }

/* ── Sources card ── */
.sources-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: .85rem; margin-bottom: .75rem; box-shadow: 0 2px 10px rgba(26, 22, 18, .05); }
.sources-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.source-row {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .55rem .5rem; margin: 0 -.5rem; border-radius: 10px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: background .15s, transform .15s;
}
.source-row:hover { background: var(--page-bg); transform: translateX(2px); }
.source-row:last-child { border-bottom: none; padding-bottom: .55rem; }
.source-icon { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--page-bg); }
.source-body { flex: 1; min-width: 0; }
.source-headline { font-size: .82rem; color: #1a1612; line-height: 1.38; margin: .1rem 0 .15rem; }

/* ── Archive: Buried Seeds cards ── */
.card.archive {
  display: block; background: #faf7f2; border: 1px dashed var(--acorn); border-radius: 12px;
  padding: .85rem 1rem; text-decoration: none; color: inherit; transition: box-shadow .15s;
}
.card.archive:hover { box-shadow: 0 3px 14px rgba(0,0,0,.06); }
.archive-media {
  width: 100%;
  height: clamp(120px, 24vw, 220px);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: .55rem;
  background: #f1e8dc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.archive-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.archive-media-fallback {
  font-size: 1.5rem;
  opacity: .7;
}
.archive-badge-row { margin-bottom: .35rem; }
.badge-archive { background: #f3e8d8; color: var(--acorn); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .38rem; border-radius: 4px; }
.card.archive .archive-item-title { display: block; font-size: .9rem; font-weight: 700; color: #1a1612; line-height: 1.35; margin-bottom: .2rem; }
.card.archive .archive-item-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .82rem; color: var(--muted); line-height: 1.5;
}

/* ── Bottom nav ── */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); display: flex; justify-content: center; z-index: 200; }
.bottom-nav .tab { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .5rem .25rem .6rem; text-decoration: none; color: var(--muted); font-size: .62rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; gap: .15rem; }
.bottom-nav .tab.active { color: var(--brand); }
.bottom-nav .tab-icon { font-size: 1.3rem; line-height: 1; }

/* ── Footer ── */
.footer-tagline { display: block; }
.footer-tagline strong { color: var(--brand); }
.footer-sub { display: block; font-size: .65rem; color: var(--muted); margin-top: .2rem; }
footer.container { text-align: center; padding-top: 1.5rem; padding-bottom: 1.5rem; }

