:root {
  --bg: #0f1115;
  --card: #181b22;
  --line: #2a2f3a;
  --fg: #e7eaf0;
  --muted: #9aa3b2;
  --accent: #5b8cff;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
/* The `hidden` attribute must win over any `display` an element's class sets (e.g. the reader
   shell's `display: grid` or the article overlay's `display: flex`), otherwise toggling
   `el.hidden` via show() does nothing and the element renders anyway. */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}
header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
/* Reader header lays the title and the action cluster out on one row; the admin pages keep the
   bare single-child header, which this still centers fine. */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ghost-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.ghost-link:hover { color: var(--accent); }
header h1 { margin: 0; font-size: 20px; font-weight: 700; }
header h1 span { color: var(--muted); font-weight: 400; }
header h1 a { color: inherit; text-decoration: none; }
main { max-width: 880px; margin: 0 auto; padding: 24px; }
main.narrow { max-width: 460px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); margin: 0 0 12px; }

input, select, button, textarea {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  background: #11141a;
  color: var(--fg);
}
textarea { width: 100%; resize: vertical; }
input::placeholder, textarea::placeholder { color: #5c6577; }
button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--fg); }
button.danger { color: var(--danger); border-color: var(--danger); }

/* A link styled as a button (e.g. the "Create your account" jump from sign-in). */
.button-link {
  display: inline-block; text-align: center; text-decoration: none;
  border-radius: 8px; padding: 9px 12px;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
}
.button-link:hover { filter: brightness(1.08); }

/* Username claim: the fixed @domain suffix sits inline after the local-part input. */
.suffix-row { display: flex; align-items: center; gap: 6px; }
.suffix-row input { flex: 1 1 auto; }
.suffix { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input { flex: 1 1 160px; }
.row.spread { justify-content: space-between; }
.row.spread h2 { margin: 0; }
.check { color: var(--muted); display: flex; align-items: center; gap: 6px; }

.bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; color: var(--muted);
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }

.tag { color: var(--danger); font-size: 12px; border: 1px solid var(--danger); border-radius: 6px; padding: 0 5px; }

/* ── Admin: the apps' five-tab Admin section (Allowlist … Danger) ────────────── */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px;
}
.tabs .tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 7px 12px; border-radius: 8px;
}
.tabs .tab:hover { color: var(--fg); filter: none; }
.tabs .tab.active { background: var(--card); border-color: var(--line); color: var(--accent); }

/* Admin card lists — mirror the native apps' Admin screens (headline + badges + detail
   lines + actions), one card per allowlist entry / user / feedback / captured error. */
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-empty { padding: 8px 2px; }
.admin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.admin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-title { font-size: 16px; font-weight: 600; flex: 1 1 auto; min-width: 0; word-break: break-word; }
.badges { display: flex; gap: 6px; flex: none; }
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--muted); border-radius: 4px; padding: 1px 5px;
}
.badge.accent { color: var(--accent); border-color: var(--accent); }
.admin-detail { color: var(--muted); font-size: 13px; word-break: break-word; }
/* A card title that discloses more on click (a user card leads with the login email and
   expands to the handles that identity wears). */
.disclosure { display: flex; flex-direction: column; gap: 6px; }
.admin-toggle {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px;
  background: transparent; border: 0; border-radius: 6px; padding: 0; text-align: left;
  color: var(--fg);
}
.admin-toggle:hover { filter: none; color: var(--accent); }
.admin-toggle .caret { flex: none; color: var(--muted); font-size: 10px; }
.admin-toggle[aria-expanded="true"] .caret { color: var(--accent); transform: rotate(90deg); }
.disclosure-panel { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; }
.admin-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.admin-when { color: var(--muted); font-size: 12px; margin-left: auto; flex: none; }
.push-right { margin-left: auto; }
.fb-cat { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.fb-plat { color: var(--muted); font-size: 12px; }
.fb-msg { white-space: pre-wrap; word-break: break-word; }
.err-card .src { color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.err-card .tgt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }

/* Site Health: stat cells (Database + error counts), then one entry per captured error. */
.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px;
  background: #11141a; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-num { font-size: 20px; font-weight: 700; }
.stat-num.bad { color: var(--danger); }

.err-msg { white-space: pre-wrap; word-break: break-word; }
.err-card .mono { word-break: break-all; }
.code {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: #11141a; border: 1px dashed var(--accent); color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 12px; }
/* Personas (Account → Identity): one button per persona, the acting one highlighted and
   disabled (you can't switch to where you already are). Row = the button + its rename/delete. */
.persona-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.persona-btn {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border-radius: 8px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
}
.persona-btn:hover:not(:disabled) { border-color: var(--accent); }
.persona-btn.active { border-color: var(--accent); background: #1b2030; cursor: default; }
.persona-btn.active .persona-name { color: var(--accent); }
.persona-name { font-size: 14px; color: var(--fg); }
.persona-hint { font-size: 11px; color: var(--muted); }
.persona-actions { display: flex; gap: 4px; }
/* The JRD a domain claim tells you to host (Account → Domains → "File…"): long token lines
   must wrap inside the card rather than pushing the page sideways. */
.dom-jrd {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 8px;
  background: #11141a; border: 1px solid var(--line);
  white-space: pre-wrap; word-break: break-all;
}
/* Feeds under a claimed domain (Account → Domains → "Feeds…", docs/multi_domain.md §10):
   one card per associated feed, stacked under the domain's row. Long feed URLs wrap rather
   than widening the panel. */
.dom-feeds { margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.dom-feed {
  padding: 10px 12px; border-radius: 8px;
  background: #11141a; border: 1px solid var(--line);
}
.dom-feed > div { margin-bottom: 4px; }
.dom-feed .small { font-size: 12px; color: var(--muted); }
.dom-feed .mono { word-break: break-all; }
.dom-feed p { margin: 4px 0 0; }

td.msg { white-space: pre-wrap; word-break: break-word; max-width: 32ch; }
.error { color: var(--danger); min-height: 1.2em; }
#auth .error { margin-top: 4px; }

/* Sign-in page: stacked credential form + passkey fallback. (Scoped to direct children so
   the admin "Your account" form, which wraps its inputs in a .row, is unaffected.) */
#auth #pw-form, #auth #idp-form { display: flex; flex-direction: column; gap: 10px; }
#auth #pw-form > input, #auth #pw-form > button,
#auth #idp-form > input, #auth #idp-form > button { width: 100%; }
.or { color: var(--muted); text-align: center; margin: 14px 0 10px; font-size: 13px; }
#passkey-btn { width: 100%; }

/* ── Reader (app.html): vertical sidebar + item list + article overlay ────────── */
/* The native apps' bottom tab bar becomes a full-height left rail here. App is the only page
   that uses its own <header>-less shell; the rail carries brand, views, channels, feeds, and a
   footer with the Account button + the signed-in identity / sign-out row. */
.reader-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { font-size: 18px; font-weight: 700; padding: 4px 10px 12px; }
.brand a { color: inherit; text-decoration: none; }
.brand span { color: var(--muted); font-weight: 400; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-section { display: flex; flex-direction: column; }
.nav-label {
  color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 16px 10px 6px;
}

/* A nav row: leading icon + label, full-width, active = tinted pill. */
.sidebar .nav {
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 8px;
  width: 100%;
  font-size: 15px;
}
.sidebar .nav:hover { background: var(--card); filter: none; }
.sidebar .nav.active { background: var(--card); color: var(--accent); }
.sidebar .nav .nav-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Attention count on the Account entry (unread messages + pending connect requests). */
.sidebar .nav .nav-badge {
  margin-left: auto; flex: none;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; line-height: 15px;
}
.sidebar .nav.indent { color: var(--muted); font-size: 14px; }
.sidebar .nav.indent.active { color: var(--accent); }
.ico { width: 18px; height: 18px; flex: none; }
.nav.indent .ico { width: 15px; height: 15px; opacity: 0.8; }

/* Activity → Updates rows: feed title (click-through to the feed's new items), "N new" count
   pill, dismiss action. */
.update-row { flex-wrap: nowrap; }
.update-row .update-title {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.update-row .update-title:hover { color: var(--accent); }
.update-row .update-count {
  flex: none;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; line-height: 16px;
}

/* Footer pinned to the bottom of the rail. */
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-foot .nav { margin-bottom: 8px; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.acct-who { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.acct-who strong { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.reader-main { min-width: 0; padding: 0 24px 24px; }
.content-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.content-head h2 { margin: 0; font-size: 20px; }

.item-list { display: flex; flex-direction: column; gap: 12px; }
.empty { padding: 24px 0; }
/* Feed item card — mirrors the native iOS/Android cards: a vertical stack of header
   (source + absolute date), a content area chosen by type (post blocks / image+caption /
   article), optional decorator+photo banners, then the action row. No read-dimming — seen
   state is expressed by the list-level "Seen" separator instead (like the apps). */
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.item-head { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 8px; }
.item-source {
  font-size: 15px; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.item-source { text-decoration: none; cursor: pointer; }
a.item-source:hover { color: var(--accent); }
.item-date { color: var(--muted); font-size: 12px; }
.item-meta { color: var(--muted); font-size: 13px; }

/* Full-bleed hero at the top of the content area — aspect-hugging, never cropped. */
.item-hero {
  display: block; width: 100%; height: auto; max-height: 560px;
  object-fit: contain; background: #11141a; cursor: pointer;
}

/* ARTICLE: title (3 lines) + summary (3 lines), both HTML-stripped. */
.item-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px 10px; cursor: pointer; }
.item-title {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.item-desc {
  margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* IMAGE: the title acts as a caption under the hero (2 lines). */
.item-caption {
  margin: 0; padding: 8px 14px 10px; color: var(--muted); font-size: 13px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* POST: member-authored blocks rendered natively (mirrors the apps' BlockList). */
.item-blocks { padding: 6px 14px 8px; }
.blk-title { font-size: 18px; font-weight: 700; margin: 10px 0 4px; }
.blk-text { font-size: 15px; line-height: 1.55; margin: 6px 0; white-space: pre-wrap; word-wrap: break-word; }
.blk-text :where(p, ul, ol, blockquote) { margin: 6px 0; }
.blk-text a { color: var(--accent); }
.blk-img {
  display: block; width: 100%; height: auto; max-height: 560px;
  object-fit: contain; border-radius: 8px; margin: 8px 0; background: #11141a;
}
.blk-caption { color: var(--muted); font-size: 12px; font-style: italic; margin: -2px 0 8px; }
.blk-quote { border-left: 3px solid var(--line); padding-left: 12px; margin: 10px 0; }
.blk-quote-text { font-style: italic; font-size: 16px; }
.blk-quote-attr { color: var(--muted); font-size: 12px; margin-top: 2px; }
.blk-card {
  display: block; background: #11141a; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin: 8px 0; text-decoration: none; color: inherit;
}
a.blk-card:hover { border-color: var(--accent); }
.blk-kicker { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.blk-link-title { color: var(--accent); font-size: 15px; font-weight: 500; margin-top: 3px; }
.blk-sub { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-word; }
.blk-card img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; border-radius: 6px; margin: 6px 0; }

/* Decorator (event/reminder) + photo-request banners. */
.item-banner { margin: 6px 14px 0; background: #11141a; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* Action row: save / archive / repost, then a trailing share. */
.item-actions { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
.item-spacer { flex: 1 1 auto; }
button.ghost.on { color: var(--accent); }
.item-share { color: var(--muted); }

/* Divider between unseen (top) and already-seen (bottom) items in feed views. */
.seen-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 2px; }
.seen-sep::before, .seen-sep::after { content: ""; height: 1px; background: var(--line); flex: 1 1 auto; }
button.small { padding: 5px 10px; font-size: 13px; }

.chan-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.chan-row input { flex: 1 1 auto; }
#sub-table td .mono { margin-top: 2px; }
#sub-table .check { display: inline-flex; margin-right: 12px; }

/* ── My Content (app.html): the apps' member creator section ─────────────────── */
.stack { display: flex; flex-direction: column; gap: 10px; }

/* A list entry (post / personal feed / shared feed / person) inside a card. */
.entry-row {
  padding: 12px 0; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.entry-row:last-child { border-bottom: none; padding-bottom: 2px; }
.entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-title { font-weight: 600; }
.entry-when { color: var(--muted); font-size: 12px; margin-left: auto; }
.entry-summary {
  color: var(--muted); font-size: 14px; margin: 0; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* A message body (Account → Messages): full text, no line clamp. */
.msg-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

.badge {
  font-size: 12px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 6px; color: var(--muted); text-transform: capitalize; flex: none;
}
.badge.draft { color: #ffb454; border-color: #8a6a34; }
.chip {
  font-size: 12px; background: #11141a; border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; color: var(--muted); flex: none;
}
.counter { color: var(--muted); font-size: 12px; text-align: right; }
.img-preview { max-width: 260px; max-height: 200px; border-radius: 8px; display: block; }
.img-preview.small { max-width: 140px; max-height: 100px; }
.feed-url a { color: var(--muted); }
.feed-url a:hover { color: var(--accent); }

/* Rule builder: one dashed box per AND-group, "— or —" separators between groups. */
.rule-group {
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.or-sep { color: var(--muted); text-align: center; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.cond-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; width: 100%; }
.cond-row input { flex: 1 1 140px; }

/* Decorator (event / reminder attachment) inside the new-post form. */
.decorator { border-top: 1px dashed var(--line); padding-top: 10px; }
.muted-label { color: var(--muted); font-size: 13px; flex: none; }

/* The unified feeds page: section labels inside cards + the new-feed type picker. */
.section-label {
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 6px;
}
.feed-type-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 10px 12px;
}
.feed-type-choice .muted { font-size: 12px; font-weight: normal; }

/* Direct-feed members panel + People feed picker. */
.members-panel {
  border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.member-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Repost / small dialogs reuse the reader overlay with a narrower panel. */
.reader-panel.dialog { max-width: 460px; }
.dialog-title { margin: 0; font-size: 18px; }
.dialog-actions { justify-content: flex-end; margin-top: 10px; }

/* Article overlay — a centered reading panel over a dimmed backdrop. */
body.reader-open { overflow: hidden; }
.reader-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.reader-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%; max-width: 720px; height: max-content;
  padding: 22px 26px 32px;
}
.reader-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.reader-panel h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.reader-panel #reader-extract { margin: 14px 0 0; }
.reader-content { margin-top: 18px; font-size: 16px; line-height: 1.7; word-break: break-word; }
.reader-content img { max-width: 100%; height: auto; border-radius: 8px; }
.reader-content a { color: var(--accent); }
.reader-content pre { overflow-x: auto; background: #11141a; padding: 12px; border-radius: 8px; }
.reader-content h1, .reader-content h2, .reader-content h3 { line-height: 1.3; }

/* ── Public profile page (/u/{handle}) — the native member card as a shareable web page ─── */
.profile-card { text-align: center; padding: 28px 24px 30px; }
.avatar,
.avatar-fallback {
  width: 112px; height: 112px; border-radius: 50%;
  margin: 0 auto 16px;
  background: #11141a; border: 1px solid var(--line);
}
.avatar { object-fit: cover; display: block; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.avatar-fallback svg { width: 56px; height: 56px; }
.avatar-sm { width: 56px; height: 56px; margin: 0; }
.avatar-sm svg { width: 28px; height: 28px; }
.profile-username { font-size: 20px; font-weight: 700; margin: 0 0 12px; word-break: break-word; }
.profile-bio { color: var(--fg); white-space: pre-wrap; word-break: break-word; margin: 0; }
.profile-bio.empty { color: var(--muted); font-style: italic; }
.profile-website { margin: 12px 0 0; }
.profile-website a { color: var(--accent); text-decoration: none; word-break: break-all; }
.profile-website a:hover { text-decoration: underline; }
.profile-feeds { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; }
.profile-feeds h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.profile-feeds ul { list-style: none; margin: 0; padding: 0; }
.profile-feeds li { padding: 4px 0; word-break: break-word; }
.profile-feeds a { color: var(--accent); text-decoration: none; }
.profile-feeds a:hover { text-decoration: underline; }
.profile-feeds .feed-kind { margin-left: 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.profile-follow { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-follow form { text-align: left; margin-top: 12px; }
.profile-follow .row { display: flex; gap: 8px; }
.profile-follow input { flex: 1; }
.profile-foot { text-align: center; margin-top: 4px; }
.profile-foot a { color: var(--muted); text-decoration: none; font-size: 13px; }
.profile-foot a:hover { color: var(--accent); }

/* Following (reader): saved-site rows + the search result panel. */
#following-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.follow-row { justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.follow-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.follow-info .muted { margin: 0; font-size: 13px; }
.follow-title a { color: var(--fg); text-decoration: none; font-weight: 600; word-break: break-word; }
.follow-title a:hover { color: var(--accent); }
.follow-member { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.follow-member .muted { margin: 2px 0 8px; }
.follow-feed { padding: 4px 0; }
.follow-feed-title { flex: 1; word-break: break-word; }
.follow-save { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.follow-save-url { flex: 1 1 100%; margin: 0; font-size: 13px; word-break: break-all; }

@media (max-width: 760px) {
  /* Rail collapses to a scrollable top bar; the footer rejoins the flow inline. */
  .reader-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px;
  }
  .brand { width: 100%; padding-bottom: 8px; }
  .nav-group { flex-direction: row; flex-wrap: wrap; }
  .nav-section { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px; }
  .nav-label { padding: 8px 8px 8px 2px; }
  .sidebar .nav { width: auto; }
  .sidebar-foot {
    margin: 0 0 0 auto; padding: 0 0 0 12px; border: none;
    display: flex; align-items: center; gap: 10px;
  }
  .sidebar-foot .nav { margin: 0; }
}
