:root {
  --bg: #0f1218; --card: #1b1f2a; --text: #e8eaf0; --muted: #9aa3b5; --line: #2a3040;
  --discovery: #4f8cff; --alert: #ff6b57; --checkin: #38c48f; --insight: #b98bff; --correction: #ffb020; --default: #6d7890;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overscroll-behavior-y: contain; }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(15,18,24,0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: env(safe-area-inset-top) 16px 8px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 20px; margin: 10px 0 4px; letter-spacing: 0.5px; }
.iconbtn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 36px; height: 36px; font-size: 18px; }
.status { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.status .stale { color: var(--alert); }
.pull { text-align: center; color: var(--muted); font-size: 13px; height: 0; overflow: hidden; transition: height 0.15s; }
.pull.armed { height: 32px; line-height: 32px; }
.feed { padding: 8px 12px 40px; max-width: 720px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--default); border-radius: 12px; padding: 12px 14px; margin: 10px 0; position: relative; transition: transform 0.2s, opacity 0.2s; touch-action: pan-y; }
.card[data-type="discovery"] { border-left-color: var(--discovery); }
.card[data-type="alert"] { border-left-color: var(--alert); border-color: var(--alert); box-shadow: 0 0 0 1px rgba(255,107,87,0.25); }
.card[data-type="check-in"] { border-left-color: var(--checkin); }
.card[data-type="insight"] { border-left-color: var(--insight); }
.card[data-type="correction"] { border-left-color: var(--correction); }
.card.dismissing { opacity: 0; transform: translateX(-110%); }
.card-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--default); color: #fff; }
.card[data-type="discovery"] .badge { background: var(--discovery); }
.card[data-type="alert"] .badge { background: var(--alert); }
.card[data-type="check-in"] .badge { background: var(--checkin); }
.card[data-type="insight"] .badge { background: var(--insight); }
.card[data-type="correction"] .badge { background: var(--correction); color: #1b1300; }
.when { margin-left: auto; white-space: nowrap; }
.name { font-size: 17px; margin: 8px 0 4px; line-height: 1.3; }
.summary { margin: 0; color: #c9cfdb; font-size: 15px; }
.meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.expanded { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.body { font-size: 15px; word-wrap: break-word; overflow-wrap: anywhere; }
.body h1, .body h2, .body h3 { font-size: 16px; margin: 12px 0 6px; }
.body p { margin: 8px 0; }
.body a { color: var(--discovery); }
.body pre, .body table { overflow-x: auto; display: block; max-width: 100%; }
.body img { display: none; }
.retracted { margin: 10px 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,176,32,0.12); font-size: 14px; }
.retracted a { color: var(--correction); }
.sourcelist { margin: 10px 0 0; padding-left: 18px; font-size: 13px; }
.sourcelist a { color: var(--muted); }
.tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.sentinel { height: 1px; }
.notice { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font-size: 14px; max-width: 90vw; }
.notice a { color: var(--discovery); }
.empty { color: var(--muted); text-align: center; padding: 48px 12px; }
.pinned { outline: 2px solid var(--discovery); }
@media (prefers-color-scheme: light) {
  :root { --bg: #f4f5f8; --card: #ffffff; --text: #171a21; --muted: #5d6677; --line: #e0e4ec; color-scheme: light; }
  .topbar { background: rgba(244,245,248,0.94); }
  .summary { color: #3a4152; }
}
