/* Rift Social — the network itself.
   A three-column shell on a desktop, one column and a bottom bar on a phone; cards on a tinted page, the
   way people expect a social network to look. Light and dark, with the network's colour in --accent. */
:root {
  --accent: #1d6ef5;
  --bg: #f0f2f5; --card: #ffffff; --card-2: #f7f8fa; --hover: #f2f3f5; --tint: #e9eef8;
  --ink: #0f1419; --ink-2: #3c4552; --muted: #65707e; --muted-2: #8b95a3;
  --line: #e4e6eb; --line-2: #d3d7de;
  --good: #0f9d58; --bad: #e0245e; --warn: #f7b125;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --r: 12px; --r-sm: 8px; --r-lg: 18px;
  --shadow: 0 1px 2px rgba(15,20,25,.06), 0 2px 12px rgba(15,20,25,.06);
  --shadow-lg: 0 12px 40px rgba(15,20,25,.18);
  --top: 56px; --rail: 280px; --feed: 620px;
}
[data-theme="dark"] {
  --bg: #15181c; --card: #1e2227; --card-2: #24282e; --hover: #262a30; --tint: #22303c;
  --ink: #e7e9ea; --ink-2: #cfd3d8; --muted: #8b98a5; --muted-2: #6e7a87;
  --line: #2f3336; --line-2: #3d4348;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .tiny { font-size: .78rem; }
.bold { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px; background: var(--tint); color: var(--ink); font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); color: var(--card); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: transparent; border-color: var(--line-2); color: var(--bad); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: .86rem; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.input, .select, textarea.input { width: 100%; min-height: 42px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--ink); }
.input:focus, textarea.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
/* a select sits inside its own bordered wrapper so it can carry the chevron and match the text fields */
.select { position: relative; display: block; padding: 0; overflow: hidden; }
.select select { width: 100%; min-height: 40px; padding: 8px 34px 8px 12px; border: 0; background: transparent;
  font: inherit; color: inherit; appearance: none; cursor: pointer; }
.select select:focus { outline: none; }
.select::after { content: ''; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
/* a row of buttons rather than a row of fields: they sit side by side and keep their own widths */
.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-row .select { width: auto; min-width: 150px; }
.btn-row .input { width: auto; flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: 9px; margin: 8px 0; cursor: pointer; font-size: .92rem; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-size: .84rem; font-weight: 600; }
.chip.on { background: var(--accent); color: #fff; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--tint); color: var(--ink-2); font-size: .74rem; font-weight: 700; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: #8a5a00; }
[data-theme="dark"] .pill.warn { color: var(--warn); }

/* ---------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 50; height: var(--top); background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1280px; margin: 0 auto; height: 100%; padding: 0 14px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.08rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.top-search { position: relative; flex: 1; max-width: 340px; }
.top-search input { width: 100%; min-height: 38px; padding: 8px 14px 8px 36px; border: 1px solid transparent; border-radius: 999px; background: var(--bg); color: var(--ink); }
.top-search input:focus { outline: none; background: var(--card); border-color: var(--accent); }
.top-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 2; }
.top-nav { display: flex; align-items: center; gap: 2px; }
.top-nav a { position: relative; display: grid; place-items: center; width: 46px; height: 42px; border-radius: var(--r-sm); color: var(--muted); }
.top-nav a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.top-nav a.on { color: var(--accent); }
.top-nav a.on::after { content: ""; position: absolute; bottom: -9px; left: 12px; right: 12px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.top-nav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 2px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--tint); display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; overflow: hidden; }
.avatar.sm { width: 32px; height: 32px; font-size: .76rem; }
.avatar.md { width: 40px; height: 40px; font-size: .88rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.xl { width: 130px; height: 130px; font-size: 2.4rem; border: 4px solid var(--card); }

/* the menu under the avatar */
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; }
.menu-panel[hidden] { display: none; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font-size: .94rem; text-align: left; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--hover); text-decoration: none; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-panel svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------------------------------------------------------------- shell */
.shell { max-width: 1280px; margin: 0 auto; padding: 16px 14px 90px; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail); gap: 18px; align-items: start; }
.shell.narrow { grid-template-columns: var(--rail) minmax(0, 1fr); }
.shell.narrow .column { max-width: 900px; justify-self: start; }
.shell.single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.side { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 14px; }
.rail { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 14px; }
.column { min-width: 0; display: grid; gap: 14px; justify-self: center; width: 100%; max-width: var(--feed); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 1.02rem; }

/* left navigation */
.nav-list { display: grid; gap: 2px; padding: 8px; }
.nav-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink); font-weight: 600; font-size: .96rem; }
.nav-list a:hover { background: var(--hover); text-decoration: none; }
.nav-list a.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.nav-list svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-list .count { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--bad); }
.me-card { display: flex; align-items: center; gap: 11px; padding: 14px 16px; }
.me-card .who { min-width: 0; }
.me-card b { display: block; font-size: .98rem; }
.me-card span { display: block; color: var(--muted); font-size: .84rem; }
.me-stats { display: flex; gap: 16px; padding: 0 16px 14px; }
.me-stats div { font-size: .84rem; color: var(--muted); }
.me-stats b { display: block; font-size: 1rem; color: var(--ink); }

/* ---------------------------------------------------------------- stories */
.stories { display: flex; gap: 10px; overflow-x: auto; padding: 12px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 104px; height: 168px; border-radius: var(--r); overflow: hidden; position: relative; background: var(--card-2); border: 1px solid var(--line); }
.story .tint { position: absolute; inset: 0; }
.story:hover { text-decoration: none; filter: brightness(.96); }
.story img, .story video { width: 100%; height: 100%; object-fit: cover; }
.story .fill { width: 100%; height: 100%; display: grid; place-items: center; padding: 10px; text-align: center; color: #fff; font-weight: 700; font-size: .84rem; }
.story .ring { position: absolute; top: 8px; left: 8px; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent); overflow: hidden; background: var(--card); }
.story.seen .ring { border-color: var(--line-2); }
.story .ring .avatar { width: 100%; height: 100%; }
.story .name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 8px; color: #fff; font-size: .78rem; font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,.78), transparent); }
.story.add { display: grid; place-items: center; gap: 6px; color: var(--ink); }
.story.add .plus { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.3rem; }

/* the full-screen viewer */
.viewer { position: fixed; inset: 0; z-index: 100; background: #0a0c0f; display: grid; place-items: center; }
.viewer-stage { position: relative; width: min(440px, 100vw); height: min(92vh, 860px); background: #000; border-radius: 12px; overflow: hidden; }
.viewer-stage img, .viewer-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.viewer-fill { width: 100%; height: 100%; display: grid; place-items: center; padding: 30px; text-align: center; color: #fff; font-size: 1.5rem; font-weight: 700; }
.viewer-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.viewer-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.viewer-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.viewer-who { position: absolute; top: 24px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; color: #fff; z-index: 3; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.viewer-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 20px; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); }
.viewer-nav { position: absolute; inset: 0; display: flex; z-index: 2; }
.viewer-nav button { flex: 1; border: 0; background: transparent; cursor: pointer; }
.viewer-close { position: absolute; top: 16px; right: 16px; z-index: 4; color: #fff; background: rgba(255,255,255,.14); }

/* ---------------------------------------------------------------- composer */
.composer { padding: 14px 16px; }
.composer-row { display: flex; gap: 11px; align-items: flex-start; }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 52px; font-size: 1.15rem; line-height: 1.4; padding: 8px 0; }
.composer textarea:focus { outline: none; }
.composer-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer-actions .input { flex: 1 1 130px; min-width: 110px; min-height: 36px; font-size: .88rem; }
.composer-actions .select { flex: 0 0 auto; width: auto; min-height: 36px; }
.composer-actions .select select { min-height: 36px; font-size: .88rem; padding: 6px 30px 6px 12px; }
.composer-actions .btn { margin-left: auto; }
.composer-actions .icon-btn svg { width: 20px; height: 20px; }
.composer-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-top: 10px; }
.composer-preview figure { position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 1; background: var(--card-2); }
.composer-preview img, .composer-preview video { width: 100%; height: 100%; object-fit: cover; }
.composer-preview button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .8rem; }
.poll-builder { display: grid; gap: 8px; margin-top: 10px; }
[hidden] { display: none !important; }
.poll-builder input { min-height: 38px; }
.composer .count { font-size: .8rem; color: var(--muted); margin-left: auto; }
.composer .count.over { color: var(--bad); font-weight: 700; }

/* ---------------------------------------------------------------- posts */
.post { overflow: hidden; }
.post-head { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px 8px; }
.post-head .who { flex: 1; min-width: 0; }
.post-head b { font-size: .98rem; }
.post-head .handle { color: var(--muted); font-size: .86rem; }
.post-head time { color: var(--muted); font-size: .84rem; }
.post-body { padding: 0 16px 10px; font-size: 1rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-body a.mention, .post-body a.tag { font-weight: 600; }
.post-media { display: grid; gap: 2px; background: var(--line); }
.post-media.n1 { grid-template-columns: 1fr; }
.post-media.n2 { grid-template-columns: 1fr 1fr; }
.post-media.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media.n3 a:first-child { grid-row: span 2; }
.post-media.n4, .post-media.n5, .post-media.n6 { grid-template-columns: 1fr 1fr; }
.post-media a { display: block; position: relative; background: var(--card-2); overflow: hidden; max-height: 520px; }
.post-media.n1 a { max-height: 560px; }
.post-media img, .post-media video { width: 100%; height: 100%; object-fit: cover; max-height: 520px; }
.post-media .more-count { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: 1.4rem; font-weight: 700; }
.link-card { margin: 0 16px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; display: block; color: var(--ink); }
.link-card:hover { background: var(--hover); text-decoration: none; }
.link-card img { width: 100%; max-height: 260px; object-fit: cover; }
.link-card .t { padding: 10px 12px; }
.link-card .t span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.link-card .t b { display: block; margin: 2px 0; }
.link-card .t p { margin: 0; color: var(--muted); font-size: .88rem; }
.shared { margin: 0 16px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.shared .post-head { padding: 10px 12px 4px; }
.shared .post-body { padding: 0 12px 8px; font-size: .94rem; }

.poll { padding: 0 16px 12px; display: grid; gap: 8px; }
.poll button, .poll .result { width: 100%; text-align: left; border: 1px solid var(--line-2); background: var(--card); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; position: relative; overflow: hidden; font-weight: 600; }
.poll button:hover { border-color: var(--accent); }
.poll .result { cursor: default; display: flex; justify-content: space-between; gap: 10px; }
.poll .result .fill { position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); width: var(--w, 0%); }
.poll .result.mine { border-color: var(--accent); }
.poll .result span { position: relative; }
.poll .total { color: var(--muted); font-size: .84rem; }

.counts { display: flex; align-items: center; gap: 8px; padding: 8px 16px; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--line); }
.counts .faces { display: inline-flex; }
.counts .faces span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); font-size: .7rem; margin-left: -5px; border: 1px solid var(--card); }
.counts .faces span:first-child { margin-left: 0; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.actions button, .actions a { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 4px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: .9rem; cursor: pointer; }
.actions button:hover, .actions a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.actions svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.actions .on { color: var(--accent); }
.actions .on svg { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.react-picker { position: absolute; bottom: calc(100% + 6px); left: 0; display: flex; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 20; }
.react-picker[hidden] { display: none; }
.react-picker button { font-size: 1.3rem; padding: 4px 6px; border-radius: 50%; }
.react-picker button:hover { transform: scale(1.25); background: var(--hover); }
.react-wrap { position: relative; }

/* comments */
.comments { border-top: 1px solid var(--line); padding: 10px 16px 14px; display: grid; gap: 12px; }
.comment { display: flex; gap: 9px; align-items: flex-start; }
.comment .bubble { background: var(--card-2); border-radius: var(--r-lg); padding: 8px 12px; min-width: 0; }
.comment .bubble b { font-size: .88rem; }
.comment .bubble p { margin: 2px 0 0; font-size: .94rem; white-space: pre-wrap; }
.comment .meta { display: flex; gap: 12px; padding: 4px 12px; font-size: .78rem; color: var(--muted); }
.comment .meta button { border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; padding: 0; font-size: .78rem; }
.comment .meta button:hover { text-decoration: underline; }
.comment .meta button.on { color: var(--accent); }
.replies { margin-left: 40px; display: grid; gap: 10px; margin-top: 8px; }
.comment-form { display: flex; gap: 9px; align-items: center; }
.comment-form input { flex: 1; min-height: 38px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card-2); padding: 8px 14px; }
.comment-form input:focus { outline: none; border-color: var(--accent); background: var(--card); }

/* ---------------------------------------------------------------- right rail */
.rail-card { padding: 14px 16px; }
.rail-card h3 { margin: 0 0 10px; font-size: .96rem; }
.trend { display: block; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.trend:last-child { border-bottom: 0; }
.trend:hover { text-decoration: none; color: var(--accent); }
.trend b { display: block; font-size: .94rem; }
.trend span { color: var(--muted); font-size: .8rem; }
.suggestion { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.suggestion .who { flex: 1; min-width: 0; }
.suggestion b { display: block; font-size: .9rem; }
.suggestion span { display: block; color: var(--muted); font-size: .8rem; }
.ad-card { overflow: hidden; }
.ad-card img { width: 100%; max-height: 180px; object-fit: cover; }
.ad-card .t { padding: 12px 14px; }
.ad-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---------------------------------------------------------------- profile */
.profile-cover { height: 220px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #7b5cff), var(--accent)); border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { padding: 0 20px 16px; margin-top: -60px; }
.profile-head .top-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.profile-head h1 { margin: 12px 0 2px; font-size: 1.5rem; display: flex; align-items: center; gap: 8px; }
.profile-head .handle { color: var(--muted); }
.profile-bio { margin: 10px 0; max-width: 60ch; white-space: pre-wrap; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .9rem; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; }
.profile-stats a { color: var(--ink); }
.profile-stats b { font-weight: 700; }
.tabs { display: flex; gap: 2px; border-top: 1px solid var(--line); padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 13px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.verified-tick { width: 18px; height: 18px; color: var(--accent); }

/* ---------------------------------------------------------------- chat */
/* ==========================================================================
   Messages: the full page, the dock that follows you around, and the bubbles
   that both of them share.
   ========================================================================== */

/* ---- presence: the green dot on an avatar */
.avatar.is-online { position: relative; overflow: visible; }
.avatar.is-online > img { border-radius: 50%; }
.avatar.is-online::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%;
  min-width: 9px; min-height: 9px; border-radius: 50%; background: #31a24c; border: 2px solid var(--card); }
.avatar svg { width: 55%; height: 55%; }

/* ---- the page at /social/messages */
.shell.bare { grid-template-columns: minmax(0, 1fr); max-width: 1240px; padding: 14px 16px 16px; }
.shell.bare .column { max-width: none; justify-self: stretch; gap: 0; }
.messenger { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 0;
  height: calc(100vh - var(--top) - 30px); min-height: 480px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }

.mg-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--card); }
.mg-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 10px; }
.mg-list-head h1 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.mg-search { position: relative; margin: 0 14px 10px; }
.mg-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mg-search input { width: 100%; min-height: 38px; padding: 8px 12px 8px 34px; border-radius: 999px;
  border: 1px solid transparent; background: var(--card-2); color: var(--ink); font: inherit; }
.mg-search input:focus { outline: none; background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.mg-search.sm input { min-height: 34px; font-size: .88rem; }
.mg-list-body { flex: 1; overflow-y: auto; padding: 0 8px 10px; scrollbar-width: thin; }

.mg-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r);
  color: var(--ink); min-width: 0; }
.mg-row:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.mg-row.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mg-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.mg-row-text b { font-size: .95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-snip { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-row-meta { display: grid; justify-items: end; gap: 5px; flex: none; }
.mg-row-meta time { font-size: .74rem; color: var(--muted-2); white-space: nowrap; }
.mg-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.mg-row.unread .mg-row-text b { font-weight: 700; }
.mg-row.unread .mg-snip { color: var(--ink-2); font-weight: 600; }

/* ---- the thread */
.mg-thread { display: flex; flex-direction: column; min-height: 0; background: var(--card); }
.mg-blank { margin: auto; text-align: center; display: grid; gap: 10px; justify-items: center; padding: 30px; }
.mg-blank-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.mg-blank h2 { margin: 6px 0 0; }
.mg-blank p { margin: 0; max-width: 34ch; }

.mg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--card); position: relative; z-index: 2; }
.mg-head .back { display: none; }
.mg-head-who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--ink); }
.mg-head-who:hover { text-decoration: none; }
.mg-head-who b { display: block; font-size: 1rem; line-height: 1.25; }
.mg-head-actions { display: flex; align-items: center; gap: 2px; flex: none; }

.mg-body { flex: 1; overflow-y: auto; padding: 16px 16px 4px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.mg-top { display: grid; justify-items: center; padding: 10px 0 18px; }
.mg-messages { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.mg-form { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.mg-form textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 14px; border-radius: 20px;
  border: 1px solid transparent; background: var(--card-2); color: var(--ink); font: inherit; resize: none; line-height: 1.4; }
.mg-form textarea:focus { outline: none; background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.mg-form .icon-btn.send { color: var(--accent); }
.mg-form .icon-btn.send:disabled { color: var(--muted-2); }
.mg-files, .chat-win-files { display: flex; gap: 6px; padding: 8px 14px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.mg-files figure, .chat-win-files figure { margin: 0; position: relative; width: 62px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--card-2); }
.mg-files img, .mg-files video, .chat-win-files img, .chat-win-files video { width: 100%; height: 100%; object-fit: cover; }
.mg-files button, .chat-win-files button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .75rem; line-height: 1; }

.chat-intro { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--ink); }
.chat-intro b { font-size: 1.05rem; }

/* ---- one message, shared by the page and the dock */
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 76%; position: relative; margin-bottom: 2px; }
.msg.run { margin-top: 0; }
.msg:not(.run) { margin-top: 10px; }
.msg-space { width: 32px; flex: none; }
.msg-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.msg-who { font-size: .74rem; color: var(--muted); padding: 0 8px 1px; }
.msg .bubble { background: var(--card-2); color: var(--ink); padding: 8px 13px; border-radius: 18px;
  font-size: .95rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.msg .bubble a { color: inherit; text-decoration: underline; }
.msg.run .bubble { border-top-left-radius: 6px; }
.msg.tail .bubble { border-bottom-left-radius: 6px; }
.msg time { font-size: .68rem; color: var(--muted-2); padding: 1px 6px 0; }

.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .bubble { background: var(--accent); color: #fff; border-radius: 18px; }
.msg.mine.run .bubble { border-top-right-radius: 6px; border-top-left-radius: 18px; }
.msg.mine.tail .bubble { border-bottom-right-radius: 6px; border-bottom-left-radius: 18px; }
.msg.mine .msg-tools { order: -1; }

.msg.system { margin: 12px auto; max-width: 100%; justify-content: center; }
.msg.system span { font-size: .8rem; color: var(--muted); background: var(--card-2); padding: 4px 12px; border-radius: 999px; }
.msg-day { display: grid; place-items: center; margin: 16px 0 8px; }
.msg-day span { font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--card-2); padding: 4px 12px; border-radius: 999px; }

.msg-media { display: grid; gap: 3px; border-radius: 16px; overflow: hidden; max-width: 260px; }
.msg-media.n2, .msg-media.n4 { grid-template-columns: 1fr 1fr; }
.msg-media.n3 { grid-template-columns: 1fr 1fr; }
.msg-media.n3 a:first-child { grid-column: span 2; }
.msg-media img, .msg-media video { width: 100%; height: 100%; object-fit: cover; display: block; max-height: 260px; }

.msg-reactions { display: inline-flex; gap: 2px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 6px; font-size: .8rem; margin-top: -6px; box-shadow: var(--shadow); align-self: flex-start; }
.msg.mine .msg-reactions { align-self: flex-end; }
.msg-reactions[hidden] { display: none; }
.msg-reactions i { font-style: normal; font-size: .7rem; color: var(--muted); margin-left: 1px; }

.msg-tools { display: flex; align-items: center; gap: 1px; opacity: 0; transition: opacity .12s ease; flex: none; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 50%; }
.icon-btn.xs svg { width: 15px; height: 15px; }
.react-picker.floating { position: fixed; z-index: 95; display: flex; gap: 2px; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; box-shadow: var(--shadow-lg); }
.react-picker.floating[hidden] { display: none; }
.react-picker.floating button { border: 0; background: none; cursor: pointer; font-size: 1.25rem; line-height: 1;
  padding: 2px 3px; transition: transform .12s ease; }
.react-picker.floating button:hover { transform: scale(1.3) translateY(-2px); }

.msg-seen { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 2px 4px 6px;
  font-size: .7rem; color: var(--muted-2); min-height: 14px; }

/* ---- somebody is typing */
.typing { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.typing[hidden] { display: none; }
.typing .dots { display: inline-flex; gap: 3px; background: var(--card-2); padding: 9px 12px; border-radius: 18px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); animation: so-typing 1.2s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: .18s; }
.typing .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes so-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---- the dock */
.chat-dock { position: fixed; right: 14px; bottom: 0; z-index: 70; display: flex; align-items: flex-end; gap: 10px; pointer-events: none; }
.chat-dock > * { pointer-events: auto; }
.chat-dock-windows { display: flex; align-items: flex-end; gap: 10px; }
.chat-dock-bubbles { display: flex; flex-direction: column-reverse; gap: 8px; margin-bottom: 14px; }
.dock-bubble { position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.dock-bubble .avatar { width: 48px; height: 48px; font-size: .95rem; box-shadow: var(--shadow-lg); }
.dock-bubble .count { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.dock-bubble:hover .avatar { filter: brightness(1.05); }

.chat-win { width: 328px; height: 440px; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg); overflow: hidden; }
.chat-win.min { height: auto; }
.chat-win.min .chat-win-body, .chat-win.min .chat-win-form, .chat-win.min .chat-win-files { display: none; }
.chat-win-head { display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: var(--card); }
.chat-win-head .who { flex: 1; min-width: 0; }
.chat-win-head b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-win-head .tiny { display: block; line-height: 1.2; }
.chat-win-actions { display: flex; gap: 0; flex: none; }
.chat-win.unread .chat-win-head { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chat-win-body { flex: 1; overflow-y: auto; padding: 10px 10px 0; display: flex; flex-direction: column; }
.chat-win-top { display: grid; justify-items: center; padding: 6px 0 12px; }
.chat-win-messages { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.chat-win .msg { max-width: 86%; }
.chat-win .msg .bubble { font-size: .9rem; padding: 7px 11px; }
.chat-win .msg-media { max-width: 190px; }
.chat-win-form { display: flex; align-items: flex-end; gap: 2px; padding: 7px 8px; border-top: 1px solid var(--line); }
.chat-win-form textarea { flex: 1; min-height: 34px; max-height: 96px; padding: 7px 12px; border-radius: 18px;
  border: 1px solid transparent; background: var(--card-2); color: var(--ink); font: inherit; font-size: .9rem; resize: none; line-height: 1.35; }
.chat-win-form textarea:focus { outline: none; background: var(--card); border-color: var(--accent); }
.chat-win-form .icon-btn { width: 32px; height: 32px; }
.chat-win-form .icon-btn.send { color: var(--accent); }

/* ---- the emoji tray, shared by both composers */
.emoji-wrap { position: relative; }
.emoji-tray { position: absolute; bottom: 40px; right: 0; width: 268px; max-height: 232px; overflow-y: auto;
  scrollbar-width: thin;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; z-index: 30; }
.emoji-tray.floating { position: fixed; bottom: auto; right: auto; z-index: 90; }
.emoji-tray[hidden] { display: none; }
.emoji-tray button { border: 0; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 4px 0; border-radius: 6px; }
.emoji-tray button:hover { background: var(--hover); }

/* ---- the messages panel in the header */
.menu-panel.wide { width: 340px; padding: 0; overflow: hidden; }
.menu-panel.right { right: 0; left: auto; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.menu-head b { font-size: 1.05rem; }
.menu-rows { max-height: 340px; overflow-y: auto; padding: 0 6px 6px; }
.menu-rows .mg-row { padding: 8px; }
.menu-foot { border-top: 1px solid var(--line); padding: 9px; text-align: center; }
.menu-foot a { font-weight: 600; font-size: .88rem; }
.empty.sm { padding: 18px 10px; text-align: center; color: var(--muted); font-size: .88rem; }

/* ---- starting a new conversation */
.people-picker { max-height: 280px; overflow-y: auto; display: grid; gap: 2px; margin-bottom: 12px; }
.people-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); cursor: pointer; }
.people-row:hover { background: var(--hover); }
.people-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.people-row b { display: block; font-size: .92rem; }

/* ---- narrow screens: the list and the thread take turns, and the dock gets out of the way */
@media (max-width: 900px) {
  .messenger { grid-template-columns: minmax(0, 1fr); }
  .messenger .mg-list { border-right: 0; }
  .messenger.has-thread .mg-list { display: none; }
  .messenger:not(.has-thread) .mg-thread { display: none; }
  .mg-head .back { display: inline-grid; }
}
@media (max-width: 800px) {
  .shell.bare { padding: 0; max-width: none; }
  .messenger { height: calc(100vh - var(--top) - 62px); border-radius: 0; border-left: 0; border-right: 0; }
  .chat-dock { display: none; }
  .msg { max-width: 84%; }
}

/* ---------------------------------------------------------------- marketplace and jobs */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; color: var(--ink); transition: box-shadow .15s ease, transform .15s ease; }
.tile:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tile .shot { display: block; aspect-ratio: 4 / 3; background: var(--card-2); overflow: hidden; }
.tile .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .shot .none { display: grid; place-items: center; height: 100%; color: var(--muted-2); }
.tile .t { display: grid; gap: 2px; padding: 10px 12px 12px; }
.tile .price { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.tile .title { font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .where { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-row { display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.job-row:last-child { border-bottom: 0; }
.job-row .who { flex: 1; min-width: 0; }
.job-row h3 { margin: 0 0 3px; font-size: 1.02rem; }
.job-row .meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .86rem; margin-top: 6px; }

/* ---------------------------------------------------------------- notifications, lists, misc */
.list-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.list-row:last-child { border-bottom: 0; }
.list-row.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.list-row .who { flex: 1; min-width: 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 46px; height: 46px; stroke: var(--line-2); fill: none; stroke-width: 1.5; margin-bottom: 10px; }
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.flash.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.pager { padding: 14px; text-align: center; }
.pager nav > div:first-child { display: none; }
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent); }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(8,12,18,.65); display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-card { background: var(--card); border-radius: var(--r); width: min(520px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(6,8,12,.94); display: grid; place-items: center; padding: 30px; }
.lightbox[hidden] { display: none; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 90vh; object-fit: contain; }
.lightbox .close { position: absolute; top: 16px; right: 16px; color: #fff; background: rgba(255,255,255,.14); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--ink); color: var(--card); padding: 11px 18px; border-radius: 999px; font-weight: 600; z-index: 120; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* bottom bar, phones only */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: grid; place-items: center; gap: 2px; padding: 6px 0; color: var(--muted); font-size: .68rem; position: relative; }
.tabbar a.on { color: var(--accent); }
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding: 30px; max-width: 1100px; margin: 0 auto; }
.auth-pitch h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.03em; }
.auth-pitch p { font-size: 1.1rem; color: var(--muted); max-width: 44ch; }
.auth-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 24px; }
.auth-card .btn { width: 100%; }
.provider { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 42px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); color: var(--ink); font-weight: 600; margin-bottom: 8px; cursor: pointer; }
.provider:hover { background: var(--hover); text-decoration: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 88px minmax(0, 1fr); }
  .rail { display: none; }
  .nav-list a span, .me-card .who, .me-stats { display: none; }
  .nav-list a { justify-content: center; }
  .me-card { justify-content: center; }
}
@media (max-width: 800px) {
  :root { --top: 52px; }
  .shell, .shell.narrow, .shell.single { grid-template-columns: minmax(0, 1fr); padding: 12px 10px 84px; }
  .side { display: none; }
  .tabbar { display: flex; }
  .top-nav { display: none; }
  .top-search { max-width: none; }
  .auth { grid-template-columns: 1fr; padding-top: 40px; }
  .auth-pitch { text-align: center; }
  .auth-pitch p { margin-inline: auto; }
  .profile-cover { height: 150px; }
  .avatar.xl { width: 96px; height: 96px; font-size: 1.8rem; }
  .profile-head { margin-top: -46px; padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .top, .side, .rail, .tabbar, .actions, .composer { display: none !important; } }

/* charts drawn inline in the admin panel and campaign pages */
.bars { display:block; width:100%; color:var(--ink); }
.bars text { font-family:inherit; }
.metric { display:flex; flex-direction:column; gap:2px; }
.metric b { font-size:26px; font-weight:800; letter-spacing:-.02em; }
.metric .change { font-size:12px; font-weight:600; }
.metric .change.up { color:var(--good); }
.metric .change.down { color:var(--bad); }
.table { width:100%; border-collapse:collapse; font-size:14px; }
.table th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--line); }
.table td { padding:10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.table tr:last-child td { border-bottom:0; }
.table .right, .right { text-align:right; }
.scroll-x { overflow-x:auto; }
.heat { position:relative; background:var(--card); border-radius:12px; overflow:hidden; }
.heat .spot { position:absolute; width:46px; height:46px; margin:-23px 0 0 -23px; border-radius:50%;
  background:radial-gradient(circle, rgba(255,64,0,.55), rgba(255,160,0,.18) 60%, transparent 70%); pointer-events:none; }

/* ==========================================================================
   Two things that have to hold everywhere, so they are stated last.
   ========================================================================== */

/* An avatar is a <span>, and several list rules style "span" in general to make a name and a line of
   detail stack. Dropped inside one of those, an avatar would turn into a muted grey block with its
   initials clipped. This keeps an avatar an avatar wherever it is used. */
span.avatar, a.avatar { display: inline-grid; place-items: center; color: #fff; white-space: normal;
  text-overflow: clip; text-align: center; line-height: 1; }
span.avatar:not(.is-online), a.avatar:not(.is-online) { overflow: hidden; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; }

/* The browser's own file control looks like nothing else on the page. */
input[type=file] { padding: 7px 10px; font-size: .9rem; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 7px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card-2); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--hover); }
.menu-head-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn.off { color: var(--muted-2); position: relative; }
.icon-btn.off::after { content: ''; position: absolute; left: 5px; right: 5px; top: 50%; height: 1.6px;
  background: currentColor; transform: rotate(-38deg); border-radius: 2px; }

/* ---- a page somebody wrote: terms, privacy, house rules */
.prose h1 { font-size: 1.7rem; letter-spacing: -.02em; margin: 0 0 6px; }
.prose .lede { font-size: 1.02rem; margin: 0 0 18px; }
.prose p { margin: 0 0 1.05em; line-height: 1.65; max-width: 68ch; }
.prose p:last-of-type { margin-bottom: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .78rem; color: var(--muted); padding: 4px 2px; margin: 4px 0 0; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.flash.warn { background: color-mix(in srgb, var(--warn) 16%, var(--card)); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); color: var(--ink); }
.flash.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---- a conversation's own controls, and settling in */
.mg-row-wrap { position: relative; display: block; }
.mg-row-tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none;
  gap: 2px; background: var(--card); border-radius: 999px; padding: 2px; box-shadow: var(--shadow); }
.mg-row-wrap:hover .mg-row-tools, .mg-row-wrap:focus-within .mg-row-tools { display: flex; }
.mg-muted { color: var(--muted-2); display: inline-grid; }
.onboard h1 { margin: 0 0 4px; }
.onboard-step { margin: 22px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.onboard-step h3 { margin: 0 0 8px; font-size: 1rem; }
.onboard-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.onboard-person { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 10px;
  border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; position: relative; }
.onboard-person:hover { background: var(--hover); }
.onboard-person input { position: absolute; top: 8px; right: 8px; width: 17px; height: 17px; accent-color: var(--accent); }
.onboard-person b { font-size: .92rem; }
.onboard-person:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }

/* ==========================================================================
   Groups and events
   ========================================================================== */
.section-label { margin: 18px 2px 8px; font-size: .82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.group-tile .shot { aspect-ratio: 16 / 9; }
.group-tile .shot .none { display: grid; place-items: center; height: 100%; color: #fff; }
.group-head { overflow: hidden; }
.group-cover { height: 180px; position: relative; overflow: hidden; }
.group-cover img { width: 100%; height: 100%; object-fit: cover; }
.group-head h1 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -.02em; }
.group-head .tabs { border-top: 1px solid var(--line); }

.events-list { display: grid; gap: 4px; }
.event-card { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r); color: var(--ink); }
.event-card:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.event-date { flex: none; width: 54px; height: 58px; border-radius: 12px; color: #fff; display: grid;
  place-items: center; align-content: center; line-height: 1.05; }
.event-date b { font-size: 1.35rem; font-weight: 800; }
.event-date span { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.event-date.big { position: absolute; left: 20px; bottom: -18px; width: 68px; height: 72px; border: 3px solid var(--card); }
.event-body { display: grid; gap: 1px; min-width: 0; }
.event-body b { font-size: .98rem; }
.events-list.past { opacity: .72; }
/* the cover clips its own picture, but not the date badge that hangs off the bottom of it */
.event-cover { height: 220px; position: relative; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.event-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.event-page { overflow: visible; }
.event-page .pad { padding-top: 30px; }
.event-page h1 { margin: 0 0 8px; font-size: 1.6rem; letter-spacing: -.02em; }
.rsvp .btn { min-width: 108px; justify-content: center; }
.guest-list { display: flex; flex-wrap: wrap; gap: 12px; }
.guest { display: grid; justify-items: center; gap: 3px; color: var(--ink); width: 64px; text-align: center; }
.guest:hover { text-decoration: none; }
.guest .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px; }
