:root {
  --bg: #ffffff;
  --bg-elev: #fffbea;
  --bg-hover: rgba(255, 200, 0, 0.06);
  --text: #1a1a1a;
  --muted: #6b6455;
  --border: #f1ebd6;
  --accent: #ffc800;          /* bright yellow: fills, underlines, buttons */
  --accent-strong: #ffb800;
  --accent-text: #9a6700;     /* readable gold for text and icons on white */
  --on-accent: #1a1a1a;
  --like: #e0245e;
  --header-bg: rgba(255, 255, 255, 0.88);
  --pill-bg: #fff3c4;
  --pill-text: #7a5200;
}

/* White is the default; dark is opt-in via the Theme button. */
:root[data-theme="dark"] {
  --bg: #0d0c08;
  --bg-elev: #1a1810;
  --bg-hover: rgba(255, 200, 0, 0.05);
  --text: #f3efe3;
  --muted: #9a937f;
  --border: #2e2a1c;
  --accent-text: #ffd23f;
  --header-bg: rgba(13, 12, 8, 0.8);
  --pill-bg: #3a2f08;
  --pill-text: #ffd23f;
}


* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
body { overflow-x: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: var(--text); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 260px 600px 350px;
  justify-content: center;
  min-height: 100vh;
}

/* ---------- left nav ---------- */
.nav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 8px 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 6px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
}
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item, .theme-toggle {
  display: flex; align-items: center; gap: 16px;
  padding: 11px 14px; border-radius: 999px;
  font-size: 19px; text-align: left; width: fit-content;
  transition: background .15s;
}
.nav-item:hover, .theme-toggle:hover { background: var(--bg-elev); }
.nav-item.active { font-weight: 700; background: var(--pill-bg); }
.ico { width: 26px; text-align: center; font-size: 20px; }
.theme-toggle { margin-top: auto; font-size: 16px; color: var(--muted); }

/* ---------- feed ---------- */
.feed {
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  min-width: 0;
}
.feed-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.mobile-top { display: none; }
.feed-title { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px 4px; }
.feed-title h1 { font-size: 20px; margin: 0; font-weight: 800; }
.updated { font-size: 13px; color: var(--muted); }
.tabs { display: flex; }
.tab {
  flex: 1; padding: 14px 0; color: var(--muted); font-weight: 500;
  position: relative; transition: background .15s;
}
.tab:hover { background: var(--bg-elev); }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 56px; height: 4px; border-radius: 4px; background: var(--accent);
}

/* tablet/phone tools: search, section chips, trending words */
.compact-tools { display: none; padding: 10px 0 4px; border-bottom: 1px solid var(--border); }
.compact-tools input {
  display: block; width: calc(100% - 32px); margin: 0 16px 10px;
  padding: 11px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--bg-elev); outline: none; font-size: 16px; /* 16px stops iOS zooming on focus */
}
.compact-tools input:focus { border-color: var(--accent); background: var(--bg); }
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px;
  scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--text);
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.trend-strip { display: flex; flex-direction: column; gap: 6px; }
.trend-strip-label { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 16px; text-transform: uppercase; letter-spacing: .04em; }
.trend-chip {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 7px 14px; border-radius: 14px; color: #1a1a1a; text-align: left;
  border: 2px solid transparent; scroll-snap-align: start;
}
.trend-chip b { font-size: 14px; white-space: nowrap; }
.trend-chip span { font-size: 11.5px; opacity: .75; white-space: nowrap; }
.trend-chip.active, .trend-term.active { border-color: #1a1a1a; }

.term-banner {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin: 10px 16px; padding: 10px 12px 10px 14px; border-radius: 14px; color: #1a1a1a;
}
.term-banner .tb-text { min-width: 0; }
.term-banner .tb-text b { font-size: 16px; }
.term-banner .tb-text div { font-size: 13px; opacity: .8; }
.term-banner button {
  flex: none; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, .08); font-weight: 700; color: #1a1a1a;
}
.term-banner button:hover { background: rgba(0, 0, 0, .15); }

/* ---------- posts ---------- */
.post {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
.post:hover { background: var(--bg-hover); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -0.3px;
  position: relative;
}
.avatar .platform {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg);
  display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff;
}
.post-head { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); }
.post-head .name { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.post-head .handle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.post-head .time { white-space: nowrap; flex: none; }
.verified { color: var(--accent-text); font-size: 14px; flex: none; }
.post-title { font-weight: 600; margin: 2px 0 4px; overflow-wrap: anywhere; }
.post-body { margin: 2px 0 8px; overflow-wrap: anywhere; white-space: pre-line; font-size: 15.5px; }
.post-summary { margin: 0 0 8px; overflow-wrap: anywhere; }
.post-link {
  display: block; border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; margin-bottom: 8px; color: var(--muted); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-link:hover { background: var(--bg-elev); color: var(--accent-text); }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--pill-bg); color: var(--pill-text);
  font-size: 12px; font-weight: 600; margin-right: 6px;
}
.pill.social { background: var(--bg-elev); color: var(--muted); border: 1px solid var(--border); }
.post-actions {
  display: flex; justify-content: space-between; max-width: 425px;
  color: var(--muted); font-size: 13px; margin-top: 4px;
}
.action { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 0 -8px; border-radius: 999px; color: var(--muted); min-height: 36px; }
button.action:hover { color: var(--accent-text); background: rgba(255, 200, 0, 0.15); }
.action.like:hover, .action.like.on { color: var(--like); }
.action.like:hover { background: rgba(224, 36, 94, 0.1); }
.action.bookmark.on { color: var(--accent-text); }
.action svg { width: 18px; height: 18px; flex: none; }

.sentinel { height: 1px; }
.empty { padding: 48px 32px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 22px; margin-bottom: 6px; }
.skeleton { padding: 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 40px 1fr; gap: 12px; }
.sk { background: var(--bg-elev); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- right side ---------- */
.side { padding: 8px 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.search-box { padding: 4px 0 12px; }
.search-box input {
  width: 100%; padding: 12px 18px; border-radius: 999px;
  border: 1px solid transparent; background: var(--bg-elev); outline: none;
}
.search-box input:focus { border-color: var(--accent); background: var(--bg); }

.card { background: var(--bg-elev); border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; }
.card h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.card p { margin: 0 0 10px; }

.trend-terms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trend-term {
  width: 100%; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: #1a1a1a; text-align: left;
  border: 2px solid transparent; transition: transform .12s;
}
.trend-term:hover { transform: translateX(2px); }
.trend-term .rank { font-weight: 800; opacity: .55; }
.trend-term .tt-name { font-weight: 800; font-size: 15.5px; display: block; }
.trend-term .tt-signals { font-size: 12.5px; opacity: .75; }
.new-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; vertical-align: 2px;
  background: #1a1a1a; color: #ffd23f; font-size: 10px; font-weight: 800; letter-spacing: .04em;
}
.trend-term .tt-share { font-weight: 800; font-size: 15px; }

.trending { list-style: none; margin: 0; padding: 0; }
.trending li { padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.trending li:first-child { border-top: 0; }
.trending li:hover .t-title { text-decoration: underline; }
.t-meta { font-size: 13px; color: var(--muted); }
.t-title { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.subscribe { display: flex; flex-direction: column; gap: 8px; }
.subscribe input { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); outline: none; }
.subscribe input:focus { border-color: var(--accent); }
.btn-primary {
  background: var(--accent); color: var(--on-accent); font-weight: 700;
  padding: 10px 16px; border-radius: 999px;
}
.btn-primary:hover { background: var(--accent-strong); }
footer { padding: 0 4px 24px; line-height: 1.6; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: 8px;
  font-weight: 600; z-index: 50; white-space: nowrap;
}

.bottom-nav { display: none; }

/* ---------- accounts & fomos ---------- */
img.avatar { object-fit: cover; display: block; background: var(--bg-elev); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.xl { width: 112px; height: 112px; font-size: 36px; border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--accent); }
.avatar-link { display: block; height: fit-content; }
.post-head a.name:hover, .post-head a.handle:hover { text-decoration: underline; }
.post-body a, .replying a { color: var(--accent-text); font-weight: 600; }
.post-body a:hover, .replying a:hover { text-decoration: underline; }
.replying { color: var(--muted); font-size: 14px; margin: 1px 0 2px; }
.post.fomo.big { cursor: default; }
.post.fomo.big .post-body { font-size: 19px; line-height: 1.45; }

.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-outline {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); font-weight: 700; font-size: 14px;
}
.btn-outline:hover { background: var(--bg-elev); }
.btn-link { font-size: 13px; color: var(--muted); text-decoration: underline; padding: 8px; }
.danger { color: #d0312d !important; }

.setup-notice { margin: 12px 16px; padding: 12px 14px; border-radius: 12px; background: var(--pill-bg); color: var(--pill-text); }

.back-btn { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; margin: -6px 6px -6px -8px; }
.back-btn:hover { background: var(--bg-elev); }
.feed-title { align-items: center; }
.feed-title h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.composer textarea {
  width: 100%; border: 0; outline: none; resize: none; background: transparent; color: var(--text);
  font: inherit; font-size: 18px; line-height: 1.4; padding: 8px 0; min-height: 52px;
}
.composer-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.counter { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.low { color: #d0312d; font-weight: 700; }
.composer.signed-out {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--muted); font-weight: 600;
}
.composer.signed-out .btn-primary { flex: none; }
.thread-composer .composer { border-top: 1px solid var(--border); }
.thread-up { display: block; padding: 10px 16px; color: var(--accent-text); font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--border); }
.replies-title { margin: 0; padding: 12px 16px; font-size: 16px; border-bottom: 1px solid var(--border); }

/* conversations opened under a fomo */
.view-replies { display: block; padding: 6px 0 2px; color: var(--accent-text); font-weight: 700; font-size: 14px; }
.view-replies:hover { text-decoration: underline; }
.post.expanded { border-bottom: 0; }
.reply-panel { padding: 0 16px 6px 68px; border-bottom: 1px solid var(--border); }
.reply-panel .reply-panel { padding: 0 0 4px 28px; border-bottom: 0; }
.reply-list { border-left: 2px solid var(--border); }
.reply-panel .post {
  grid-template-columns: 32px minmax(0, 1fr); gap: 10px;
  padding: 10px 0 6px 12px; border-bottom: 0;
}
.reply-panel .post:hover { background: transparent; }
.reply-panel .avatar { width: 32px; height: 32px; font-size: 12px; }
.reply-panel .post-body { font-size: 15px; margin-bottom: 4px; }
.reply-panel .post-actions { max-width: 360px; }
.reply-note { padding: 10px 0 4px 14px; color: var(--muted); font-size: 14px; }
.reply-more .view-replies { padding-left: 14px; }
.reply-panel .composer { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 10px 0 6px; border: 0; }
.reply-panel .composer textarea { font-size: 15px; min-height: 40px; padding: 6px 0; }
.reply-panel .composer.signed-out { padding: 12px 0 6px; font-size: 14px; }

.profile-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 16px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--pill-bg), var(--bg) 70%);
}
.profile-photo { position: relative; }
.photo-edit {
  position: absolute; right: 0; bottom: 4px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); font-size: 14px;
}
.joined { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.joined svg { width: 16px; height: 16px; }
.profile-name { margin: 10px 0 0; font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.ai-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; flex: none;
  border: 1px solid var(--accent-text); color: var(--accent-text);
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; line-height: 16px; vertical-align: 2px;
}
.profile-name .ai-tag { font-size: 12px; line-height: 18px; vertical-align: 4px; margin-left: 6px; }
.profile-bio { margin: 8px 0 0; max-width: 420px; color: var(--muted); font-size: 14px; }
/* admin stats */
.admin { padding: 12px 16px 24px; }
.admin-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--bg-elev); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 700; font-size: 13px; margin-top: 2px; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chart-card, .list-card { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-card h3, .list-card h3 { margin: 0 0 8px; font-size: 15px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .mark { fill: var(--accent-text); }
.chart .hit { fill: transparent; cursor: default; }
.chart .bar:hover .mark { opacity: .75; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 6px; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.chart-table th, .chart-table td { text-align: left; padding: 3px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; z-index: 70; pointer-events: none; padding: 5px 9px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.lists-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.list-card ol { margin: 0; padding-left: 18px; }
.list-card li { padding: 5px 0; overflow-wrap: anywhere; }
.list-card a:hover { text-decoration: underline; }
.nav-admin .ico { font-size: 18px; }
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lists-grid { grid-template-columns: minmax(0, 1fr); }
  .admin { padding: 10px 12px 20px; }
}

/* readers / reading */
.read-counts { display: flex; gap: 16px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.read-counts a:hover { text-decoration: underline; }
.read-counts b { color: var(--text); }
.read-btn {
  flex: none; padding: 7px 18px; border-radius: 999px; font-weight: 800; font-size: 14px;
  background: var(--text); color: var(--bg); border: 1px solid var(--text);
}
.read-btn.on { background: transparent; color: var(--text); border-color: var(--border); }
.read-btn.on:hover { color: #d0312d; border-color: #f2b8b5; }
.read-btn.on:hover::after { content: " ×"; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.person-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-text .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-link:hover .name { text-decoration: underline; }
.people-block h3 { margin: 0; padding: 12px 16px 6px; font-size: 16px; }
.people-block { border-bottom: 1px solid var(--border); }
.people-block .person:last-child { border-bottom: 0; }
.empty .people-block { margin-top: 18px; text-align: left; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; color: var(--text); }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }

.nav-account { margin-top: auto; padding: 8px 0; }
.nav-account .nav-item { gap: 12px; }
.nav-signin { width: 100%; padding: 12px 16px; font-size: 16px; }
.nav-signin .ico-only { display: none; }
.nav-post { width: 100%; padding: 12px 16px; font-size: 16px; margin-bottom: 8px; }
.nav-post .ico-only { display: none; }
.compose-dialog { width: min(560px, calc(100vw - 24px)); text-align: left; margin: 10vh auto auto; padding: 14px 18px 12px; }
.compose-dialog .dialog-close-row { margin: -4px -8px 0 0; }
.compose-dialog .composer { border: 0; padding: 4px 0 0; }
.compose-dialog .composer textarea { min-height: 96px; }
.theme-toggle { margin-top: 0; }

.menu {
  position: absolute; z-index: 60; min-width: 180px; padding: 6px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--border); box-shadow: 0 8px 28px rgba(0, 0, 0, .15);
}
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.menu button:hover { background: var(--bg-elev); }

.dialog {
  width: min(400px, calc(100vw - 32px)); padding: 20px 24px 24px; border: 0; border-radius: 20px;
  background: var(--bg); color: var(--text); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.dialog::backdrop { background: rgba(20, 16, 0, .45); }
.dialog h2 { margin: 12px 0 6px; font-size: 24px; }
.dialog-close-row { display: flex; justify-content: flex-end; margin: -8px -12px 0 0; }
.logo.big { width: 52px; height: 52px; font-size: 20px; border-radius: 14px; margin: 0 auto; }
.auth-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-radius: 999px; border: 1px solid var(--border); font-weight: 700;
}
.auth-btn:hover { background: var(--bg-elev); }
.gsi-slot { display: flex; justify-content: center; min-height: 44px; }
.auth-btn span { font-weight: 800; width: 20px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); outline: none; font-size: 16px;
}
.email-form input:focus { border-color: var(--accent); }

.fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 25; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 28px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); display: none;
}

/* ---------- responsive ---------- */
@media (max-width: 1260px) {
  .layout { grid-template-columns: 88px 600px 350px; }
  .nav .label, .nav .brand-name { display: none; }
  .nav { align-items: center; }
  .nav-signin { width: 48px; height: 48px; padding: 0; }
  .nav-signin .ico-only { display: inline; font-size: 20px; }
  .nav-post { width: 48px; height: 48px; padding: 0; }
  .nav-post .ico-only { display: inline; font-size: 22px; }
}
@media (max-width: 1040px) {
  .layout { grid-template-columns: 88px minmax(0, 600px); }
  .side { display: none; }
  .compact-tools { display: block; }
  .compact-tools #categoryChips { display: none; } /* left rail has the sections */
}
@media (max-width: 640px) {
  .layout { display: block; }
  .nav { display: none; }
  .feed { border: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .mobile-top {
    display: flex; align-items: center; gap: 8px;
    padding: calc(6px + env(safe-area-inset-top)) 8px 0 6px;
  }
  .mobile-top .brand { padding: 6px; margin: 0; gap: 8px; }
  .mobile-top .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
  .mobile-top .brand-name { font-size: 19px; }
  .mobile-top .icon-btn { margin-left: auto; }
  .icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 18px; color: var(--muted); }
  .icon-btn:active { background: var(--bg-elev); }
  .feed-title { display: none; }
  .tab { padding: 12px 0; }

  .compact-tools #categoryChips { display: flex; }

  .post { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
  .avatar { width: 36px; height: 36px; font-size: 12px; }
  .post-head { font-size: 14px; }
  .post-actions { max-width: none; }
  .action { min-height: 40px; }
  .term-banner { margin: 10px 14px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; min-height: 52px; font-size: 11px; color: var(--muted); border-radius: 12px;
  }
  .bottom-nav svg { width: 24px; height: 24px; }
  .bottom-nav button.active { color: var(--text); font-weight: 700; }
  .bottom-nav button.active svg { stroke-width: 2.4; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

  /* sub-pages (profile, fomo) keep a title bar with a back button */
  body:not([data-route="home"]) .feed-title { display: flex; padding: 8px 12px; }
  body:not([data-route="home"]) .feed-title .updated { display: none; }
  .composer { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 12px 14px; }
  .composer textarea { font-size: 17px; }
  .fab:not([hidden]) { display: block; bottom: calc(76px + env(safe-area-inset-bottom)); right: 16px; }
  .reply-panel { padding: 0 14px 6px 40px; }
  .reply-panel .reply-panel { padding-left: 14px; }
  .reply-panel .post { padding-left: 10px; }
  .avatar.xl { width: 96px; height: 96px; }
}
